Rework of alertpanel default button focus handling.
authorAndrej Kacian <ticho@claws-mail.org>
Fri, 9 Feb 2018 13:44:30 +0000 (14:44 +0100)
committerAndrej Kacian <ticho@claws-mail.org>
Fri, 9 Feb 2018 13:44:30 +0000 (14:44 +0100)
Instead of using "+" prefix with button labels and/or
the default_value parameter, we introduce "focus"
parameter, which will point to first, second or third
button.

Advantages:
- we got rid of the "+" prefix, which won't work with GTK3
  with GTK3
- instead of having two ways to indicate which button
  should have focus, which can be in conflict, and
  are not very straightforward, there is just one,
  arguably more intuitive
- some small memory leaks fixed along the way
  (using g_strconcat() directly as function argument)

57 files changed:
src/account.c
src/addrcustomattr.c
src/addrduplicates.c
src/addressadd.c
src/addressbook.c
src/addrindex.c
src/alertpanel.c
src/alertpanel.h
src/compose.c
src/editaddress.c
src/edittags.c
src/exphtmldlg.c
src/expldifdlg.c
src/file_checker.c
src/folderview.c
src/gtk/sslcertwindow.c
src/imap_gtk.c
src/import.c
src/inc.c
src/main.c
src/mainwindow.c
src/mbox.c
src/message_search.c
src/messageview.c
src/mh_gtk.c
src/mimeview.c
src/news_gtk.c
src/plugins/archive/archiver_gtk.c
src/plugins/att_remover/att_remover.c
src/plugins/attachwarner/attachwarner.c
src/plugins/libravatar/libravatar_prefs.c
src/plugins/mailmbox/plugin_gtk.c
src/plugins/managesieve/sieve_editor.c
src/plugins/managesieve/sieve_manager.c
src/plugins/notification/notification_trayicon.c
src/plugins/pdf_viewer/poppler_viewer.c
src/plugins/perl/perl_plugin.c
src/plugins/pgpcore/pgp_viewer.c
src/plugins/pgpcore/select-keys.c
src/plugins/pgpcore/sgpgme.c
src/plugins/rssyl/rssyl_cb_menu.c
src/plugins/vcalendar/vcal_folder.c
src/plugins/vcalendar/vcal_meeting_gtk.c
src/plugins/vcalendar/vcalendar.c
src/prefs_actions.c
src/prefs_customheader.c
src/prefs_filtering.c
src/prefs_folder_item.c
src/prefs_matcher.c
src/prefs_migration.c
src/prefs_template.c
src/prefs_themes.c
src/ssl_manager.c
src/summary_search.c
src/summaryview.c
src/textview.c
src/toolbar.c

index 11840aefcd75fc474a46b4bfc8b320be7c387bd4..87f8953be8f6b4a3e5f098e010bc0ea64722c1cc 100644 (file)
@@ -1098,8 +1098,8 @@ static void account_delete(GtkWidget *widget, gpointer data)
                   ac_prefs->account_name ? ac_prefs->account_name :
                   _("(Untitled)"));
        if (alertpanel_full(_("Delete account"), buf,
                   ac_prefs->account_name ? ac_prefs->account_name :
                   _("(Untitled)"));
        if (alertpanel_full(_("Delete account"), buf,
-                           GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, FALSE,
-                           NULL, ALERT_WARNING, G_ALERTDEFAULT) != G_ALERTALTERNATE)
+                           GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, ALERTFOCUS_FIRST, FALSE,
+                           NULL, ALERT_WARNING) != G_ALERTALTERNATE)
                return;
        account_list_dirty = TRUE;
 
                return;
        account_list_dirty = TRUE;
 
