2005-10-16 [wwp] 1.9.15cvs52
authorTristan Chabredier <wwp@claws-mail.org>
Sun, 16 Oct 2005 12:23:20 +0000 (12:23 +0000)
committerTristan Chabredier <wwp@claws-mail.org>
Sun, 16 Oct 2005 12:23:20 +0000 (12:23 +0000)
* src/addressbook.c
* src/editaddress.c
* src/prefs_common.c
* src/prefs_common.h
Remember window sizes (address book)

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/addressbook.c
src/editaddress.c
src/prefs_common.c
src/prefs_common.h

index a96b1d8..dc48a76 100644 (file)
@@ -1,3 +1,11 @@
+2005-10-16 [wwp]       1.9.15cvs52
+
+       * src/addressbook.c
+       * src/editaddress.c
+       * src/prefs_common.c
+       * src/prefs_common.h
+               Remember window sizes (address book)
+
 2005-10-16 [wwp]       1.9.15cvs51
 
        * src/plugins/clamav/clamav_plugin_gtk.c
index 120caf0..db072ec 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.60.2.33 -r 1.60.2.34 src/addressbook.c;  cvs diff -u -r 1.274.2.74 -r 1.274.2.75 src/mainwindow.c;  cvs diff -u -r 1.395.2.137 -r 1.395.2.138 src/summaryview.c;  ) > 1.9.15cvs49.patchset
 ( cvs diff -u -r 1.83.2.44 -r 1.83.2.45 src/mimeview.c;  cvs diff -u -r 1.395.2.138 -r 1.395.2.139 src/summaryview.c;  cvs diff -u -r 1.96.2.78 -r 1.96.2.79 src/textview.c;  ) > 1.9.15cvs50.patchset
 ( cvs diff -u -r 1.9.2.10 -r 1.9.2.11 src/plugins/clamav/clamav_plugin_gtk.c;  cvs diff -u -r 1.23.2.13 -r 1.23.2.14 src/plugins/spamassassin/spamassassin_gtk.c;  ) > 1.9.15cvs51.patchset
+( cvs diff -u -r 1.60.2.34 -r 1.60.2.35 src/addressbook.c;  cvs diff -u -r 1.14.2.11 -r 1.14.2.12 src/editaddress.c;  cvs diff -u -r 1.204.2.62 -r 1.204.2.63 src/prefs_common.c;  cvs diff -u -r 1.103.2.32 -r 1.103.2.33 src/prefs_common.h;  ) > 1.9.15cvs52.patchset
index d46cbe5..77d69cb 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=15
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=51
+EXTRA_VERSION=52
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index ad12f8c..53ddd30 100644 (file)
@@ -662,6 +662,18 @@ static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event, gpointer data
        return FALSE;
 }
 
+/*!
+ *\brief       Save Gtk object size to prefs dataset
+ */
+static void addressbook_size_allocate_cb(GtkWidget *widget,
+                                        GtkAllocation *allocation)
+{
+       g_return_if_fail(allocation != NULL);
+
+       prefs_common.addressbookwin_width = allocation->width;
+       prefs_common.addressbookwin_height = allocation->height;
+}
+
 /*
 * Create the address book widgets. The address book contains two CTree widgets: the
 * address index tree on the left and the address list on the right.
@@ -716,6 +728,8 @@ static void addressbook_create(void)
        gchar *text;
        gint i;
 
+       static GdkGeometry geometry;
+
        debug_print("Creating addressbook window...\n");
 
        index_titles[COL_SOURCES] = _("Sources");
@@ -726,12 +740,13 @@ static void addressbook_create(void)
        /* Address book window */
        window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
        gtk_window_set_title(GTK_WINDOW(window), _("Address book"));
-       gtk_widget_set_size_request(window, ADDRESSBOOK_WIDTH, ADDRESSBOOK_HEIGHT);
        gtk_window_set_resizable(GTK_WINDOW(window), TRUE);
        gtk_widget_realize(window);
 
        g_signal_connect(G_OBJECT(window), "delete_event",
                         G_CALLBACK(addressbook_close), NULL);
+       g_signal_connect(G_OBJECT(window), "size_allocate",
+                        G_CALLBACK(addressbook_size_allocate_cb), NULL);
        g_signal_connect(G_OBJECT(window), "key_press_event",
                         G_CALLBACK(key_pressed), NULL);
        MANAGE_WINDOW_SIGNALS_CONNECT(window);
@@ -1006,6 +1021,17 @@ static void addressbook_create(void)
 
        addrbook.listSelected = NULL;
        address_completion_start(window);
