aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-04-01 01:00:24 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-04-01 01:00:24 +0800
commit2ab629886e8850257ffe7681fcfdf73648278b4b (patch)
tree54a1145024182b7373b42f69a9e4d183ac0447ad
parent786d09b39b0ab9c9e79b7f81a22c8784abf9559d (diff)
downloadgsoc2013-evolution-2ab629886e8850257ffe7681fcfdf73648278b4b.tar
gsoc2013-evolution-2ab629886e8850257ffe7681fcfdf73648278b4b.tar.gz
gsoc2013-evolution-2ab629886e8850257ffe7681fcfdf73648278b4b.tar.bz2
gsoc2013-evolution-2ab629886e8850257ffe7681fcfdf73648278b4b.tar.lz
gsoc2013-evolution-2ab629886e8850257ffe7681fcfdf73648278b4b.tar.xz
gsoc2013-evolution-2ab629886e8850257ffe7681fcfdf73648278b4b.tar.zst
gsoc2013-evolution-2ab629886e8850257ffe7681fcfdf73648278b4b.zip
Save/restore the subscribe dialog's window size. Fixes bug #56230.
2004-03-31 Jeffrey Stedfast <fejj@ximian.com> * em-subscribe-editor.c (em_subscribe_editor_new): Save/restore the subscribe dialog's window size. Fixes bug #56230. svn path=/trunk/; revision=25266
-rw-r--r--mail/ChangeLog5
-rw-r--r--mail/em-subscribe-editor.c52
-rw-r--r--mail/evolution-mail.schemas.in.in26
-rw-r--r--mail/subscribe-dialog.glade4
4 files changed, 82 insertions, 5 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 30031c0ccd..81a63cccc9 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,8 @@
+2004-03-31 Jeffrey Stedfast <fejj@ximian.com>
+
+ * em-subscribe-editor.c (em_subscribe_editor_new): Save/restore
+ the subscribe dialog's window size. Fixes bug #56230.
+
2004-03-31 Not Zed <NotZed@Ximian.com>
* mail.h: REMOVED! And there was much rejoicing.
diff --git a/mail/em-subscribe-editor.c b/mail/em-subscribe-editor.c
index fa7b1bec07..f975e02c59 100644
--- a/mail/em-subscribe-editor.c
+++ b/mail/em-subscribe-editor.c
@@ -795,6 +795,27 @@ static void sub_editor_busy(EMSubscribeEditor *se, int dir)
}
}
+
+#define DEFAULT_WIDTH 600
+#define DEFAULT_HEIGHT 400
+
+static GtkAllocation window_size = { 0, 0, 0, 0 };
+
+static void
+window_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
+{
+ GConfClient *gconf;
+
+ /* save to in-memory variable for current session access */
+ window_size = *allocation;
+
+ /* save the setting across sessions */
+ gconf = gconf_client_get_default ();
+ gconf_client_set_int (gconf, "/apps/evolution/mail/subscribe_window/width", window_size.width, NULL);
+ gconf_client_set_int (gconf, "/apps/evolution/mail/subscribe_window/height", window_size.height, NULL);
+ g_object_unref (gconf);
+}
+
GtkDialog *em_subscribe_editor_new(void)
{
EMSubscribeEditor *se;
@@ -813,7 +834,7 @@ GtkDialog *em_subscribe_editor_new(void)
}
se->dialog = (GtkDialog *)glade_xml_get_widget (xml, "subscribe_dialog");
g_signal_connect(se->dialog, "destroy", G_CALLBACK(sub_editor_destroy), se);
-
+
gtk_widget_realize ((GtkWidget *)se->dialog);
gtk_container_set_border_width ((GtkContainer *) ((GtkDialog *)se->dialog)->action_area, 12);
gtk_container_set_border_width ((GtkContainer *) ((GtkDialog *)se->dialog)->vbox, 0);
@@ -872,8 +893,31 @@ GtkDialog *em_subscribe_editor_new(void)
gtk_option_menu_set_menu((GtkOptionMenu *)se->optionmenu, menu);
g_signal_connect(se->optionmenu, "changed", G_CALLBACK(sub_editor_menu_changed), se);
-
- gtk_window_set_default_size((GtkWindow *)se->dialog, 350, 400);
-
+
+ if (window_size.width == 0) {
+ /* initialize @window_size with the previous session's size */
+ GConfClient *gconf;
+ GError *err = NULL;
+
+ gconf = gconf_client_get_default ();
+
+ window_size.width = gconf_client_get_int (gconf, "/apps/evolution/mail/subscribe_window/width", &err);
+ if (err != NULL) {
+ window_size.width = DEFAULT_WIDTH;
+ g_clear_error (&err);
+ }
+
+ window_size.height = gconf_client_get_int (gconf, "/apps/evolution/mail/subscribe_window/height", &err);
+ if (err != NULL) {
+ window_size.height = DEFAULT_HEIGHT;
+ g_clear_error (&err);
+ }
+
+ g_object_unref (gconf);
+ }
+
+ gtk_window_set_default_size ((GtkWindow *) se->dialog, window_size.width, window_size.height);
+ g_signal_connect (se->dialog, "size-allocate", G_CALLBACK (window_size_allocate), NULL);
+
return se->dialog;
}
diff --git a/mail/evolution-mail.schemas.in.in b/mail/evolution-mail.schemas.in.in
index e3040bd930..69fb8424a8 100644
--- a/mail/evolution-mail.schemas.in.in
+++ b/mail/evolution-mail.schemas.in.in
@@ -472,6 +472,32 @@
</locale>
</schema>
+ <!-- Subscribe dialog -->
+
+ <schema>
+ <key>/schemas/apps/evolution/mail/subscribe_window/width</key>
+ <applyto>/apps/evolution/mail/subscribe_window/width</applyto>
+ <owner>evolution-mail</owner>
+ <type>int</type>
+ <default>600</default>
+ <locale name="C">
+ <short>Subscribe dialog default width</short>
+ <long>Default width of the Subscribe dialog</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/apps/evolution/mail/subscribe_window/height</key>
+ <applyto>/apps/evolution/mail/subscribe_window/height</applyto>
+ <owner>evolution-mail</owner>
+ <type>int</type>
+ <default>400</default>
+ <locale name="C">
+ <short>Subscribe dialog default hight</short>
+ <long>Default height of the Subscribe dialog</long>
+ </locale>
+ </schema>
+
<!-- Filter logging -->
<schema>
diff --git a/mail/subscribe-dialog.glade b/mail/subscribe-dialog.glade
index 95ee676ae0..6f8238efa4 100644
--- a/mail/subscribe-dialog.glade
+++ b/mail/subscribe-dialog.glade
@@ -2,13 +2,15 @@
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
<glade-interface>
+<requires lib="gnome"/>
<widget class="GtkDialog" id="subscribe_dialog">
- <property name="visible">True</property>
<property name="title" translatable="yes">Folder Subscriptions</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
+ <property name="default_width">600</property>
+ <property name="default_height">400</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="has_separator">False</property>