Update of /cvsroot/mahogany/M/src/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9453/src/gui

Modified Files:
        wxFolderView.cpp 
Log Message:
show threading indicator in the status column; toggle threading by clicking it

Index: wxFolderView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxFolderView.cpp,v
retrieving revision 1.663
retrieving revision 1.664
diff -b -u -2 -r1.663 -r1.664
--- wxFolderView.cpp    13 Jul 2004 22:17:07 -0000      1.663
+++ wxFolderView.cpp    15 Jul 2004 22:36:46 -0000      1.664
@@ -104,4 +104,14 @@
 #include "../icons/sortdown.xpm"
 #include "../icons/sortup.xpm"
+#include "../icons/thread.xpm"
+
+enum ListCtrlImages
+{
+   ListCtrlImage_None = -1,
+   ListCtrlImage_SortDown,
+   ListCtrlImage_SortUp,
+   ListCtrlImage_Thread,
+   ListCtrlImage_Max
+};
 
 #ifndef wxHAS_RADIO_MENU_ITEMS
@@ -612,4 +622,8 @@
    void UpdateSortIndicator();
 
+   /// and the same for threading
+   void UpdateThreadIndicator();
+
+   /// save the widths of the columns in profile if needed
    /// save the widths of the columns in profile if needed
    void SaveColWidths();
@@ -1492,6 +1506,6 @@
 
    m_colSort = WXFLC_NONE;
-   // FIXME: replace by a more efficient call
-   for (size_t i = 0; i < WXFLC_NUMENTRIES; ++i) {
+   for (size_t i = 0; i < WXFLC_NUMENTRIES; ++i)
+   {
       m_columns[i] = 0;
    }
@@ -1516,5 +1530,6 @@
    // add the images to use for the columns
    wxBitmap bmpDown = sort_down_xpm,
-            bmpUp = sort_up_xpm;
+            bmpUp = sort_up_xpm,
+            bmpThread = thread_xpm;
    wxImageList *imagelist = new wxImageList(bmpDown.GetWidth(),
                                             bmpDown.GetHeight());
@@ -1524,4 +1539,5 @@
    imagelist->Add(bmpUp);
    imagelist->Add(bmpDown);
+   imagelist->Add(bmpThread);
    AssignImageList(imagelist, wxIMAGE_LIST_SMALL);
 
@@ -1623,4 +1639,5 @@
 
    UpdateSortIndicator();
+   UpdateThreadIndicator();
 }
 
@@ -2019,4 +2036,26 @@
    wxCHECK_RET( col != WXFLC_NONE, _T("should have a valid column") );
 
+   // we now toggle threading when status column is clicked: this is more
+   // useful than toggling "sort by status" which is hardly ever used
+   if ( col == WXFLC_STATUS )
+   {
+      Profile_obj profile(m_FolderView->GetFolderProfile());
+
+      profile->writeEntry(MP_MSGS_USE_THREADING,
+                           !READ_CONFIG_BOOL(profile,  MP_MSGS_USE_THREADING));
+
+      // although this would be done by ApplyOptions() anyhow, doing it
+      // immediately results in a faster (and hence better) visual feedback
+      UpdateThreadIndicator();
+
+      MEventManager::Send(new MEventOptionsChangeData
+                              (
+                               profile,
+                               MEventOptionsChangeData::Ok
+                              ));
+      return;
+   }
+
+
    MessageSortOrder orderCol = SortOrderFromCol(col);
    if ( orderCol == MSO_NONE )
@@ -2721,4 +2760,14 @@
 }
 
+void wxFolderListCtrl::UpdateThreadIndicator()
+{
+   Profile_obj profile(m_FolderView->GetFolderProfile());
+
+   SetColumnImage(m_columns[WXFLC_STATUS],
+                  READ_CONFIG(profile, MP_MSGS_USE_THREADING)
+                     ? ListCtrlImage_Thread
+                     : ListCtrlImage_None);
+}
+
 // ----------------------------------------------------------------------------
 // wxFolderListCtrl focus/selection management
@@ -3756,4 +3805,5 @@
 
    m_FolderCtrl->UpdateSortIndicator();
+   m_FolderCtrl->UpdateThreadIndicator();
 
    m_MessageWindow->UpdateOptions();



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to