diff options
author | Not Zed <NotZed@Ximian.com> | 2004-03-18 12:58:29 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-03-18 12:58:29 +0800 |
commit | 4b308cddb0efde0acf808f3a52a4e7653e9e0070 (patch) | |
tree | 07b26e695cf25781e620946712c210e5348e5c6c /mail/em-mailer-prefs.c | |
parent | bc6046b8f1bb7c50cae563c08cb9d55c956ff38b (diff) | |
download | gsoc2013-evolution-4b308cddb0efde0acf808f3a52a4e7653e9e0070.tar.gz gsoc2013-evolution-4b308cddb0efde0acf808f3a52a4e7653e9e0070.tar.zst gsoc2013-evolution-4b308cddb0efde0acf808f3a52a4e7653e9e0070.zip |
started writing this, but i couldn't be fucked right now - apparently
2004-03-18 Not Zed <NotZed@Ximian.com>
* mail-config.c (mail_config_writable): started writing this, but
i couldn't be fucked right now - apparently gnome is supposed to
use the gconf thing which just doens't work. i'll waste a few
hours trying to get it to work again first before i keep going
with this.
2004-03-17 Not Zed <NotZed@Ximian.com>
* em-format-html.c (efh_message_deliverystatus): format as plain
text too.
* em-format.c (emf_message_deliverystatus): format delivery
status messages as plain text, rather than as messages. since
they wont be CamelMimeMessages. Maybe they should be silently
hidden.
* mail-offline-handler.c (store_go_online): split this, only call
add_store/note_store once we've actually set the store online.
(store_went_online): set the store up once we're fully online.
Works around a deadlock in #55618.
* em-account-prefs.c (account_cursor_change): disable
editing/adding/removing accounts etc if accounts aren't editable.
(em_account_prefs_construct): call above after setup.
* mail-component.c (mc_quit_sync): if we have empty on exit days,
check that. keep track of the last empty on exit time.
* em-mailer-prefs.c (emmp_empty_trash_init): init the trash stuff
here.
(em_mailer_prefs_apply): save empty trash on exit frequency.
svn path=/trunk/; revision=25110
Diffstat (limited to 'mail/em-mailer-prefs.c')
-rw-r--r-- | mail/em-mailer-prefs.c | 53 |
1 files changed, 49 insertions, 4 deletions
diff --git a/mail/em-mailer-prefs.c b/mail/em-mailer-prefs.c index ff8c789be0..8fbb5c9685 100644 --- a/mail/em-mailer-prefs.c +++ b/mail/em-mailer-prefs.c @@ -76,6 +76,17 @@ static const struct { #define EM_FORMAT_HEADER_XMAILER "x-evolution-mailer" +/* for empty trash on exit frequency */ +static const struct { + const char *label; + int days; +} empty_trash_frequency[] = { + { N_("Every time"), 0 }, + { N_("Once per day"), 1 }, + { N_("Once per week"), 7 }, + { N_("Once per month"), 30 }, +}; + GtkType em_mailer_prefs_get_type (void) { @@ -234,7 +245,6 @@ option_menu_connect (GtkOptionMenu *omenu, gpointer user_data) } } - static void emmp_header_remove_sensitivity (EMMailerPrefs *prefs) { @@ -445,6 +455,36 @@ toggle_button_init (GtkToggleButton *toggle, GConfClient *gconf, const char *key } static void +emmp_empty_trash_init(EMMailerPrefs *prefs) +{ + int days, hist = 0, i; + GtkWidget *menu, *item; + + toggle_button_init (prefs->empty_trash, prefs->gconf, + "/apps/evolution/mail/trash/empty_on_exit", + FALSE, G_CALLBACK (settings_changed), prefs); + + days = gconf_client_get_int(prefs->gconf, "/apps/evolution/mail/trash/empty_on_exit_days", NULL); + menu = gtk_menu_new(); + for (i=0;i<sizeof(empty_trash_frequency)/sizeof(empty_trash_frequency[0]);i++) { + if (days >= empty_trash_frequency[i].days) + hist = i; + + item = gtk_menu_item_new_with_label(_(empty_trash_frequency[i].label)); + gtk_widget_show(item); + gtk_menu_shell_append((GtkMenuShell *)menu, item); + } + + gtk_widget_show(menu); + gtk_option_menu_set_menu((GtkOptionMenu *)prefs->empty_trash_days, menu); + gtk_option_menu_set_history((GtkOptionMenu *)prefs->empty_trash_days, hist); + g_signal_connect(prefs->empty_trash_days, "changed", G_CALLBACK(settings_changed), prefs); + + gtk_widget_set_sensitive((GtkWidget *)prefs->empty_trash_days, + gconf_client_key_is_writable(prefs->gconf, "/apps/evolution/mail/trash/empty_on_exit_days", NULL)); +} + +static void em_mailer_prefs_construct (EMMailerPrefs *prefs) { GSList *list, *header_config_list, *header_add_list, *p; @@ -507,9 +547,8 @@ em_mailer_prefs_construct (EMMailerPrefs *prefs) /* Deleting Mail */ prefs->empty_trash = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkEmptyTrashOnExit")); - toggle_button_init (prefs->empty_trash, prefs->gconf, - "/apps/evolution/mail/trash/empty_on_exit", - FALSE, G_CALLBACK (settings_changed), prefs); + prefs->empty_trash_days = GTK_OPTION_MENU(glade_xml_get_widget (gui, "omenuEmptyTrashDays")); + emmp_empty_trash_init(prefs); prefs->confirm_expunge = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkConfirmExpunge")); toggle_button_init (prefs->confirm_expunge, prefs->gconf, @@ -813,6 +852,12 @@ em_mailer_prefs_apply (EMMailerPrefs *prefs) /* Deleting Mail */ gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/trash/empty_on_exit", gtk_toggle_button_get_active (prefs->empty_trash), NULL); + val = gtk_option_menu_get_history(prefs->empty_trash_days); + if (val > sizeof(empty_trash_frequency)/sizeof(empty_trash_frequency[0])) + val = sizeof(empty_trash_frequency)/sizeof(empty_trash_frequency[0]); + if (val < 0) + val = 0; + gconf_client_set_int(prefs->gconf, "/apps/evolution/mail/trash/empty_on_exit_days", empty_trash_frequency[val].days, NULL); gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/prompts/expunge", gtk_toggle_button_get_active (prefs->confirm_expunge), NULL); |