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

List:       kmail-devel
Subject:    [PATCH] unread column
From:       Carsten Burghardt <burghardt () kde ! org>
Date:       2003-03-30 16:02:02
[Download RAW message or body]

Hi,

to optimise the current unread column logic I propose the attached patch. It 
introduces a new submenu "Unread Count" in the View-menu with the entries 
"Separate Column" and "Part Of Foldername". I didn't change the context menu 
of the column-header as this should only (in my eyes) switch columns on/off.

Regards,

Carsten
["unread_column.diff" (text/x-diff)]

Index: kmmainwidget.cpp
===================================================================
RCS file: /home/kde/kdepim/kmail/kmmainwidget.cpp,v
retrieving revision 1.38
diff -u -3 -p -r1.38 kmmainwidget.cpp
--- kmmainwidget.cpp	24 Mar 2003 13:01:46 -0000	1.38
+++ kmmainwidget.cpp	30 Mar 2003 15:45:44 -0000
@@ -1253,7 +1253,7 @@ void KMMainWidget::slotUndo()
 }
 
 //-----------------------------------------------------------------------------
-void KMMainWidget::slotToggleUnreadColumn()
+void KMMainWidget::slotToggleUnread()
 {
   mFolderTree->toggleColumn(KMFolderTree::unread);
 }
@@ -2249,13 +2249,27 @@ void KMMainWidget::setupActions()
   if ( raction )
     raction->setChecked( true );
 
-  unreadColumnToggle = new KToggleAction( i18n("View->", "&Unread Column"), 0, this,
-			       SLOT(slotToggleUnreadColumn()),
-			       actionCollection(), "view_columns_unread" );
-  unreadColumnToggle->setToolTip( i18n("Toggle display of column showing the "
-                                       "number of unread messages in folders.") );
+  // Unread Submenu
+  KActionMenu * unreadMenu =
+    new KActionMenu( i18n("View->", "&Unread Count"),
+		     actionCollection(), "view_unread" );
+  unreadMenu->setToolTip( i18n("Choose how to display the count of unread messages") );
+
+  unreadColumnToggle = new KRadioAction( i18n("View->Unread Count", "&Separate Column"), 0, this,
+			       SLOT(slotToggleUnread()),
+			       actionCollection(), "view_unread_column" );
+  unreadColumnToggle->setExclusiveGroup( "view_unread_group" );
   unreadColumnToggle->setChecked( mFolderTree->isUnreadActive() );
+  unreadMenu->insert( unreadColumnToggle );
 
+  unreadTextToggle = new KRadioAction( i18n("View->Unread Count", "&Part Of Foldername"), 0, this,
+			       SLOT(slotToggleUnread()),
+			       actionCollection(), "view_unread_text" );
+  unreadTextToggle->setExclusiveGroup( "view_unread_group" );
+  unreadTextToggle->setChecked( !mFolderTree->isUnreadActive() );
+  unreadMenu->insert( unreadTextToggle );
+
+  // toggle for total column
   totalColumnToggle = new KToggleAction( i18n("View->", "&Total Column"), 0, this,
 			       SLOT(slotToggleTotalColumn()),
 			       actionCollection(), "view_columns_total" );
Index: kmmainwidget.h
===================================================================
RCS file: /home/kde/kdepim/kmail/kmmainwidget.h,v
retrieving revision 1.15
diff -u -3 -p -r1.15 kmmainwidget.h
--- kmmainwidget.h	24 Mar 2003 13:01:46 -0000	1.15
+++ kmmainwidget.h	30 Mar 2003 15:45:44 -0000
@@ -110,7 +110,8 @@ public:
     *applyFilterActionsMenu;
 
   /** we need to access those KToggleActions from the foldertree-popup */
-  KToggleAction* unreadColumnToggle;
+  KRadioAction* unreadColumnToggle;
+  KRadioAction* unreadTextToggle;
   KToggleAction* totalColumnToggle;
 
   void folderSelected(KMFolder*, bool jumpToUnread);
@@ -222,7 +223,7 @@ protected slots:
   void slotSetThreadStatusQueued();
   void slotSetThreadStatusSent();
   void slotSetThreadStatusFlag();
-  void slotToggleUnreadColumn();
+  void slotToggleUnread();
   void slotToggleTotalColumn();
   void slotBriefHeaders();
   void slotFancyHeaders();
Index: kmmainwin.rc
===================================================================
RCS file: /home/kde/kdepim/kmail/kmmainwin.rc,v
retrieving revision 1.52
diff -u -3 -p -r1.52 kmmainwin.rc
--- kmmainwin.rc	13 Jan 2003 07:43:16 -0000	1.52
+++ kmmainwin.rc	30 Mar 2003 15:45:44 -0000
@@ -1,5 +1,5 @@
 <!DOCTYPE kpartgui>
-<kpartgui version="55" name="kmmainwin" >
+<kpartgui version="56" name="kmmainwin" >
  <MenuBar>
   <Menu noMerge="1" name="file" >
    <text>&amp;File</text>
@@ -37,7 +37,7 @@
    <Action name="view_headers"/>
    <Action name="view_attachments"/>
    <Separator/>
-   <Action name="view_columns_unread"/>
+   <Action name="view_unread"/>
    <Action name="view_columns_total"/>
    <Separator/>
    <Action name="expand_thread"/>

_______________________________________________
KMail Developers mailing list
kmail@mail.kde.org
http://mail.kde.org/mailman/listinfo/kmail

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

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