more alertpanel fixes
authorColin Leroy <colin@colino.net>
Wed, 28 Jul 2004 08:07:08 +0000 (08:07 +0000)
committerColin Leroy <colin@colino.net>
Wed, 28 Jul 2004 08:07:08 +0000 (08:07 +0000)
14 files changed:
ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/account.c
src/addressbook.c
src/alertpanel.c
src/alertpanel.h
src/compose.c
src/expldifdlg.c
src/gtk/sslcertwindow.c
src/main.c
src/messageview.c
src/summaryview.c
src/textview.c

index 5b189c3b44446ef6f00d397cecef1899bec55d4d..64977591da73c43b98b0b98e41290df844bb18f4 100644 (file)
@@ -1,3 +1,21 @@
+2004-07-28 [colin]     0.9.12cvs37.3
+
+       * src/alertpanel.c
+       * src/alertpanel.h
+               Add a way to specify panel type for specific
+               panels (alertpanel())
+       * src/account.c
+       * src/addressbook.c
+       * src/compose.c
+       * src/expldifdlg.c
+       * src/main.c
+       * src/messageview.c
+       * src/summaryview.c
+       * src/textview.c
+       * src/gtk/sslcertwindow.c
+               Fix alertpanel()s so that their icon match
+               their real type
+
 2004-07-28 [paul]      0.9.12cvs37.2
 
        * src/addr_compl.c
index d6773dcdfabc562829cb9cc9470b5d6fc18dc817..fc8e2302845dbee56f34c42662a713143012a725 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
@@ -85,3 +85,4 @@
 ( cvs diff -u -r 1.16.2.6 -r 1.16.2.7 src/msgcache.c; ) > 0.9.12cvs35.3.patchset
 ( cvs diff -u -r 1.16.2.7 -r 1.16.2.8 src/msgcache.c; ) > 0.9.12cvs37.1.patchset
 ( cvs diff -u -r 1.27.2.6 -r 1.27.2.7 src/addr_compl.c; cvs diff -u -r 1.60.2.5 -r 1.60.2.6 src/addressbook.c; cvs diff -u -r 1.17.2.5 -r 1.17.2.6 src/alertpanel.c; cvs diff -u -r 1.382.2.35 -r 1.382.2.36 src/compose.c; cvs diff -u -r 1.8.2.2 -r 1.8.2.3 src/export.c; cvs diff -u -r 1.26.2.2 -r 1.26.2.3 src/foldersel.c; cvs diff -u -r 1.207.2.10 -r 1.207.2.11 src/folderview.c; cvs diff -u -r 1.14.2.4 -r 1.14.2.5 src/grouplistdialog.c; cvs diff -u -r 1.13.2.3 -r 1.13.2.4 src/import.c; cvs diff -u -r 1.274.2.13 -r 1.274.2.14 src/mainwindow.c; cvs diff -u -r 1.3.12.3 -r 1.3.12.4 src/message_search.c; cvs diff -u -r 1.94.2.23 -r 1.94.2.24 src/messageview.c; cvs diff -u -r 1.12.2.3 -r 1.12.2.4 src/passphrase.c; cvs diff -u -r 1.60.2.4 -r 1.60.2.5 src/prefs_actions.c; cvs diff -u -r 1.204.2.17 -r 1.204.2.18 src/prefs_common.c; cvs diff -u -r 1.16.2.2 -r 1.16.2.3 src/prefs_customheader.c; cvs diff -u -r 1.16.2.3 -r 1.16.2.4 src/prefs_display_header.c; cvs diff -u -r 1.59.2.6 -r 1.59.2.7 src/prefs_filtering.c; cvs diff -u -r 1.1.4.5 -r 1.1.4.6 src/prefs_filtering_action.c; cvs diff -u -r 1.10.2.4 -r 1.10.2.5 src/prefs_gtk.c; cvs diff -u -r 1.43.2.6 -r 1.43.2.7 src/prefs_matcher.c; cvs diff -u -r 1.1.2.2 -r 1.1.2.3 src/prefs_msg_colors.c; cvs diff -u -r 1.10.2.1 -r 1.10.2.2 src/prefs_summary_column.c; cvs diff -u -r 1.12.2.2 -r 1.12.2.3 src/prefs_template.c; cvs diff -u -r 1.9.2.4 -r 1.9.2.5 src/sourcewindow.c; cvs diff -u -r 1.3.2.2 -r 1.3.2.3 src/ssl_manager.c; cvs diff -u -r 1.15.2.5 -r 1.15.2.6 src/summary_search.c; cvs diff -u -r 1.1.4.3 -r 1.1.4.4 src/gtk/colorsel.c; cvs diff -u -r 1.5.2.4 -r 1.5.2.5 src/gtk/description_window.c; cvs diff -u -r 1.9.2.7 -r 1.9.2.8 src/gtk/gtkaspell.c; cvs diff -u -r 1.2.2.1 -r 1.2.2.2 src/gtk/inputdialog.c; cvs diff -u -r 1.1.4.2 -r 1.1.4.3 src/gtk/logwindow.c; cvs diff -u -r 1.12.2.2 -r 1.12.2.3 src/gtk/prefswindow.c; cvs diff -u -r 1.1.4.2 -r 1.1.4.3 src/gtk/progressdialog.c; ) > 0.9.12cvs37.2.patchset
