* src/mainwindow.c
authorChristoph Hohmann <reboot@gmx.ch>
Wed, 21 Aug 2002 13:11:35 +0000 (13:11 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Wed, 21 Aug 2002 13:11:35 +0000 (13:11 +0000)
        o fix broken menu update for sorting type, we have to
          get this info from the summaryview now
        o removed setting of threaded state in menu callback
* src/summaryview.[ch]
        more summaryview/folderitem seperation for
        threading option
* configure.in
        removed not required --with-compiler-flags option

ChangeLog.claws
configure.in
src/mainwindow.c
src/summaryview.c
src/summaryview.h

index 15c0afe..ddb0ebb 100644 (file)
@@ -1,3 +1,15 @@
+2002-08-21 [christoph] 0.8.1claws95
+
+       * src/mainwindow.c
+               o fix broken menu update for sorting type, we have to
+                 get this info from the summaryview now
+               o removed setting of threaded state in menu callback
+       * src/summaryview.[ch]
+               more summaryview/folderitem seperation for
+               threading option
+       * configure.in
+               removed not required --with-compiler-flags option
+
 2002-08-21 [oliver]    0.8.1claws94
        
        * src/toolbar.h 
index 595087e..70490c4 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws94
+EXTRA_VERSION=claws95
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
@@ -69,11 +69,6 @@ case "$target" in
        ;;
 esac
 
-dnl add additional parameters
-AC_ARG_WITH(compiler-flags,
-    [  --with-compiler-flags=FLAGS  add parameters to the compiler command],
-    CFLAGS="$CFLAGS $withval")
-
 dnl for gettext
 ALL_LINGUAS="cs de el en_GB es fr hr it ja ko nl pl pt_BR ru sr sv"
 AM_GNU_GETTEXT
index 3183d9d..eaf9327 100644 (file)
@@ -1420,10 +1420,6 @@ SensitiveCond main_window_get_current_state(MainWindow *mainwin)
                state |= M_MSG_EXIST;
        if (item && item->path && item->parent && !item->no_select) {
                state |= M_EXEC;
-               if (item->threaded)
-                       state |= M_THREADED;
-               else
-                       state |= M_UNTHREADED;  
                /*              if (item->folder->type != F_NEWS) */
                state |= M_ALLOW_DELETE;
 
@@ -1431,6 +1427,10 @@ SensitiveCond main_window_get_current_state(MainWindow *mainwin)
                    || selection != SUMMARY_NONE)
                        state |= M_HIDE_READ_MSG;       
        }               
+       if (mainwin->summaryview->threaded)
+               state |= M_THREADED;
+       else
+               state |= M_UNTHREADED;  
        if (selection == SUMMARY_SELECTED_SINGLE ||
            selection == SUMMARY_SELECTED_MULTIPLE)
                state |= M_TARGET_EXIST;
@@ -1468,7 +1468,7 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
        SensitiveCond state;
        gboolean sensitive;
        GtkWidget *menuitem;
-       FolderItem *item;
+       SummaryView *summaryview;
        gchar *menu_path;
        gint i;
 
@@ -1558,46 +1558,45 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
        SET_CHECK_MENU_ACTIVE("/View/Show or hide/Message view",
                              messageview_is_visible(mainwin->messageview));
 
-       item = mainwin->summaryview->folder_item;
+       summaryview = mainwin->summaryview;
        menu_path = "/View/Sort/Don't sort";