index 46f769d0a1a0308b2e11e58456913c09545ca892..d3f97d568b8c61e3930447578e049f89d794a00f 100644 (file)
@@ -155,7 +155,7 @@ static void custom_attr_window_list_view_clear_list(GtkWidget *list_view, gboole
 {
        if (!warn || alertpanel(_("Delete all attribute names"),
                       _("Do you really want to delete all attribute names?"),
 {
        if (!warn || alertpanel(_("Delete all attribute names"),
                       _("Do you really want to delete all attribute names?"),
-                      GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL) == G_ALERTALTERNATE) {
+                      GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, ALERTFOCUS_FIRST) == G_ALERTALTERNATE) {
                GtkListStore *list_store = GTK_LIST_STORE(gtk_tree_view_get_model
                                                (GTK_TREE_VIEW(list_view)));
                gtk_list_store_clear(list_store);
                GtkListStore *list_store = GTK_LIST_STORE(gtk_tree_view_get_model
                                                (GTK_TREE_VIEW(list_view)));
                gtk_list_store_clear(list_store);
@@ -180,7 +180,7 @@ static void custom_attr_popup_delete (void *obj, void *data)
 
        if (alertpanel(_("Delete attribute name"),
                       _("Do you really want to delete this attribute name?"),
 
        if (alertpanel(_("Delete attribute name"),
                       _("Do you really want to delete this attribute name?"),
-                      GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL) == G_ALERTALTERNATE) {
+                      GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, ALERTFOCUS_FIRST) == G_ALERTALTERNATE) {
                gtk_list_store_remove(GTK_LIST_STORE(model), &sel);
                dirty = TRUE;
        }
                gtk_list_store_remove(GTK_LIST_STORE(model), &sel);
                dirty = TRUE;
        }
@@ -190,7 +190,7 @@ static void custom_attr_popup_factory_defaults (void *obj, void *data)
 {
        if (alertpanel(_("Reset to default"),
                       _("Do you really want to replace all attribute names\nwith the default set?"),
 {
        if (alertpanel(_("Reset to default"),
                       _("Do you really want to replace all attribute names\nwith the default set?"),
-                      GTK_STOCK_NO, GTK_STOCK_YES, NULL) == G_ALERTALTERNATE) {
+                      GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_FIRST) == G_ALERTALTERNATE) {
                GList *tmp = custom_attr_default_list();
                custom_attr_window_load_list(tmp);
                if (tmp) {
                GList *tmp = custom_attr_default_list();
                custom_attr_window_load_list(tmp);
                if (tmp) {
index 96fe30ddb249d9da77fc6d18c8f8e141bdf0ac84..af3ad08ac341ebf3267af60554591d49ba4e9e79 100644 (file)
@@ -144,8 +144,8 @@ static gboolean create_dialog()
        val = alertpanel_full(_("Find address book email duplicates"),
                              _("Claws Mail will now search for duplicate email "
                                "addresses in the address book."),
        val = alertpanel_full(_("Find address book email duplicates"),
                              _("Claws Mail will now search for duplicate email "
                                "addresses in the address book."),
-                             GTK_STOCK_CANCEL,GTK_STOCK_FIND,NULL, FALSE, vbox, ALERT_NOTICE,
-                             G_ALERTALTERNATE);
+                             GTK_STOCK_CANCEL,GTK_STOCK_FIND, NULL,
+                                                                                               ALERTFOCUS_SECOND, FALSE, vbox, ALERT_NOTICE);
        if(val == G_ALERTALTERNATE) {
                want_search = TRUE;
 
        if(val == G_ALERTALTERNATE) {
                want_search = TRUE;
 
@@ -792,7 +792,8 @@ static void cb_del_btn_clicked(GtkButton *button, gpointer data)
 
        aval = alertpanel(_("Delete address(es)"),
                          _("Really delete the address(es)?"),
 
        aval = alertpanel(_("Delete address(es)"),
                          _("Really delete the address(es)?"),
-                         GTK_STOCK_CANCEL, "+"GTK_STOCK_DELETE, NULL);
+                         GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL,
+                                                                               ALERTFOCUS_SECOND);
        if(aval != G_ALERTALTERNATE)
                return;
 
        if(aval != G_ALERTALTERNATE)
                return;
 
@@ -841,7 +842,7 @@ gboolean addrduplicates_delete_item_person(ItemPerson *item, AddressDataSource *
        if( iface && iface->readOnly ) {
                alertpanel( _("Delete address"),
                            _("This address data is readonly and cannot be deleted."),
        if( iface && iface->readOnly ) {
                alertpanel( _("Delete address"),
                            _("This address data is readonly and cannot be deleted."),
-                           GTK_STOCK_CLOSE, NULL, NULL );
+                           GTK_STOCK_CLOSE, NULL, NULL, ALERTFOCUS_FIRST );
                return FALSE;
        }
 
                return FALSE;
        }
 
index a44275cec23b09e3af823573aa65d3b6d2989dd3..eb32ccd1d7647f27f175fff485841a469daae5cd 100644 (file)
@@ -533,7 +533,7 @@ gboolean addressadd_selection(const gchar *name, const gchar *address,
                                if (server->retVal != LDAPRC_SUCCESS) {
                                        alertpanel( _("Add address(es)"),
                                                _("Can't add the specified address"),
                                if (server->retVal != LDAPRC_SUCCESS) {
                                        alertpanel( _("Add address(es)"),
                                                _("Can't add the specified address"),
-                                               GTK_STOCK_CLOSE, NULL, NULL );
+                                               GTK_STOCK_CLOSE, NULL, NULL, ALERTFOCUS_FIRST );
                                        return server->retVal;
                                }
                        }
                                        return server->retVal;
                                }
                        }
index c074cb9eafb8989f3404029a4593dc2b87d68dd2..77c3b65a672293fb2544a36ec2e8a098f6640244 100644 (file)
@@ -1439,7 +1439,7 @@ static void addressbook_del_clicked(GtkButton *button, gpointer data)
        if( iface->readOnly ) {
                alertpanel( _("Delete address(es)"),
                        _("This address data is readonly and cannot be deleted."),
        if( iface->readOnly ) {
                alertpanel( _("Delete address(es)"),
                        _("This address data is readonly and cannot be deleted."),
-                       GTK_STOCK_CLOSE, NULL, NULL );
+                       GTK_STOCK_CLOSE, NULL, NULL, ALERTFOCUS_FIRST);
                return;
        }
 
                return;
        }
 
@@ -1485,14 +1485,14 @@ static void addressbook_del_clicked(GtkButton *button, gpointer data)
                        aval = alertpanel( _("Delete group"),
                                        _("Really delete the group(s)?\n"
                                          "The addresses it contains will not be lost."),
                        aval = alertpanel( _("Delete group"),
                                        _("Really delete the group(s)?\n"
                                          "The addresses it contains will not be lost."),
-                                       GTK_STOCK_CANCEL, "+"GTK_STOCK_DELETE, NULL );
+                                       GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, ALERTFOCUS_SECOND );
                        if( aval != G_ALERTALTERNATE ) {
                                goto thaw_ret;
                        }
                } else {
                        aval = alertpanel( _("Delete address(es)"),
                                        _("Really delete the address(es)?"),
                        if( aval != G_ALERTALTERNATE ) {
                                goto thaw_ret;
                        }
                } else {
                        aval = alertpanel( _("Delete address(es)"),
                                        _("Really delete the address(es)?"),
-                                       GTK_STOCK_CANCEL, "+"GTK_STOCK_DELETE, NULL );
+                                       GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, ALERTFOCUS_SECOND );
                        if( aval != G_ALERTALTERNATE ) {
                                goto thaw_ret;
                        }
                        if( aval != G_ALERTALTERNATE ) {
                                goto thaw_ret;
                        }
@@ -2913,7 +2913,7 @@ static void addressbook_treenode_delete_cb(GtkAction *action, gpointer data)
                                "results and addresses in '%s'?" ),
                                obj->name );
                        aval = alertpanel( _("Delete"), message,
                                "results and addresses in '%s'?" ),
                                obj->name );
                        aval = alertpanel( _("Delete"), message,
-                               GTK_STOCK_CANCEL, "+"GTK_STOCK_DELETE, NULL );
+                               GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, ALERTFOCUS_SECOND );
                        g_free(message);
                        if( aval == G_ALERTALTERNATE ) {
                                delType = ADDRTREE_DEL_FOLDER_ADDR;
                        g_free(message);
                        if( aval == G_ALERTALTERNATE ) {
                                delType = ADDRTREE_DEL_FOLDER_ADDR;
@@ -2925,7 +2925,7 @@ static void addressbook_treenode_delete_cb(GtkAction *action, gpointer data)
                                     "If you delete the folder only, the addresses it contains will be moved into the parent folder." ),
                                 obj->name );
                        aval = alertpanel( _("Delete folder"), message,
                                     "If you delete the folder only, the addresses it contains will be moved into the parent folder." ),
                                 obj->name );
                        aval = alertpanel( _("Delete folder"), message,
-                               GTK_STOCK_CANCEL, g_strconcat("+",_("Delete _folder only"), NULL), _("Delete folder and _addresses"));
+                               GTK_STOCK_CANCEL, _("Delete _folder only"), _("Delete folder and _addresses"), ALERTFOCUS_SECOND);
                        g_free(message);
                        if( aval == G_ALERTALTERNATE ) {
                                delType = ADDRTREE_DEL_FOLDER_ONLY;
                        g_free(message);
                        if( aval == G_ALERTALTERNATE ) {
                                delType = ADDRTREE_DEL_FOLDER_ONLY;
@@ -2939,14 +2939,14 @@ static void addressbook_treenode_delete_cb(GtkAction *action, gpointer data)
                message = g_strdup_printf(_("Do you want to delete '%s'?\n"
                                            "The addresses it contains will not be lost."), obj->name);
                aval = alertpanel(_("Delete"), message, GTK_STOCK_CANCEL, 
                message = g_strdup_printf(_("Do you want to delete '%s'?\n"
                                            "The addresses it contains will not be lost."), obj->name);
                aval = alertpanel(_("Delete"), message, GTK_STOCK_CANCEL, 
-                               "+" GTK_STOCK_DELETE, NULL);
+                               GTK_STOCK_DELETE, NULL, ALERTFOCUS_SECOND);
                g_free(message);
                if( aval == G_ALERTALTERNATE ) delType = ADDRTREE_DEL_FOLDER_ONLY;
        } else {
                message = g_strdup_printf(_("Do you want to delete '%s'?\n"
                                            "The addresses it contains will be lost."), obj->name);
                aval = alertpanel(_("Delete"), message, GTK_STOCK_CANCEL, 
                g_free(message);
                if( aval == G_ALERTALTERNATE ) delType = ADDRTREE_DEL_FOLDER_ONLY;
        } else {
                message = g_strdup_printf(_("Do you want to delete '%s'?\n"
                                            "The addresses it contains will be lost."), obj->name);
                aval = alertpanel(_("Delete"), message, GTK_STOCK_CANCEL, 
-                               "+" GTK_STOCK_DELETE, NULL);
+                               GTK_STOCK_DELETE, NULL, ALERTFOCUS_SECOND);
                g_free(message);
                if( aval == G_ALERTALTERNATE ) delType = ADDRTREE_DEL_DATA;
        }
                g_free(message);
                if( aval == G_ALERTALTERNATE ) delType = ADDRTREE_DEL_DATA;
        }
@@ -3214,7 +3214,7 @@ static void addressbook_new_address_cb( GtkAction *action, gpointer data ) {
                                if (server->retVal != LDAPRC_SUCCESS) {
                                        alertpanel( _("Add address(es)"),
                                                addressbook_err2string(_lutErrorsLDAP_, server->retVal),
                                if (server->retVal != LDAPRC_SUCCESS) {
                                        alertpanel( _("Add address(es)"),
                                                addressbook_err2string(_lutErrorsLDAP_, server->retVal),
-                                               GTK_STOCK_CLOSE, NULL, NULL );
+                                               GTK_STOCK_CLOSE, NULL, NULL, ALERTFOCUS_FIRST );
                                        server->retVal = LDAPRC_SUCCESS;
                                        return;
                                }
                                        server->retVal = LDAPRC_SUCCESS;
                                        return;
                                }
@@ -3265,7 +3265,7 @@ static void addressbook_new_address_cb( GtkAction *action, gpointer data ) {
                        if (server->retVal != LDAPRC_SUCCESS) {
                                alertpanel( _("Add address(es)"),
                                                addressbook_err2string(_lutErrorsLDAP_, server->retVal),
                        if (server->retVal != LDAPRC_SUCCESS) {
                                alertpanel( _("Add address(es)"),
                                                addressbook_err2string(_lutErrorsLDAP_, server->retVal),
-                                       GTK_STOCK_CLOSE, NULL, NULL );
+                                       GTK_STOCK_CLOSE, NULL, NULL, ALERTFOCUS_FIRST );
                                return;
                        }
                }
                                return;
                        }
                }
@@ -4134,14 +4134,14 @@ static gboolean addressbook_convert( AddressIndex *addrIndex ) {
        if( errFlag ) {
                debug_print( "Error\n%s\n", msg );
                alertpanel_full(_("Addressbook conversion error"), msg,
        if( errFlag ) {
                debug_print( "Error\n%s\n", msg );
                alertpanel_full(_("Addressbook conversion error"), msg,
-                               GTK_STOCK_CLOSE, NULL, NULL, FALSE,
-                               NULL, ALERT_ERROR, G_ALERTDEFAULT);
+                               GTK_STOCK_CLOSE, NULL, NULL, ALERTFOCUS_FIRST, FALSE,
+                               NULL, ALERT_ERROR);
        }
        else if( msg ) {
                debug_print( "Warning\n%s\n", msg );
                alertpanel_full(_("Addressbook conversion error"), msg,
        }
        else if( msg ) {
                debug_print( "Warning\n%s\n", msg );
                alertpanel_full(_("Addressbook conversion error"), msg,
-                               GTK_STOCK_CLOSE, NULL, NULL, FALSE,
-                               NULL, ALERT_WARNING, G_ALERTDEFAULT);
+                               GTK_STOCK_CLOSE, NULL, NULL, ALERTFOCUS_FIRST, FALSE,
+                               NULL, ALERT_WARNING);
        }
 
        return retVal;
        }
 
        return retVal;
@@ -4256,8 +4256,8 @@ void addressbook_read_file( void ) {
                addrindex_print_index( addrIndex, stdout );
                alertpanel_full(_("Addressbook Error"),
                                _("Could not read address index"),
                addrindex_print_index( addrIndex, stdout );
                alertpanel_full(_("Addressbook Error"),
                                _("Could not read address index"),
-                               GTK_STOCK_CLOSE, NULL, NULL, FALSE,
-                               NULL, ALERT_ERROR, G_ALERTDEFAULT);
+                               GTK_STOCK_CLOSE, NULL, NULL, ALERTFOCUS_FIRST, FALSE,
+                               NULL, ALERT_ERROR);
        }
        debug_print( "done.\n" );
 }
        }
        debug_print( "done.\n" );
 }
index 282281f6224b2b9c33663124965000868222177f..80129968e87c5b1636287244f2c164a17421058c 100644 (file)
@@ -1828,7 +1828,7 @@ gint addrindex_save_data( AddressIndex *addrIndex ) {
                                                if( abf->retVal != LDAPRC_SUCCESS ) {
                                                        alertpanel( _("Address(es) update"),
                                                                _("Update failed. Changes not written to Directory."),
                                                if( abf->retVal != LDAPRC_SUCCESS ) {
                                                        alertpanel( _("Address(es) update"),
                                                                _("Update failed. Changes not written to Directory."),
-                                                               GTK_STOCK_CLOSE, NULL, NULL );
+                                                               GTK_STOCK_CLOSE, NULL, NULL, ALERTFOCUS_FIRST );
                                                }
                                                else {
                                                        abf->retVal = MGU_SUCCESS;
                                                }
                                                else {
                                                        abf->retVal = MGU_SUCCESS;
index 624b8a54b1b36bacb61e457fae6f922ead27980d..406ab34e06313b53d6b89f1cad37b93dae3574f4 100644 (file)
@@ -53,10 +53,10 @@ static void alertpanel_create               (const gchar    *title,
                                         const gchar    *button1_label,
                                         const gchar    *button2_label,
                                         const gchar    *button3_label,
                                         const gchar    *button1_label,
                                         const gchar    *button2_label,
                                         const gchar    *button3_label,
+                                        AlertFocus    focus,
                                         gboolean        can_disable,
                                         GtkWidget      *custom_widget,
                                         gboolean        can_disable,
                                         GtkWidget      *custom_widget,
-                                        gint            alert_type,
-                                        AlertValue      default_value);
+                                        gint            alert_type);
 
 static void alertpanel_button_toggled  (GtkToggleButton        *button,
                                         gpointer                data);
 
 static void alertpanel_button_toggled  (GtkToggleButton        *button,
                                         gpointer                data);
@@ -74,24 +74,23 @@ AlertValue alertpanel_with_widget(const gchar *title,
                                  const gchar *button1_label,
                                  const gchar *button2_label,
                                  const gchar *button3_label,
                                  const gchar *button1_label,
                                  const gchar *button2_label,
                                  const gchar *button3_label,
+                                       AlertFocus   focus,
                                  gboolean     can_disable,
                                  gboolean     can_disable,
-                                 AlertValue   default_value,
                                  GtkWidget   *widget)
 {
        return alertpanel_full(title, message, button1_label,
                                  GtkWidget   *widget)
 {
        return alertpanel_full(title, message, button1_label,
-                                   button2_label, button3_label,
-                                   can_disable, widget, ALERT_QUESTION,
-                                   default_value);
+                                   button2_label, button3_label, focus,
+                                   can_disable, widget, ALERT_QUESTION);
 }
 
 AlertValue alertpanel_full(const gchar *title, const gchar *message,
                           const gchar *button1_label,
                           const gchar *button2_label,
                           const gchar *button3_label,
 }
 
 AlertValue alertpanel_full(const gchar *title, const gchar *message,
                           const gchar *button1_label,
                           const gchar *button2_label,
                           const gchar *button3_label,
+                                AlertFocus   focus,
                           gboolean     can_disable,
                           GtkWidget   *widget,
                           gboolean     can_disable,
                           GtkWidget   *widget,
-                          AlertType    alert_type,
-                          AlertValue   default_value)
+                          AlertType    alert_type)
 {
        if (alertpanel_is_open)
                return -1;
 {
        if (alertpanel_is_open)
                return -1;
@@ -100,8 +99,7 @@ AlertValue alertpanel_full(const gchar *title, const gchar *message,
                hooks_invoke(ALERTPANEL_OPENED_HOOKLIST, &alertpanel_is_open);
        }
        alertpanel_create(title, message, button1_label, button2_label,
                hooks_invoke(ALERTPANEL_OPENED_HOOKLIST, &alertpanel_is_open);
        }
        alertpanel_create(title, message, button1_label, button2_label,
-                         button3_label, can_disable, widget, alert_type,
-                         default_value);
+                         button3_label, focus, can_disable, widget, alert_type);
        alertpanel_show();
 
        debug_print("return value = %d\n", value);
        alertpanel_show();
 
        debug_print("return value = %d\n", value);
@@ -112,11 +110,11 @@ AlertValue alertpanel(const gchar *title,
                      const gchar *message,
                      const gchar *button1_label,
                      const gchar *button2_label,
                      const gchar *message,
                      const gchar *button1_label,
                      const gchar *button2_label,
-                     const gchar *button3_label)
+                     const gchar *button3_label,
+                                       AlertFocus   focus)
 {
        return alertpanel_full(title, message, button1_label, button2_label,
 {
        return alertpanel_full(title, message, button1_label, button2_label,
-                              button3_label, FALSE, NULL, ALERT_QUESTION,
-                              G_ALERTDEFAULT);
+                              button3_label, focus, FALSE, NULL, ALERT_QUESTION);
 }
 
 static void alertpanel_message(const gchar *title, const gchar *message, gint type)
 }
 
 static void alertpanel_message(const gchar *title, const gchar *message, gint type)
@@ -129,7 +127,7 @@ static void alertpanel_message(const gchar *title, const gchar *message, gint ty
        }
 
        alertpanel_create(title, message, GTK_STOCK_CLOSE, NULL, NULL,
        }
 
        alertpanel_create(title, message, GTK_STOCK_CLOSE, NULL, NULL,
-                         FALSE, NULL, type, G_ALERTDEFAULT);
+                         ALERTFOCUS_FIRST, FALSE, NULL, type);
        alertpanel_show();
 }
 
        alertpanel_show();
 }
 
@@ -193,8 +191,8 @@ void alertpanel_error_log(const gchar *format, ...)
        if (mainwin && mainwin->logwin) {
                mainwindow_clear_error(mainwin);
                val = alertpanel_full(_("Error"), buf, GTK_STOCK_CLOSE,
        if (mainwin && mainwin->logwin) {
                mainwindow_clear_error(mainwin);
                val = alertpanel_full(_("Error"), buf, GTK_STOCK_CLOSE,
-                                     _("_View log"), NULL, FALSE, NULL,
-                                     ALERT_ERROR, G_ALERTDEFAULT);
+                                     _("_View log"), NULL, ALERTFOCUS_FIRST, FALSE, NULL,
+                                     ALERT_ERROR);
                if (val == G_ALERTALTERNATE)
                        log_window_show(mainwin->logwin);
        } else
                if (val == G_ALERTALTERNATE)
                        log_window_show(mainwin->logwin);
        } else
@@ -228,10 +226,10 @@ static void alertpanel_create(const gchar *title,
                              const gchar *button1_label,
                              const gchar *button2_label,
                              const gchar *button3_label,
                              const gchar *button1_label,
                              const gchar *button2_label,
                              const gchar *button3_label,
+                                               AlertFocus   focus,
                              gboolean     can_disable,
                              GtkWidget   *custom_widget,
                              gboolean     can_disable,
                              GtkWidget   *custom_widget,
-                             gint         alert_type,
-                             AlertValue   default_value)
+                             gint         alert_type)
 {
        static PangoFontDescription *font_desc;
        GtkWidget *image;
 {
        static PangoFontDescription *font_desc;
        GtkWidget *image;
@@ -243,6 +241,7 @@ static void alertpanel_create(const gchar *title,
        GtkWidget *button1;
        GtkWidget *button2;
        GtkWidget *button3;
        GtkWidget *button1;
        GtkWidget *button2;
        GtkWidget *button3;
+       GtkWidget *focusbutton;
        const gchar *label2;
        const gchar *label3;
        gchar *tmp = title?g_markup_printf_escaped("%s", title)
        const gchar *label2;
        const gchar *label3;
        gchar *tmp = title?g_markup_printf_escaped("%s", title)
@@ -359,8 +358,6 @@ static void alertpanel_create(const gchar *title,
                button1_label = GTK_STOCK_OK;
        label2 = button2_label;
        label3 = button3_label;
                button1_label = GTK_STOCK_OK;
        label2 = button2_label;
        label3 = button3_label;
-       if (label2 && *label2 == '+') label2++;
-       if (label3 && *label3 == '+') label3++;
 
        gtkut_stock_button_set_create(&confirm_area,
                                      &button1, button1_label,
 
        gtkut_stock_button_set_create(&confirm_area,
                                      &button1, button1_label,
@@ -370,18 +367,25 @@ static void alertpanel_create(const gchar *title,
        gtk_box_pack_end(GTK_BOX(gtk_dialog_get_action_area(GTK_DIALOG(dialog))),
                         confirm_area, FALSE, FALSE, 0);
        gtk_container_set_border_width(GTK_CONTAINER(confirm_area), 5);
        gtk_box_pack_end(GTK_BOX(gtk_dialog_get_action_area(GTK_DIALOG(dialog))),
                         confirm_area, FALSE, FALSE, 0);
        gtk_container_set_border_width(GTK_CONTAINER(confirm_area), 5);
-       gtk_widget_grab_default(button1);
-       gtk_widget_grab_focus(button1);
-       if (button2_label &&
-           (default_value == G_ALERTALTERNATE || *button2_label == '+')) {
-               gtk_widget_grab_default(button2);
-               gtk_widget_grab_focus(button2);
-       }
-       if (button3_label &&
-           (default_value == G_ALERTOTHER || *button3_label == '+')) {
-               gtk_widget_grab_default(button3);
-               gtk_widget_grab_focus(button3);
+
+       /* Set focus on correct button as requested. */
+       focusbutton = button1;
+       switch (focus) {
+               case ALERTFOCUS_SECOND:
+                       if (button2_label != NULL)
+                               focusbutton = button2;
+                       break;
+               case ALERTFOCUS_THIRD:
+                       if (button3_label != NULL)
+                               focusbutton = button3;
+                       break;
+               case ALERTFOCUS_FIRST:
+               default:
+                       focusbutton = button1;
+                       break;
        }
        }
+       gtk_widget_grab_default(focusbutton);
+       gtk_widget_grab_focus(focusbutton);
 
        g_signal_connect(G_OBJECT(button1), "clicked",
                         G_CALLBACK(alertpanel_button_clicked),
 
        g_signal_connect(G_OBJECT(button1), "clicked",
                         G_CALLBACK(alertpanel_button_clicked),
index fa8acb302710ae19a8b1ed4b7591d7ac72b5d5c0..708766d2e40087df692a24c5696affa9dba6ab95 100644 (file)
@@ -42,30 +42,38 @@ typedef enum
 } AlertType;
 #define G_ALERT_VALUE_MASK     0x0000ffff
 
 } AlertType;
 #define G_ALERT_VALUE_MASK     0x0000ffff
 
+typedef enum
+{
+       ALERTFOCUS_FIRST,
+       ALERTFOCUS_SECOND,
+       ALERTFOCUS_THIRD
+} AlertFocus;
+
 #define ALERTPANEL_OPENED_HOOKLIST "alertpanel_opened_hooklist"
 
 AlertValue alertpanel_full(const gchar *title, const gchar *message,
                           const gchar *button1_label,
                           const gchar *button2_label,
                           const gchar *button3_label,
 #define ALERTPANEL_OPENED_HOOKLIST "alertpanel_opened_hooklist"
 
 AlertValue alertpanel_full(const gchar *title, const gchar *message,
                           const gchar *button1_label,
                           const gchar *button2_label,
                           const gchar *button3_label,
+                                AlertFocus   focus,
                           gboolean     can_disable,
                           GtkWidget   *widget,
                           gboolean     can_disable,
                           GtkWidget   *widget,
-                          AlertType    alert_type,
-                          AlertValue   default_value);
+                          AlertType    alert_type);
 
 AlertValue alertpanel  (const gchar    *title,
                         const gchar    *message,
                         const gchar    *button1_label,
                         const gchar    *button2_label,
 
 AlertValue alertpanel  (const gchar    *title,
                         const gchar    *message,
                         const gchar    *button1_label,
                         const gchar    *button2_label,
-                        const gchar    *button3_label);
+                        const gchar    *button3_label,
+                        AlertFocus    focus);
 
 AlertValue alertpanel_with_widget      (const gchar *title,
                                         const gchar *message,
                                         const gchar *button1_label,
                                         const gchar *button2_label,
                                         const gchar *button3_label,
 
 AlertValue alertpanel_with_widget      (const gchar *title,
                                         const gchar *message,
                                         const gchar *button1_label,
                                         const gchar *button2_label,
                                         const gchar *button3_label,
+                                        AlertFocus   focus,
                                         gboolean     can_disable,
                                         gboolean     can_disable,
-                                        AlertValue   default_value,
                                         GtkWidget   *widget);
 
 void alertpanel_notice (const gchar    *format,
                                         GtkWidget   *widget);
 
 void alertpanel_notice (const gchar    *format,
index ae5cd90e89b68b0056553d441d851b0ced5b5d78..0c967392c22e7ecb28c6e501d1b68043404c918f 100644 (file)
@@ -3643,7 +3643,8 @@ static ComposeInsertResult compose_insert_file(Compose *compose, const gchar *fi
                                                "in the message body. Are you sure you want to do that?"),
                                                to_human_readable(size));
                        aval = alertpanel_full(_("Are you sure?"), msg, GTK_STOCK_CANCEL,
                                                "in the message body. Are you sure you want to do that?"),
                                                to_human_readable(size));
                        aval = alertpanel_full(_("Are you sure?"), msg, GTK_STOCK_CANCEL,
-                                       g_strconcat("+", _("_Insert"), NULL), NULL, TRUE, NULL, ALERT_QUESTION, G_ALERTDEFAULT);
+                                       _("_Insert"), NULL, ALERTFOCUS_SECOND, TRUE,
+                                       NULL, ALERT_QUESTION);
                        g_free(msg);
 
                        /* do we ask for confirmation next time? */
                        g_free(msg);
 
                        /* do we ask for confirmation next time? */
@@ -3769,8 +3770,8 @@ static gboolean compose_attach_append(Compose *compose, const gchar *file,
        if (size == 0 && !compose->batch) {
                gchar * msg = g_strdup_printf(_("File %s is empty."), filename);
                AlertValue aval = alertpanel_full(_("Empty file"), msg, 
        if (size == 0 && !compose->batch) {
                gchar * msg = g_strdup_printf(_("File %s is empty."), filename);
                AlertValue aval = alertpanel_full(_("Empty file"), msg, 
-                               GTK_STOCK_CANCEL,  g_strconcat("+", _("_Attach anyway"), NULL), NULL, FALSE,
-                               NULL, ALERT_WARNING, G_ALERTDEFAULT);
+                               GTK_STOCK_CANCEL,  _("_Attach anyway"), NULL,
+                               ALERTFOCUS_SECOND, FALSE, NULL, ALERT_WARNING);
                g_free(msg);
 
                if (aval != G_ALERTALTERNATE) {
                g_free(msg);
 
                if (aval != G_ALERTALTERNATE) {
@@ -5068,7 +5069,7 @@ static gboolean compose_check_for_set_recipients(Compose *compose)
                                           prefs_common_translated_header_name("Cc"));
                        aval = alertpanel(_("Send"),
                                          text,
                                           prefs_common_translated_header_name("Cc"));
                        aval = alertpanel(_("Send"),
                                          text,
-                                         GTK_STOCK_CANCEL, g_strconcat("+", _("_Send"), NULL), NULL);
+                                         GTK_STOCK_CANCEL, _("_Send"), NULL, ALERTFOCUS_SECOND);
                        g_free(text);
                        if (aval != G_ALERTALTERNATE)
                                return FALSE;
                        g_free(text);
                        if (aval != G_ALERTALTERNATE)
                                return FALSE;
@@ -5105,7 +5106,7 @@ static gboolean compose_check_for_set_recipients(Compose *compose)
                                           prefs_common_translated_header_name("Bcc"));
                        aval = alertpanel(_("Send"),
                                          text,
                                           prefs_common_translated_header_name("Bcc"));
                        aval = alertpanel(_("Send"),
                                          text,
-                                         GTK_STOCK_CANCEL, g_strconcat("+", _("_Send"), NULL), NULL);
+                                         GTK_STOCK_CANCEL, _("_Send"), NULL, ALERTFOCUS_SECOND);
                        g_free(text);
                        if (aval != G_ALERTALTERNATE)
                                return FALSE;
                        g_free(text);
                        if (aval != G_ALERTALTERNATE)
                                return FALSE;
@@ -5147,8 +5148,8 @@ static gboolean compose_check_entries(Compose *compose, gboolean check_everythin
                                        _("Queue it anyway?"));
 
                        aval = alertpanel_full(compose->sending?_("Send"):_("Send later"), message,
                                        _("Queue it anyway?"));
 
                        aval = alertpanel_full(compose->sending?_("Send"):_("Send later"), message,
-                                              GTK_STOCK_CANCEL, button_label, NULL, TRUE, NULL,
-                                              ALERT_QUESTION, G_ALERTDEFAULT);
+                                              GTK_STOCK_CANCEL, button_label, NULL, ALERTFOCUS_FIRST,
+                                                                TRUE, NULL, ALERT_QUESTION);
                        g_free(message);
                        g_free(button_label);
                        if (aval & G_ALERTDISABLE) {
                        g_free(message);
                        g_free(button_label);
                        if (aval & G_ALERTDISABLE) {
@@ -5196,8 +5197,8 @@ static gboolean compose_check_entries(Compose *compose, gboolean check_everythin
                                        _("Queue it anyway?"));
 
                        aval = alertpanel_full(compose->sending?_("Send"):_("Send later"), message,
                                        _("Queue it anyway?"));
 
                        aval = alertpanel_full(compose->sending?_("Send"):_("Send later"), message,
-                                              GTK_STOCK_CANCEL, button_label, NULL, TRUE, NULL,
-                                              ALERT_QUESTION, G_ALERTDEFAULT);
+                                              GTK_STOCK_CANCEL, button_label, NULL, ALERTFOCUS_FIRST,
+                                                                TRUE, NULL, ALERT_QUESTION);
                        g_free(message);
                        if (aval & G_ALERTDISABLE) {
                                aval &= ~G_ALERTDISABLE;
                        g_free(message);
                        if (aval & G_ALERTDISABLE) {
                                aval &= ~G_ALERTDISABLE;
@@ -5734,8 +5735,8 @@ static gint compose_write_to_file(Compose *compose, FILE *fp, gint action, gbool
                                                "to the specified %s charset.\n"
                                                "Send it as %s?"), out_codeset, src_codeset);
                        aval = alertpanel_full(_("Error"), msg, GTK_STOCK_CANCEL,
                                                "to the specified %s charset.\n"
                                                "Send it as %s?"), out_codeset, src_codeset);
                        aval = alertpanel_full(_("Error"), msg, GTK_STOCK_CANCEL,
-                                              g_strconcat("+", _("_Send"), NULL), NULL, FALSE,
-                                             NULL, ALERT_ERROR, G_ALERTDEFAULT);
+                                              _("_Send"), NULL, ALERTFOCUS_SECOND, FALSE,
+                                             NULL, ALERT_ERROR);
                        g_free(msg);
 
                        if (aval != G_ALERTALTERNATE) {
                        g_free(msg);
 
                        if (aval != G_ALERTALTERNATE) {
@@ -5796,7 +5797,8 @@ static gint compose_write_to_file(Compose *compose, FILE *fp, gint action, gbool
                           "The contents of the message might be broken on the way to the delivery.\n"
                           "\n"
                           "Send it anyway?"), line + 1);
                           "The contents of the message might be broken on the way to the delivery.\n"
                           "\n"
                           "Send it anyway?"), line + 1);
-               aval = alertpanel(_("Warning"), msg, GTK_STOCK_CANCEL, GTK_STOCK_OK, NULL);
+               aval = alertpanel(_("Warning"), msg, GTK_STOCK_CANCEL, GTK_STOCK_OK, NULL,
+                               ALERTFOCUS_FIRST);
                g_free(msg);
                if (aval != G_ALERTALTERNATE) {
                        g_free(buf);
                g_free(msg);
                if (aval != G_ALERTALTERNATE) {
                        g_free(buf);
@@ -6025,8 +6027,8 @@ static gboolean compose_warn_encryption(Compose *compose)
                return TRUE;
 
        val = alertpanel_full(_("Encryption warning"), warning,
                return TRUE;
 
        val = alertpanel_full(_("Encryption warning"), warning,
-                 GTK_STOCK_CANCEL, g_strconcat("+", _("C_ontinue"), NULL), NULL,
-                 TRUE, NULL, ALERT_WARNING, G_ALERTALTERNATE);
+                 GTK_STOCK_CANCEL, _("C_ontinue"), NULL, ALERTFOCUS_SECOND,
+                 TRUE, NULL, ALERT_WARNING);
        if (val & G_ALERTDISABLE) {
                val &= ~G_ALERTDISABLE;
                if (val == G_ALERTALTERNATE)
        if (val & G_ALERTDISABLE) {
                val &= ~G_ALERTDISABLE;
                if (val == G_ALERTALTERNATE)
@@ -6324,8 +6326,9 @@ static int compose_add_attachments(Compose *compose, MimeInfo *parent)
                
                if (!is_file_exist(ainfo->file)) {
                        gchar *msg = g_strdup_printf(_("Attachment %s doesn't exist anymore. Ignore?"), ainfo->file);
                
                if (!is_file_exist(ainfo->file)) {
                        gchar *msg = g_strdup_printf(_("Attachment %s doesn't exist anymore. Ignore?"), ainfo->file);
-                       AlertValue val = alertpanel_full(_("Warning"), msg, _("Cancel sending"), _("Ignore attachment"),
-                                     NULL, FALSE, NULL, ALERT_WARNING, G_ALERTDEFAULT);
+                       AlertValue val = alertpanel_full(_("Warning"), msg,
+                                       _("Cancel sending"), _("Ignore attachment"), NULL,
+                                       ALERTFOCUS_FIRST, FALSE, NULL, ALERT_WARNING);
                        g_free(msg);
                        if (val == G_ALERTDEFAULT) {
                                return -1;
                        g_free(msg);
                        if (val == G_ALERTDEFAULT) {
                                return -1;
@@ -9723,7 +9726,8 @@ static gboolean compose_ext_editor_kill(Compose *compose)
                           "Force terminating the process?\n"
                           "process group id: %d"), -pgid);
                val = alertpanel_full(_("Notice"), msg, GTK_STOCK_NO, GTK_STOCK_YES,
                           "Force terminating the process?\n"
                           "process group id: %d"), -pgid);
                val = alertpanel_full(_("Notice"), msg, GTK_STOCK_NO, GTK_STOCK_YES,
-                                     NULL, FALSE, NULL, ALERT_WARNING, G_ALERTDEFAULT);
+                                     NULL, ALERTFOCUS_FIRST, FALSE, NULL,
+                                                                               ALERT_WARNING);
                        
                g_free(msg);
 
                        
                g_free(msg);
 
@@ -10399,8 +10403,8 @@ warn_err:
                                val = alertpanel_full(_("Could not save draft"),
                                        _("Could not save draft.\n"
                                        "Do you want to cancel exit or discard this email?"),
                                val = alertpanel_full(_("Could not save draft"),
                                        _("Could not save draft.\n"
                                        "Do you want to cancel exit or discard this email?"),
-                                         _("_Cancel exit"), _("_Discard email"), NULL,
-                                         FALSE, NULL, ALERT_QUESTION, G_ALERTDEFAULT);
+                                         _("_Cancel exit"), _("_Discard email"), NULL, ALERTFOCUS_FIRST,
+                                         FALSE, NULL, ALERT_QUESTION);
                                if (val == G_ALERTALTERNATE) {
                                        lock = FALSE;
                                        g_mutex_unlock(compose->mutex); /* must be done before closing */
                                if (val == G_ALERTALTERNATE) {
                                        lock = FALSE;
                                        g_mutex_unlock(compose->mutex); /* must be done before closing */
@@ -10700,12 +10704,13 @@ static void compose_close_cb(GtkAction *action, gpointer data)
                if (!reedit) {
                        val = alertpanel(_("Discard message"),
                                 _("This message has been modified. Discard it?"),
                if (!reedit) {
                        val = alertpanel(_("Discard message"),
                                 _("This message has been modified. Discard it?"),
-                                _("_Discard"), _("_Save to Drafts"), GTK_STOCK_CANCEL);
+                                _("_Discard"), _("_Save to Drafts"), GTK_STOCK_CANCEL,
+                                ALERTFOCUS_FIRST);
                } else {
                        val = alertpanel(_("Save changes"),
                                 _("This message has been modified. Save the latest changes?"),
                } else {
                        val = alertpanel(_("Save changes"),
                                 _("This message has been modified. Save the latest changes?"),
-                                _("_Don't save"), g_strconcat("+", _("_Save to Drafts"), NULL),
-                               GTK_STOCK_CANCEL);
+                                _("_Don't save"), _("_Save to Drafts"), GTK_STOCK_CANCEL,
+                                ALERTFOCUS_SECOND);
                }
                g_mutex_unlock(compose->mutex);
                switch (val) {
                }
                g_mutex_unlock(compose->mutex);
                switch (val) {
@@ -10778,7 +10783,7 @@ static void compose_template_activate_cb(GtkWidget *widget, gpointer data)
        msg = g_strdup_printf(_("Do you want to apply the template '%s'?"),
                              tmpl->name);
        val = alertpanel(_("Apply template"), msg,
        msg = g_strdup_printf(_("Do you want to apply the template '%s'?"),
                              tmpl->name);
        val = alertpanel(_("Apply template"), msg,
-                        _("_Replace"), _("_Insert"), GTK_STOCK_CANCEL);
+                        _("_Replace"), _("_Insert"), GTK_STOCK_CANCEL, ALERTFOCUS_FIRST);
        g_free(msg);
 
        if (val == G_ALERTDEFAULT)
        g_free(msg);
 
        if (val == G_ALERTDEFAULT)
@@ -11656,8 +11661,9 @@ static void compose_insert_drag_received_cb (GtkWidget          *widget,
                                                        num_files),
                                                num_files);
                                val = alertpanel_full(_("Insert or attach?"), msg,
                                                        num_files),
                                                num_files);
                                val = alertpanel_full(_("Insert or attach?"), msg,
-                                         GTK_STOCK_CANCEL, g_strconcat("+", _("_Insert"), NULL), _("_Attach"),
-                                         TRUE, NULL, ALERT_QUESTION, G_ALERTALTERNATE);
+                                         GTK_STOCK_CANCEL, _("_Insert"), _("_Attach"),
+                                               ALERTFOCUS_SECOND,
+                                         TRUE, NULL, ALERT_QUESTION);
                                g_free(msg);
                                break;
                        case COMPOSE_DND_INSERT:
                                g_free(msg);
                                break;
                        case COMPOSE_DND_INSERT:
@@ -12179,8 +12185,8 @@ void compose_reply_from_messageview(MessageView *msgview, GSList *msginfo_list,
                                               "want to continue?"), 
                                               g_slist_length(msginfo_list));
                if (g_slist_length(msginfo_list) > 9
                                               "want to continue?"), 
                                               g_slist_length(msginfo_list));
                if (g_slist_length(msginfo_list) > 9
-               &&  alertpanel(_("Warning"), msg, GTK_STOCK_CANCEL, "+" GTK_STOCK_YES, NULL)
-                   != G_ALERTALTERNATE) {
+               &&  alertpanel(_("Warning"), msg, GTK_STOCK_CANCEL, GTK_STOCK_YES, NULL,
+                       ALERTFOCUS_SECOND) != G_ALERTALTERNATE) {
                        g_free(msg);
                        return;
                }
                        g_free(msg);
                        return;
                }
index 18fc0411c37ca434ec3c213c45960e7cc89cb954..36963c6ed014524de4f992dd3e66247e51a0ccee 100644 (file)
@@ -174,7 +174,7 @@ static void edit_person_ok(GtkWidget *widget, gboolean *cancelled) {
                                  "Click OK to keep editing this contact.\n"
                                  "Click Cancel to close without saving."),
 #endif
                                  "Click OK to keep editing this contact.\n"
                                  "Click Cancel to close without saving."),
 #endif
-                               GTK_STOCK_CANCEL, "+"GTK_STOCK_OK, NULL );
+                               GTK_STOCK_CANCEL, GTK_STOCK_OK, NULL, ALERTFOCUS_SECOND );
                if( val == G_ALERTDEFAULT ) {
                        edit_person_cancel(widget, cancelled);
                }
                if( val == G_ALERTDEFAULT ) {
                        edit_person_cancel(widget, cancelled);
                }
index bd2cb914db79b7e8a2c34e2dbd9db4f1f5bbcc92..1209dd08698559b1a7427dfff78fcaaac69b2e66 100644 (file)
@@ -215,7 +215,8 @@ static void apply_popup_delete (GtkAction *action, gpointer data)
 
        if (alertpanel(_("Delete tag"),
                       _("Do you really want to delete this tag?"),
 
        if (alertpanel(_("Delete tag"),
                       _("Do you really want to delete this tag?"),
-                      GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL) != G_ALERTALTERNATE)
+                      GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL,
+                                        ALERTFOCUS_FIRST) != G_ALERTALTERNATE)
                return;
 
        APPLYWINDOW_LOCK();
                return;
 
        APPLYWINDOW_LOCK();
@@ -250,7 +251,8 @@ static void apply_popup_delete_all (GtkAction *action, gpointer data)
        
        if (alertpanel(_("Delete all tags"),
                       _("Do you really want to delete all tags?"),
        
        if (alertpanel(_("Delete all tags"),
                       _("Do you really want to delete all tags?"),
-                      GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL) != G_ALERTALTERNATE)
+                      GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL,
+                                        ALERTFOCUS_FIRST) != G_ALERTALTERNATE)
                return;
 
        APPLYWINDOW_LOCK();
                return;
 
        APPLYWINDOW_LOCK();
index 209544af623fb2acb13aa444deafa0f3f340cb33..4643524f38f5bcdeb72d4d7f3259050ba333feab 100644 (file)
@@ -178,7 +178,7 @@ static gboolean exp_html_move_file( void ) {
                "does not exist. Do you want to create it?" ),
                _exportCtl_->dirOutput );
        aval = alertpanel( _("Create directory" ),
                "does not exist. Do you want to create it?" ),
                _exportCtl_->dirOutput );
        aval = alertpanel( _("Create directory" ),
-               msg, GTK_STOCK_NO, GTK_STOCK_YES, NULL );
+               msg, GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_FIRST );
        g_free( msg );
        if( aval != G_ALERTALTERNATE ) return FALSE;
 
        g_free( msg );
        if( aval != G_ALERTALTERNATE ) return FALSE;
 
@@ -189,8 +189,8 @@ static gboolean exp_html_move_file( void ) {
                        "Could not create output directory for HTML file:\n%s" ),
                        reason );
                aval = alertpanel_full(_("Failed to Create Directory"), msg,
                        "Could not create output directory for HTML file:\n%s" ),
                        reason );
                aval = alertpanel_full(_("Failed to Create Directory"), msg,
-                                      GTK_STOCK_CLOSE, NULL, NULL, FALSE,
-                                      NULL, ALERT_ERROR, G_ALERTDEFAULT);
+                                      GTK_STOCK_CLOSE, NULL, NULL, ALERTFOCUS_FIRST, FALSE,
+                                      NULL, ALERT_ERROR);
                g_free( msg );
                return FALSE;
        }
                g_free( msg );
                return FALSE;
        }
