From: Colin Leroy Date: Wed, 14 May 2008 20:45:55 +0000 (+0000) Subject: 2008-05-14 [colin] 3.4.0cvs36 X-Git-Tag: rel_3_5_0~84 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=ab5e6dcc74b2c8d58bbbbad42abb4d47066827f7 2008-05-14 [colin] 3.4.0cvs36 * src/main.c * src/mainwindow.c * src/mainwindow.h Make it possible to cancel quit when Claws ask whether to empty trash. --- diff --git a/ChangeLog b/ChangeLog index d5e93ad9c..7468c54e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-05-14 [colin] 3.4.0cvs36 + + * src/main.c + * src/mainwindow.c + * src/mainwindow.h + Make it possible to cancel quit when Claws + ask whether to empty trash. + 2008-05-14 [colin] 3.4.0cvs35 * src/compose.c diff --git a/PATCHSETS b/PATCHSETS index 4d32677be..daf860c7b 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -3331,3 +3331,4 @@ ( cvs diff -u -r 1.1.2.18 -r 1.1.2.19 src/ldapupdate.c; ) > 3.4.0cvs33.patchset ( cvs diff -u -r 1.382.2.448 -r 1.382.2.449 src/compose.c; ) > 3.4.0cvs34.patchset ( cvs diff -u -r 1.382.2.449 -r 1.382.2.450 src/compose.c; cvs diff -u -r 1.204.2.169 -r 1.204.2.170 src/prefs_common.c; cvs diff -u -r 1.103.2.107 -r 1.103.2.108 src/prefs_common.h; cvs diff -u -r 1.1.2.20 -r 1.1.2.21 src/prefs_send.c; ) > 3.4.0cvs35.patchset +( cvs diff -u -r 1.115.2.194 -r 1.115.2.195 src/main.c; cvs diff -u -r 1.274.2.240 -r 1.274.2.241 src/mainwindow.c; cvs diff -u -r 1.39.2.44 -r 1.39.2.45 src/mainwindow.h; ) > 3.4.0cvs36.patchset diff --git a/configure.ac b/configure.ac index 94d267c1e..5f8108b3f 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=4 MICRO_VERSION=0 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=35 +EXTRA_VERSION=36 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/main.c b/src/main.c index 023d47fc9..100e482fa 100644 --- a/src/main.c +++ b/src/main.c @@ -1551,10 +1551,6 @@ static void exit_claws(MainWindow *mainwin) debug_print("shutting down\n"); inc_autocheck_timer_remove(); - if (prefs_common.clean_on_exit && !emergency_exit) { - main_window_empty_trash(mainwin, prefs_common.ask_on_clean); - } - #ifdef HAVE_NETWORKMANAGER_SUPPORT if (prefs_common.work_offline && went_offline_nm) prefs_common.work_offline = FALSE; diff --git a/src/mainwindow.c b/src/mainwindow.c index 849591c78..5b10ad9b2 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -2585,14 +2585,20 @@ void main_window_progress_off(MainWindow *mainwin) gtk_progress_bar_set_text(GTK_PROGRESS_BAR(mainwin->progressbar), ""); } -void main_window_empty_trash(MainWindow *mainwin, gboolean confirm) +static gboolean main_window_empty_trash(MainWindow *mainwin, gboolean confirm) { if (confirm && procmsg_have_trashed_mails_fast()) { - if (alertpanel(_("Empty trash"), + AlertValue val = alertpanel(_("Empty trash"), _("Delete all messages in trash folders?"), - GTK_STOCK_NO, "+" GTK_STOCK_YES, NULL) - != G_ALERTALTERNATE) - return; + GTK_STOCK_NO, "+" GTK_STOCK_YES, _("Don't quit")); + if (val == G_ALERTALTERNATE) { + debug_print("will empty trash\n"); + } else if (val == G_ALERTDEFAULT) { + debug_print("will not empty trash\n"); + return TRUE; + } else { + return FALSE; /* cancel exit */ + } manage_window_focus_in(mainwin->window, NULL, NULL); } @@ -2601,6 +2607,7 @@ void main_window_empty_trash(MainWindow *mainwin, gboolean confirm) if (mainwin->summaryview->folder_item && mainwin->summaryview->folder_item->stype == F_TRASH) gtk_widget_grab_focus(mainwin->folderview->ctree); + return TRUE; } static void main_window_add_mailbox(MainWindow *mainwin) @@ -3600,6 +3607,11 @@ static void page_setup_cb(MainWindow *mainwin, guint action, GtkWidget *widget) static void app_exit_cb(MainWindow *mainwin, guint action, GtkWidget *widget) { + if (prefs_common.clean_on_exit) { + if (!main_window_empty_trash(mainwin, prefs_common.ask_on_clean)) + return; + } + if (prefs_common.confirm_on_exit) { if (alertpanel(_("Exit"), _("Exit Claws Mail?"), GTK_STOCK_CANCEL, GTK_STOCK_QUIT, NULL) diff --git a/src/mainwindow.h b/src/mainwindow.h index a8f945367..069ddf971 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -171,8 +171,6 @@ void main_window_get_position (MainWindow *mainwin); void main_window_progress_on (MainWindow *mainwin); void main_window_progress_off (MainWindow *mainwin); -void main_window_empty_trash (MainWindow *mainwin, - gboolean confirm); void main_window_set_menu_sensitive (MainWindow *mainwin);