From d41045a2b4e30916bd05c5950b9d7c426294d65c Mon Sep 17 00:00:00 2001 From: Till Adam Date: Sat, 29 Jan 2005 17:42:48 +0000 Subject: [PATCH] More shuffling around of bits in the folder context menu. svn path=/trunk/kdepim/; revision=383778 --- kmfoldertree.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/kmfoldertree.cpp b/kmfoldertree.cpp index 39f04e635..8fdc5a57c 100644 --- a/kmfoldertree.cpp +++ b/kmfoldertree.cpp @@ -928,10 +928,14 @@ void KMFolderTree::slotContextMenuRequested( QListViewItem *lvi, KPopupMenu *folderMenu = new KPopupMenu; if (fti->folder()) folderMenu->insertTitle(fti->folder()->label()); + // outbox specific, but there it's the most used action + if ( (fti->folder() == kmkernel->outboxFolder()) && fti->folder()->count() ) + mMainWidget->action("send_queued")->plug( folderMenu ); // Mark all as read is supposedly used often, therefor it is first - if ( fti->folder() && !fti->folder()->noContent() ) + if ( fti->folder() && !fti->folder()->noContent() && fti->folder()->count() ) mMainWidget->action("mark_all_as_read")->plug( folderMenu ); + /* Treat the special case of the root and account folders */ if ((!fti->folder() || (fti->folder()->noContent() && !fti->parent()))) { @@ -951,11 +955,10 @@ void KMFolderTree::slotContextMenuRequested( QListViewItem *lvi, this, SLOT(slotCheckMail())); } - } else { - if ((fti->folder() == kmkernel->outboxFolder()) && (fti->folder()->count()) ) - mMainWidget->action("send_queued")->plug(folderMenu); - if (!fti->folder()->noChildren()) - { + } else { // regular folders + + folderMenu->insertSeparator(); + if ( !fti->folder()->noChildren() ) { folderMenu->insertItem(SmallIconSet("folder_new"), i18n("&New Subfolder..."), this, SLOT(addChildFolder())); @@ -968,23 +971,22 @@ void KMFolderTree::slotContextMenuRequested( QListViewItem *lvi, { mMainWidget->action("search_messages")->plug(folderMenu); - mMainWidget->action("mark_all_as_read")->plug(folderMenu); - mMainWidget->action("compact")->plug(folderMenu); - folderMenu->insertSeparator(); + if ( !fti->folder()->isSystemFolder() ) + mMainWidget->action("delete_folder")->plug(folderMenu); + folderMenu->insertSeparator(); mMainWidget->action("empty")->plug(folderMenu); + folderMenu->insertSeparator(); } - if ( !fti->folder()->isSystemFolder() ) - mMainWidget->action("delete_folder")->plug(folderMenu); - } + + /* plug in IMAP and DIMAP specific things */ if (fti->folder() && (fti->folder()->folderType() == KMFolderTypeImap || fti->folder()->folderType() == KMFolderTypeCachedImap )) { - folderMenu->insertSeparator(); folderMenu->insertItem(SmallIconSet("bookmark_folder"), i18n("Subscription..."), mMainWidget, SLOT(slotSubscriptionDialog()));