2007-01-20 [colin] 2.7.1cvs37
authorColin Leroy <colin@colino.net>
Sat, 20 Jan 2007 11:29:48 +0000 (11:29 +0000)
committerColin Leroy <colin@colino.net>
Sat, 20 Jan 2007 11:29:48 +0000 (11:29 +0000)
* src/mainwindow.c
* src/mainwindow.h
* src/summaryview.c
* src/gtk/quicksearch.c
Add Wide message list layout

ChangeLog
PATCHSETS
configure.ac
src/gtk/quicksearch.c
src/mainwindow.c
src/mainwindow.h
src/summaryview.c

index 7357b23..55550d2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-01-20 [colin]     2.7.1cvs37
+
+       * src/mainwindow.c
+       * src/mainwindow.h
+       * src/summaryview.c
+       * src/gtk/quicksearch.c
+               Add Wide message list layout
+
 2007-01-19 [fabien]    2.7.1cvs36
 
        * src/textview.c
index 79a0b28..c0bf6b2 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.29 -r 1.1.2.30 src/prefs_msg_colors.c;  ) > 2.7.1cvs34.patchset
 ( cvs diff -u -r 1.115.2.127 -r 1.115.2.128 src/main.c;  cvs diff -u -r 1.274.2.165 -r 1.274.2.166 src/mainwindow.c;  cvs diff -u -r 1.39.2.29 -r 1.39.2.30 src/mainwindow.h;  cvs diff -u -r 1.94.2.119 -r 1.94.2.120 src/messageview.c;  cvs diff -u -r 1.19.2.13 -r 1.19.2.14 src/messageview.h;  cvs diff -u -r 1.204.2.119 -r 1.204.2.120 src/prefs_common.c;  cvs diff -u -r 1.103.2.75 -r 1.103.2.76 src/prefs_common.h;  cvs diff -u -r 1.395.2.278 -r 1.395.2.279 src/summaryview.c;  cvs diff -u -r 1.68.2.32 -r 1.68.2.33 src/summaryview.h;  cvs diff -u -r 1.1.2.57 -r 1.1.2.58 src/gtk/quicksearch.c;  cvs diff -u -r 1.1.2.10 -r 1.1.2.11 src/gtk/quicksearch.h;  ) > 2.7.1cvs35.patchset
 ( cvs diff -u -r 1.96.2.165 -r 1.96.2.166 src/textview.c;  ) > 2.7.1cvs36.patchset
