Bug 65115 - Delete Message Button on Toolbar in Message Window
Summary: Delete Message Button on Toolbar in Message Window
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 124477 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-09-28 19:27 UTC by Ben Lamb
Modified: 2007-09-14 12:17 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Lamb 2003-09-28 19:27:33 UTC
Version:           1.5.9 (using KDE 3.1.92 (alpha2, CVS >= 20030921), compiled sources)
Compiler:          gcc version 3.2.2
OS:          Linux (i686) release 2.4.21

Please could you add a button to the toolbar in the message window to move the message to trash.

Thanks,

Ben.
Comment 1 Ingo Klöcker 2003-10-07 01:37:50 UTC
Subject: Re:  New: Delete Message Button on Toolbar in Message Window

Are you talking about the separate reader window which you get if you 
doubleclick on a message in the message list?

Comment 2 Ben Lamb 2003-10-07 13:40:49 UTC
Subject: Re:  Delete Message Button on Toolbar in Message Window

Yes, I did mean the separate reader window.

Thanks, Ben.

Comment 3 Frank 2004-11-01 18:28:56 UTC
Great idea, but why don't you just add a bunch of relevant buttons to it. Some suggestions:

- Trash
- Next Message
- Previous Message
Etc.
Comment 4 Senthil 2004-11-05 11:26:00 UTC
Yes.
Trash
Next Message
Previous Message

And KeyBoard Controls to them should be important additions when viewing mail standalone	
Comment 5 seth 2004-12-05 16:04:18 UTC
this is a wonderful idea, i can't imagine why this hasn't been addressed so far.  the message window buttons are very sparse and not helpful and there seems to be no way to modify them.  i much prefer the popup window to the preview plane, but using it requires extra actions as i cannot do anything but print reply or forward from the message window.  i'm using kmail 1.7.1 on kde 3.3.1.
Comment 6 Brian 2005-01-18 19:57:26 UTC
I'm with Frank !
Comment 7 Tim Dodge 2006-04-01 23:06:39 UTC
*** This bug has been confirmed by popular vote. ***
Comment 8 Stan Young 2006-09-04 05:42:09 UTC
For someone converting from Outlook, this ability is sorely missed.  It would seem the desired behavior, for delete or trash, would be to close the window, delete or trash the message, as appropriate, then behave as if you'd deleted the message from the list of messages.  (In other words, next message, or next message in thread, or whatever your defaults are.)  A really nice touch would be the ability to configure whether to end up on the message list, or to open the "next" message automatically.   I prefer to do the former, but a lot of folks seem to prefer the latter.
Comment 9 Christian Zangl 2006-09-12 13:50:46 UTC
I've posted a patch to kmail-devel.
Comment 10 Allen Winter 2006-09-12 23:44:57 UTC
SVN commit 583655 by winterz:

Can now trash a message from the message reader window.
Patch written by Christian and approved by Till.

Other feature wishes mentioned in the comments should
be opened as new "bugs".

BUGS: 65115

PS. Christian, it is time to get your own SVN account.


 M  +24 -0     kmreadermainwin.cpp  
 M  +2 -1      kmreadermainwin.h  
 M  +5 -1      kmreadermainwin.rc  


--- branches/KDE/3.5/kdepim/kmail/kmreadermainwin.cpp #583654:583655
@@ -41,6 +41,7 @@
 #include "kmfolder.h"
 #include "kmmainwidget.h"
 #include "kmfoldertree.h"
+#include "kmmsgdict.h"
 
 #include "kmreadermainwin.h"
 
@@ -123,6 +124,24 @@
 }
 
 //-----------------------------------------------------------------------------
+void KMReaderMainWin::slotTrashMsg()
+{
+  // find the real msg by its sernum
+  KMFolder* parent;
+  int index;
+  KMMsgDict::instance()->getLocation( mMsg->getMsgSerNum(), &parent, &index );
+  if (parent) {
+    KMMessage *msg = parent->getMsg( index );
+    if (msg) {
+      // now delete the msg and close this window
+      KMDeleteMsgCommand *command = new KMDeleteMsgCommand( parent, msg );
+      command->start();
+      close();
+    }
+  }
+}
+
+//-----------------------------------------------------------------------------
 void KMReaderMainWin::slotPrintMsg()
 {
   KMCommand *command = new KMPrintCommand( this, mReaderWin->message(),
@@ -241,6 +260,11 @@
   //                             this, SLOT( slotSaveMsg() ),
   //                             actionCollection(), "file_save_as" );
 
+  mTrashAction = new KAction( KGuiItem( i18n("&Move to Trash"), "edittrash",
+                                       i18n("Move message to trashcan") ),
+                             Key_Delete, this, SLOT(slotTrashMsg()),
+                             actionCollection(), "move_to_trash" );
+
   mPrintAction = KStdAction::print( this, SLOT( slotPrintMsg() ),
                                     actionCollection() );
 
--- branches/KDE/3.5/kdepim/kmail/kmreadermainwin.h #583654:583655
@@ -38,6 +38,7 @@
 
   /** Copy selected messages to folder with corresponding to given menuid */
   void copySelectedToFolder( int menuId );
+  void slotTrashMsg();
   void slotPrintMsg();
   void slotReplyToMsg();
   void slotReplyAllToMsg();
@@ -60,7 +61,7 @@
   KURL mUrl;
   QMap<int,KMFolder*> mMenuToFolder;
   // a few actions duplicated from kmmainwidget
-  KAction *mPrintAction, *mReplyAction, *mReplyAllAction, *mReplyAuthorAction,
+  KAction *mTrashAction, *mPrintAction, *mReplyAction, *mReplyAllAction, *mReplyAuthorAction,
           *mReplyListAction, *mForwardInlineAction,
           *mForwardAttachedAction, *mForwardDigestAction, *mRedirectAction,
           *mViewSourceAction;
--- branches/KDE/3.5/kdepim/kmail/kmreadermainwin.rc #583654:583655
@@ -1,5 +1,5 @@
 <!DOCTYPE kpartgui>
-<kpartgui version="5" name="kmreadermainwin" >
+<kpartgui version="6" name="kmreadermainwin" >
  <MenuBar>
   <Menu noMerge="1" name="file" >
    <text>&amp;File</text>
@@ -7,6 +7,8 @@
    <Action name="file_save_as" />
    <Action name="file_print" />
    <Separator/>
+   <Action name="move_to_trash" />
+   <Separator/>
    <Action name="file_close" />
   </Menu>
   <Menu noMerge="1" name="view">
@@ -52,5 +54,7 @@
   <Separator/>
   <Action name="message_reply_menu" />
   <Action name="message_forward"/>
+  <Separator/>
+  <Action name="move_to_trash" />
  </ToolBar>
 </kpartgui>
Comment 11 Juha Tuomala 2006-09-13 08:47:55 UTC
Thank you Christian :)
Comment 12 Christian Zangl 2006-10-05 12:17:49 UTC
*** Bug 124477 has been marked as a duplicate of this bug. ***