fix bug 4239, 'Preferences: Text Options Header Display modal is not modal' (sic)
[claws.git] / src / prefs_template.c
index e8f656de441b509e52fe5437da89de1cf862215a..26683669ea44fe7dbd8795859edbd9b9a903d27d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Claws Mail templates subsystem 
  * Copyright (C) 2001 Alexander Barinov
- * Copyright (C) 2001-2013 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 2001-2013 The Claws Mail team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -194,6 +194,7 @@ static void prefs_template_window_create(void)
        window = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "prefs_template");
        gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
        gtk_window_set_resizable(GTK_WINDOW(window), TRUE);
+       gtk_window_set_type_hint(GTK_WINDOW(window), GDK_WINDOW_TYPE_HINT_DIALOG);
 
        vbox = gtk_vbox_new(FALSE, 8);
        gtk_widget_show(vbox);
@@ -294,7 +295,6 @@ static void prefs_template_window_create(void)
        arrow1 = gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_OUT);
        gtk_widget_show(arrow1);
        gtk_box_pack_start(GTK_BOX(hbox2), arrow1, FALSE, FALSE, 0);
-       gtk_widget_set_size_request(arrow1, -1, 16);
 
        hbox3 = gtk_hbox_new(TRUE, 4);
        gtk_widget_show(hbox3);
@@ -369,7 +369,7 @@ static void prefs_template_window_create(void)
        CLAWS_SET_TIP(top_btn,
                        _("Move the selected template to the top"));
 
-       PACK_VSPACER(vbox3, spc_vbox, VSPACING_NARROW_2);
+       PACK_SPACER(vbox3, spc_vbox, VSPACING_NARROW_2);
 
        up_btn = gtk_button_new_from_stock(GTK_STOCK_GO_UP);
        gtk_widget_show(up_btn);
@@ -387,7 +387,7 @@ static void prefs_template_window_create(void)
        CLAWS_SET_TIP(down_btn,
                        _("Move the selected template down"));
 
-       PACK_VSPACER(vbox3, spc_vbox, VSPACING_NARROW_2);
+       PACK_SPACER(vbox3, spc_vbox, VSPACING_NARROW_2);
 
        bottom_btn = gtk_button_new_from_stock(GTK_STOCK_GOTO_BOTTOM);
        gtk_widget_show(bottom_btn);
@@ -571,8 +571,8 @@ static void prefs_template_ok_cb(gpointer action, gpointer data)
 
        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;
        } 
 
@@ -596,13 +596,13 @@ static void prefs_template_cancel_cb(gpointer action, gpointer data)
 
        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?"),
-                                GTK_STOCK_CLOSE, g_strconcat("+", _("_Continue editing"), NULL),
-                                NULL) != G_ALERTDEFAULT) {
+                                GTK_STOCK_CLOSE, _("_Continue editing"), NULL,
+                                ALERTFOCUS_SECOND) != G_ALERTDEFAULT) {
                return;
        }
 
@@ -903,8 +903,8 @@ static void prefs_template_delete_cb(gpointer action, gpointer data)
 
        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);
@@ -916,7 +916,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?"),
-                         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();
@@ -1107,7 +1108,7 @@ static GtkWidget *prefs_template_popup_menu = NULL;
 
 static GtkActionEntry prefs_template_popup_entries[] =
 {
-       {"PrefsTemplatePopup",                  NULL, "PrefsTemplatePopup" },
+       {"PrefsTemplatePopup",                  NULL, "PrefsTemplatePopup", NULL, NULL, NULL },
        {"PrefsTemplatePopup/Delete",           NULL, N_("_Delete"), NULL, NULL, G_CALLBACK(prefs_template_delete_cb) },
        {"PrefsTemplatePopup/DeleteAll",        NULL, N_("Delete _all"), NULL, NULL, G_CALLBACK(prefs_template_delete_all_cb) },
        {"PrefsTemplatePopup/Duplicate",        NULL, N_("D_uplicate"), NULL, NULL, G_CALLBACK(prefs_template_duplicate_cb) },