+( cvs diff -u -r 1.61.2.7 -r 1.61.2.8 src/account.c; cvs diff -u -r 1.60.2.6 -r 1.60.2.7 src/addressbook.c; cvs diff -u -r 1.17.2.6 -r 1.17.2.7 src/alertpanel.c; cvs diff -u -r 1.5.2.1 -r 1.5.2.2 src/alertpanel.h; cvs diff -u -r 1.382.2.36 -r 1.382.2.37 src/compose.c; cvs diff -u -r 1.1.4.3 -r 1.1.4.4 src/expldifdlg.c; cvs diff -u -r 1.115.2.10 -r 1.115.2.11 src/main.c; cvs diff -u -r 1.94.2.24 -r 1.94.2.25 src/messageview.c; cvs diff -u -r 1.395.2.25 -r 1.395.2.26 src/summaryview.c; cvs diff -u -r 1.96.2.14 -r 1.96.2.15 src/textview.c; cvs diff -u -r 1.9.2.1 -r 1.9.2.2 src/gtk/sslcertwindow.c; ) > 0.9.12cvs37.3.patchset
index 5c167a312a85b5d4c6c036546d03f6eb9084c81a..0a0e217a6e4f7424f864b75d79f49787254849a0 100644 (file)
@@ -13,7 +13,7 @@ INTERFACE_AGE=0
 BINARY_AGE=0
 EXTRA_VERSION=37
 EXTRA_RELEASE=
-EXTRA_GTK2_VERSION=.2
+EXTRA_GTK2_VERSION=.3
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION}
index 55184df9b94a111bbc1b1a35bfbb00cf2855f09a..98ae1f3b46d4a357ded243f59a86b48b31df0dd4 100644 (file)
@@ -306,8 +306,9 @@ void account_edit_open(void)
        inc_lock();
 
        if (compose_get_compose_list()) {
-               alertpanel_notice(_("Some composing windows are open.\n"
-                                   "Please close all the composing windows before editing the accounts."));
+               alertpanel_error(_("Some composing windows are open.\n"
+                                   "Please close all the composing "
+                                   "windows before editing the accounts."));
                inc_unlock();
                return;
        }
index f44b66e3c2a705ddeb8c9c52a1d84387527d71db..1f05f930df9510e26e6813a35eb810d5d84f05af 100644 (file)
@@ -3178,11 +3178,13 @@ static gboolean addressbook_convert( AddressIndex *addrIndex ) {
        }
        if( errFlag ) {
                debug_print( "Error\n%s\n", msg );
-               alertpanel( _( "Addressbook conversion error" ), msg, _( "Close" ), NULL, NULL );
+               alertpanel_with_type( _( "Addressbook conversion error" ), msg, _( "Close" ), 
+                                     NULL, NULL, NULL, ALERT_ERROR );
        }
        else if( msg ) {
                debug_print( "Warning\n%s\n", msg );
-               alertpanel( _( "Addressbook conversion" ), msg, _( "Close" ), NULL, NULL );
+               alertpanel_with_type( _( "Addressbook conversion" ), msg, _( "Close" ), 
+                                     NULL, NULL, NULL, ALERT_WARNING );
        }
 
        return retVal;
@@ -3218,9 +3220,10 @@ void addressbook_read_file( void ) {
                /* Error reading address book */
                debug_print( "Could not read address index.\n" );
                addrindex_print_index( addrIndex, stdout );
-               alertpanel( _( "Addressbook Error" ),
+               alertpanel_with_type( _( "Addressbook Error" ),
                            _( "Could not read address index" ),
-                           _( "Close" ), NULL, NULL );
+                           _( "Close" ), NULL, NULL, NULL,
+                           ALERT_ERROR);
        }
        debug_print( "done.\n" );
 }
