diff options
author | Radek Doulik <rodo@ximian.com> | 2004-02-13 22:54:10 +0800 |
---|---|---|
committer | Radek Doulik <rodo@src.gnome.org> | 2004-02-13 22:54:10 +0800 |
commit | 65dafbf9c3cb661d981bec0f46da7a99cf1b644a (patch) | |
tree | b0f33b1bfea148c8bcaa1f08935f324aada3d23b /composer | |
parent | f533c78580c4f71236def6bb48c958ba1a82b61c (diff) | |
download | gsoc2013-evolution-65dafbf9c3cb661d981bec0f46da7a99cf1b644a.tar gsoc2013-evolution-65dafbf9c3cb661d981bec0f46da7a99cf1b644a.tar.gz gsoc2013-evolution-65dafbf9c3cb661d981bec0f46da7a99cf1b644a.tar.bz2 gsoc2013-evolution-65dafbf9c3cb661d981bec0f46da7a99cf1b644a.tar.lz gsoc2013-evolution-65dafbf9c3cb661d981bec0f46da7a99cf1b644a.tar.xz gsoc2013-evolution-65dafbf9c3cb661d981bec0f46da7a99cf1b644a.tar.zst gsoc2013-evolution-65dafbf9c3cb661d981bec0f46da7a99cf1b644a.zip |
get default composer size from gconf, hook to unrealize event and save
2004-02-13 Radek Doulik <rodo@ximian.com>
* e-msg-composer.c (create_composer): get default composer size
from gconf, hook to unrealize event and save size to gconf
(e_msg_composer_unmap): new handler, saves composer window size
svn path=/trunk/; revision=24735
Diffstat (limited to 'composer')
-rw-r--r-- | composer/ChangeLog | 6 | ||||
-rw-r--r-- | composer/e-msg-composer.c | 28 |
2 files changed, 27 insertions, 7 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog index 32c1ec2376..7962fc01a7 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,9 @@ +2004-02-13 Radek Doulik <rodo@ximian.com> + + * e-msg-composer.c (create_composer): get default composer size + from gconf, hook to unrealize event and save size to gconf + (e_msg_composer_unmap): new handler, saves composer window size + 2004-02-06 Rodney Dawes <dobey@ximian.com> * e-msg-composer-attachment-bar.c: add accel and icon for diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 80ab2873f7..864ae540ed 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -114,10 +114,6 @@ #define d(x) x - -#define DEFAULT_WIDTH 600 -#define DEFAULT_HEIGHT 500 - enum { SEND, SAVE_DRAFT, @@ -3025,6 +3021,22 @@ composer_settings_update (GConfClient *gconf, guint cnxn_id, GConfEntry *entry, NULL); } +static void +e_msg_composer_unmap (GtkWidget *widget, gpointer data) +{ + EMsgComposer *composer = E_MSG_COMPOSER (widget); + GConfClient *gconf; + int width, height; + + gtk_window_get_size (GTK_WINDOW (composer), &width, &height); + printf ("composer width: %d height: %d\n", width, height); + + gconf = gconf_client_get_default (); + gconf_client_set_int (gconf, "/apps/evolution/mail/composer/width", width, NULL); + gconf_client_set_int (gconf, "/apps/evolution/mail/composer/height", height, NULL); + g_object_unref (gconf); +} + static EMsgComposer * create_composer (int visible_mask) { @@ -3048,9 +3060,7 @@ create_composer (int visible_mask) g_signal_connect (composer, "destroy", G_CALLBACK (msg_composer_destroy_notify), NULL); - - gtk_window_set_default_size (GTK_WINDOW (composer), - DEFAULT_WIDTH, DEFAULT_HEIGHT); + gnome_window_icon_set_from_file (GTK_WINDOW (composer), EVOLUTION_IMAGESDIR "/compose-message.png"); @@ -3121,6 +3131,10 @@ create_composer (int visible_mask) gconf_client_add_dir (gconf, "/apps/evolution/mail/composer", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); composer->notify_id = gconf_client_notify_add (gconf, "/apps/evolution/mail/composer", composer_settings_update, composer, NULL, NULL); + gtk_window_set_default_size (GTK_WINDOW (composer), + gconf_client_get_int (gconf, "/apps/evolution/mail/composer/width", NULL), + gconf_client_get_int (gconf, "/apps/evolution/mail/composer/height", NULL)); + g_signal_connect (composer, "unrealize", G_CALLBACK (e_msg_composer_unmap), NULL); g_object_unref (gconf); editor_server = bonobo_widget_get_objref (BONOBO_WIDGET (composer->editor)); |