index 9defe7cd1f452eb08c673dc4beffd3044253c320..54ef3bbbb8f52339b55ed15dd4648a6133c70b35 100644 (file)
@@ -188,7 +188,7 @@ static gboolean exp_ldif_move_file( void ) {
                "does not exist. OK to create new directory?" ),
                _exportCtl_->dirOutput );
        aval = alertpanel( _("Create Directory" ),
                "does not exist. OK to create new directory?" ),
                _exportCtl_->dirOutput );
        aval = alertpanel( _("Create Directory" ),
-               msg, GTK_STOCK_NO, GTK_STOCK_YES, NULL );
+               msg, GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_FIRST );
        g_free( msg );
        if( aval != G_ALERTALTERNATE ) return FALSE;
 
        g_free( msg );
        if( aval != G_ALERTALTERNATE ) return FALSE;
 
@@ -199,8 +199,8 @@ static gboolean exp_ldif_move_file( void ) {
                        "Could not create output directory for LDIF file:\n%s" ),
                        reason );
                aval = alertpanel_full(_("Failed to Create Directory"), msg,
                        "Could not create output directory for LDIF file:\n%s" ),
                        reason );
                aval = alertpanel_full(_("Failed to Create Directory"), msg,
-                                      GTK_STOCK_CLOSE, NULL, NULL, FALSE,
-                                      NULL, ALERT_ERROR, G_ALERTDEFAULT);
+                                      GTK_STOCK_CLOSE, NULL, NULL, ALERTFOCUS_FIRST, FALSE,
+                                      NULL, ALERT_ERROR);
                g_free( msg );
                return FALSE;
        }
                g_free( msg );
                return FALSE;
        }
@@ -244,7 +244,7 @@ static gboolean exp_ldif_move_dn( void ) {
                                "for an LDAP server. Are you sure you wish " \
                                "to proceed without a suffix?"
                         ),
                                "for an LDAP server. Are you sure you wish " \
                                "to proceed without a suffix?"
                         ),
