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

List:       kde-pim
Subject:    [Kde-pim] Patch to fix bug 95441
From:       Albert Astals Cid <tsdgeos () yahoo ! es>
Date:       2004-12-20 22:50:51
Message-ID: 200412202350.51179.tsdgeos () yahoo ! es
[Download RAW message or body]

Hi, i have a patch for bug 95441. As a quick explanation the bug says that the 
kmail contextual menu does not use the same actions as the window menu so the 
shortcuts do not appear on the contextual menú and that confuses some users 
(the bug is reported by me, but because i got the report from kde-i18n-ca 
mailing list)

http://bugs.kde.org/show_bug.cgi?id=95441

I have a patch the plugs the mainwindow actions into the popup menu.

Any comments?

May i commit?

Please CC me as i am not on the list

Albert

["kmail.95441.patch" (text/x-diff)]

? kmail.95441.patch
Index: kmfoldertree.cpp
===================================================================
RCS file: /home/kde/kdepim/kmail/kmfoldertree.cpp,v
retrieving revision 1.338
diff -u -r1.338 kmfoldertree.cpp
--- kmfoldertree.cpp	17 Dec 2004 16:16:37 -0000	1.338
+++ kmfoldertree.cpp	20 Dec 2004 22:46:19 -0000
@@ -925,10 +925,8 @@
                                SLOT(addChildFolder()));
     
     if (!fti->folder()) {
-      folderMenu->insertItem(i18n("&Compact All Folders"),
-                             kmkernel->folderMgr(), SLOT(compactAll()));
-      folderMenu->insertItem(i18n("&Expire All Folders"),
-                             kmkernel->folderMgr(), SLOT(expireAll()));
+      mMainWidget->action("compact_all_folders")->plug(folderMenu);
+      mMainWidget->action("expire_all_folders")->plug(folderMenu);
     } else if (fti->folder()->folderType() == KMFolderTypeImap) {
       folderMenu->insertItem(SmallIconSet("mail_get"), i18n("Check &Mail"),
         this,
@@ -936,9 +934,7 @@
     }
   } else {
     if ((fti->folder() == kmkernel->outboxFolder()) && (fti->folder()->count()) )
-        folderMenu->insertItem(SmallIconSet("mail_send"),
-                               i18n("&Send Queued Messages"), mMainWidget,
-                               SLOT(slotSendQueued()));
+        mMainWidget->action("send_queued")->plug(folderMenu);
     if (!fti->folder()->noChildren())
     {
       folderMenu->insertItem(SmallIconSet("folder_new"),
@@ -951,37 +947,20 @@
     // -- smp.
     if (!fti->folder()->noContent())
     {
-      folderMenu->insertItem( SmallIconSet("mail_find"),
-			      i18n("&Find Messages..."), 
-			      mMainWidget,
-			      SLOT(slotSearch()) );
-
-      int itemId = folderMenu->insertItem( SmallIconSet("goto"),
-                                           i18n("Mark All Messages as &Read"),
-                                           mMainWidget,
-                                           SLOT( slotMarkAllAsRead() ) );
-      folderMenu->setItemEnabled( itemId, fti->folder()->countUnread() > 0 );
-
-      folderMenu->insertItem(i18n("&Compact"), mMainWidget,
-                             SLOT(slotCompactFolder()));
-
-      itemId = folderMenu->insertItem(i18n("&Expire"), mMainWidget,
-                                      SLOT(slotExpireFolder()));
-      folderMenu->setItemEnabled( itemId, fti->folder()->isAutoExpire() && \
!fti->folder()->isReadOnly() ); +      \
mMainWidget->action("search_messages")->plug(folderMenu);  
+      mMainWidget->action("mark_all_as_read")->plug(folderMenu);
+
+      mMainWidget->action("compact")->plug(folderMenu);
+
+      mMainWidget->action("expire")->plug(folderMenu);
 
       folderMenu->insertSeparator();
 
-      itemId = folderMenu->insertItem(SmallIconSet("edittrash"),
-        (kmkernel->folderIsTrash(fti->folder())) ? i18n("&Empty") :
-                             i18n("&Move All Messages to Trash"), mMainWidget,
-                             SLOT(slotEmptyFolder()));
-      folderMenu->setItemEnabled( itemId, fti->folder()->count() > 0 && \
!fti->folder()->isReadOnly() ); +      \
mMainWidget->action("empty")->plug(folderMenu);  }
     if ( !fti->folder()->isSystemFolder() )
-      folderMenu->insertItem(SmallIconSet("editdelete"),
-                             i18n("&Delete Folder"), mMainWidget,
-                             SLOT(slotRemoveFolder()));
+      mMainWidget->action("delete_folder")->plug(folderMenu);
 
   }
   if (fti->folder() &&
@@ -995,15 +974,10 @@
 
     if (!fti->folder()->noContent())
     {
-      int id = folderMenu->insertItem(SmallIconSet("mail_get"), i18n("Check Mail in \
                This Folder"), mMainWidget,
-                                      SLOT(slotRefreshFolder()));
+      mMainWidget->action("refresh_folder")->plug(folderMenu);
       if ( fti->folder()->folderType() == KMFolderTypeImap ) {
         folderMenu->insertItem(SmallIconSet("reload"), i18n("Refresh Folder List"), \
this,  SLOT(slotResetFolderList()));
-      } else {
-        bool knownImapPath = !static_cast<KMFolderCachedImap*>( \
                fti->folder()->storage() )->imapPath().isEmpty();
-        folderMenu->setItemEnabled( id, knownImapPath );
-
       }
     }
     if ( fti->folder()->folderType() == KMFolderTypeCachedImap ) {
@@ -1016,9 +990,7 @@
 
   if ( fti->folder() && fti->folder()->isMailingListEnabled() ) {
     folderMenu->insertSeparator();
-    folderMenu->insertItem( i18n("New Message to Mailing-List..."),
-                            this,
-                            SLOT( slotNewMessageToMailingList() ) );
+    mMainWidget->action("post_message")->plug(folderMenu);
   }
 
   if (fti->folder() && fti->parent())
@@ -1028,10 +1000,7 @@
         i18n("&Assign Shortcut..."),
         fti,
         SLOT(assignShortcut()));
-    folderMenu->insertItem(SmallIconSet("configure"),
-        i18n("&Properties"),
-        fti,
-        SLOT(properties()));
+    mMainWidget->action("modify")->plug(folderMenu);
   }
 
 



_______________________________________________
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