2011-11-18 [pawel] 3.7.10cvs88
authorPaweł Pękala <c0rn@gazeta.pl>
Fri, 18 Nov 2011 21:41:56 +0000 (21:41 +0000)
committerPaweł Pękala <c0rn@gazeta.pl>
Fri, 18 Nov 2011 21:41:56 +0000 (21:41 +0000)
* src/compose.c
* src/mainwindow.c
* src/mimeview.c
* src/mimeview.h
* src/prefs_common.c
* src/prefs_common.h
Fix bug #2408 'Some UI elements are not persistent
between sessions'
Remember size of main window, compose notebook, mimeview
tree widgets between claws-mail runs. Compose window
size saving was already done in cvs74

ChangeLog
PATCHSETS
configure.ac
src/compose.c
src/mainwindow.c
src/mimeview.c
src/mimeview.h
src/prefs_common.c
src/prefs_common.h

index 98e0f84..c510842 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2011-11-18 [pawel]     3.7.10cvs88
+
+       * src/compose.c
+       * src/mainwindow.c
+       * src/mimeview.c
+       * src/mimeview.h
+       * src/prefs_common.c
+       * src/prefs_common.h
+               Fix bug #2408 'Some UI elements are not persistent
+               between sessions'
+               Remember size of main window, compose notebook, mimeview
+               tree widgets between claws-mail runs. Compose window
+               size saving was already done in cvs74
+
 2011-11-18 [mones]     3.7.10cvs87
 
        * src/compose.c
index 3bb699c..c221c50 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.593 -r 1.382.2.594 src/compose.c;  ) > 3.7.10cvs85.patchset
 ( cvs diff -u -r 1.83.2.180 -r 1.83.2.181 src/mimeview.c;  ) > 3.7.10cvs86.patchset
 ( cvs diff -u -r 1.382.2.594 -r 1.382.2.595 src/compose.c;  cvs diff -u -r 1.47.2.54 -r 1.47.2.55 src/procheader.c;  cvs diff -u -r 1.11.2.12 -r 1.11.2.13 src/procheader.h;  ) > 3.7.10cvs87.patchset
