[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    [Kde-pim] [PATCH] Add Copy/Move Icons in Menus
From:       klebezettel () gmx ! net
Date:       2008-10-13 18:48:50
Message-ID: 200810132048.50521.klebezettel () gmx ! net
[Download RAW message or body]

Hiya!

Again, some icon polishing.

The patch add the typical copy/move icons to the menu entries for "Copy 
To"/"Move To" and "Copy Folder To"/"Move Folder To".

The sub menu of these entries (listing your folders) is populated with icons 
from the folder list, too.

Please commit if OK.

Bye

["IconsForCopyMoveMenus_2008-10-13.diff" (text/x-patch)]

Index: kmail/kmheaders.cpp
===================================================================
--- kmail/kmheaders.cpp	(revision 870992)
+++ kmail/kmheaders.cpp	(working copy)
@@ -2490,6 +2490,7 @@ void KMHeaders::slotRMB()
   mOwner->folderTree()->folderToPopupMenu( KMFolderTree::CopyMessage, this,
       &mMenuToFolder, msgCopyMenu );
   msgCopyMenu->setTitle(i18n("&Copy To"));
+  msgCopyMenu->setIcon(KIcon("edit-copy"));
   menu->addMenu( msgCopyMenu );
 
   if ( !mFolder->canDeleteMessages() ) {
@@ -2500,6 +2501,7 @@ void KMHeaders::slotRMB()
     mOwner->folderTree()->folderToPopupMenu( KMFolderTree::MoveMessage, this,
         &mMenuToFolder, msgMoveMenu );
     msgMoveMenu->setTitle(i18n("&Move To"));
+    msgMoveMenu->setIcon(KIcon("go-jump"));
     menu->addMenu( msgMoveMenu) ;
   }
   menu->addSeparator();
Index: kmail/searchwindow.cpp
===================================================================
--- kmail/searchwindow.cpp	(revision 870992)
+++ kmail/searchwindow.cpp	(working copy)
@@ -837,10 +837,12 @@ void SearchWindow::slotContextMenuReques
     menu->addAction( mCopyAction );
     menu->addAction( mCutAction );
     msgCopyMenu->setTitle(i18n("&Copy To"));
+    msgCopyMenu->setIcon(KIcon("edit-copy"));
     menu->addMenu( msgCopyMenu );
     msgMoveMenu->setTitle(i18n("&Move To"));
-    menu->addSeparator();
+    msgMoveMenu->setIcon(KIcon("go-jump"));
     menu->addMenu( msgMoveMenu );
+    menu->addSeparator();
     menu->addAction( mSaveAsAction );
     menu->addAction( mSaveAtchAction );
     menu->addAction( mPrintAction );
Index: kmail/kmmainwidget.cpp
===================================================================
--- kmail/kmmainwidget.cpp	(revision 870992)
+++ kmail/kmmainwidget.cpp	(working copy)
@@ -3093,10 +3093,10 @@ void KMMainWidget::setupActions()
   actionCollection()->addAction("file_save_attachments", mSaveAttachmentsAction );
   connect(mSaveAttachmentsAction, SIGNAL(triggered(bool) ), SLOT(slotSaveAttachments()));
 
-  mMoveActionMenu = new KActionMenu(i18n("&Move To"), this);
+  mMoveActionMenu = new KActionMenu(KIcon("go-jump"), i18n("&Move To"), this);
   actionCollection()->addAction("move_to", mMoveActionMenu );
 
-  mCopyActionMenu = new KActionMenu(i18n("&Copy To"), this);
+  mCopyActionMenu = new KActionMenu(KIcon("edit-copy"), i18n("&Copy To"), this);
   actionCollection()->addAction("copy_to", mCopyActionMenu );
 
   mApplyAllFiltersAction = new KAction(KIcon("view-filter"), i18n("Appl&y All Filters"), this);
Index: kmail/kmfoldertree.h
===================================================================
--- kmail/kmfoldertree.h	(revision 870992)
+++ kmail/kmfoldertree.h	(working copy)
@@ -87,6 +87,8 @@ public:
 
   /** dnd */
   virtual bool acceptDrag(QDropEvent* e) const;
+  /** Returns the icon size. */
+  virtual int iconSize() const { return 16; }
 
 signals:
   /** Our icon changed */
@@ -108,8 +110,6 @@ protected:
   KMFolder* mFolder;
   /** Returns true when top-level/account icons should be used */
   virtual bool useTopLevelIcon() const { return depth() == 0; }
-  /** Returns the icon size. */
-  virtual int iconSize() const { return 16; }
 
 private:
   bool mNeedsRepaint;
Index: kmail/kmfoldertree.cpp
===================================================================
--- kmail/kmfoldertree.cpp	(revision 870992)
+++ kmail/kmfoldertree.cpp	(working copy)
@@ -1116,12 +1116,12 @@ void KMFolderTree::slotContextMenuReques
     }
 
     // copy folder
-    QMenu *copyMenu =  folderMenu->addMenu( i18n("&Copy Folder To") );
+    QMenu *copyMenu =  folderMenu->addMenu( KIcon("edit-copy"), i18n("&Copy Folder To") );
     folderToPopupMenu( CopyFolder, this, &mMenuToFolder, copyMenu );
 
     if ( fti->folder()->isMoveable() )
     {
-      QMenu *moveMenu = folderMenu->addMenu( i18n("&Move Folder To") );
+      QMenu *moveMenu = folderMenu->addMenu( KIcon("edit-copy"), i18n("&Move Folder To") );
       folderToPopupMenu( MoveFolder, this, &mMenuToFolder, moveMenu );
     }
 
@@ -1945,7 +1945,7 @@ void KMFolderTree::folderToPopupMenu( Me
     } else
     {
       // insert an item
-      QAction* act = menu->addAction( label );
+      QAction* act = menu->addAction( fti->normalIcon( fti->iconSize() ), label );
       if ( fti->folder() )
         aMenuToFolder->insert( act, fti->folder() );
       bool enabled = (fti->folder() ? true : false);


_______________________________________________
KDE PIM mailing list kde-pim@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic