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

List:       kmail-devel
Subject:    [PATCH] Find/Copy/Select all (was: delete message button for reader
From:       Christian Zangl <cza () sixxac ! com>
Date:       2006-09-27 17:41:42
Message-ID: 200609271941.43159.cza () sixxac ! com
[Download RAW message or body]

OK, I've added the Find, Copy and Select all commands and have also thrown in 
a Find Next for good measure ;-)  

"Move to Trash" is now also on the Edit menu. The new menu entries require no 
new strings.

Please take a look at it and let me know if I can commit it (now that I have 
commit access). 

bye, chris

> -----Original Message-----
> From: Ingo Klöcker <kloecker@kde.org>
> Date: Thursday 14 September 2006 22:39
> On Thursday 14 September 2006 08:46, Christian Zangl wrote:
> > > From: Till Adam <adam@kde.org>
> > > Date: Wednesday 13 September 2006 20:14
> > >
> > > On Tuesday 12 September 2006 19:50, Christian Zangl wrote:
> > > > Is the position for the menu item OK? (File->Move to trash)
> > >
> > > Hm, in the mainwindow we have it in the Edit menu, maybe that would
> > > be better for consistency?
> >
> > I think it would look strange if we create an Edit menu that has only
> > one entry.
>
> You could add Copy, Find in Message and Select All Text to the Edit
> menu. Then Move to Trash won't be so lonely anymore. :-)
>
> Regards,
> Ingo

["search_patch.diff" (text/x-diff)]

Index: kmreadermainwin.rc
===================================================================
--- kmreadermainwin.rc	(revision 589075)
+++ kmreadermainwin.rc	(working copy)
@@ -1,5 +1,5 @@
 <!DOCTYPE kpartgui>
-<kpartgui version="6" name="kmreadermainwin" >
+<kpartgui version="7" name="kmreadermainwin" >
  <MenuBar>
   <Menu noMerge="1" name="file" >
    <text>&amp;File</text>
@@ -7,10 +7,13 @@
    <Action name="file_save_as" />
    <Action name="file_print" />
    <Separator/>
-   <Action name="move_to_trash" />
-   <Separator/>
    <Action name="file_close" />
   </Menu>
+  <Menu name="edit" >
+    <text>&amp;Edit</text>
+    <Action name="move_to_trash" />
+  </Menu>
+
   <Menu noMerge="1" name="view">
    <text>&amp;View</text>
    <Action name="view_headers"/>
Index: kmreadermainwin.cpp
===================================================================
--- kmreadermainwin.cpp	(revision 589075)
+++ kmreadermainwin.cpp	(working copy)
@@ -144,6 +144,29 @@
 }
 
 //-----------------------------------------------------------------------------
+void KMReaderMainWin::slotFind()
+{
+  mReaderWin->findText();
+}
+
+void KMReaderMainWin::slotFindNext()
+{
+  mReaderWin->findTextNext();
+}
+
+//-----------------------------------------------------------------------------
+void KMReaderMainWin::slotCopy()
+{
+  mReaderWin->slotCopySelectedText();
+}
+
+//-----------------------------------------------------------------------------
+void KMReaderMainWin::slotMarkAll()
+{
+  mReaderWin->selectAll();
+}
+
+//-----------------------------------------------------------------------------
 void KMReaderMainWin::slotPrintMsg()
 {
   KMCommand *command = new KMPrintCommand( this, mReaderWin->message(),
@@ -262,11 +285,6 @@
   //                             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() );
 
@@ -275,6 +293,16 @@
   closeShortcut.append( KKey(Key_Escape));
   closeAction->setShortcut(closeShortcut);
 
+  //----- Edit Menu
+  KStdAction::copy (this, SLOT(slotCopy()), actionCollection());
+  KStdAction::selectAll (this, SLOT(slotMarkAll()), actionCollection());
+  KStdAction::find (this, SLOT(slotFind()), actionCollection());
+  KStdAction::findNext(this, SLOT(slotFindNext()), actionCollection());
+  mTrashAction = new KAction( KGuiItem( i18n("&Move to Trash"), "edittrash",
+                                       i18n("Move message to trashcan") ),
+                             Key_Delete, this, SLOT(slotTrashMsg()),
+                             actionCollection(), "move_to_trash" );
+
   //----- View Menu
   mViewSourceAction = new KAction( i18n("&View Source"), Key_V, this,
                                    SLOT(slotShowMsgSrc()), actionCollection(),
Index: kmreaderwin.cpp
===================================================================
--- kmreaderwin.cpp	(revision 589075)
+++ kmreaderwin.cpp	(working copy)
@@ -1726,8 +1726,21 @@
   mViewer->view()->print();
 }
 
+//-----------------------------------------------------------------------------
+void KMReaderWin::findText()
+{
+  if (!message()) return;
+  mViewer->view()->part()->findText();
+}
 
 //-----------------------------------------------------------------------------
+void KMReaderWin::findTextNext()
+{
+  if (!message()) return;
+  mViewer->view()->part()->findTextNext();
+}
+
+//-----------------------------------------------------------------------------
 int KMReaderWin::msgPartFromUrl(const KURL &aUrl)
 {
   if (aUrl.isEmpty()) return -1;
Index: kmreaderwin.h
===================================================================
--- kmreaderwin.h	(revision 589075)
+++ kmreaderwin.h	(working copy)
@@ -165,6 +165,11 @@
   /** Print current message. */
   virtual void printMsg(void);
 
+  /** Starts a new search by popping up a dialog asking the user what he wants to search for. **/
+  void findText();
+  /** Finds the next occurrence of the string or expression **/
+  void findTextNext();
+
   /** Return selected text */
   QString copyText();
 
Index: kmreadermainwin.h
===================================================================
--- kmreadermainwin.h	(revision 589075)
+++ kmreadermainwin.h	(working copy)
@@ -49,6 +49,10 @@
   void slotForwardDigestMsg();
   void slotRedirectMsg();
   void slotShowMsgSrc();
+  void slotMarkAll();
+  void slotCopy();
+  void slotFind();
+  void slotFindNext();
 
   void slotConfigChanged();
 


_______________________________________________
KMail developers mailing list
KMail-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmail-devel


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

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