+( cvs diff -u -r 1.274.2.166 -r 1.274.2.167 src/mainwindow.c;  cvs diff -u -r 1.39.2.30 -r 1.39.2.31 src/mainwindow.h;  cvs diff -u -r 1.395.2.279 -r 1.395.2.280 src/summaryview.c;  cvs diff -u -r 1.1.2.58 -r 1.1.2.59 src/gtk/quicksearch.c;  ) > 2.7.1cvs37.patchset
index dbd2757..c0e9d63 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=7
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=36
+EXTRA_VERSION=37
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index baf35db..25714a5 100644 (file)
@@ -627,7 +627,10 @@ QuickSearch *quicksearch_new()
 
 void quicksearch_relayout(QuickSearch *quicksearch)
 {
-       if (prefs_common.layout_mode != VERTICAL_LAYOUT) {
+       switch (prefs_common.layout_mode) {
+       case NORMAL_LAYOUT:
+       case WIDE_LAYOUT:
+       case WIDE_MSGLIST_LAYOUT:
 #if GTK_CHECK_VERSION(2, 8, 0)
                gtk_button_set_label(GTK_BUTTON(quicksearch->search_description), GTK_STOCK_INFO);
                gtk_button_set_label(GTK_BUTTON(quicksearch->search_condition_expression), GTK_STOCK_EDIT);
@@ -637,7 +640,8 @@ void quicksearch_relayout(QuickSearch *quicksearch)
                gtk_button_set_label(GTK_BUTTON(quicksearch->search_condition_expression), " ... ");
                gtk_button_set_label(GTK_BUTTON(quicksearch->clear_search), _(" Clear "));
 #endif
-       } else {
+               break;
+       case VERTICAL_LAYOUT:
 #if GTK_CHECK_VERSION(2, 8, 0)
                gtk_button_set_label(GTK_BUTTON(quicksearch->search_description), "");
                gtk_button_set_label(GTK_BUTTON(quicksearch->search_condition_expression), "");
@@ -654,6 +658,7 @@ void quicksearch_relayout(QuickSearch *quicksearch)
                gtk_button_set_label(GTK_BUTTON(quicksearch->search_condition_expression), "...");
                gtk_button_set_label(GTK_BUTTON(quicksearch->clear_search), _("Clear"));
 #endif
+               break;
        }
 }
 
index 824fc3f..dc69724 100644 (file)
@@ -547,9 +547,10 @@ static GtkItemFactoryEntry mainwin_entries[] =
 
        {N_("/_View/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_View/La_yout"),                  NULL, NULL, 0, "<Branch>"},
-       {N_("/_View/Layout/_Normal"),           NULL, set_layout_cb, NORMAL_LAYOUT, "<RadioItem>"},
-       {N_("/_View/Layout/_Vertical"),         NULL, set_layout_cb, VERTICAL_LAYOUT, "/View/Layout/Normal"},
-       {N_("/_View/Layout/_Wide"),             NULL, set_layout_cb, WIDE_LAYOUT, "/View/Layout/Normal"},
+       {N_("/_View/Layout/_Standard"),         NULL, set_layout_cb, NORMAL_LAYOUT, "<RadioItem>"},
+       {N_("/_View/Layout/_Three columns"),    NULL, set_layout_cb, VERTICAL_LAYOUT, "/View/Layout/Standard"},
+       {N_("/_View/Layout/_Wide message"),     NULL, set_layout_cb, WIDE_LAYOUT, "/View/Layout/Standard"},
+       {N_("/_View/Layout/W_ide message list"),NULL, set_layout_cb, WIDE_MSGLIST_LAYOUT, "/View/Layout/Standard"},
        {N_("/_View/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_View/_Sort"),                    NULL, NULL, 0, "<Branch>"},
        {N_("/_View/_Sort/by _number"),         NULL, sort_summary_cb, SORT_BY_NUMBER, "<RadioItem>"},
@@ -1884,7 +1885,9 @@ void main_window_toggle_message_view(MainWindow *mainwin)
        GtkWidget *ppaned = NULL;
        GtkWidget *container = NULL;
        
-       if (prefs_common.layout_mode != WIDE_LAYOUT) {
+       switch (prefs_common.layout_mode) {
+       case NORMAL_LAYOUT:
+       case VERTICAL_LAYOUT:
                ppaned = mainwin->vpaned;
                container = mainwin->hpaned;
                if (ppaned->parent != NULL) {
@@ -1899,7 +1902,8 @@ void main_window_toggle_message_view(MainWindow *mainwin)
                        gtk_container_add(GTK_CONTAINER(container), ppaned);
                        gtk_widget_unref(ppaned);
                }
-       } else {
+               break;
+       case WIDE_LAYOUT:
                ppaned = mainwin->hpaned;
                container = mainwin->vpaned;
                if (mainwin->messageview->vbox->parent != NULL) {
@@ -1912,6 +1916,10 @@ void main_window_toggle_message_view(MainWindow *mainwin)
                        gtk_container_add(GTK_CONTAINER(container), mainwin->messageview->vbox);
                        gtk_widget_unref(mainwin->messageview->vbox);
                }
+               break;
+       case WIDE_MSGLIST_LAYOUT:
+               g_warning("can't hide messageview in this wide msglist layout");
+               break;
        }
 
        if (messageview_is_visible(mainwin->messageview))
@@ -2616,7 +2624,11 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
                else
                        gtk_widget_destroy(mainwin->hpaned);
        }
-       if (layout_mode != WIDE_LAYOUT) {
+
+       menu_set_sensitive(ifactory, "/View/Show or hide/Message view", (layout_mode != WIDE_MSGLIST_LAYOUT));
+       switch (layout_mode) {
+       case VERTICAL_LAYOUT:
+       case NORMAL_LAYOUT:
                hpaned = gtk_hpaned_new();
                if (layout_mode == VERTICAL_LAYOUT)
                        vpaned = gtk_hpaned_new();
@@ -2641,7 +2653,8 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
                               GTK_WIDGET_PTR(mainwin->messageview));
                gtk_widget_show(vpaned);
                gtk_widget_queue_resize(vpaned);
-       } else {
+               break;
+       case WIDE_LAYOUT:
                vpaned = gtk_vpaned_new();
                hpaned = gtk_hpaned_new();
                gtk_box_pack_start(GTK_BOX(vbox_body), vpaned, TRUE, TRUE, 0);
@@ -2663,6 +2676,34 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
                }
                gtk_widget_show(vpaned);
                gtk_widget_queue_resize(vpaned);
+               break;
+       case WIDE_MSGLIST_LAYOUT:
+               vpaned = gtk_vpaned_new();
+               hpaned = gtk_hpaned_new();
+               gtk_box_pack_start(GTK_BOX(vbox_body), vpaned, TRUE, TRUE, 0);
+
+               gtk_paned_add1(GTK_PANED(vpaned),
+                              GTK_WIDGET_PTR(mainwin->summaryview));
+               gtk_paned_add1(GTK_PANED(hpaned),
+                              GTK_WIDGET_PTR(mainwin->folderview));
+
+               gtk_widget_show(hpaned);
+               gtk_widget_queue_resize(hpaned);
+
+               if (messageview_is_visible(mainwin->messageview)) {
+                       gtk_paned_add2(GTK_PANED(hpaned),
+                              GTK_WIDGET_PTR(mainwin->messageview));   
+               } else {
+                       gtk_widget_ref(GTK_WIDGET_PTR(mainwin->messageview));
+               }
+               gtk_paned_add2(GTK_PANED(vpaned), hpaned);
+
+               gtk_widget_show(vpaned);
+               gtk_widget_queue_resize(vpaned);
+               break;
+       default:
+               g_warning("Unknown layout");
+               return;
        }
 
        mainwin->hpaned = hpaned;