index 6a3e7f38d2ece181d1f2296a3dc3fd07cbc7936b..6164acbf050140dc22d8a106795d617adfa8bd44 100644 (file)
@@ -73,17 +73,9 @@ AlertValue alertpanel(const gchar *title,
                      const gchar *button2_label,
                      const gchar *button3_label)
 {
-       if (alertpanel_is_open)
-               return -1;
-       else
-               alertpanel_is_open = TRUE;
-
-       alertpanel_create(title, message, button1_label, button2_label,
-                         button3_label, FALSE, NULL, ALERT_QUESTION);
-       alertpanel_show();
-
-       debug_print("return value = %d\n", value);
-       return value;
+       return alertpanel_with_type(title, message, button1_label,
+                                   button2_label, button3_label,
+                                   NULL, ALERT_QUESTION);
 }
 
 AlertValue alertpanel_with_widget(const gchar *title,
@@ -92,13 +84,27 @@ AlertValue alertpanel_with_widget(const gchar *title,
                                  const gchar *button2_label,
                                  const gchar *button3_label,
                                  GtkWidget *widget)
+{
+       return alertpanel_with_type(title, message, button1_label,
+                                   button2_label, button3_label,
+                                   widget, ALERT_QUESTION);
+}
+
+AlertValue alertpanel_with_type(const gchar *title,
+                               const gchar *message,
+                               const gchar *button1_label,
+                               const gchar *button2_label,
+                               const gchar *button3_label,
+                               GtkWidget   *widget,
+                               gint         alert_type)
 {
        if (alertpanel_is_open)
                return -1;
        else
                alertpanel_is_open = TRUE;
-       alertpanel_create(title, message, button1_label, button2_label, 
-                         button3_label, FALSE, widget, ALERT_QUESTION);
+       
+       alertpanel_create(title, message, button1_label, button2_label,
+                         button3_label, FALSE, widget, alert_type);
        alertpanel_show();
 
        debug_print("return value = %d\n", value);
index fc0b05755eac52554b6b48af05295d97d83201f5..25a26671bf6f438c39cb18153edd6d8361c4ce3c 100644 (file)
@@ -55,6 +55,14 @@ AlertValue alertpanel_with_widget    (const gchar *title,
                                         const gchar *button3_label,
                                         GtkWidget *widget);
 
+AlertValue alertpanel_with_type        (const gchar *title,
+                                const gchar *message,
+                                const gchar *button1_label,
+                                const gchar *button2_label,
+                                const gchar *button3_label,
+                                GtkWidget   *widget,
+                                gint         alert_type);
+
 AlertValue alertpanel_message_with_disable     (const gchar    *title,
                                                 const gchar    *message,
                                                 gint            alert_type);
index e1adb887f42fdd69bc54acb7e87e6583463b2dcb..fa88f0890a637e78fdf141a5e424fe0c47c07bc4 100644 (file)
@@ -3732,8 +3732,8 @@ static gint compose_write_to_file(Compose *compose, const gchar *file,
                        msg = g_strdup_printf(_("Can't convert the character encoding of the message from\n"
                                                "%s to %s.\n"
                                                "Send it anyway?"), src_codeset, out_codeset);
-                       aval = alertpanel
-                               (_("Error"), msg, _("Yes"), _("+No"), NULL);
+                       aval = alertpanel_with_type
+                               (_("Error"), msg, _("Yes"), _("+No"), NULL, NULL, ALERT_ERROR);
                        g_free(msg);
 
                        if (aval != G_ALERTDEFAULT) {
index c4162d0ce64649776400034fb65ae421fb5a708e..fd2d384dfa3a430f4b7154476ed2b9a298565810 100644 (file)
@@ -199,8 +199,8 @@ static gboolean exp_ldif_move_file( void ) {
                msg = g_strdup_printf( _(
                        "Could not create output directory for LDIF file:\n%s" ),
                        reason );
-               aval = alertpanel( _( "Failed to Create Directory" ),
-                       msg, _( "Close" ), NULL, NULL );
+               aval = alertpanel_with_type( _( "Failed to Create Directory" ),
+                       msg, _( "Close" ), NULL, NULL, NULL, ALERT_ERROR );
                g_free( msg );
                return FALSE;
        }
index 6d7094be3b7f45d47c2b47daf0be3b198a4786fd..0e2f737878fee07977c2ef1a5db2a3abba29a642 100644 (file)
@@ -227,7 +227,7 @@ void sslcertwindow_show_cert(SSLCertificate *cert)
        gchar *buf;
        
        buf = g_strdup_printf(_("SSL certificate for %s"), cert->host);
-       alertpanel_with_widget(buf, NULL, _("OK"), NULL, NULL, cert_widget);
+       alertpanel_with_type(buf, NULL, _("OK"), NULL, NULL, cert_widget, ALERT_NOTICE);
        g_free(buf);
 }
 
@@ -280,7 +280,7 @@ gboolean sslcertwindow_ask_new_cert(SSLCertificate *cert)
        g_signal_connect(G_OBJECT(button), "toggled",
                         G_CALLBACK(toggle_cert_cb), cert_widget);
 
-       val = alertpanel_with_widget(_("Unknown SSL Certificate"), NULL, _("Accept and save"), _("Cancel connection"), NULL, vbox);
+       val = alertpanel_with_type(_("Unknown SSL Certificate"), NULL, _("Accept and save"), _("Cancel connection"), NULL, vbox, ALERT_QUESTION);
        
        return (val == G_ALERTDEFAULT);
 }
@@ -332,7 +332,7 @@ gboolean sslcertwindow_ask_changed_cert(SSLCertificate *old_cert, SSLCertificate
        g_signal_connect(G_OBJECT(button), "toggled",
                         G_CALLBACK(toggle_cert_cb), vbox);
 
-       val = alertpanel_with_widget(_("Changed SSL Certificate"), NULL, _("Accept and save"), _("Cancel connection"), NULL, vbox2);
+       val = alertpanel_with_type(_("Changed SSL Certificate"), NULL, _("Accept and save"), _("Cancel connection"), NULL, vbox2, ALERT_WARNING);
        
        return (val == G_ALERTDEFAULT);
 }
index 4429a24e19a189e74fc3c52228f3d57f0778368d..5b1436e627b385ed9bbd31f9d66fd97afe23f705 100644 (file)
@@ -649,7 +649,7 @@ void app_will_exit(GtkWidget *widget, gpointer data)
        MainWindow *mainwin = data;
        
        if (compose_get_compose_list()) {
-               gint val = alertpanel(_("Notice"),
+               gint val = alertpanel(_("Really quit?"),
                               _("Composing message exists."),
                               _("Draft them"), _("Discard them"), _("Don't quit"));
                switch (val) {
index 05d025d9937d1c24cc70d2a1503ef7828e817561..7fc7114be9ffc4b5d151de902d50d90f94b72504 100644 (file)
@@ -523,8 +523,8 @@ static gint disposition_notification_send(MsgInfo *msginfo)
                                   "Return path: %s\n"
                                   "It is advised to not to send the return "
                                   "receipt."), to, buf);
-               val = alertpanel(_("Warning"), message, _("Send"),
-                               _("+Don't Send"), NULL);
+               val = alertpanel_with_type(_("Warning"), message, _("Send"),
+                               _("+Don't Send"), NULL, NULL, ALERT_WARNING);
                g_free(message);                                
                if (val != G_ALERTDEFAULT)
                        return -1;
index 8195bce8915f9f19bd7bcf05dabaf82ec349a804..b3c19b9933c1ce1f14b76062811f528313f2b742 100644 (file)
@@ -3072,7 +3072,7 @@ void summary_move_selected_to(SummaryView *summaryview, FolderItem *to_folder)
        if (summary_is_locked(summaryview)) return;
 
        if (summaryview->folder_item == to_folder) {
-               alertpanel_notice(_("Destination is same as current folder."));
+               alertpanel_error(_("Destination is same as current folder."));
                return;
        }
 
@@ -3148,7 +3148,7 @@ void summary_copy_selected_to(SummaryView *summaryview, FolderItem *to_folder)
        if (summary_is_locked(summaryview)) return;
 
        if (summaryview->folder_item == to_folder) {
-               alertpanel_notice
+               alertpanel_error
                        (_("Destination to copy is same as current folder."));
                return;
        }
index b7e2477fef8c92f69cb915ef0bb1220bf51dccd2..2c0b266d2dcdc432fd97f8dce278abf015865168 100644 (file)
@@ -1849,11 +1849,11 @@ static gboolean uri_security_check(RemoteURI *uri, TextView *textview)
                                        "the apparent URL (%s).  \n"
                                        "Open it anyway?"),
                                        uri->uri, clicked_str);
-               resp = alertpanel(_("Warning"), 
+               resp = alertpanel_with_type(_("Warning"), 
                                  msg,
                                  _("Yes"), 
                                  _("No"),
-                                 NULL);
+                                 NULL, NULL, ALERT_WARNING);
                g_free(msg);
                if (resp == G_ALERTDEFAULT)
                        retval = TRUE;
@@ -1998,7 +1998,8 @@ static gboolean textview_uri_security_check(TextView *textview, RemoteURI *uri)
                                        "the apparent URL (%s).\n"
                                        "Open it anyway?"),
                                      uri->uri, visible_str);
-               aval = alertpanel(_("Warning"), msg, _("Yes"), _("No"), NULL);
+               aval = alertpanel_with_type(_("Warning"), msg, _("Yes"), _("No"), NULL,
+                                           NULL, ALERT_WARNING);
                g_free(msg);
                if (aval == G_ALERTDEFAULT)
                        retval = TRUE;