+
+       if (!geometry.min_height) {
+               geometry.min_width = ADDRESSBOOK_WIDTH;
+               geometry.min_height = ADDRESSBOOK_HEIGHT;
+       }
+
+       gtk_window_set_geometry_hints(GTK_WINDOW(window), NULL, &geometry,
+                                     GDK_HINT_MIN_SIZE);
+       gtk_widget_set_size_request(window, prefs_common.addressbookwin_width,
+                                   prefs_common.addressbookwin_height);
+
        gtk_widget_show_all(window);
 }
 
index 56d0cc2..fe26460 100644 (file)
@@ -531,6 +531,18 @@ static void edit_person_attrib_add( gpointer data ) {
        }
 }
 
+/*!
+ *\brief       Save Gtk object size to prefs dataset
+ */
+static void edit_person_size_allocate_cb(GtkWidget *widget,
+                                        GtkAllocation *allocation)
+{
+       g_return_if_fail(allocation != NULL);
+
+       prefs_common.addressbookeditpersonwin_width = allocation->width;
+       prefs_common.addressbookeditpersonwin_height = allocation->height;
+}
+
 static void addressbook_edit_person_dialog_create( gboolean *cancelled ) {
        GtkWidget *window;
        GtkWidget *vbox;
@@ -541,9 +553,9 @@ static void addressbook_edit_person_dialog_create( gboolean *cancelled ) {
        GtkWidget *cancel_btn;
        GtkWidget *hsbox;
        GtkWidget *statusbar;
+       static GdkGeometry geometry;
 
        window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-       gtk_widget_set_size_request(window, EDITPERSON_WIDTH, EDITPERSON_HEIGHT );
        /* gtk_container_set_border_width(GTK_CONTAINER(window), 0); */
        gtk_window_set_title(GTK_WINDOW(window), _("Edit Person Data"));
        gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
@@ -551,6 +563,9 @@ static void addressbook_edit_person_dialog_create( gboolean *cancelled ) {
        g_signal_connect(G_OBJECT(window), "delete_event",
                         G_CALLBACK(edit_person_delete_event),
                         cancelled);
+       g_signal_connect(G_OBJECT(window), "size_allocate",
+                        G_CALLBACK(edit_person_size_allocate_cb),
+                       cancelled);
        g_signal_connect(G_OBJECT(window), "key_press_event",
                         G_CALLBACK(edit_person_key_pressed),
                         cancelled);
@@ -593,6 +608,16 @@ static void addressbook_edit_person_dialog_create( gboolean *cancelled ) {
 
        gtk_widget_show_all(vbox);
 
+       if (!geometry.min_height) {
+               geometry.min_width = EDITPERSON_WIDTH;
+               geometry.min_height = EDITPERSON_HEIGHT;
+       }
+
+       gtk_window_set_geometry_hints(GTK_WINDOW(window), NULL, &geometry,
+                                     GDK_HINT_MIN_SIZE);
+       gtk_widget_set_size_request(window, prefs_common.addressbookeditpersonwin_width,
+                                   prefs_common.addressbookeditpersonwin_height);
+
        personeditdlg.window     = window;
        personeditdlg.notebook   = notebook;
        personeditdlg.ok_btn     = ok_btn;
index d7f7612..e12a092 100644 (file)
@@ -569,6 +569,16 @@ static PrefParam param[] = {
        {"actionswin_height", "-1", &prefs_common.actionswin_height, P_INT,
         NULL, NULL, NULL},
 
+       {"addressbookwin_width", "520", &prefs_common.addressbookwin_width, P_INT,
+        NULL, NULL, NULL},
+       {"addressbookwin_height", "-1", &prefs_common.addressbookwin_height, P_INT,
+        NULL, NULL, NULL},
+
+       {"addressbookeditpersonwin_width", "640", &prefs_common.addressbookeditpersonwin_width, P_INT,
+        NULL, NULL, NULL},
+       {"addressbookeditpersonwin_height", "-1", &prefs_common.addressbookeditpersonwin_height, P_INT,
+        NULL, NULL, NULL},
+
        /* Hidden */
        {"warn_dnd", "1", &prefs_common.warn_dnd, P_INT,
         NULL, NULL, NULL},
index 5f1a579..4d03f50 100644 (file)
@@ -332,6 +332,10 @@ struct _PrefsCommon
        gint templateswin_height;
        gint actionswin_width;
        gint actionswin_height;
+       gint addressbookwin_width;
+       gint addressbookwin_height;
+       gint addressbookeditpersonwin_width;
+       gint addressbookeditpersonwin_height;
        gint warn_dnd;
        gint broken_are_utf8;
 };