@@ -2711,12 +2752,19 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), active); \
 }
 
-       if (prefs_common.layout_mode == NORMAL_LAYOUT) {
-               SET_CHECK_MENU_ACTIVE("/View/Layout/Normal", TRUE);
-       } else if (prefs_common.layout_mode == VERTICAL_LAYOUT) {
-               SET_CHECK_MENU_ACTIVE("/View/Layout/Vertical", TRUE);
-       } else if (prefs_common.layout_mode == WIDE_LAYOUT) {
-               SET_CHECK_MENU_ACTIVE("/View/Layout/Wide", TRUE);
+       switch (prefs_common.layout_mode) {
+       case NORMAL_LAYOUT:
+               SET_CHECK_MENU_ACTIVE("/View/Layout/Standard", TRUE);
+               break;
+       case VERTICAL_LAYOUT:
+               SET_CHECK_MENU_ACTIVE("/View/Layout/Three columns", TRUE);
+               break;
+       case WIDE_LAYOUT:
+               SET_CHECK_MENU_ACTIVE("/View/Layout/Wide message", TRUE);
+               break;
+       case WIDE_MSGLIST_LAYOUT:
+               SET_CHECK_MENU_ACTIVE("/View/Layout/Wide message list", TRUE);
+               break;
        }
 #undef SET_CHECK_MENU_ACTIVE
 
index 82b0aa1..62c20e0 100644 (file)
@@ -62,7 +62,8 @@ typedef enum
 {
        NORMAL_LAYOUT    = 0,
        VERTICAL_LAYOUT  = 1 << 0,
-       WIDE_LAYOUT = 1 << 1
+       WIDE_LAYOUT = 1 << 1,
+       WIDE_MSGLIST_LAYOUT = 1 << 2
 } LayoutType;
 
 typedef enum
index 5361b2a..6d1c079 100644 (file)
@@ -713,6 +713,9 @@ SummaryView *summary_create(void)
        else
                quicksearch_hide(quicksearch);
        
+       if (prefs_common.layout_mode == WIDE_MSGLIST_LAYOUT)
+               gtk_widget_hide(summaryview->toggle_eventbox);
+
        return summaryview;
 }
 
@@ -726,16 +729,26 @@ void summary_relayout(SummaryView *summaryview)
        gtkut_container_remove(GTK_CONTAINER(summaryview->hbox_l->parent), summaryview->hbox_l);
        gtkut_container_remove(GTK_CONTAINER(summaryview->statlabel_msgs->parent), summaryview->statlabel_msgs);
 
-       if (prefs_common.layout_mode != VERTICAL_LAYOUT) {
+       switch (prefs_common.layout_mode) {
+       case NORMAL_LAYOUT:
+       case WIDE_LAYOUT:
+       case WIDE_MSGLIST_LAYOUT:
                gtk_box_pack_start(GTK_BOX(summaryview->stat_box), summaryview->hbox_l, TRUE, TRUE, 0);
                gtk_box_pack_end(GTK_BOX(summaryview->stat_box), summaryview->statlabel_msgs, FALSE, FALSE, 4);
                gtk_widget_show_all(summaryview->stat_box);
                gtk_widget_show_all(summaryview->stat_box2);
-       } else {
+               if (prefs_common.layout_mode == WIDE_MSGLIST_LAYOUT)
+                       gtk_widget_hide(summaryview->toggle_eventbox);
+               else
+                       gtk_widget_show(summaryview->toggle_eventbox);
+               break;
+       case VERTICAL_LAYOUT:
                gtk_box_pack_start(GTK_BOX(summaryview->stat_box), summaryview->hbox_l, TRUE, TRUE, 0);
                gtk_box_pack_start(GTK_BOX(summaryview->stat_box2), summaryview->statlabel_msgs, FALSE, FALSE, 4);
                gtk_widget_show_all(summaryview->stat_box);
                gtk_widget_show_all(summaryview->stat_box2);
+               gtk_widget_show(summaryview->toggle_eventbox);
+               break;
        }
        gtk_widget_unref(summaryview->hbox_l);
        gtk_widget_unref(summaryview->statlabel_msgs);