-                       GTK_STOCK_NO, GTK_STOCK_YES, NULL );
+                       GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_FIRST );
                if( aval != G_ALERTALTERNATE ) {
                        gtk_widget_grab_focus( expldif_dlg.entrySuffix );
                        errFlag = TRUE;
                if( aval != G_ALERTALTERNATE ) {
                        gtk_widget_grab_focus( expldif_dlg.entrySuffix );
                        errFlag = TRUE;
index d38e28cb203ff741fd7d9418e22f5193243a368c..d458a8399659c09745d0493b81bf124a64a8d0d7 100644 (file)
@@ -75,7 +75,8 @@ static gboolean verify_folderlist_xml()
                msg = g_strdup_printf
                        (_("The file %s is missing! "
                           "Do you want to use the backup file from %s?"), FOLDER_LIST,buf);
                msg = g_strdup_printf
                        (_("The file %s is missing! "
                           "Do you want to use the backup file from %s?"), FOLDER_LIST,buf);
-               aval = alertpanel(_("Warning"), msg, GTK_STOCK_NO, GTK_STOCK_YES, NULL);
+               aval = alertpanel(_("Warning"), msg, GTK_STOCK_NO, GTK_STOCK_YES, NULL,
+                               ALERTFOCUS_FIRST);
                g_free(msg);
                if (aval != G_ALERTALTERNATE)
                        return FALSE;
                g_free(msg);
                if (aval != G_ALERTALTERNATE)
                        return FALSE;
@@ -97,7 +98,8 @@ static gboolean verify_folderlist_xml()
                msg = g_strdup_printf
                        (_("The file %s is empty or corrupted! "
                           "Do you want to use the backup file from %s?"), FOLDER_LIST,buf);
                msg = g_strdup_printf
                        (_("The file %s is empty or corrupted! "
                           "Do you want to use the backup file from %s?"), FOLDER_LIST,buf);
-               aval = alertpanel(_("Warning"), msg, GTK_STOCK_NO, GTK_STOCK_YES, NULL);
+               aval = alertpanel(_("Warning"), msg, GTK_STOCK_NO, GTK_STOCK_YES, NULL,
+                               ALERTFOCUS_FIRST);
                g_free(msg);
                if (aval != G_ALERTALTERNATE)
                        return FALSE;
                g_free(msg);
                if (aval != G_ALERTALTERNATE)
                        return FALSE;
index 3befa3887b67297ef80ca0a7917085be995442bf..8a7383a2a21bfb7288bcfdfd187fb67f1d0ea4df 100644 (file)
@@ -877,8 +877,8 @@ static void mark_all_read_unread_handler(GtkAction *action, gpointer data,
        }
        if (prefs_common.ask_mark_all_read) {
                val = alertpanel_full(title, message,
        }
        if (prefs_common.ask_mark_all_read) {
                val = alertpanel_full(title, message,
-                         GTK_STOCK_NO, GTK_STOCK_YES, NULL,
-                         TRUE, NULL, ALERT_QUESTION, G_ALERTDEFAULT);
+                         GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_FIRST,
+                         TRUE, NULL, ALERT_QUESTION);
 
                if ((val & ~G_ALERTDISABLE) != G_ALERTALTERNATE)
                        return;
 
                if ((val & ~G_ALERTDISABLE) != G_ALERTALTERNATE)
                        return;
@@ -1099,8 +1099,8 @@ void folderview_rescan_tree(Folder *folder, gboolean rebuild)
            alertpanel_full(_("Rebuild folder tree"), 
                         _("Rebuilding the folder tree will remove "
                           "local caches. Do you want to continue?"),
            alertpanel_full(_("Rebuild folder tree"), 
                         _("Rebuilding the folder tree will remove "
                           "local caches. Do you want to continue?"),
-                        GTK_STOCK_NO, GTK_STOCK_YES, NULL, FALSE,
-                        NULL, ALERT_WARNING, G_ALERTDEFAULT
+                        GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_FIRST,
+                                                FALSE, NULL, ALERT_WARNING
                != G_ALERTALTERNATE) {
                return;
        }
                != G_ALERTALTERNATE) {
                return;
        }
@@ -2482,7 +2482,8 @@ static void folderview_empty_trash_cb(GtkAction *action, gpointer data)
        if (prefs_common.ask_on_clean) {
                if (alertpanel(_("Empty trash"),
                               _("Delete all messages in trash?"),
        if (prefs_common.ask_on_clean) {
                if (alertpanel(_("Empty trash"),
                               _("Delete all messages in trash?"),
-                              GTK_STOCK_CANCEL, g_strconcat("+", _("_Empty trash"), NULL), NULL) != G_ALERTALTERNATE)
+                              GTK_STOCK_CANCEL, _("_Empty trash"), NULL,
+                                                ALERTFOCUS_SECOND) != G_ALERTALTERNATE)
                        return;
        }
        
                        return;
        }
        
@@ -2528,7 +2529,7 @@ static void folderview_send_queue_cb(GtkAction *action, gpointer data)
                if (alertpanel(_("Offline warning"), 
                               _("You're working offline. Override?"),
                               GTK_STOCK_NO, GTK_STOCK_YES,
                if (alertpanel(_("Offline warning"), 
                               _("You're working offline. Override?"),
                               GTK_STOCK_NO, GTK_STOCK_YES,
-                              NULL) != G_ALERTALTERNATE)
+                              NULL, ALERTFOCUS_FIRST) != G_ALERTALTERNATE)
                return;
 
        /* ask for confirmation before sending queued messages only
                return;
 
        /* ask for confirmation before sending queued messages only
@@ -2540,7 +2541,7 @@ static void folderview_send_queue_cb(GtkAction *action, gpointer data)
                        if (alertpanel(_("Send queued messages"), 
                                   _("Send all queued messages?"),
                                   GTK_STOCK_CANCEL, _("_Send"),
                        if (alertpanel(_("Send queued messages"), 
                                   _("Send all queued messages?"),
                                   GTK_STOCK_CANCEL, _("_Send"),
-                                  NULL) != G_ALERTALTERNATE)
+                                  NULL, ALERTFOCUS_FIRST) != G_ALERTALTERNATE)
                                return;
                }
        }
                                return;
                }
        }
@@ -2629,8 +2630,8 @@ void folderview_move_folder(FolderView *folderview, FolderItem *from_folder,
                                             _("Do you really want to make folder '%s' a subfolder of '%s'?"), 
                                        from_folder->name, to_folder->name);
                status = alertpanel_full(copy ? _("Copy folder"):_("Move folder"), buf,
                                             _("Do you really want to make folder '%s' a subfolder of '%s'?"), 
                                        from_folder->name, to_folder->name);
                status = alertpanel_full(copy ? _("Copy folder"):_("Move folder"), buf,
-                                        GTK_STOCK_NO, GTK_STOCK_YES, NULL, TRUE,
-                                        NULL, ALERT_QUESTION, G_ALERTDEFAULT);
+                                        GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_FIRST,
+                                                                TRUE, NULL, ALERT_QUESTION);
                g_free(buf);
 
                if ((status & ~G_ALERTDISABLE) != G_ALERTALTERNATE)
                g_free(buf);
 
                if ((status & ~G_ALERTDISABLE) != G_ALERTALTERNATE)
index 5a643b6894d3ff2e60ca5fa5eda49b5a6c195fdc..bd2b6b6d6d6b7aeadb8aecf2a49485bafd3da303 100644 (file)
@@ -301,7 +301,7 @@ void sslcertwindow_show_cert(SSLCertificate *cert)
        
        buf = g_strdup_printf(_("SSL/TLS certificate for %s"), cert->host);
        alertpanel_full(buf, NULL, GTK_STOCK_CLOSE, NULL, NULL,
        
        buf = g_strdup_printf(_("SSL/TLS certificate for %s"), cert->host);
        alertpanel_full(buf, NULL, GTK_STOCK_CLOSE, NULL, NULL,
-                       FALSE, cert_widget, ALERT_NOTICE, G_ALERTDEFAULT);
+                       ALERTFOCUS_FIRST, FALSE, cert_widget, ALERT_NOTICE);
        g_free(buf);
 }
 
        g_free(buf);
 }
 
@@ -367,7 +367,7 @@ static gboolean sslcertwindow_ask_new_cert(SSLCertificate *cert)
 
        val = alertpanel_full(title, NULL,
                              _("_Cancel connection"), _("_Accept and save"), NULL,
 
        val = alertpanel_full(title, NULL,
                              _("_Cancel connection"), _("_Accept and save"), NULL,
-                             FALSE, vbox, ALERT_QUESTION, G_ALERTDEFAULT);
+                             ALERTFOCUS_FIRST, FALSE, vbox, ALERT_QUESTION);
        
        return (val == G_ALERTALTERNATE);
 }
        
        return (val == G_ALERTALTERNATE);
 }
@@ -417,7 +417,7 @@ static gboolean sslcertwindow_ask_expired_cert(SSLCertificate *cert)
 
        val = alertpanel_full(title, NULL,
                              _("_Cancel connection"), _("_Accept"), NULL,
 
        val = alertpanel_full(title, NULL,
                              _("_Cancel connection"), _("_Accept"), NULL,
-                             FALSE, vbox, ALERT_QUESTION, G_ALERTDEFAULT);
+                             ALERTFOCUS_FIRST, FALSE, vbox, ALERT_QUESTION);
        
        return (val == G_ALERTALTERNATE);
 }
        
        return (val == G_ALERTALTERNATE);
 }
@@ -479,7 +479,7 @@ static gboolean sslcertwindow_ask_changed_cert(SSLCertificate *old_cert, SSLCert
                title = _("SSL/TLS certificate changed");
        val = alertpanel_full(title, NULL,
                              _("_Cancel connection"), _("_Accept and save"), NULL,
                title = _("SSL/TLS certificate changed");
        val = alertpanel_full(title, NULL,
                              _("_Cancel connection"), _("_Accept and save"), NULL,
-                             FALSE, vbox2, ALERT_WARNING, G_ALERTDEFAULT);
+                             ALERTFOCUS_FIRST, FALSE, vbox2, ALERT_WARNING);
        
        return (val == G_ALERTALTERNATE);
 }
        
        return (val == G_ALERTALTERNATE);
 }
index 6e41b40eb245ed8b427171f605c7ac55372ccfb8..e545554f4fce079ecd65fe7709ff718f549adb52 100644 (file)
@@ -366,8 +366,8 @@ static void delete_folder_cb(GtkAction *action, gpointer data)
                   "Recovery will not be possible.\n\n"
                   "Do you really want to delete?"), name);
        avalue = alertpanel_full(_("Delete folder"), message,
                   "Recovery will not be possible.\n\n"
                   "Do you really want to delete?"), name);
        avalue = alertpanel_full(_("Delete folder"), message,
-                                GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, FALSE,
-                                NULL, ALERT_WARNING, G_ALERTDEFAULT);
+                                GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, ALERTFOCUS_FIRST, FALSE,
+                                NULL, ALERT_WARNING);
        g_free(message);
        if (avalue != G_ALERTALTERNATE) return;
 
        g_free(message);
        if (avalue != G_ALERTALTERNATE) return;
 
@@ -512,8 +512,8 @@ static void subscribe_cb_full(FolderView *folderview, guint action)
                                G_CALLBACK(chk_update_val), &recurse);
 
                avalue = alertpanel_full(_("Subscriptions"), message,
                                G_CALLBACK(chk_update_val), &recurse);
 
                avalue = alertpanel_full(_("Subscriptions"), message,
-                                        GTK_STOCK_CANCEL, g_strconcat("+", _("_Search"), NULL),
-                                        NULL, FALSE, rec_chk, ALERT_QUESTION, G_ALERTDEFAULT);
+                                        GTK_STOCK_CANCEL, _("_Search"), NULL, ALERTFOCUS_SECOND,
+                                        FALSE, rec_chk, ALERT_QUESTION);
                g_free(message);
                if (avalue != G_ALERTALTERNATE) return;
                
                g_free(message);
                if (avalue != G_ALERTALTERNATE) return;
                
@@ -571,9 +571,8 @@ static void subscribe_cb_full(FolderView *folderview, guint action)
                        G_CALLBACK(chk_update_val), &recurse);
 
        avalue = alertpanel_full(_("Subscriptions"), message,
                        G_CALLBACK(chk_update_val), &recurse);
 
        avalue = alertpanel_full(_("Subscriptions"), message,
-                                GTK_STOCK_CANCEL, action?g_strconcat("+", _("_Subscribe"), NULL):
-                                g_strconcat("+", _("_Unsubscribe"), NULL), NULL, FALSE,
-                                rec_chk, ALERT_QUESTION, G_ALERTDEFAULT);
+                                GTK_STOCK_CANCEL, action?_("_Subscribe"):_("_Unsubscribe"), NULL,
+                                ALERTFOCUS_SECOND, FALSE, rec_chk, ALERT_QUESTION);
        g_free(message);
        if (avalue != G_ALERTALTERNATE) return;
        
        g_free(message);
        if (avalue != G_ALERTALTERNATE) return;
        
index b573bb1d1211a5c9e414d5613bd56b06195086f3..1dcd12a3cc804a327d48d3b0cd7381680bc9b359 100644 (file)
@@ -205,7 +205,7 @@ static void import_ok_cb(GtkWidget *widget, gpointer data)
        }
        if (destdir && !*destdir) {
                if (alertpanel(_("Import mbox file"), _("Destination folder is not set.\nImport mbox file to the Inbox folder?"),
        }
        if (destdir && !*destdir) {
                if (alertpanel(_("Import mbox file"), _("Destination folder is not set.\nImport mbox file to the Inbox folder?"),
-                                               GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL)
+                                               GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL, ALERTFOCUS_FIRST)
                        == G_ALERTALTERNATE) {
                        gtk_widget_grab_focus(dest_entry);
                        return;
                        == G_ALERTALTERNATE) {
                        gtk_widget_grab_focus(dest_entry);
                        return;
index 5761f7750739d58feb0d6fb7fcc005be097e335a..95f8b019068f386d607dbca14d1318bbadc82d0d 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -1532,8 +1532,8 @@ gboolean inc_offline_should_override(gboolean force_ask, const gchar *msg)
 
                answer = alertpanel(_("Offline warning"), 
                               tmp,
 
                answer = alertpanel(_("Offline warning"), 
                               tmp,
-                              GTK_STOCK_NO, "+" GTK_STOCK_YES, 
-                               !force_ask? _("On_ly once"):NULL);
+                              GTK_STOCK_NO, GTK_STOCK_YES,
+                               !force_ask? _("On_ly once"):NULL, ALERTFOCUS_SECOND);
                g_free(tmp);
                if (answer == G_ALERTALTERNATE) {
                        overridden_yes = time(NULL);
                g_free(tmp);
                if (answer == G_ALERTALTERNATE) {
                        overridden_yes = time(NULL);
index 1d2654c6b3f30e81a6004547890f57b00dbde697..c404a3deaa30ef0ae1cc2e544eeba63c290632be 100644 (file)
@@ -393,8 +393,8 @@ static gboolean migrate_old_config(const gchar *old_cfg_dir, const gchar *new_cf
                        G_CALLBACK(chk_update_val), &backup);
 
        if (alertpanel_full(_("Migration of configuration"), message,
                        G_CALLBACK(chk_update_val), &backup);
 
        if (alertpanel_full(_("Migration of configuration"), message,
-                       GTK_STOCK_NO, "+" GTK_STOCK_YES, NULL, FALSE,
-                       keep_backup_chk, ALERT_QUESTION, G_ALERTDEFAULT) != G_ALERTALTERNATE) {
+                       GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_SECOND, FALSE,
+                       keep_backup_chk, ALERT_QUESTION) != G_ALERTALTERNATE) {
                return FALSE;
        }
        
                return FALSE;
        }
        
@@ -2178,7 +2178,7 @@ void app_will_exit(GtkWidget *widget, gpointer data)
        if (prefs_common.warn_queued_on_exit && procmsg_have_queued_mails_fast()) {
                if (alertpanel(_("Queued messages"),
                               _("Some unsent messages are queued. Exit now?"),
        if (prefs_common.warn_queued_on_exit && procmsg_have_queued_mails_fast()) {
                if (alertpanel(_("Queued messages"),
                               _("Some unsent messages are queued. Exit now?"),
-                              GTK_STOCK_CANCEL, GTK_STOCK_OK, NULL)
+                              GTK_STOCK_CANCEL, GTK_STOCK_OK, NULL, ALERTFOCUS_FIRST)
                    != G_ALERTALTERNATE) {
                        main_window_popup(mainwin);
                        sc_exiting = FALSE;
                    != G_ALERTALTERNATE) {
                        main_window_popup(mainwin);
                        sc_exiting = FALSE;
index 49de23fa0a86ddd60fce299bfef4616c92d52eeb..74dbc4b0fa26b323470b4d082ad6eb328a4cc61c 100644 (file)
@@ -2901,11 +2901,13 @@ gboolean main_window_empty_trash(MainWindow *mainwin, gboolean confirm, gboolean
                if (for_quit)
                        val = alertpanel(_("Empty trash"),
                               _("Delete all messages in trash folders?"),
                if (for_quit)
                        val = alertpanel(_("Empty trash"),
                               _("Delete all messages in trash folders?"),
-                              GTK_STOCK_NO, "+" GTK_STOCK_YES, _("Don't quit"));
+                              GTK_STOCK_NO, GTK_STOCK_YES, _("Don't quit"),
+                                                ALERTFOCUS_SECOND);
                else
                        val = alertpanel(_("Empty trash"),
                               _("Delete all messages in trash folders?"),
                else
                        val = alertpanel(_("Empty trash"),
                               _("Delete all messages in trash folders?"),
-                              GTK_STOCK_NO, "+" GTK_STOCK_YES, NULL);
+                              GTK_STOCK_NO, GTK_STOCK_YES, NULL,
+                                                ALERTFOCUS_SECOND);
                if (val == G_ALERTALTERNATE) {
                        debug_print("will empty trash\n");
                } else if (val == G_ALERTDEFAULT) {
                if (val == G_ALERTALTERNATE) {
                        debug_print("will empty trash\n");
                } else if (val == G_ALERTDEFAULT) {
@@ -4059,7 +4061,7 @@ static void app_exit_cb(GtkAction *action, gpointer data)
 
        if (prefs_common.confirm_on_exit) {
                if (alertpanel(_("Exit"), _("Exit Claws Mail?"),
 
        if (prefs_common.confirm_on_exit) {
                if (alertpanel(_("Exit"), _("Exit Claws Mail?"),
-                              GTK_STOCK_CANCEL, GTK_STOCK_QUIT,  NULL)
+                              GTK_STOCK_CANCEL, GTK_STOCK_QUIT,  NULL, ALERTFOCUS_FIRST)
                    != G_ALERTALTERNATE)
                        return;
                manage_window_focus_in(mainwin->window, NULL, NULL);
                    != G_ALERTALTERNATE)
                        return;
                manage_window_focus_in(mainwin->window, NULL, NULL);
@@ -4251,7 +4253,7 @@ static void mainwindow_check_synchronise(MainWindow *mainwin, gboolean ask)
 
        if (offline_ask_sync && ask && alertpanel(_("Folder synchronisation"),
                        _("Do you want to synchronise your folders now?"),
 
        if (offline_ask_sync && ask && alertpanel(_("Folder synchronisation"),
                        _("Do you want to synchronise your folders now?"),
-                       GTK_STOCK_CANCEL, g_strconcat("+", _("_Synchronise"), NULL), NULL) != G_ALERTALTERNATE)
+                       GTK_STOCK_CANCEL, _("_Synchronise"), NULL, ALERTFOCUS_SECOND) != G_ALERTALTERNATE)
                return;
        
        if (offline_ask_sync)
                return;
        
        if (offline_ask_sync)
index 606663f574fcfc77a204c1ca49687912004b2155..e2c51ccc66a566bcbbaebc70ece48cc16ccfa542 100644 (file)
@@ -548,8 +548,8 @@ gint export_list_to_mbox(GSList *mlist, const gchar *mbox)
        if (g_file_test(mbox, G_FILE_TEST_EXISTS) == TRUE) {
                if (alertpanel_full(_("Overwrite mbox file"),
                                        _("This file already exists. Do you want to overwrite it?"),
        if (g_file_test(mbox, G_FILE_TEST_EXISTS) == TRUE) {
                if (alertpanel_full(_("Overwrite mbox file"),
                                        _("This file already exists. Do you want to overwrite it?"),
-                                       GTK_STOCK_CANCEL, _("Overwrite"), NULL, FALSE,
-                                       NULL, ALERT_WARNING, G_ALERTDEFAULT)
+                                       GTK_STOCK_CANCEL, _("Overwrite"), NULL,
+                                       ALERTFOCUS_FIRST, FALSE, NULL, ALERT_WARNING)
                                != G_ALERTALTERNATE) {
                        return -2;
                }
                                != G_ALERTALTERNATE) {
                        return -2;
                }
index c7f9299b4d72eae005f9720589416c7a0dc31f11..1f50a22d8c58281d990327f3cd6687a30cd01a30 100644 (file)
@@ -306,7 +306,7 @@ static void message_search_execute(gboolean backward)
                        alertpanel_full(_("Search failed"),
                                        _("Search string not found."),
                                         GTK_STOCK_CLOSE, NULL, NULL, FALSE,
                        alertpanel_full(_("Search failed"),
                                        _("Search string not found."),
                                         GTK_STOCK_CLOSE, NULL, NULL, FALSE,
-                                        NULL, ALERT_WARNING, G_ALERTDEFAULT);
+                                        ALERTFOCUS_FIRST, NULL, ALERT_WARNING);
                        break;
                }
 
                        break;
                }
 
@@ -320,7 +320,7 @@ static void message_search_execute(gboolean backward)
                                "continue from beginning?");
 
                val = alertpanel(_("Search finished"), str,
                                "continue from beginning?");
 
                val = alertpanel(_("Search finished"), str,
-                                GTK_STOCK_NO, "+" GTK_STOCK_YES, NULL);
+                                GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_SECOND);
                if (G_ALERTALTERNATE == val) {
                        manage_window_focus_in(search_window.window,
                                               NULL, NULL);
                if (G_ALERTALTERNATE == val) {
                        manage_window_focus_in(search_window.window,
                                               NULL, NULL);
index 0fadb623bdf808fec5d2a002c88f5bc3c565e34e..4dfb090e1c4524cd91c8d1823db0711ee07cd105 100644 (file)
@@ -853,8 +853,8 @@ static gint disposition_notification_send(MsgInfo *msginfo)
                    "It is advised to not send the return receipt."),
                  to, buf);
                val = alertpanel_full(_("Warning"), message,
                    "It is advised to not send the return receipt."),
                  to, buf);
                val = alertpanel_full(_("Warning"), message,
-                               _("_Don't Send"), _("_Send"), NULL, FALSE,
-                               NULL, ALERT_WARNING, G_ALERTDEFAULT);
+                               _("_Don't Send"), _("_Send"), NULL, ALERTFOCUS_FIRST, FALSE,
+                               NULL, ALERT_WARNING);
                g_free(message);                                
                if (val != G_ALERTALTERNATE) {
                        g_free(buf);
                g_free(message);                                
                if (val != G_ALERTALTERNATE) {
                        g_free(buf);
@@ -881,8 +881,8 @@ static gint disposition_notification_send(MsgInfo *msginfo)
                  prefs_common_translated_header_name("Cc"));
                val = alertpanel_full(_("Warning"),
                  text,
                  prefs_common_translated_header_name("Cc"));
                val = alertpanel_full(_("Warning"),
                  text,
-                 _("_Don't Send"), _("_Send"), NULL, FALSE,
-                 NULL, ALERT_WARNING, G_ALERTDEFAULT);
+                 _("_Don't Send"), _("_Send"), NULL, ALERTFOCUS_FIRST, FALSE,
+                 NULL, ALERT_WARNING);
                g_free(text);
                g_free(tr);
                if (val != G_ALERTALTERNATE)
                g_free(text);
                g_free(tr);
                if (val != G_ALERTALTERNATE)
@@ -1863,7 +1863,7 @@ static void messageview_save_as(MessageView *messageview)
 
                aval = alertpanel(_("Overwrite"),
                                  _("Overwrite existing file?"),
 
                aval = alertpanel(_("Overwrite"),
                                  _("Overwrite existing file?"),
-                                 GTK_STOCK_CANCEL, GTK_STOCK_OK, NULL);
+                                 GTK_STOCK_CANCEL, GTK_STOCK_OK, NULL, ALERTFOCUS_FIRST);
                if (G_ALERTALTERNATE != aval) return;
        }
 
                if (G_ALERTALTERNATE != aval) return;
        }
 
@@ -2114,8 +2114,8 @@ static PrefsAccount *select_account_from_list(GList *ac_list)
                                  "address that this message was sent to.\n"
                                  "Please choose which account you want to "
                                  "use for sending the receipt notification:"),
                                  "address that this message was sent to.\n"
                                  "Please choose which account you want to "
                                  "use for sending the receipt notification:"),
-                               _("_Cancel"), _("_Send Notification"), NULL,
-                               FALSE, G_ALERTDEFAULT, optmenu) != G_ALERTALTERNATE)
+                               _("_Cancel"), _("_Send Notification"), NULL, ALERTFOCUS_FIRST,
+                               FALSE, optmenu) != G_ALERTALTERNATE)
                return NULL;
        return account_find_from_id(account_id);
 }
                return NULL;
        return account_find_from_id(account_id);
 }
index f4525be9690e06d407cd33c74c84e95cf699a815..3b1b7a062a66f497d707b4640a304d59b893857c 100644 (file)
@@ -204,8 +204,8 @@ static void delete_folder_cb(GtkAction *action, gpointer data)
                   "Recovery will not be possible.\n\n"
                   "Do you really want to delete?"), name);
        avalue = alertpanel_full(_("Delete folder"), message,
                   "Recovery will not be possible.\n\n"
                   "Do you really want to delete?"), name);
        avalue = alertpanel_full(_("Delete folder"), message,
-                                GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, FALSE,
-                                NULL, ALERT_WARNING, G_ALERTDEFAULT);
+                                GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, ALERTFOCUS_FIRST, FALSE,
+                                NULL, ALERT_WARNING);
        g_free(message);
        if (avalue != G_ALERTALTERNATE) return;
 
        g_free(message);
        if (avalue != G_ALERTALTERNATE) return;
 
@@ -372,8 +372,8 @@ static void remove_mailbox_cb(GtkAction *action, gpointer data)
                (_("Really remove the mailbox '%s'?\n"
                   "(The messages are NOT deleted from the disk)"), name);
        avalue = alertpanel_full(_("Remove mailbox"), message,
                (_("Really remove the mailbox '%s'?\n"
                   "(The messages are NOT deleted from the disk)"), name);
        avalue = alertpanel_full(_("Remove mailbox"), message,
-                                GTK_STOCK_CANCEL, _("_Remove"), NULL, FALSE,
-                                NULL, ALERT_WARNING, G_ALERTDEFAULT);
+                                GTK_STOCK_CANCEL, _("_Remove"), NULL, ALERTFOCUS_FIRST, FALSE,
+                                NULL, ALERT_WARNING);
                            
        g_free(message);
        g_free(name);
                            
        g_free(message);
        g_free(name);
index 53f0d0fe10171a11e0cec51b8f83a7de97384860..dbb6259a9f095b6d6d14a57ff178f424bcb66783 100644 (file)
@@ -1839,7 +1839,7 @@ static gboolean mimeview_write_part(const gchar *filename,
                                      tmp);
                g_free(tmp);
                aval = alertpanel(_("Overwrite"), res, GTK_STOCK_CANCEL,
                                      tmp);
                g_free(tmp);
                aval = alertpanel(_("Overwrite"), res, GTK_STOCK_CANCEL,
-                                 GTK_STOCK_OK, NULL);
+                                 GTK_STOCK_OK, NULL, ALERTFOCUS_FIRST);
                g_free(res);
                if (G_ALERTALTERNATE != aval) return FALSE;
        }
                g_free(res);
                if (G_ALERTALTERNATE != aval) return FALSE;
        }
@@ -1864,7 +1864,7 @@ static AlertValue mimeview_save_all_error_ask(gint n)
                "continue?"), n);
        AlertValue av = alertpanel_full(_("Error saving all message parts"),
                message, GTK_STOCK_CANCEL, _("Skip"), _("Skip all"),
                "continue?"), n);
        AlertValue av = alertpanel_full(_("Error saving all message parts"),
                message, GTK_STOCK_CANCEL, _("Skip"), _("Skip all"),
-               FALSE, NULL, ALERT_WARNING, G_ALERTDEFAULT);
+               ALERTFOCUS_FIRST, FALSE, NULL, ALERT_WARNING);
        g_free(message);
        return av;
 }
        g_free(message);
        return av;
 }
index e49c2b8c40e94fb3ce4d7ec5319f898bb0d6fa5e..cc9236fe55e27bf4e798c20a7bb53b75ec0ba62e 100644 (file)
@@ -249,8 +249,8 @@ static void unsubscribe_newsgroup_cb(GtkAction *action, gpointer data)
        name = trim_string(item->path, 32);
        message = g_strdup_printf(_("Really unsubscribe newsgroup '%s'?"), name);
        avalue = alertpanel_full(_("Unsubscribe newsgroup"), message,
        name = trim_string(item->path, 32);
        message = g_strdup_printf(_("Really unsubscribe newsgroup '%s'?"), name);
        avalue = alertpanel_full(_("Unsubscribe newsgroup"), message,
-                                GTK_STOCK_CANCEL, _("_Unsubscribe"), NULL, FALSE,
-                                NULL, ALERT_WARNING, G_ALERTDEFAULT);
+                                GTK_STOCK_CANCEL, _("_Unsubscribe"), NULL,
+                                                        ALERTFOCUS_FIRST, FALSE, NULL, ALERT_WARNING);
        g_free(message);
        g_free(name);
        if (avalue != G_ALERTALTERNATE) return;
        g_free(message);
        g_free(name);
        if (avalue != G_ALERTALTERNATE) return;
index aa9e1b3f6ea9b3a0e96315d3e09338cfd0f78435..c7982531fb55f3e388f99d51ec6ebdebef5e82ef 100644 (file)
@@ -571,8 +571,8 @@ static gboolean archiver_save_files(struct ArchivePage* page) {
                        AlertValue aval;
 
                        aval = alertpanel_full(_("Creating archive"), msg,
                        AlertValue aval;
 
                        aval = alertpanel_full(_("Creating archive"), msg,
-                               GTK_STOCK_CANCEL, GTK_STOCK_OK, NULL, FALSE,
-                               NULL, ALERT_WARNING, G_ALERTDEFAULT);
+                               GTK_STOCK_CANCEL, GTK_STOCK_OK, NULL, ALERTFOCUS_FIRST, FALSE,
+                               NULL, ALERT_WARNING);
                        g_free(msg);
                        if (aval != G_ALERTALTERNATE)
                                return FALSE;
                        g_free(msg);
                        if (aval != G_ALERTALTERNATE)
                                return FALSE;
@@ -618,8 +618,8 @@ static gboolean archiver_save_files(struct ArchivePage* page) {
                                  "\nContinue anyway?"),
                                orig_file, g_slist_length(list));
                aval = alertpanel_full(_("Creating archive"), msg,
                                  "\nContinue anyway?"),
                                orig_file, g_slist_length(list));
                aval = alertpanel_full(_("Creating archive"), msg,
-                       GTK_STOCK_CANCEL, GTK_STOCK_OK, NULL, FALSE,
-                       NULL, ALERT_WARNING, G_ALERTDEFAULT);
+                       GTK_STOCK_CANCEL, GTK_STOCK_OK, NULL, ALERTFOCUS_FIRST, FALSE,
+                       NULL, ALERT_WARNING);
                g_free(msg);
                if (aval != G_ALERTALTERNATE) {
                        archive_free_file_list(page->md5, page->rename);
                g_free(msg);
                if (aval != G_ALERTALTERNATE) {
                        archive_free_file_list(page->md5, page->rename);
index 0946bb12ccfbecc4a586e3fa1bcae5e12c794eb0..b8a3cdefb5d7f0b9cd2a96b8718589b8f61758dd 100644 (file)
@@ -423,8 +423,8 @@ static void remove_attachments(GSList *msglist)
                   _("Do you really want to remove all attachments from "
                   "the selected messages?\n\n"
                  "The deleted data will be unrecoverable."), 
                   _("Do you really want to remove all attachments from "
                   "the selected messages?\n\n"
                  "The deleted data will be unrecoverable."), 
-                 GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL,
-                  FALSE, NULL, ALERT_QUESTION, G_ALERTALTERNATE) != G_ALERTALTERNATE)
+                 GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, ALERTFOCUS_SECOND,
+                  FALSE, NULL, ALERT_QUESTION) != G_ALERTALTERNATE)
                return;
 
        main_window_cursor_wait(summaryview->mainwin);
                return;
 
        main_window_cursor_wait(summaryview->mainwin);
index 4dd8f96eccf39e1a8809c1a1fc0b85f2e819bf81..7ada74b13a3ed92fcbf572cd892e2e2b27a2617c 100644 (file)
@@ -201,16 +201,9 @@ static gboolean attwarn_before_send_hook(gpointer source, gpointer data)
        mention = are_attachments_mentioned(compose); 
        if (does_not_have_attachments(compose) && mention != NULL) { 
                AlertValue aval;
        mention = are_attachments_mentioned(compose); 
        if (does_not_have_attachments(compose) && mention != NULL) { 
                AlertValue aval;
-               gchar *button_label;
                gchar *message;
                gchar *bold_text;
                
                gchar *message;
                gchar *bold_text;
                
-               debug_print("user has to decide\n");
-               if (compose->sending)
-                       button_label = g_strconcat("+", _("_Send"), NULL);
-               else
-                       button_label = g_strconcat("+", _("_Queue"), NULL);
-
                bold_text = g_strdup_printf("<span weight=\"bold\">%.20s</span>...",
                                mention->context);
                message = g_strdup_printf(
                bold_text = g_strdup_printf("<span weight=\"bold\">%.20s</span>...",
                                mention->context);
                message = g_strdup_printf(
@@ -221,10 +214,12 @@ static gboolean attwarn_before_send_hook(gpointer source, gpointer data)
                                bold_text,
                                compose->sending?_("Send it anyway?"):_("Queue it anyway?"));
                aval = alertpanel(_("Attachment warning"), message,
                                bold_text,
                                compose->sending?_("Send it anyway?"):_("Queue it anyway?"));
                aval = alertpanel(_("Attachment warning"), message,
-                                 GTK_STOCK_CANCEL, button_label, NULL);
+                                 GTK_STOCK_CANCEL,
+                                       compose->sending ? _("_Send") : _("Queue"),
+                                       NULL,
+                                       ALERTFOCUS_SECOND);
                g_free(message);
                g_free(bold_text);
                g_free(message);
                g_free(bold_text);
-               g_free(button_label);
                if (aval != G_ALERTALTERNATE)
                        return TRUE;
        }
                if (aval != G_ALERTALTERNATE)
                        return TRUE;
        }
index c70305a456e2da8a22b02e9152651542a804bbf5..84e4fd9d90e9a5b41e2b33014afef3c577de12f3 100644 (file)
@@ -163,8 +163,8 @@ static void cache_clean_button_clicked_cb(GtkButton *button, gpointer data)
 
        val = alertpanel_full(_("Clear icon cache"),
                        _("Are you sure you want to remove all cached avatar icons?"),
 
        val = alertpanel_full(_("Clear icon cache"),
                        _("Are you sure you want to remove all cached avatar icons?"),
-                       GTK_STOCK_NO, GTK_STOCK_YES, NULL, FALSE,
-                       NULL, ALERT_WARNING, G_ALERTDEFAULT);
+                       GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_FIRST, FALSE,
+                       NULL, ALERT_WARNING);
        if (val != G_ALERTALTERNATE)
                return;
 
        if (val != G_ALERTALTERNATE)
                return;
 
index d567ec83b54dc135759558f7d24a58439198f9e5..166055c742a7703df2740547d037158e91df55c0 100644 (file)
@@ -298,8 +298,8 @@ static void remove_mailbox_cb(GtkAction *action, gpointer data)
                (_("Really remove the mailbox '%s'?\n"
                   "(The messages are NOT deleted from the disk)"), name);
        avalue = alertpanel_full(_("Remove mailbox"), message,
                (_("Really remove the mailbox '%s'?\n"
                   "(The messages are NOT deleted from the disk)"), name);
        avalue = alertpanel_full(_("Remove mailbox"), message,
-                                GTK_STOCK_CANCEL, _("_Remove"), NULL, FALSE,
-                                NULL, ALERT_WARNING, G_ALERTDEFAULT);
+                                GTK_STOCK_CANCEL, _("_Remove"), NULL, ALERTFOCUS_FIRST, FALSE,
+                                NULL, ALERT_WARNING);
        g_free(message);
        g_free(name);
        if (avalue != G_ALERTALTERNATE) return;
        g_free(message);
        g_free(name);
        if (avalue != G_ALERTALTERNATE) return;
@@ -330,8 +330,8 @@ static void delete_folder_cb(GtkAction *action, gpointer data)
                (_("All folders and messages under '%s' will be deleted.\n"
                   "Do you really want to delete?"), name);
        avalue = alertpanel_full(_("Delete folder"), message,
                (_("All folders and messages under '%s' will be deleted.\n"
                   "Do you really want to delete?"), name);
        avalue = alertpanel_full(_("Delete folder"), message,
-                                GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, FALSE,
-                                NULL, ALERT_NOTICE, G_ALERTDEFAULT);
+                                GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, ALERTFOCUS_FIRST, FALSE,
+                                NULL, ALERT_NOTICE);
        g_free(message);
        if (avalue != G_ALERTALTERNATE) return;
 
        g_free(message);
        if (avalue != G_ALERTALTERNATE) return;
 
index 2247981411af46c67acbbba32ef60db623c5c08b..d32265240d67e8bfe1c47216f2438a79ba10634a 100644 (file)
@@ -333,7 +333,7 @@ static void sieve_editor_revert_cb(GtkAction *action, SieveEditorPage *page)
        if (!page->modified ||
                        alertpanel(_("Revert script"),
                                _("This script has been modified. Revert the unsaved changes?"),
        if (!page->modified ||
                        alertpanel(_("Revert script"),
                                _("This script has been modified. Revert the unsaved changes?"),
-                               _("_Revert"), NULL, GTK_STOCK_CANCEL) == G_ALERTDEFAULT)
+                               _("_Revert"), NULL, GTK_STOCK_CANCEL, ALERTFOCUS_FIRST) == G_ALERTDEFAULT)
                sieve_editor_revert(page);
 }
 
                sieve_editor_revert(page);
 }
 
@@ -430,7 +430,8 @@ static gboolean sieve_editor_confirm_close(SieveEditorPage *page)
        if (page->modified) {
                switch (alertpanel(_("Save changes"),
                                _("This script has been modified. Save the latest changes?"),
        if (page->modified) {
                switch (alertpanel(_("Save changes"),
                                _("This script has been modified. Save the latest changes?"),
-                               _("_Discard"), g_strconcat("+", _("_Save"), NULL), GTK_STOCK_CANCEL)) {
+                               _("_Discard"), _("_Save"), GTK_STOCK_CANCEL,
+                               ALERTFOCUS_SECOND)) {
                        case G_ALERTDEFAULT:
                                return TRUE;
                        case G_ALERTALTERNATE:
                        case G_ALERTDEFAULT:
                                return TRUE;
                        case G_ALERTALTERNATE:
index 3120d7e0f5a08a82b7cfbab319d25e639d05c935..7635c8b80d770c53199e1449f3990012c1c75783 100644 (file)
@@ -322,8 +322,8 @@ static void filter_delete(GtkWidget *widget, SieveManagerPage *page)
        g_snprintf(buf, sizeof(buf),
                   _("Do you really want to delete the filter '%s'?"), filter_name);
        if (alertpanel_full(_("Delete filter"), buf,
        g_snprintf(buf, sizeof(buf),
                   _("Do you really want to delete the filter '%s'?"), filter_name);
        if (alertpanel_full(_("Delete filter"), buf,
-                               GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, FALSE,
-                               NULL, ALERT_WARNING, G_ALERTDEFAULT) != G_ALERTALTERNATE)
+                               GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, ALERTFOCUS_FIRST, FALSE,
+                               NULL, ALERT_WARNING) != G_ALERTALTERNATE)
                return;
 
        cmd_data = g_new(CommandDataName, 1);
                return;
 
        cmd_data = g_new(CommandDataName, 1);
index b019405100bd3fccf22e5fa990d13f9171dc71f7..0c37e41b599945b189bb281628ca68e0f99e3b33 100644 (file)
@@ -549,7 +549,7 @@ static void app_exit_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
   if(prefs_common_get_prefs()->confirm_on_exit) {
     if(alertpanel(_("Exit"), _("Exit Claws Mail?"),
                  GTK_STOCK_CANCEL, GTK_STOCK_OK,
   if(prefs_common_get_prefs()->confirm_on_exit) {
     if(alertpanel(_("Exit"), _("Exit Claws Mail?"),
                  GTK_STOCK_CANCEL, GTK_STOCK_OK,
-                 NULL) != G_ALERTALTERNATE) {
+                 NULL, ALERTFOCUS_FIRST) != G_ALERTALTERNATE) {
       return;
     }
     manage_window_focus_in(mainwin->window, NULL, NULL);
       return;
     }
     manage_window_focus_in(mainwin->window, NULL, NULL);
index 60f4a49abd31d79ad028937c99688f7d7b17927c..effd9114165104dd56339b9963cee4c3d0aa1736 100644 (file)
@@ -1204,8 +1204,9 @@ static void pdf_viewer_button_print_cb(GtkButton *button, PdfViewer *viewer)
 static void pdf_viewer_button_document_info_cb(GtkButton *button, PdfViewer *viewer)
 {
        alertpanel_full(_("PDF properties"), NULL, GTK_STOCK_CLOSE, NULL, NULL,
 static void pdf_viewer_button_document_info_cb(GtkButton *button, PdfViewer *viewer)
 {
        alertpanel_full(_("PDF properties"), NULL, GTK_STOCK_CLOSE, NULL, NULL,
-                       FALSE, (GtkWidget *) pdf_viewer_fill_info_table(viewer), 
-                       ALERT_NOTICE, G_ALERTDEFAULT);
+                       ALERTFOCUS_FIRST, FALSE,
+                       GTK_WIDGET(pdf_viewer_fill_info_table(viewer)), 
+                       ALERT_NOTICE);
 }
 
 /*
 }
 
 /*
index fc265551178c8fbd62cd58ebd3f0afddf39b80eb..1854eb073aa99567e4d4d7a93e0ecec941982d3c 100644 (file)
@@ -1606,7 +1606,8 @@ static int perl_load_file(void)
     message = g_strdup_printf("Error processing Perl script file: "
             "(line numbers may not be valid)\n%s",
             SvPV(ERRSV,n_a));
     message = g_strdup_printf("Error processing Perl script file: "
             "(line numbers may not be valid)\n%s",
             SvPV(ERRSV,n_a));
-    val = alertpanel("Perl Plugin error",message,"Retry","Abort","Edit");
+    val = alertpanel("Perl Plugin error",message,"Retry","Abort","Edit",
+                               ALERTFOCUS_FIRST);
     g_free(message);
 
     if(val == G_ALERTOTHER) {
     g_free(message);
 
     if(val == G_ALERTOTHER) {
index 6826c4b2a42edeac7c7639bbd55bf9fe7c706757..45eef3ce700d1cbe628f49d12aca3546e7bb2342 100644 (file)
@@ -174,7 +174,7 @@ static void pgpview_show_mime_part(TextView *textview, MimeInfo *partinfo)
                                _("This key is not in your keyring. Do you want "
                                  "Claws Mail to try and import it from a "
                                  "keyserver?"),
                                _("This key is not in your keyring. Do you want "
                                  "Claws Mail to try and import it from a "
                                  "keyserver?"),
-                                 GTK_STOCK_NO, "+" GTK_STOCK_YES, NULL);
+                                 GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_SECOND);
                        GTK_EVENTS_FLUSH();
                }
                if (val == G_ALERTDEFAULT) {
                        GTK_EVENTS_FLUSH();
                }
                if (val == G_ALERTDEFAULT) {
index e532a33ae1362d6266b5cb3b129f83ec9131c7db..ec1ec4a8132ead94e1c6e0c3c3629c28c8302ccb 100644 (file)
@@ -623,9 +623,8 @@ use_untrusted (gpgme_key_t key, gpgme_user_id_t uid, gpgme_protocol_t proto)
               "Key details: ID %s, primary identity %s <%s>\n\n"
               "Do you trust this key enough to use it anyway?"), 
               key->subkeys->keyid, key->uids->name, key->uids->email);
               "Key details: ID %s, primary identity %s <%s>\n\n"
               "Do you trust this key enough to use it anyway?"), 
               key->subkeys->keyid, key->uids->name, key->uids->email);
-    aval = alertpanel
-           (title, buf,
-            GTK_STOCK_NO, GTK_STOCK_YES, NULL);
+    aval = alertpanel(title, buf,
+            GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_FIRST);
     g_free(buf);
     g_free(title);
     if (aval == G_ALERTALTERNATE)
     g_free(buf);
     g_free(title);
     if (aval == G_ALERTALTERNATE)
index 11bd25bfebfbf3c9c73786ffebc1cc02e614be0c..f79c8b6304a0fbf7315bf4026fb0af50942d55fb 100644 (file)
@@ -807,8 +807,8 @@ void sgpgme_init()
                                 _("GnuPG is not installed properly, or needs "
                                 "to be upgraded.\n"
                                 "OpenPGP support disabled."),
                                 _("GnuPG is not installed properly, or needs "
                                 "to be upgraded.\n"
                                 "OpenPGP support disabled."),
-                                GTK_STOCK_CLOSE, NULL, NULL, TRUE, NULL,
-                                ALERT_WARNING, G_ALERTDEFAULT);
+                                GTK_STOCK_CLOSE, NULL, NULL, ALERTFOCUS_FIRST, TRUE, NULL,
+                                ALERT_WARNING);
                        if (val & G_ALERTDISABLE)
                                prefs_gpg_get_config()->gpg_warning = FALSE;
                }
                        if (val & G_ALERTDISABLE)
                                prefs_gpg_get_config()->gpg_warning = FALSE;
                }
@@ -891,7 +891,7 @@ void sgpgme_create_secret_key(PrefsAccount *account, gboolean ask_create)
                                  "which means that you won't be able to sign "
                                  "emails or receive encrypted emails.\n"
                                  "Do you want to create a new key pair now?"),
                                  "which means that you won't be able to sign "
                                  "emails or receive encrypted emails.\n"
                                  "Do you want to create a new key pair now?"),
-                                 GTK_STOCK_NO, "+" GTK_STOCK_YES, NULL);
+                                 GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_SECOND);
                if (val == G_ALERTDEFAULT) {
                        return;
                }
                if (val == G_ALERTDEFAULT) {
                        return;
                }
@@ -1013,7 +1013,7 @@ again:
                                    "to a keyserver?"),
                                    key->fpr ? key->fpr:"null");
                AlertValue val = alertpanel(_("Key generated"), buf,
                                    "to a keyserver?"),
                                    key->fpr ? key->fpr:"null");
                AlertValue val = alertpanel(_("Key generated"), buf,
-                                 GTK_STOCK_NO, "+" GTK_STOCK_YES, NULL);
+                                 GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_SECOND);
                g_free(buf);
                if (val == G_ALERTALTERNATE) {
                        gchar *gpgbin = get_gpg_executable_name();
                g_free(buf);
                if (val == G_ALERTALTERNATE) {
                        gchar *gpgbin = get_gpg_executable_name();
index 3237e97a6dd6faa564610ac109afee3d4adb934e..304d13358f2e8b21a52f18f23a9b95100a6f0f88 100644 (file)
@@ -153,8 +153,8 @@ void rssyl_remove_folder_cb(GtkAction *action,
                   "Recovery will not be possible.\n\n"
                   "Do you really want to delete?"), name);
        avalue = alertpanel_full(_("Delete folder"), message,
                   "Recovery will not be possible.\n\n"
                   "Do you really want to delete?"), name);
        avalue = alertpanel_full(_("Delete folder"), message,
-                                GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, FALSE,
-                                NULL, ALERT_WARNING, G_ALERTDEFAULT);
+                                GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, ALERTFOCUS_FIRST, FALSE,
+                                NULL, ALERT_WARNING);
        g_free(message);
        if (avalue != G_ALERTALTERNATE) return;
 
        g_free(message);
        if (avalue != G_ALERTALTERNATE) return;
 
@@ -313,8 +313,8 @@ void rssyl_remove_mailbox_cb(GtkAction *action, gpointer data)
        n = trim_string(item->folder->name, 32);
        message = g_strdup_printf(_("Really remove the feed tree `%s' ?\n"), n);
        avalue = alertpanel_full(_("Remove feed tree"), message,
        n = trim_string(item->folder->name, 32);
        message = g_strdup_printf(_("Really remove the feed tree `%s' ?\n"), n);
        avalue = alertpanel_full(_("Remove feed tree"), message,
-                                GTK_STOCK_CANCEL, _("_Remove"), NULL, FALSE,
-                                NULL, ALERT_WARNING, G_ALERTDEFAULT);
+                                GTK_STOCK_CANCEL, _("_Remove"), NULL, ALERTFOCUS_FIRST, FALSE,
+                                NULL, ALERT_WARNING);
        g_free(message);
        g_free(n);
 
        g_free(message);
        g_free(n);
 
index 985534c251c87dc1db7f67811aa6ae0829e9003a..1c987bd5265a85037a5e98d25ffe4f3f0eaa7bdc 100644 (file)
@@ -1985,8 +1985,8 @@ static void unsubscribe_cal_cb(GtkAction *action, gpointer data)
        message = g_strdup_printf
                (_("Do you really want to unsubscribe?"));
        avalue = alertpanel_full(_("Delete subscription"), message,
        message = g_strdup_printf
                (_("Do you really want to unsubscribe?"));
        avalue = alertpanel_full(_("Delete subscription"), message,
-                                GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, 
-                                FALSE, NULL, ALERT_WARNING, G_ALERTDEFAULT);
+                                GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, ALERTFOCUS_FIRST, 
+                                FALSE, NULL, ALERT_WARNING);
        g_free(message);
        if (avalue != G_ALERTALTERNATE) return;
 
        g_free(message);
        if (avalue != G_ALERTALTERNATE) return;
 
index 898f5e982b988f3a5421ad1c7169c28ac43bfb1e..eeae3804a403eeb62a17d72deb829301fe83a7b3 100644 (file)
@@ -967,8 +967,8 @@ static gboolean find_availability(const gchar *dtstart, const gchar *dtend, GSLi
                msg = get_avail_msg(unavailable_persons, (total > 1), FALSE, offset_before, offset_after);
 
                val = alertpanel_full(_("Not everyone is available"), msg,
                msg = get_avail_msg(unavailable_persons, (total > 1), FALSE, offset_before, offset_after);
 
                val = alertpanel_full(_("Not everyone is available"), msg,
-                                       GTK_STOCK_CANCEL, _("Send anyway"), NULL, FALSE,
-                                       NULL, ALERT_QUESTION, G_ALERTDEFAULT);
+                                       GTK_STOCK_CANCEL, _("Send anyway"), NULL, ALERTFOCUS_FIRST,
+                                               FALSE, NULL, ALERT_QUESTION);
                g_free(msg);
        }
        msg = get_avail_msg(unavailable_persons, TRUE, TRUE, offset_before, offset_after);
                g_free(msg);
        }
        msg = get_avail_msg(unavailable_persons, TRUE, TRUE, offset_before, offset_after);
@@ -1887,8 +1887,8 @@ gboolean vcal_meeting_alert_check(gpointer data)
                                                 postpone_min > 1 ? 2:1), 
                                                 postpone_min);
                        aval = alertpanel_full(title, message,
                                                 postpone_min > 1 ? 2:1), 
                                                 postpone_min);
                        aval = alertpanel_full(title, message,
-                                       label, GTK_STOCK_OK, NULL, FALSE,
-                                       NULL, ALERT_NOTICE, G_ALERTDEFAULT);
+                                       label, GTK_STOCK_OK, NULL, ALERTFOCUS_FIRST, FALSE,
+                                       NULL, ALERT_NOTICE);
                        g_free(label);
 
                        g_free(title);
                        g_free(label);
 
                        g_free(title);
@@ -2011,8 +2011,8 @@ gboolean vcal_meeting_export_calendar(const gchar *path,
                if (!automatic) {
                        alertpanel_full(_("Empty calendar"),
                                        _("There is nothing to export."),
                if (!automatic) {
                        alertpanel_full(_("Empty calendar"),
                                        _("There is nothing to export."),
-                                       GTK_STOCK_OK, NULL, NULL, FALSE,
-                                       NULL, ALERT_NOTICE, G_ALERTDEFAULT);
+                                       GTK_STOCK_OK, NULL, NULL, ALERTFOCUS_FIRST, FALSE,
+                               NULL, ALERT_NOTICE);
                        return FALSE;
                } else {
                        str_write_to_file("", tmpfile);
                        return FALSE;
                } else {
                        str_write_to_file("", tmpfile);
index 28840606893c1d68eaa94501cae8cf28bd83082f..88c2fea1f20843135cf501838ac4ee0cfc16ab9c 100644 (file)
@@ -121,7 +121,8 @@ static void create_meeting_from_message_cb_ui(GtkAction *action, gpointer data)
                                       "want to continue?"), 
                                       total);
        if (total > 9
                                       "want to continue?"), 
                                       total);
        if (total > 9
-       &&  alertpanel(_("Warning"), msg, GTK_STOCK_CANCEL, "+" GTK_STOCK_YES, NULL)
+       &&  alertpanel(_("Warning"), msg, GTK_STOCK_CANCEL, GTK_STOCK_YES, NULL,
+               ALERTFOCUS_SECOND)
            != G_ALERTALTERNATE) {
                g_free(msg);
                return;
            != G_ALERTALTERNATE) {
                g_free(msg);
                return;
@@ -986,8 +987,8 @@ void vcalendar_cancel_meeting(FolderItem *item, const gchar *uid)
 
        val = alertpanel_full(_("Cancel meeting"),
                                   _("Are you sure you want to cancel this meeting?"),
 
        val = alertpanel_full(_("Cancel meeting"),
                                   _("Are you sure you want to cancel this meeting?"),
-                                  GTK_STOCK_NO, GTK_STOCK_YES, NULL, FALSE,
-                                  send_notify_chkbtn, ALERT_WARNING, G_ALERTDEFAULT);
+                                  GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_FIRST, FALSE,
+                                  send_notify_chkbtn, ALERT_WARNING);
 
        if (val != G_ALERTALTERNATE)
                return;
 
        if (val != G_ALERTALTERNATE)
                return;
@@ -1083,8 +1084,8 @@ static gboolean vcalviewer_action_cb(GtkButton *widget, gpointer data)
                AlertValue val = alertpanel_full(_("No account found"), 
                                        _("You have no account matching any attendee.\n"
                                            "Do you want to reply anyway?"),
                AlertValue val = alertpanel_full(_("No account found"), 
                                        _("You have no account matching any attendee.\n"
                                            "Do you want to reply anyway?"),
-                                       GTK_STOCK_CANCEL, g_strconcat("+", _("Reply anyway"), NULL),
-                                       NULL, FALSE, NULL, ALERT_QUESTION, G_ALERTDEFAULT);
+                                       GTK_STOCK_CANCEL, _("Reply anyway"), NULL,
+                                               ALERTFOCUS_SECOND, FALSE, NULL, ALERT_QUESTION);
                if (val == G_ALERTALTERNATE) {          
                        account = account_get_default();
                        vcal_manager_update_answer(event, account->address, 
                if (val == G_ALERTALTERNATE) {          
                        account = account_get_default();
                        vcal_manager_update_answer(event, account->address, 
index d5288b4026dfab0ad896f6d3eb3c9a8e45944c7a..b4e4198ce119bfb37957a4255713ae8f7cdb9db8 100644 (file)
@@ -706,7 +706,7 @@ static void prefs_actions_delete_cb(gpointer gtk_action, gpointer data)
 
        if (alertpanel(_("Delete action"),
                       _("Do you really want to delete this action?"),
 
        if (alertpanel(_("Delete action"),
                       _("Do you really want to delete this action?"),
-                      GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL) != G_ALERTALTERNATE)
+                      GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, ALERTFOCUS_FIRST) != G_ALERTALTERNATE)
                return;
 
        /* XXX: Here's the reason why we need to store the original 
                return;
 
        /* XXX: Here's the reason why we need to store the original 
@@ -727,7 +727,7 @@ static void prefs_actions_delete_all_cb(gpointer gtk_action, gpointer data)
 
        if (alertpanel(_("Delete all actions"),
                          _("Do you really want to delete all the actions?"),
 
        if (alertpanel(_("Delete all actions"),
                          _("Do you really want to delete all the actions?"),
-                         GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL) != G_ALERTDEFAULT)
+                         GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, ALERTFOCUS_FIRST) != G_ALERTDEFAULT)
           return;
 
        list_store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(actions.actions_list_view)));
           return;
 
        list_store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(actions.actions_list_view)));
@@ -891,13 +891,13 @@ static void prefs_actions_cancel(GtkWidget *w, gpointer data)
 
        if (modified && alertpanel(_("Entry not saved"),
                                 _("The entry was not saved. Close anyway?"),
 
        if (modified && alertpanel(_("Entry not saved"),
                                 _("The entry was not saved. Close anyway?"),
-                                GTK_STOCK_CLOSE, g_strconcat("+", _("_Continue editing"), NULL),
-                                NULL) != G_ALERTDEFAULT) {
+                                GTK_STOCK_CLOSE, _("_Continue editing"), NULL,
+                                ALERTFOCUS_SECOND) != G_ALERTDEFAULT) {
                return;
        } else if (modified_list && alertpanel(_("Actions list not saved"),
                                 _("The actions list has been modified. Close anyway?"),
                return;
        } else if (modified_list && alertpanel(_("Actions list not saved"),
                                 _("The actions list has been modified. Close anyway?"),
-                                GTK_STOCK_CLOSE, g_strconcat("+", _("_Continue editing"), NULL),
-                                NULL) != G_ALERTDEFAULT) {
+                                GTK_STOCK_CLOSE, _("_Continue editing"), NULL,
+                                ALERTFOCUS_SECOND) != G_ALERTDEFAULT) {
                return;
        }
        modified = FALSE;
                return;
        }
        modified = FALSE;
@@ -922,8 +922,8 @@ static void prefs_actions_ok(GtkWidget *widget, gpointer data)
 
        if (modified && alertpanel(_("Entry not saved"),
                                 _("The entry was not saved. Close anyway?"),
 
        if (modified && alertpanel(_("Entry not saved"),
                                 _("The entry was not saved. Close anyway?"),
-                                GTK_STOCK_CLOSE, g_strconcat("+", _("_Continue editing"), NULL),
-                                NULL) != G_ALERTDEFAULT) {
+                                GTK_STOCK_CLOSE, _("_Continue editing"),
+                                NULL, ALERTFOCUS_SECOND) != G_ALERTDEFAULT) {
                return;
        } 
        modified = FALSE;
                return;
        } 
        modified = FALSE;
index 7cfb4638a5d0c10f9cc6d44e6436b7a0a6d65f49..ce3dd674fdaf9ccb4f18387ae67b921fd1d3f073 100644 (file)
@@ -698,7 +698,7 @@ static void prefs_custom_header_delete_cb(void)
 
        if (alertpanel(_("Delete header"),
                       _("Do you really want to delete this header?"),
 
        if (alertpanel(_("Delete header"),
                       _("Do you really want to delete this header?"),
-                      GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL) != G_ALERTALTERNATE)
+                      GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, ALERTFOCUS_FIRST) != G_ALERTALTERNATE)
                return;
 
        gtk_tree_model_get(model, &sel,
                return;
 
        gtk_tree_model_get(model, &sel,
index 2376cb1704a5ade45fba3447ba0a93fceda46b63..799b54e95e128384d3f0ad9a0185b9654c1aafc5 100644 (file)
@@ -1208,7 +1208,7 @@ static void prefs_filtering_delete_cb(gpointer action, gpointer data)
 
        if (alertpanel(_("Delete rule"),
                       _("Do you really want to delete this rule?"),
 
        if (alertpanel(_("Delete rule"),
                       _("Do you really want to delete this rule?"),
-                      GTK_STOCK_CANCEL, "+"GTK_STOCK_DELETE, NULL) == G_ALERTDEFAULT)
+                      GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, ALERTFOCUS_SECOND) == G_ALERTDEFAULT)
                return;
 
        model = gtk_tree_view_get_model(list_view);     
                return;
 
        model = gtk_tree_view_get_model(list_view);     
@@ -1227,7 +1227,7 @@ static void prefs_filtering_delete_all_cb(gpointer action, gpointer data)
        
        if (alertpanel(_("Delete all rules"),
                       _("Do you really want to delete all the rules?"),
        
        if (alertpanel(_("Delete all rules"),
                       _("Do you really want to delete all the rules?"),
-                      GTK_STOCK_CANCEL, "+"GTK_STOCK_DELETE, NULL) == G_ALERTDEFAULT)
+                      GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, ALERTFOCUS_SECOND) == G_ALERTDEFAULT)
                return;
 
        list_store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(filtering.cond_list_view)));
                return;
 
        list_store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(filtering.cond_list_view)));
@@ -1478,8 +1478,8 @@ static gboolean prefs_filtering_check_mod(gboolean check_changed_list)
        if (check_changed_list) {
                if (modified && alertpanel(_("Filtering rules not saved"),
                                         _("The list of filtering rules have been modified. Close anyway?"),
        if (check_changed_list) {
                if (modified && alertpanel(_("Filtering rules not saved"),
                                         _("The list of filtering rules have been modified. Close anyway?"),
-                                        GTK_STOCK_CLOSE, g_strconcat("+", _("_Continue editing"), NULL),
-                                        NULL) != G_ALERTDEFAULT) {
+                                        GTK_STOCK_CLOSE, _("_Continue editing"), NULL,
+                                        ALERTFOCUS_SECOND) != G_ALERTDEFAULT) {
                        return TRUE;
                }
        }
                        return TRUE;
                }
        }
@@ -1500,7 +1500,7 @@ static gboolean prefs_filtering_check_mod(gboolean check_changed_list)
                if (!filtering_str) {
                        val = alertpanel(_("Entry not saved"),
                                 _("The entry was not saved. Close anyway?"),
                if (!filtering_str) {
                        val = alertpanel(_("Entry not saved"),
                                 _("The entry was not saved. Close anyway?"),
-                                GTK_STOCK_CLOSE, g_strconcat("+", _("_Continue editing"),NULL), NULL);
+                                GTK_STOCK_CLOSE, _("_Continue editing"), NULL, ALERTFOCUS_SECOND);
                        if (G_ALERTDEFAULT != val) {
                                g_free(filtering_str);
                                g_free(str); /* fixed two leaks: huzzah! */
                        if (G_ALERTDEFAULT != val) {
                                g_free(filtering_str);
                                g_free(str); /* fixed two leaks: huzzah! */
@@ -1522,7 +1522,7 @@ static gboolean prefs_filtering_check_mod(gboolean check_changed_list)
                    strlen(action)) {
                        val = alertpanel(_("Entry not saved"),
                                 _("The entry was not saved. Close anyway?"),
                    strlen(action)) {
                        val = alertpanel(_("Entry not saved"),
                                 _("The entry was not saved. Close anyway?"),
-                                GTK_STOCK_CLOSE, g_strconcat("+", _("_Continue editing"), NULL), NULL);
+                                GTK_STOCK_CLOSE, _("_Continue editing"), NULL, ALERTFOCUS_SECOND);
                        if (G_ALERTDEFAULT != val) {
                                g_free(name);
                                g_free(condition);
                        if (G_ALERTDEFAULT != val) {
                                g_free(name);
                                g_free(condition);
index 9459bf0a713cb744031aa94c0b0d6989dcc1ce20..9c5bed1f65fe5fdc0a5dabf115a2bd5b3d6032de 100644 (file)
@@ -1691,8 +1691,8 @@ static void clean_cache_cb(GtkWidget *widget, gpointer data)
        if (alertpanel_full(_("Discard cache"), 
                            _("Do you really want to discard the local cached "
                              "data for this folder?"),
        if (alertpanel_full(_("Discard cache"), 
                            _("Do you really want to discard the local cached "
                              "data for this folder?"),
-                                GTK_STOCK_CANCEL, g_strconcat("+", _("Discard"), NULL),
-                                NULL, FALSE, NULL, ALERT_WARNING, G_ALERTDEFAULT)
+                                GTK_STOCK_CANCEL, _("Discard"), NULL, ALERTFOCUS_SECOND,
+                                FALSE, NULL, ALERT_WARNING)
                != G_ALERTALTERNATE)
                return;
        
                != G_ALERTALTERNATE)
                return;
        
index 7cdc1932dc42446cf0da68573f9bce4b27d714e8..d987f42b293f43ca1afd9d9fb630413da7b55c0a 100644 (file)
@@ -2112,8 +2112,9 @@ static void prefs_matcher_ok(void)
                                        val = alertpanel(_("Entry not saved"),
                                                         _("The entry was not saved.\nClose anyway?"),
                                                         GTK_STOCK_CLOSE,
                                        val = alertpanel(_("Entry not saved"),
                                                         _("The entry was not saved.\nClose anyway?"),
                                                         GTK_STOCK_CLOSE,
-                                                g_strconcat("+", _("_Continue editing"), NULL),
-                                                NULL);
+                                                _("_Continue editing"),
+                                                NULL,
+                                                ALERTFOCUS_SECOND);
                                        if (G_ALERTDEFAULT != val) {
                                                g_free(matcher_str);                                             
                                                g_free(str);
                                        if (G_ALERTDEFAULT != val) {
                                                g_free(matcher_str);                                             
                                                g_free(str);
index 7bd57a296357e0ccf4708e6675e745290fe9856d..a7189d96d656e56e269dca61f8e1abae99ddbaec 100644 (file)
@@ -57,9 +57,8 @@ gboolean _version_check(gint ver)
                          markup, "</span></a>");
                g_free(markup);
                av = alertpanel_full(_("Configuration warning"), msg,
                          markup, "</span></a>");
                g_free(markup);
                av = alertpanel_full(_("Configuration warning"), msg,
-                                       GTK_STOCK_NO, GTK_STOCK_YES, NULL,
-                                       FALSE, NULL,
-                                       ALERT_ERROR, G_ALERTALTERNATE);
+                                       GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_SECOND,
+                                       FALSE, NULL, ALERT_ERROR);
                g_free(msg);
 
                if (av != G_ALERTDEFAULT)
                g_free(msg);
 
                if (av != G_ALERTDEFAULT)
index c1b6dcc3e361baad475384972acba7e7bd5e36ed..3b91b9b4d57944829be5368207160d3209a36ca6 100644 (file)
@@ -570,8 +570,8 @@ static void prefs_template_ok_cb(gpointer action, gpointer data)
 
        if (modified && alertpanel(_("Entry not saved"),
                                 _("The entry was not saved. Close anyway?"),
 
        if (modified && alertpanel(_("Entry not saved"),
                                 _("The entry was not saved. Close anyway?"),
-                                GTK_STOCK_CLOSE, g_strconcat("+", _("_Continue editing"), NULL),
-                                NULL) != G_ALERTDEFAULT) {
+                                GTK_STOCK_CLOSE, _("_Continue editing"), NULL,
+                                ALERTFOCUS_SECOND) != G_ALERTDEFAULT) {
                return;
        } 
 
                return;
        } 
 
@@ -595,13 +595,13 @@ static void prefs_template_cancel_cb(gpointer action, gpointer data)
 
        if (modified && alertpanel(_("Entry not saved"),
                                 _("The entry was not saved. Close anyway?"),
 
        if (modified && alertpanel(_("Entry not saved"),
                                 _("The entry was not saved. Close anyway?"),
-                                GTK_STOCK_CLOSE, g_strconcat("+", _("_Continue editing"), NULL),
-                                NULL) != G_ALERTDEFAULT) {
+                                GTK_STOCK_CLOSE, _("_Continue editing"), NULL,
+                                ALERTFOCUS_SECOND) != G_ALERTDEFAULT) {
                return;
        } else if (modified_list && alertpanel(_("Templates list not saved"),
                                 _("The templates list has been modified. Close anyway?"),
                return;
        } else if (modified_list && alertpanel(_("Templates list not saved"),
                                 _("The templates list has been modified. Close anyway?"),
-                                GTK_STOCK_CLOSE, g_strconcat("+", _("_Continue editing"), NULL),
-                                NULL) != G_ALERTDEFAULT) {
+                                GTK_STOCK_CLOSE, _("_Continue editing"), NULL,
+                                ALERTFOCUS_SECOND) != G_ALERTDEFAULT) {
                return;
        }
 
                return;
        }
 
@@ -902,8 +902,8 @@ static void prefs_template_delete_cb(gpointer action, gpointer data)
 
        if (alertpanel(_("Delete template"),
                       _("Do you really want to delete this template?"),
 
        if (alertpanel(_("Delete template"),
                       _("Do you really want to delete this template?"),
-                      GTK_STOCK_CANCEL, GTK_STOCK_DELETE,
-                      NULL) != G_ALERTALTERNATE)
+                      GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL,
+                                        ALERTFOCUS_FIRST) != G_ALERTALTERNATE)
                return;
 
        gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
                return;
 
        gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
@@ -915,7 +915,8 @@ static void prefs_template_delete_all_cb(gpointer action, gpointer data)
 {
        if (alertpanel(_("Delete all templates"),
                          _("Do you really want to delete all the templates?"),
 {
        if (alertpanel(_("Delete all templates"),
                          _("Do you really want to delete all the templates?"),
-                         GTK_STOCK_CANCEL, "+"GTK_STOCK_DELETE, NULL) == G_ALERTDEFAULT)
+                         GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL,
+                               ALERTFOCUS_SECOND) == G_ALERTDEFAULT)
           return;
 
        prefs_template_clear_list();
           return;
 
        prefs_template_clear_list();
index 02440aef2b9d3e2ca13d69cd2be57f51542122c8..36a801fa28b2f4b35c3b9098529c8fe83ddb9539 100644 (file)
@@ -511,7 +511,7 @@ static void prefs_themes_btn_remove_clicked_cb(GtkWidget *widget, gpointer data)
 
        val = alertpanel(alert_title,
                         _("Are you sure you want to remove this theme?"),
 
        val = alertpanel(alert_title,
                         _("Are you sure you want to remove this theme?"),
-                        GTK_STOCK_NO, GTK_STOCK_YES, NULL);
+                        GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_FIRST);
        g_free(alert_title);
 
        if (G_ALERTALTERNATE == val) {
        g_free(alert_title);
 
        if (G_ALERTALTERNATE == val) {
@@ -566,14 +566,14 @@ static void prefs_themes_btn_install_clicked_cb(GtkWidget *widget, gpointer data
        if (file_exist(themeinfo, FALSE) == FALSE) {
                val = alertpanel(alert_title,
                                 _("This folder doesn't seem to be a theme folder.\nInstall anyway?"),
        if (file_exist(themeinfo, FALSE) == FALSE) {
                val = alertpanel(alert_title,
                                 _("This folder doesn't seem to be a theme folder.\nInstall anyway?"),
-                                GTK_STOCK_NO, GTK_STOCK_YES, NULL);
+                                GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_FIRST);
                if (G_ALERTALTERNATE != val)
                        goto end_inst;
        }
        if (superuser_p ()) {
                val = alertpanel(alert_title,
                                 _("Do you want to install theme for all users?"),
                if (G_ALERTALTERNATE != val)
                        goto end_inst;
        }
        if (superuser_p ()) {
                val = alertpanel(alert_title,
                                 _("Do you want to install theme for all users?"),
-                                GTK_STOCK_NO, GTK_STOCK_YES, NULL);
+                                GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_FIRST);
                switch (val) {
                case G_ALERTALTERNATE:
                        cinfo->dest = stock_pixmap_get_system_theme_dir_for_theme(
                switch (val) {
                case G_ALERTALTERNATE:
                        cinfo->dest = stock_pixmap_get_system_theme_dir_for_theme(
@@ -595,8 +595,8 @@ static void prefs_themes_btn_install_clicked_cb(GtkWidget *widget, gpointer data
                AlertValue val = alertpanel_full(_("Theme exists"),
                                _("A theme with the same name is\nalready installed in this location.\n\n"
                                  "Do you want to replace it?"),
                AlertValue val = alertpanel_full(_("Theme exists"),
                                _("A theme with the same name is\nalready installed in this location.\n\n"
                                  "Do you want to replace it?"),
-                               GTK_STOCK_CANCEL, _("Overwrite"), NULL, FALSE,
-                               NULL, ALERT_WARNING, G_ALERTDEFAULT);
+                               GTK_STOCK_CANCEL, _("Overwrite"), NULL, ALERTFOCUS_FIRST,
+                               FALSE, NULL, ALERT_WARNING);
                if (val == G_ALERTALTERNATE) {
                        if (remove_dir_recursive(cinfo->dest) < 0) {
                                alertpanel_error(_("Couldn't delete the old theme in %s."), cinfo->dest);
                if (val == G_ALERTALTERNATE) {
                        if (remove_dir_recursive(cinfo->dest) < 0) {
                                alertpanel_error(_("Couldn't delete the old theme in %s."), cinfo->dest);
index 60042cc498606a22afa01d811fac223711a33189..9c75cf0884746d14b0a95707d7fbda04386e29c8 100644 (file)
@@ -409,8 +409,8 @@ static void ssl_manager_delete_cb(GtkWidget *widget,
 
        val = alertpanel_full(_("Delete certificate"),
                              _("Do you really want to delete this certificate?"),
 
        val = alertpanel_full(_("Delete certificate"),
                              _("Do you really want to delete this certificate?"),
-                             GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, FALSE,
-                             NULL, ALERT_WARNING, G_ALERTDEFAULT);
+                             GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, ALERTFOCUS_FIRST,
+                                               FALSE, NULL, ALERT_WARNING);
 
                             
        if (val != G_ALERTALTERNATE)
 
                             
        if (val != G_ALERTALTERNATE)
index 5b208e1a7d4e84462e13017db7b878689a0c50fa..9d059515954977eaec03e3b513e8375cf7dfa815 100644 (file)
@@ -780,8 +780,8 @@ static void summary_search_execute(gboolean backward, gboolean search_all)
                        if (all_searched) {
                                alertpanel_full(_("Search failed"),
                                                _("Search string not found."),
                        if (all_searched) {
                                alertpanel_full(_("Search failed"),
                                                _("Search string not found."),
-                                               GTK_STOCK_CLOSE, NULL, NULL, FALSE,
-                                               NULL, ALERT_WARNING, G_ALERTDEFAULT);
+                                               GTK_STOCK_CLOSE, NULL, NULL, ALERTFOCUS_FIRST,
+                                               FALSE, NULL, ALERT_WARNING);
                                break;
                        }
 
                                break;
                        }
 
@@ -791,7 +791,8 @@ static void summary_search_execute(gboolean backward, gboolean search_all)
                                str = _("End of list reached; continue from beginning?");
 
                        val = alertpanel(_("Search finished"), str,
                                str = _("End of list reached; continue from beginning?");
 
                        val = alertpanel(_("Search finished"), str,
-                                        GTK_STOCK_NO, "+" GTK_STOCK_YES, NULL);
+                                        GTK_STOCK_NO, GTK_STOCK_YES, NULL,
+                                        ALERTFOCUS_SECOND);
                        if (G_ALERTALTERNATE == val) {
                                if (backward) {
                                        node = GTK_CMCTREE_NODE(GTK_CMCLIST(ctree)->row_list_end);
                        if (G_ALERTALTERNATE == val) {
                                if (backward) {
                                        node = GTK_CMCTREE_NODE(GTK_CMCLIST(ctree)->row_list_end);
index 9ce55586c9f50e40f53d169ab1d566d4f0f9671c..ce7062bd9a0d0e06ee9a1c63787514daa127ced1 100644 (file)
@@ -1279,7 +1279,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
 
                val = alertpanel(_("Process mark"),
                                 _("Some marks are left. Process them?"),
 
                val = alertpanel(_("Process mark"),
                                 _("Some marks are left. Process them?"),
-                                GTK_STOCK_NO, GTK_STOCK_YES, GTK_STOCK_CANCEL);
+                                GTK_STOCK_NO, GTK_STOCK_YES, GTK_STOCK_CANCEL, ALERTFOCUS_FIRST);
                if (G_ALERTALTERNATE == val) {
                        summary_unlock(summaryview);
                        summary_execute(summaryview);
                if (G_ALERTALTERNATE == val) {
                        summary_unlock(summaryview);
                        summary_execute(summaryview);
@@ -1907,7 +1907,7 @@ void summary_select_prev_unread(SummaryView *summaryview)
                                val = alertpanel(_("No more unread messages"),
                                                 _("No unread message found. "
                                                   "Search from the end?"),
                                val = alertpanel(_("No more unread messages"),
                                                 _("No unread message found. "
                                                   "Search from the end?"),
-                                                GTK_STOCK_NO, "+"GTK_STOCK_YES, NULL);
+                                                GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_SECOND);
                                break;
                        case NEXTUNREADMSGDIALOG_ASSUME_YES:
                                val = G_ALERTALTERNATE;
                                break;
                        case NEXTUNREADMSGDIALOG_ASSUME_YES:
                                val = G_ALERTALTERNATE;
@@ -1955,7 +1955,7 @@ void summary_select_next_unread(SummaryView *summaryview)
                                val = alertpanel(_("No more unread messages"),
                                                 _("No unread message found. "
                                                   "Go to next folder?"),
                                val = alertpanel(_("No more unread messages"),
                                                 _("No unread message found. "
                                                   "Go to next folder?"),
-                                                GTK_STOCK_NO, "+"GTK_STOCK_YES, NULL);
+                                                GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_SECOND);
                                break;
                        case NEXTUNREADMSGDIALOG_ASSUME_YES:
                                val = G_ALERTALTERNATE;
                                break;
                        case NEXTUNREADMSGDIALOG_ASSUME_YES:
                                val = G_ALERTALTERNATE;
@@ -1992,7 +1992,7 @@ void summary_select_prev_new(SummaryView *summaryview)
                                val = alertpanel(_("No more new messages"),
                                                 _("No new message found. "
                                                   "Search from the end?"),
                                val = alertpanel(_("No more new messages"),
                                                 _("No new message found. "
                                                   "Search from the end?"),
-                                                GTK_STOCK_NO, "+"GTK_STOCK_YES, NULL);
+                                                GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_SECOND);
                                break;
                        case NEXTUNREADMSGDIALOG_ASSUME_YES:
                                val = G_ALERTALTERNATE;
                                break;
                        case NEXTUNREADMSGDIALOG_ASSUME_YES:
                                val = G_ALERTALTERNATE;
@@ -2040,7 +2040,7 @@ void summary_select_next_new(SummaryView *summaryview)
                                val = alertpanel(_("No more new messages"),
                                                 _("No new message found. "
                                                   "Go to next folder?"),
                                val = alertpanel(_("No more new messages"),
                                                 _("No new message found. "
                                                   "Go to next folder?"),
-                                                GTK_STOCK_NO, "+"GTK_STOCK_YES, NULL);
+                                                GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_SECOND);
                                break;
                        case NEXTUNREADMSGDIALOG_ASSUME_YES:
                                val = G_ALERTALTERNATE;
                                break;
                        case NEXTUNREADMSGDIALOG_ASSUME_YES:
                                val = G_ALERTALTERNATE;
@@ -2074,7 +2074,7 @@ void summary_select_prev_marked(SummaryView *summaryview)
                val = alertpanel(_("No more marked messages"),
                                 _("No marked message found. "
                                   "Search from the end?"),
                val = alertpanel(_("No more marked messages"),
                                 _("No marked message found. "
                                   "Search from the end?"),
-                                GTK_STOCK_NO, "+"GTK_STOCK_YES, NULL);
+                                GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_SECOND);
                if (val != G_ALERTALTERNATE) return;
                node = summary_find_prev_flagged_msg(summaryview, NULL,
                                                     MSG_MARKED, TRUE);
                if (val != G_ALERTALTERNATE) return;
                node = summary_find_prev_flagged_msg(summaryview, NULL,
                                                     MSG_MARKED, TRUE);
@@ -2107,7 +2107,7 @@ void summary_select_next_marked(SummaryView *summaryview)
                                val = alertpanel(_("No more marked messages"),
                                                 _("No marked message found. "
                                                   "Go to next folder?"),
                                val = alertpanel(_("No more marked messages"),
                                                 _("No marked message found. "
                                                   "Go to next folder?"),
-                                                GTK_STOCK_NO, "+"GTK_STOCK_YES, NULL);
+                                                GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_SECOND);
                                break;
                        case NEXTUNREADMSGDIALOG_ASSUME_YES:
                                val = G_ALERTALTERNATE;
                                break;
                        case NEXTUNREADMSGDIALOG_ASSUME_YES:
                                val = G_ALERTALTERNATE;
@@ -2141,7 +2141,7 @@ void summary_select_prev_labeled(SummaryView *summaryview)
                val = alertpanel(_("No more labeled messages"),
                                 _("No labeled message found. "
                                   "Search from the end?"),
                val = alertpanel(_("No more labeled messages"),
                                 _("No labeled message found. "
                                   "Search from the end?"),
-                                GTK_STOCK_NO, "+"GTK_STOCK_YES, NULL);
+                                GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_SECOND);
                if (val != G_ALERTALTERNATE) return;
                node = summary_find_prev_flagged_msg(summaryview, NULL,
                                                     MSG_CLABEL_FLAG_MASK, TRUE);
                if (val != G_ALERTALTERNATE) return;
                node = summary_find_prev_flagged_msg(summaryview, NULL,
                                                     MSG_CLABEL_FLAG_MASK, TRUE);
@@ -2170,7 +2170,7 @@ void summary_select_next_labeled(SummaryView *summaryview)
                val = alertpanel(_("No more labeled messages"),
                                 _("No labeled message found. "
                                   "Search from the beginning?"),
                val = alertpanel(_("No more labeled messages"),
                                 _("No labeled message found. "
                                   "Search from the beginning?"),
-                                GTK_STOCK_NO, "+"GTK_STOCK_YES, NULL);
+                                GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_SECOND);
                if (val != G_ALERTALTERNATE) return;
                if (summaryview->sort_type == SORT_ASCENDING)
                        node = summary_find_next_flagged_msg(summaryview, NULL,
                if (val != G_ALERTALTERNATE) return;
                if (summaryview->sort_type == SORT_ASCENDING)
                        node = summary_find_next_flagged_msg(summaryview, NULL,
@@ -4205,8 +4205,8 @@ void summary_mark_all_read(SummaryView *summaryview, gboolean ask_if_needed)
        if (ask_if_needed && prefs_common.ask_mark_all_read) {
                val = alertpanel_full(_("Mark all as read"),
                          _("Do you really want to mark all mails in this folder as read?"),
        if (ask_if_needed && prefs_common.ask_mark_all_read) {
                val = alertpanel_full(_("Mark all as read"),
                          _("Do you really want to mark all mails in this folder as read?"),
-                         GTK_STOCK_NO, GTK_STOCK_YES, NULL,
-                         TRUE, NULL, ALERT_QUESTION, G_ALERTDEFAULT);
+                         GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_FIRST,
+                         TRUE, NULL, ALERT_QUESTION);
 
                if ((val & ~G_ALERTDISABLE) != G_ALERTALTERNATE)
                        return;
 
                if ((val & ~G_ALERTDISABLE) != G_ALERTALTERNATE)
                        return;
@@ -4244,8 +4244,8 @@ void summary_mark_all_unread(SummaryView *summaryview, gboolean ask_if_needed)
        if (ask_if_needed && prefs_common.ask_mark_all_read) {
                val = alertpanel_full(_("Mark all as unread"),
                          _("Do you really want to mark all mails in this folder as unread?"),
        if (ask_if_needed && prefs_common.ask_mark_all_read) {
                val = alertpanel_full(_("Mark all as unread"),
                          _("Do you really want to mark all mails in this folder as unread?"),
-                         GTK_STOCK_NO, GTK_STOCK_YES, NULL,
-                         TRUE, NULL, ALERT_QUESTION, G_ALERTDEFAULT);
+                         GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_FIRST,
+                         TRUE, NULL, ALERT_QUESTION);
 
                if ((val & ~G_ALERTDISABLE) != G_ALERTALTERNATE)
                        return;
 
                if ((val & ~G_ALERTDISABLE) != G_ALERTALTERNATE)
                        return;
@@ -4472,7 +4472,7 @@ void summary_delete(SummaryView *summaryview)
                        num);
                aval = alertpanel(ngettext("Delete message", "Delete messages", num),
                                  buf,
                        num);
                aval = alertpanel(ngettext("Delete message", "Delete messages", num),
                                  buf,
-                                 GTK_STOCK_CANCEL, "+"GTK_STOCK_DELETE, NULL);
+                                 GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, ALERTFOCUS_SECOND);
                g_free(buf);
                if (aval != G_ALERTALTERNATE) {
                        END_LONG_OPERATION(summaryview);
                g_free(buf);
                if (aval != G_ALERTALTERNATE) {
                        END_LONG_OPERATION(summaryview);
@@ -4912,8 +4912,8 @@ void summary_save_as(SummaryView *summaryview)
        if (is_file_exist(dest)) {
                aval = alertpanel(_("Append or Overwrite"),
                                  _("Append or overwrite existing file?"),
        if (is_file_exist(dest)) {
                aval = alertpanel(_("Append or Overwrite"),
                                  _("Append or overwrite existing file?"),
-                                 _("_Append"), _("_Overwrite"),
-                                 GTK_STOCK_CANCEL);
+                                 _("_Append"), _("_Overwrite"), GTK_STOCK_CANCEL,
+                                       ALERTFOCUS_FIRST);
                if (aval != 0 && aval != 1)
                        return;
        }
                if (aval != 0 && aval != 1)
                        return;
        }
@@ -4958,8 +4958,8 @@ void summary_print(SummaryView *summaryview)
                                       "want to continue?"), 
                                       g_list_length(clist->selection));
        if (g_list_length(clist->selection) > 9
                                       "want to continue?"), 
                                       g_list_length(clist->selection));
        if (g_list_length(clist->selection) > 9
-       &&  alertpanel(_("Warning"), msg, GTK_STOCK_CANCEL, "+" GTK_STOCK_YES, NULL)
-           != G_ALERTALTERNATE) {
+       &&  alertpanel(_("Warning"), msg, GTK_STOCK_CANCEL, GTK_STOCK_YES,
+               NULL, ALERTFOCUS_SECOND) != G_ALERTALTERNATE) {
                g_free(msg);
                return;
        }
                g_free(msg);
                return;
        }
@@ -5697,7 +5697,8 @@ static gboolean summary_filter_get_mode(void)
                        _("Filtering"),
                        _("There are some filtering rules that belong to an account.\n"
                          "Please choose what to do with these rules:"),
                        _("Filtering"),
                        _("There are some filtering rules that belong to an account.\n"
                          "Please choose what to do with these rules:"),
-                       GTK_STOCK_CANCEL, _("_Filter"), NULL, TRUE, G_ALERTALTERNATE, vbox);
+                       GTK_STOCK_CANCEL, _("_Filter"), NULL, ALERTFOCUS_SECOND,
+                       TRUE, vbox);
 
        if ((val & ~G_ALERTDISABLE) != G_ALERTALTERNATE) {
                return FALSE;
 
        if ((val & ~G_ALERTDISABLE) != G_ALERTALTERNATE) {
                return FALSE;
index 1a4878850674a65ccbef8be72b573c079c5e347e..52030ad6d79c69dfb616dd63bfd0517214e911a3 100644 (file)
@@ -2916,8 +2916,8 @@ gboolean textview_uri_security_check(TextView *textview, ClickableText *uri)
                                                _("Real URL:"), uri->uri,
                                                _("Open it anyway?"));
                aval = alertpanel_full(_("Phishing attempt warning"), msg,
                                                _("Real URL:"), uri->uri,
                                                _("Open it anyway?"));
                aval = alertpanel_full(_("Phishing attempt warning"), msg,
-                                      GTK_STOCK_CANCEL, _("_Open URL"), NULL, FALSE,
-                                      NULL, ALERT_WARNING, G_ALERTDEFAULT);
+                                      GTK_STOCK_CANCEL, _("_Open URL"), NULL, ALERTFOCUS_FIRST,
+                                                        FALSE, NULL, ALERT_WARNING);
                g_free(msg);
                if (aval == G_ALERTALTERNATE)
                        retval = TRUE;
                g_free(msg);
                if (aval == G_ALERTALTERNATE)
                        retval = TRUE;
@@ -3093,7 +3093,7 @@ static void save_file_cb (GtkAction *action, TextView *textview)
                res = g_strdup_printf(_("Overwrite existing file '%s'?"),
                                      filename);
                aval = alertpanel(_("Overwrite"), res, GTK_STOCK_CANCEL, 
                res = g_strdup_printf(_("Overwrite existing file '%s'?"),
                                      filename);
                aval = alertpanel(_("Overwrite"), res, GTK_STOCK_CANCEL, 
-                                 GTK_STOCK_OK, NULL);
+                                 GTK_STOCK_OK, NULL, ALERTFOCUS_FIRST);
                g_free(res);                                      
                if (G_ALERTALTERNATE != aval)
                        return;
                g_free(res);                                      
                if (G_ALERTALTERNATE != aval)
                        return;
index 7a56fc869d82086aef249cf7d7a6a76d523c3d4a..75443abe73ca68f9a438c1cc1235baaf471f16f2 100644 (file)
@@ -3008,7 +3008,7 @@ void send_queue_cb(gpointer data, guint action, GtkWidget *widget)
                if (alertpanel(_("Offline warning"), 
                               _("You're working offline. Override?"),
                               GTK_STOCK_NO, GTK_STOCK_YES,
                if (alertpanel(_("Offline warning"), 
                               _("You're working offline. Override?"),
                               GTK_STOCK_NO, GTK_STOCK_YES,
-                              NULL) != G_ALERTALTERNATE)
+                              NULL, ALERTFOCUS_FIRST) != G_ALERTALTERNATE)
                return;
 
        /* ask for confirmation before sending queued messages only
                return;
 
        /* ask for confirmation before sending queued messages only
@@ -3028,7 +3028,7 @@ void send_queue_cb(gpointer data, guint action, GtkWidget *widget)
                        if (alertpanel(_("Send queued messages"), 
                                   _("Send all queued messages?"),
                                   GTK_STOCK_CANCEL, _("_Send"),
                        if (alertpanel(_("Send queued messages"), 
                                   _("Send all queued messages?"),
                                   GTK_STOCK_CANCEL, _("_Send"),
-                                  NULL) != G_ALERTALTERNATE)
+                                  NULL, ALERTFOCUS_FIRST) != G_ALERTALTERNATE)
                                return;
                }
        }
                                return;
                }
        }