From: Colin Leroy Date: Wed, 28 Jul 2004 08:07:08 +0000 (+0000) Subject: more alertpanel fixes X-Git-Tag: gtk2_win32_last_merge~272 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=71b2162bdf849d87ef1ddc68a5953e45f6aae333 more alertpanel fixes --- diff --git a/ChangeLog-gtk2.claws b/ChangeLog-gtk2.claws index 5b189c3b4..64977591d 100644 --- a/ChangeLog-gtk2.claws +++ b/ChangeLog-gtk2.claws @@ -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 diff --git a/PATCHSETS b/PATCHSETS index d6773dcdf..fc8e23028 100644 --- 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 diff --git a/configure.ac b/configure.ac index 5c167a312..0a0e217a6 100644 --- a/configure.ac +++ b/configure.ac @@ -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} diff --git a/src/account.c b/src/account.c index 55184df9b..98ae1f3b4 100644 --- a/src/account.c +++ b/src/account.c @@ -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; } diff --git a/src/addressbook.c b/src/addressbook.c index f44b66e3c..1f05f930d 100644 --- a/src/addressbook.c +++ b/src/addressbook.c @@ -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" ); } diff --git a/src/alertpanel.c b/src/alertpanel.c index 6a3e7f38d..6164acbf0 100644 --- a/src/alertpanel.c +++ b/src/alertpanel.c @@ -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); diff --git a/src/alertpanel.h b/src/alertpanel.h index fc0b05755..25a26671b 100644 --- a/src/alertpanel.h +++ b/src/alertpanel.h @@ -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); diff --git a/src/compose.c b/src/compose.c index e1adb887f..fa88f0890 100644 --- a/src/compose.c +++ b/src/compose.c @@ -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) { diff --git a/src/expldifdlg.c b/src/expldifdlg.c index c4162d0ce..fd2d384df 100644 --- a/src/expldifdlg.c +++ b/src/expldifdlg.c @@ -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; } diff --git a/src/gtk/sslcertwindow.c b/src/gtk/sslcertwindow.c index 6d7094be3..0e2f73787 100644 --- a/src/gtk/sslcertwindow.c +++ b/src/gtk/sslcertwindow.c @@ -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); } diff --git a/src/main.c b/src/main.c index 4429a24e1..5b1436e62 100644 --- a/src/main.c +++ b/src/main.c @@ -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) { diff --git a/src/messageview.c b/src/messageview.c index 05d025d99..7fc7114be 100644 --- a/src/messageview.c +++ b/src/messageview.c @@ -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; diff --git a/src/summaryview.c b/src/summaryview.c index 8195bce89..b3c19b993 100644 --- a/src/summaryview.c +++ b/src/summaryview.c @@ -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; } diff --git a/src/textview.c b/src/textview.c index b7e2477fe..2c0b266d2 100644 --- a/src/textview.c +++ b/src/textview.c @@ -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;