2008-05-14 [colin] 3.4.0cvs36
authorColin Leroy <colin@colino.net>
Wed, 14 May 2008 20:45:55 +0000 (20:45 +0000)
committerColin Leroy <colin@colino.net>
Wed, 14 May 2008 20:45:55 +0000 (20:45 +0000)
* src/main.c
* src/mainwindow.c
* src/mainwindow.h
Make it possible to cancel quit when Claws
ask whether to empty trash.

ChangeLog
PATCHSETS
configure.ac
src/main.c
src/mainwindow.c
src/mainwindow.h

index d5e93ad9c4d1e0b4737a935b447ce9caa88b1a6e..7468c54e8e81d8be9860187fd9042b58b84bc66c 100644 (file)
--- 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
index 4d32677be2cd9969d429ef8037e68dad47f6d93c..daf860c7b01637a76ce1781e0ecf935a13a7bcb5 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( 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
index 94d267c1ec99b5bbd9fab63fb7a96f5b60441e23..5f8108b3fbedb2afe6fa486f32fa54a6eaac5c7f 100644 (file)
@@ -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=
 
index 023d47fc915494ccd861cab1b4bdd59f968c2874..100e482fa5ff6b6f14b9342017999ab81f9a4927 100644 (file)
@@ -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;
index 849591c781ec4b4039395d59f58ef7b965d25bb1..5b10ad9b22ff3ca3976b47ec792c4e0cf7391d85 100644 (file)
@@ -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)
index a8f9453675cf29513095adc1e42bf4235d6d8b84..069ddf9711c8e121faff8aa4d7d0fdb43b41b816 100644 (file)
@@ -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);