-       if (item) {
-               switch (item->sort_key) {
-               case SORT_BY_NUMBER:
-                       menu_path = "/View/Sort/by number"; break;
-               case SORT_BY_SIZE:
-                       menu_path = "/View/Sort/by size"; break;
-               case SORT_BY_DATE:
-                       menu_path = "/View/Sort/by date"; break;
-               case SORT_BY_FROM:
-                       menu_path = "/View/Sort/by from"; break;
-               case SORT_BY_SUBJECT:
-                       menu_path = "/View/Sort/by subject"; break;
-               case SORT_BY_LABEL:
-                       menu_path = "/View/Sort/by color label"; break;
-               case SORT_BY_MARK:
-                       menu_path = "/View/Sort/by mark"; break;
-               case SORT_BY_UNREAD:
-                       menu_path = "/View/Sort/by unread"; break;
-               case SORT_BY_MIME:
-                       menu_path = "/View/Sort/by attachment"; break;
-               case SORT_BY_SCORE:
-                       menu_path = "/View/Sort/by score"; break;
-               case SORT_BY_LOCKED:
-                       menu_path = "/View/Sort/by locked"; break;
-               case SORT_BY_NONE:
-               default:
-                       menu_path = "/View/Sort/Don't sort"; break;
-               }
+
+       switch (summaryview->sort_key) {
+       case SORT_BY_NUMBER:
+               menu_path = "/View/Sort/by number"; break;
+       case SORT_BY_SIZE:
+               menu_path = "/View/Sort/by size"; break;
+       case SORT_BY_DATE:
+               menu_path = "/View/Sort/by date"; break;
+       case SORT_BY_FROM:
+               menu_path = "/View/Sort/by from"; break;
+       case SORT_BY_SUBJECT:
+               menu_path = "/View/Sort/by subject"; break;
+       case SORT_BY_LABEL:
+               menu_path = "/View/Sort/by color label"; break;
+       case SORT_BY_MARK:
+               menu_path = "/View/Sort/by mark"; break;
+       case SORT_BY_UNREAD:
+               menu_path = "/View/Sort/by unread"; break;
+       case SORT_BY_MIME:
+               menu_path = "/View/Sort/by attachment"; break;
+       case SORT_BY_SCORE:
+               menu_path = "/View/Sort/by score"; break;
+       case SORT_BY_LOCKED:
+               menu_path = "/View/Sort/by locked"; break;
+       case SORT_BY_NONE:
+       default:
+               menu_path = "/View/Sort/Don't sort"; break;
        }
        SET_CHECK_MENU_ACTIVE(menu_path, TRUE);
 
-       if (!item || item->sort_type == SORT_ASCENDING) {
+       if (summaryview->sort_type == SORT_ASCENDING) {
                SET_CHECK_MENU_ACTIVE("/View/Sort/Ascending", TRUE);
        } else {
                SET_CHECK_MENU_ACTIVE("/View/Sort/Descending", TRUE);
        }
 
-       if (item && item->sort_key != SORT_BY_NONE) {
+       if (summaryview->sort_key != SORT_BY_NONE) {
                menu_set_sensitive(ifactory, "/View/Sort/Ascending", TRUE);
                menu_set_sensitive(ifactory, "/View/Sort/Descending", TRUE);
        } else {
@@ -2427,10 +2426,10 @@ static void thread_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
 
        if (GTK_CHECK_MENU_ITEM(widget)->active) {
                summary_thread_build(mainwin->summaryview);
-               mainwin->summaryview->folder_item->threaded = TRUE;
+/*             mainwin->summaryview->folder_item->threaded = TRUE; */
        } else {
                summary_unthread(mainwin->summaryview);
-               mainwin->summaryview->folder_item->threaded = FALSE;
+/*             mainwin->summaryview->folder_item->threaded = FALSE; */
        }
 }
 
index 420cbb4..4dd9b91 100644 (file)
@@ -2078,7 +2078,7 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
                                summaryview->folder_item->prefs->important_score;
        }
 
-       if (summaryview->folder_item->threaded) {
+       if (summaryview->threaded) {
                GNode *root, *gnode;
 
                root = procmsg_get_thread_tree(mlist);
@@ -3261,7 +3261,7 @@ gboolean summary_execute(SummaryView *summaryview)
 
        gtk_clist_freeze(clist);
 
-       if (summaryview->folder_item->threaded)
+       if (summaryview->threaded)
                summary_unthread_for_exec(summaryview);
 
        summary_execute_move(summaryview);
@@ -3284,7 +3284,7 @@ gboolean summary_execute(SummaryView *summaryview)
                node = next;
        }
 
-       if (summaryview->folder_item->threaded)
+       if (summaryview->threaded)
                summary_thread_build(summaryview);
 
        summaryview->selected = clist->selection ?
@@ -3537,6 +3537,8 @@ void summary_thread_build(SummaryView *summaryview)
        STATUSBAR_POP(summaryview->mainwin);
        main_window_cursor_normal(summaryview->mainwin);
 
+       summaryview->threaded = TRUE;
+
        summary_unlock(summaryview);
 }
 
@@ -3604,6 +3606,8 @@ void summary_unthread(SummaryView *summaryview)
        STATUSBAR_POP(summaryview->mainwin);
        main_window_cursor_normal(summaryview->mainwin);
 
+       summaryview->threaded = FALSE;
+
        summary_unlock(summaryview);
 }
 
@@ -5160,12 +5164,19 @@ void summary_set_prefs_from_folderitem(SummaryView *summaryview, FolderItem *ite
        /* Sorting */
        summaryview->sort_key = item->sort_key;
        summaryview->sort_type = item->sort_type;
+
+       /* Threading */
+       summaryview->threaded = item->threaded;
 }
 
 void summary_save_prefs_to_folderitem(SummaryView *summaryview, FolderItem *item)
 {
+       /* Sorting */
        item->sort_key = summaryview->sort_key;
        item->sort_type = summaryview->sort_type;
+
+       /* Threading */
+       item->threaded = summaryview->threaded;
 }
 
 /*
index 18548d3..f3194c5 100644 (file)
@@ -135,6 +135,7 @@ struct _SummaryView
        gint important_score;
        FolderSortKey sort_key;
        FolderSortType sort_type;
+       guint threaded;
 
        /* Extra data for summaryview */
        regex_t *simplify_subject_preg;