+( cvs diff -u -r 1.382.2.595 -r 1.382.2.596 src/compose.c;  cvs diff -u -r 1.274.2.336 -r 1.274.2.337 src/mainwindow.c;  cvs diff -u -r 1.83.2.181 -r 1.83.2.182 src/mimeview.c;  cvs diff -u -r 1.20.2.35 -r 1.20.2.36 src/mimeview.h;  cvs diff -u -r 1.204.2.205 -r 1.204.2.206 src/prefs_common.c;  cvs diff -u -r 1.103.2.134 -r 1.103.2.135 src/prefs_common.h;  ) > 3.7.10cvs88.patchset
index 9d5485f..01ff9f1 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=10
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=87
+EXTRA_VERSION=88
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 8d31b16..513929f 100644 (file)
@@ -355,6 +355,9 @@ static void compose_add_field_list  ( Compose *compose,
 
 /* callback functions */
 
+static void compose_notebook_size_alloc (GtkNotebook *notebook,
+                                        GtkAllocation *allocation,
+                                        Compose *compose);
 static gboolean compose_edit_size_alloc (GtkEditable   *widget,
                                         GtkAllocation  *allocation,
                                         GtkSHRuler     *shruler);
@@ -7483,7 +7486,7 @@ static Compose *compose_create(PrefsAccount *account,
        
        /* Notebook */
        notebook = gtk_notebook_new();
-       gtk_widget_set_size_request(notebook, -1, 130);
+       gtk_widget_set_size_request(notebook, -1, prefs_common.compose_notebook_height);
        gtk_widget_show(notebook);
 
        /* header labels and entries */
@@ -7573,6 +7576,8 @@ static Compose *compose_create(PrefsAccount *account,
        gtk_text_buffer_add_selection_clipboard(buffer, clipboard);
        
        gtk_container_add(GTK_CONTAINER(scrolledwin), text);
+       g_signal_connect(G_OBJECT(notebook), "size_allocate",
+                        G_CALLBACK(compose_notebook_size_alloc), compose);     
        g_signal_connect_after(G_OBJECT(text), "size_allocate",
                               G_CALLBACK(compose_edit_size_alloc),
                               ruler);
@@ -9232,6 +9237,13 @@ static void compose_undo_state_changed(UndoMain *undostruct, gint undo_state,
 
 /* callback functions */
 
+static void compose_notebook_size_alloc(GtkNotebook *notebook,
+                                       GtkAllocation *allocation,
+                                       Compose *compose)
+{
+       prefs_common.compose_notebook_height = allocation->height;
+}
+
 /* compose_edit_size_alloc() - called when resized. don't know whether Gtk
  * includes "non-client" (windows-izm) in calculation, so this calculation
  * may not be accurate.
index 9317cb5..0deab19 100644 (file)
@@ -3659,26 +3659,6 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
        gboolean first_set = (mainwin->hpaned == NULL);
        debug_print("Setting widgets... ");
 
-       if (layout_mode == SMALL_LAYOUT && first_set) {
-               gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->folderview),
-                                   prefs_common.folderview_width,
-                                   prefs_common.folderview_height);
-               gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->summaryview),
-                                   0,0);
-               gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->messageview),
-                                   0,0);
-       } else {
-               gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->folderview),
-                                   prefs_common.folderview_width,
-                                   prefs_common.folderview_height);
-               gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->summaryview),
-                                   prefs_common.summaryview_width,
-                                   prefs_common.summaryview_height);
-               gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->messageview),
-                                   prefs_common.msgview_width,
-                                   prefs_common.msgview_height);
-       }
-
 #ifndef GENERIC_UMPC
        mainwin->messageview->statusbar = mainwin->statusbar;
        mainwin->messageview->statusbar_cid = mainwin->messageview_cid;
@@ -3801,6 +3781,19 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
                                prefs_common.mainwin_width,
                                prefs_common.mainwin_height);
                gtk_paned_set_position(GTK_PANED(mainwin->hpaned), 800);
+       } else {
+               gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->folderview),
+                                   prefs_common.folderview_width,
+                                   prefs_common.folderview_height);
+               gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->summaryview),
+                                   prefs_common.summaryview_width,
+                                   prefs_common.summaryview_height);
+               gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->messageview),
+                                   prefs_common.msgview_width,
+                                   prefs_common.msgview_height);
+               gtk_widget_set_size_request(GTK_WIDGET(mainwin->window),
+                                   prefs_common.mainwin_width,
+                                   prefs_common.mainwin_height);
        } 
        /* remove headerview if not in prefs */
        headerview_set_visibility(mainwin->messageview->headerview,
index 9a19f3e..bc0705f 100644 (file)
@@ -143,6 +143,9 @@ static void icon_list_create                (MimeView       *mimeview,
 static void icon_list_clear            (MimeView       *mimeview);
 static void icon_list_toggle_by_mime_info (MimeView    *mimeview,
                                           MimeInfo     *mimeinfo);
+static void ctree_size_allocate_cb     (GtkWidget      *widget,
+                                        GtkAllocation  *allocation,
+                                        MimeView       *mimeview);
 static gint mime_toggle_button_cb(GtkWidget *button, GdkEventButton *event,
                                    MimeView *mimeview);
 static gboolean part_button_pressed    (MimeView       *mimeview, 
@@ -383,6 +386,8 @@ MimeView *mimeview_create(MainWindow *mainwin)
        
        ctree_mainbox = gtk_hbox_new(FALSE, 0); 
        gtk_box_pack_start(GTK_BOX(ctree_mainbox), scrolledwin, TRUE, TRUE, 0);
+       g_signal_connect(G_OBJECT(ctree_mainbox), "size_allocate", 
+                        G_CALLBACK(ctree_size_allocate_cb), mimeview);
 
        mimeview->ui_manager = gtk_ui_manager_new();
        mimeview->action_group = cm_menu_create_action_group_full(mimeview->ui_manager,
@@ -458,7 +463,6 @@ MimeView *mimeview_create(MainWindow *mainwin)
 #if !(GTK_CHECK_VERSION(2,12,0))
        mimeview->tooltips      = tips;
 #endif
-       mimeview->oldsize       = 60;
        mimeview->mime_toggle   = mime_toggle;
        mimeview->siginfoview   = siginfoview;
        mimeview->scrollbutton  = scrollbutton;
@@ -2684,10 +2688,15 @@ static void icon_list_toggle_by_mime_info (MimeView     *mimeview,
        }
 }
 
+static void ctree_size_allocate_cb(GtkWidget *widget, GtkAllocation *allocation,
+                                   MimeView *mimeview)
+{
+       prefs_common.mimeview_tree_height = allocation->height;
+}
+
 static gint mime_toggle_button_cb(GtkWidget *button, GdkEventButton *event,
                                    MimeView *mimeview)
 {
-       GtkAllocation allocation;
        g_object_ref(button); 
 
        mimeview_leave_notify(button, NULL, NULL);
@@ -2698,7 +2707,8 @@ static gint mime_toggle_button_cb(GtkWidget *button, GdkEventButton *event,
                                        GTK_SHADOW_NONE);
                gtk_widget_hide(mimeview->icon_mainbox);
                gtk_widget_show(mimeview->ctree_mainbox);
-               gtk_paned_set_position(GTK_PANED(mimeview->paned), mimeview->oldsize);
+               gtk_paned_set_position(GTK_PANED(mimeview->paned),
+                                       prefs_common.mimeview_tree_height);
 
                gtkut_container_remove(GTK_CONTAINER(mimeview->icon_mainbox), 
                                        button);
@@ -2707,8 +2717,6 @@ static gint mime_toggle_button_cb(GtkWidget *button, GdkEventButton *event,
        } else {
                gtk_arrow_set(GTK_ARROW(gtk_bin_get_child(GTK_BIN((button)))), GTK_ARROW_LEFT, 
                              GTK_SHADOW_NONE);
-               gtk_widget_get_allocation(mimeview->ctree_mainbox, &allocation);
-               mimeview->oldsize = allocation.height;
                gtk_widget_hide(mimeview->ctree_mainbox);
                gtk_widget_show(mimeview->icon_mainbox);
                gtk_paned_set_position(GTK_PANED(mimeview->paned), 0);
index 1527da0..840fc46 100644 (file)
@@ -96,7 +96,6 @@ struct _MimeView
 #if !GTK_CHECK_VERSION(2,12,0)
        GtkTooltips *tooltips;
 #endif
-       gint oldsize;
 
        NoticeView *siginfoview;
        MimeInfo *siginfo;
index b7e4350..4b5d46b 100644 (file)
@@ -652,6 +652,8 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"messagewin_height", "540", &prefs_common.msgwin_height, P_INT,
         NULL, NULL, NULL},
+       {"mimeview_tree_height", "60", &prefs_common.mimeview_tree_height, P_INT,
+        NULL, NULL, NULL},      
        {"sourcewin_width", "600", &prefs_common.sourcewin_width, P_INT,
         NULL, NULL, NULL},
        {"sourcewin_height", "500", &prefs_common.sourcewin_height, P_INT,
@@ -678,6 +680,8 @@ static PrefParam param[] = {
        {"compose_height", "470", &prefs_common.compose_height, P_INT,
         NULL, NULL, NULL},
 #endif
+       {"compose_notebook_height", "130", &prefs_common.compose_notebook_height, P_INT,
+        NULL, NULL, NULL},
        {"compose_x", "0", &prefs_common.compose_x, P_INT,
         NULL, NULL, NULL},
        {"compose_y", "0", &prefs_common.compose_y, P_INT,
index e9716e5..b2a9daf 100644 (file)
@@ -292,11 +292,14 @@ struct _PrefsCommon
        gint msgwin_width;
        gint msgwin_height;
 
+       gint mimeview_tree_height;
+       
        gint sourcewin_width;
        gint sourcewin_height;
 
        gint compose_width;
        gint compose_height;
+       gint compose_notebook_height;
        gint compose_x;
        gint compose_y;