From c787ec006b646211a0a8a5a1dd7bb45fc2be4e47 Mon Sep 17 00:00:00 2001 From: Andreas Gungl Date: Thu, 17 Feb 2005 20:55:44 +0000 Subject: [PATCH] Implement Folder->"Assign Shortcut" to allow changing the shortcut of a folder w/o using the folder's context menu. BUGS:99611 GUI: svn path=/trunk/kdepim/; revision=390372 --- kmmainwidget.cpp | 13 +++++++++++++ kmmainwidget.h | 4 +++- kmmainwin.rc | 3 ++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/kmmainwidget.cpp b/kmmainwidget.cpp index 777b889d9..b0f733aa0 100644 --- a/kmmainwidget.cpp +++ b/kmmainwidget.cpp @@ -909,6 +909,15 @@ void KMMainWidget::slotFolderMailingListProperties() } } +//----------------------------------------------------------------------------- +void KMMainWidget::slotFolderShortcutCommand() +{ + if (!mFolderTree) return; + KMFolderTreeItem *item = static_cast( mFolderTree->currentItem() ); + if ( item ) + item->assignShortcut(); +} + //----------------------------------------------------------------------------- void KMMainWidget::slotModifyFolder() @@ -2273,6 +2282,10 @@ void KMMainWidget::setupActions() /*"folder_mailinglist_properties",*/ 0, this, SLOT( slotFolderMailingListProperties() ), actionCollection(), "folder_mailinglist_properties" ); + mFolderShortCutCommandAction = new KAction( i18n("&Assign Shortcut..."), "configure_shortcuts", + 0, this, SLOT( slotFolderShortcutCommand() ), actionCollection(), + "folder_shortcut_command" ); + mMarkAllAsReadAction = new KAction( i18n("Mark All Messages as &Read"), "goto", 0, this, SLOT(slotMarkAllAsRead()), actionCollection(), "mark_all_as_read" ); diff --git a/kmmainwidget.h b/kmmainwidget.h index a543984bb..f73dc36b6 100644 --- a/kmmainwidget.h +++ b/kmmainwidget.h @@ -234,6 +234,7 @@ protected slots: void slotPostToML(); void slotModifyFolder(); void slotFolderMailingListProperties(); + void slotFolderShortcutCommand(); void slotExpireFolder(); void slotExpireAll(); void slotInvalidateIMAPFolders(); @@ -456,7 +457,8 @@ private: KAction *mModifyFolderAction, *mRemoveFolderAction, *mExpireFolderAction, *mCompactFolderAction, *mRefreshFolderAction, *mEmptyFolderAction, - *mMarkAllAsReadAction, *mFolderMailingListPropertiesAction; + *mMarkAllAsReadAction, *mFolderMailingListPropertiesAction, + *mFolderShortCutCommandAction; KToggleAction *mPreferHtmlAction, *mPreferHtmlLoadExtAction, *mThreadMessagesAction; KToggleAction *mThreadBySubjectAction; KToggleAction *mFolderAction, *mHeaderAction, *mMimeAction; diff --git a/kmmainwin.rc b/kmmainwin.rc index fa1e09300..5ca8d76ed 100644 --- a/kmmainwin.rc +++ b/kmmainwin.rc @@ -1,5 +1,5 @@ - + &File @@ -84,6 +84,7 @@ +