|
|
@ -42,7 +42,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
using namespace Printing;
|
|
|
|
using namespace Printing;
|
|
|
|
|
|
|
|
|
|
|
|
CMainIndex::ToolTip::ToolTip(CMainIndex* tqparent) : TQToolTip(tqparent->viewport()), m_mainIndex(tqparent) {}
|
|
|
|
CMainIndex::ToolTip::ToolTip(CMainIndex* parent) : TQToolTip(parent->viewport()), m_mainIndex(parent) {}
|
|
|
|
|
|
|
|
|
|
|
|
void CMainIndex::ToolTip::maybeTip(const TQPoint& p) {
|
|
|
|
void CMainIndex::ToolTip::maybeTip(const TQPoint& p) {
|
|
|
|
CItemBase* i = dynamic_cast<CItemBase*>(m_mainIndex->itemAt(p));
|
|
|
|
CItemBase* i = dynamic_cast<CItemBase*>(m_mainIndex->itemAt(p));
|
|
|
@ -77,7 +77,7 @@ void CMainIndex::ToolTip::maybeTip(const TQPoint& p) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CMainIndex::CMainIndex(TQWidget *tqparent) : KListView(tqparent),
|
|
|
|
CMainIndex::CMainIndex(TQWidget *parent) : KListView(parent),
|
|
|
|
m_searchDialog(0), m_toolTip(0), m_itemsMovable(false), m_autoOpenFolder(0), m_autoOpenTimer(this) {
|
|
|
|
m_searchDialog(0), m_toolTip(0), m_itemsMovable(false), m_autoOpenFolder(0), m_autoOpenTimer(this) {
|
|
|
|
initView();
|
|
|
|
initView();
|
|
|
|
initConnections();
|
|
|
|
initConnections();
|
|
|
@ -272,9 +272,9 @@ void CMainIndex::initTree() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** No descriptions */
|
|
|
|
/** No descriptions */
|
|
|
|
void CMainIndex::dropped( TQDropEvent* e, TQListViewItem* tqparent, TQListViewItem* after) {
|
|
|
|
void CMainIndex::dropped( TQDropEvent* e, TQListViewItem* parent, TQListViewItem* after) {
|
|
|
|
Q_ASSERT(after);
|
|
|
|
Q_ASSERT(after);
|
|
|
|
Q_ASSERT(tqparent);
|
|
|
|
Q_ASSERT(parent);
|
|
|
|
|
|
|
|
|
|
|
|
//the drop was started in this main index widget
|
|
|
|
//the drop was started in this main index widget
|
|
|
|
if (m_itemsMovable && ((e->source()) == (viewport()))) {
|
|
|
|
if (m_itemsMovable && ((e->source()) == (viewport()))) {
|
|
|
@ -283,7 +283,7 @@ void CMainIndex::dropped( TQDropEvent* e, TQListViewItem* tqparent, TQListViewIt
|
|
|
|
* folder or one of its subfolders
|
|
|
|
* folder or one of its subfolders
|
|
|
|
* we remove the current items because the new ones will be inserted soon.
|
|
|
|
* we remove the current items because the new ones will be inserted soon.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
if (dynamic_cast<CBookmarkFolder*>(tqparent) || dynamic_cast<Bookmarks::SubFolder*>(tqparent)) {
|
|
|
|
if (dynamic_cast<CBookmarkFolder*>(parent) || dynamic_cast<Bookmarks::SubFolder*>(parent)) {
|
|
|
|
// we drop onto the bookmark folder or one of it's subfolders
|
|
|
|
// we drop onto the bookmark folder or one of it's subfolders
|
|
|
|
// TQPtrList<TQListViewItem> items = selectedItems();
|
|
|
|
// TQPtrList<TQListViewItem> items = selectedItems();
|
|
|
|
// items.setAutoDelete(true);
|
|
|
|
// items.setAutoDelete(true);
|
|
|
@ -292,7 +292,7 @@ void CMainIndex::dropped( TQDropEvent* e, TQListViewItem* tqparent, TQListViewIt
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//finally do the drop, either with external drop data or with the moved items' data
|
|
|
|
//finally do the drop, either with external drop data or with the moved items' data
|
|
|
|
CItemBase* const parentItem = dynamic_cast<CItemBase*>(tqparent);
|
|
|
|
CItemBase* const parentItem = dynamic_cast<CItemBase*>(parent);
|
|
|
|
CItemBase* const afterItem = dynamic_cast<CItemBase*>(after);
|
|
|
|
CItemBase* const afterItem = dynamic_cast<CItemBase*>(after);
|
|
|
|
|
|
|
|
|
|
|
|
bool removeSelectedItems = true;
|
|
|
|
bool removeSelectedItems = true;
|
|
|
@ -323,14 +323,14 @@ void CMainIndex::dropped( TQDropEvent* e, TQListViewItem* tqparent, TQListViewIt
|
|
|
|
if (afterItem->acceptDrop(e)) {
|
|
|
|
if (afterItem->acceptDrop(e)) {
|
|
|
|
afterItem->dropped(e, after);
|
|
|
|
afterItem->dropped(e, after);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else { //insert in the tqparent folder and then move the inserted items
|
|
|
|
else { //insert in the parent folder and then move the inserted items
|
|
|
|
parentItem->dropped(e, after);
|
|
|
|
parentItem->dropped(e, after);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
parentItem->setOpen(true);
|
|
|
|
parentItem->setOpen(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (parentItem) { //no after item present, but a tqparent is there
|
|
|
|
else if (parentItem) { //no after item present, but a parent is there
|
|
|
|
moveSelectedItems = false;
|
|
|
|
moveSelectedItems = false;
|
|
|
|
removeSelectedItems = false;
|
|
|
|
removeSelectedItems = false;
|
|
|
|
|
|
|
|
|
|
|
@ -762,7 +762,7 @@ void CMainIndex::readSettings() {
|
|
|
|
|
|
|
|
|
|
|
|
TQStringList openGroups = CBTConfig::get(CBTConfig::bookshelfOpenGroups);
|
|
|
|
TQStringList openGroups = CBTConfig::get(CBTConfig::bookshelfOpenGroups);
|
|
|
|
for (TQStringList::Iterator it( openGroups.begin() ); it != openGroups.end(); ++it) {
|
|
|
|
for (TQStringList::Iterator it( openGroups.begin() ); it != openGroups.end(); ++it) {
|
|
|
|
TQStringList path = TQStringList::split("/", (*it)); //e.g. with items tqparent, child
|
|
|
|
TQStringList path = TQStringList::split("/", (*it)); //e.g. with items parent, child
|
|
|
|
TQListViewItem* item = firstChild(); //begin on the top for each item
|
|
|
|
TQListViewItem* item = firstChild(); //begin on the top for each item
|
|
|
|
Q_ASSERT(item);
|
|
|
|
Q_ASSERT(item);
|
|
|
|
unsigned int index = 1;
|
|
|
|
unsigned int index = 1;
|
|
|
@ -833,9 +833,9 @@ void CMainIndex::saveSettings() {
|
|
|
|
//it.current()'s full name needs to be added to the list
|
|
|
|
//it.current()'s full name needs to be added to the list
|
|
|
|
TQListViewItem* i = it.current();
|
|
|
|
TQListViewItem* i = it.current();
|
|
|
|
TQString fullName = i->text(0);
|
|
|
|
TQString fullName = i->text(0);
|
|
|
|
while (i->tqparent()) {
|
|
|
|
while (i->parent()) {
|
|
|
|
i = i->tqparent();
|
|
|
|
i = i->parent();
|
|
|
|
fullName.prepend("/").prepend( i->text(0).replace("/", "\\/")); // tqparent / child
|
|
|
|
fullName.prepend("/").prepend( i->text(0).replace("/", "\\/")); // parent / child
|
|
|
|
}
|
|
|
|
}
|
|
|
|
openGroups << fullName;
|
|
|
|
openGroups << fullName;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -856,7 +856,7 @@ void CMainIndex::saveSettings() {
|
|
|
|
TQString path;
|
|
|
|
TQString path;
|
|
|
|
while (item) {
|
|
|
|
while (item) {
|
|
|
|
path.prepend( item->text(0) + "/" );
|
|
|
|
path.prepend( item->text(0) + "/" );
|
|
|
|
item = item->tqparent();
|
|
|
|
item = item->parent();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
CBTConfig::set(CBTConfig::bookshelfCurrentItem, path);
|
|
|
|
CBTConfig::set(CBTConfig::bookshelfCurrentItem, path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|