From dafc74eeaf244b39d1fd0f8498d50d2535ca8bd9 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 3 Jul 2001 01:45:41 +0000 Subject: Setup the Empty Trash On Exit widgets. 2001-07-02 Jeffrey Stedfast * mail-accounts.c (construct): Setup the Empty Trash On Exit widgets. * mail-config.c (config_read): Option to emtpy trash on exit. (mail_config_write_on_exit): Same. (mail_config_set_empty_trash_on_exit): Set the option. (mail_config_get_empty_trash_on_exit): Get the option. * component-factory.c (owner_unset_cb): Empty the trash folders if the user set the "empty trash on exit" option. svn path=/trunk/; revision=10711 --- mail/mail-accounts.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'mail/mail-accounts.c') diff --git a/mail/mail-accounts.c b/mail/mail-accounts.c index 47d53a8b62..0be25756f0 100644 --- a/mail/mail-accounts.c +++ b/mail/mail-accounts.c @@ -601,6 +601,12 @@ images_radio_toggled (GtkWidget *radio, gpointer data) mail_config_set_http_mode (MAIL_CONFIG_HTTP_NEVER); } +static void +empty_trash_toggled (GtkWidget *toggle, gpointer data) +{ + mail_config_set_empty_trash_on_exit (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle))); +} + static void forward_style_activated (GtkWidget *item, gpointer data) { @@ -751,6 +757,11 @@ construct (MailAccountsDialog *dialog) gtk_signal_connect (GTK_OBJECT (menu), "deactivate", GTK_SIGNAL_FUNC (charset_menu_deactivate), NULL); + dialog->empty_trash = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkEmptyTrashOnExit")); + gtk_toggle_button_set_active (dialog->empty_trash, mail_config_get_empty_trash_on_exit ()); + gtk_signal_connect (GTK_OBJECT (dialog->empty_trash), "toggled", + GTK_SIGNAL_FUNC (empty_trash_toggled), dialog); + /* now to fill in the clists */ dialog->accounts_row = -1; dialog->accounts = mail_config_get_accounts (); -- cgit