fix last commit
[claws.git] / src / prefs_template.c
index e8f656de441b509e52fe5437da89de1cf862215a..3f19df7e6062c3a55b406c6211990a7481076da8 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-2020 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
@@ -76,10 +76,10 @@ static struct
        gboolean compl;
        gchar *tooltips;
 } widgets_table[] = {
-       {N_("Name"),    &templates.entry_name,          FALSE,
-               N_("This name is used as the Menu item")},
+       {_("Name"),     &templates.entry_name,          FALSE,
+               _("This name is used as the Menu item")},
        {"From",        &templates.entry_from,          TRUE,
-               N_("Override composing account's From header. This doesn't change the composing account.")},
+               _("Override composing account's From header. This doesn't change the composing account.")},
        {"To",          &templates.entry_to,            TRUE,   NULL},
        {"Cc",          &templates.entry_cc,            TRUE,   NULL},
        {"Bcc",         &templates.entry_bcc,           TRUE,   NULL},
@@ -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);
@@ -233,7 +234,7 @@ static void prefs_template_window_create(void)
 
                label = gtk_label_new( (i != 0) ?
                        prefs_common_translated_header_name(widgets_table[i].label) :
-                       widgets_table[i].label);
+                       _(widgets_table[i].label));
                gtk_widget_show(label);
                gtk_table_attach(GTK_TABLE(table), label, 0, 1, i, (i + 1),
                                (GtkAttachOptions) (GTK_FILL),
@@ -246,7 +247,7 @@ static void prefs_template_window_create(void)
                                (GtkAttachOptions) (GTK_EXPAND|GTK_SHRINK|GTK_FILL),
                                (GtkAttachOptions) 0, 0, 0);
                CLAWS_SET_TIP(*(widgets_table[i].entry),
-                               widgets_table[i].tooltips);
+                               _(widgets_table[i].tooltips));
        }
 
        /* template content */
@@ -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) },