2007-08-25 [paul] 2.10.0cvs175
[claws.git] / src / prefs_actions.c
index 33f2e5d4712ac07ec3a88fe9e4cbb1d90540cb9e..6c1c0f180285b82d9a59d59f995a8f29d66d9727 100644 (file)
@@ -1,10 +1,10 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2006 Hiroyuki Yamamoto & The Sylpheed Claws Team
+ * Copyright (C) 1999-2007 Hiroyuki Yamamoto & 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
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
@@ -13,8 +13,8 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * 
  */
 
 #ifdef HAVE_CONFIG_H
@@ -152,9 +152,8 @@ static void prefs_actions_create(MainWindow *mainwin)
        GtkWidget *confirm_area;
 
        GtkWidget *vbox1;
+       GtkWidget *table;
 
-       GtkWidget *entry_vbox;
-       GtkWidget *hbox;
        GtkWidget *name_label;
        GtkWidget *name_entry;
        GtkWidget *cmd_label;
@@ -180,7 +179,7 @@ static void prefs_actions_create(MainWindow *mainwin)
 
        debug_print("Creating actions configuration window...\n");
 
-       window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+       window = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "prefs_actions");
 
        gtk_container_set_border_width(GTK_CONTAINER (window), 8);
        gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
@@ -215,33 +214,42 @@ static void prefs_actions_create(MainWindow *mainwin)
                         G_CALLBACK(manual_open_with_anchor_cb),
                         MANUAL_ANCHOR_ACTIONS);
 
-       vbox1 = gtk_vbox_new(FALSE, 8);
+       vbox1 = gtk_vbox_new(FALSE, VSPACING);
        gtk_widget_show(vbox1);
        gtk_box_pack_start(GTK_BOX(vbox), vbox1, TRUE, TRUE, 0);
        gtk_container_set_border_width(GTK_CONTAINER(vbox1), 2);
 
-       entry_vbox = gtk_vbox_new(FALSE, 4);
-       gtk_box_pack_start(GTK_BOX(vbox1), entry_vbox, FALSE, FALSE, 0);
-
-       hbox = gtk_hbox_new(FALSE, 8);
-       gtk_box_pack_start(GTK_BOX(entry_vbox), hbox, FALSE, FALSE, 0);
-
-       name_label = gtk_label_new(_("Menu name:"));
-       gtk_box_pack_start(GTK_BOX(hbox), name_label, FALSE, FALSE, 0);
-
-       name_entry = gtk_entry_new();
-       gtk_box_pack_start(GTK_BOX(hbox), name_entry, TRUE, TRUE, 0);
-
-       hbox = gtk_hbox_new(FALSE, 8);
-       gtk_box_pack_start(GTK_BOX(entry_vbox), hbox, TRUE, TRUE, 0);
-
-       cmd_label = gtk_label_new(_("Command line:"));
-       gtk_box_pack_start(GTK_BOX(hbox), cmd_label, FALSE, FALSE, 0);
-
-       cmd_entry = gtk_entry_new();
-       gtk_box_pack_start(GTK_BOX(hbox), cmd_entry, TRUE, TRUE, 0);
-
-       gtk_widget_show_all(entry_vbox);
+       table = gtk_table_new(2, 2, FALSE);
+       gtk_table_set_row_spacings (GTK_TABLE (table), VSPACING_NARROW_2);
+       gtk_table_set_col_spacings (GTK_TABLE (table), 4);
+       gtk_widget_show(table);
+       gtk_box_pack_start (GTK_BOX (vbox1), table, FALSE, FALSE, 0);
+
+       name_label = gtk_label_new (_("Menu name"));
+       gtk_widget_show (name_label);
+       gtk_misc_set_alignment (GTK_MISC (name_label), 1, 0.5);
+       gtk_table_attach (GTK_TABLE (table), name_label, 0, 1, 0, 1,
+                         (GtkAttachOptions) (GTK_FILL),
+                         (GtkAttachOptions) (0), 0, 0);
+
+       name_entry = gtk_entry_new ();
+       gtk_widget_show (name_entry);
+       gtk_table_attach (GTK_TABLE (table), name_entry, 1, 2, 0, 1,
+                         (GtkAttachOptions) (GTK_FILL|GTK_EXPAND),
+                         (GtkAttachOptions) (0), 0, 0);
+
+       cmd_label = gtk_label_new (_("Command line"));
+       gtk_widget_show (cmd_label);
+       gtk_misc_set_alignment (GTK_MISC (cmd_label), 1, 0.5);
+       gtk_table_attach (GTK_TABLE (table), cmd_label, 0, 1, 1, 2,
+                         (GtkAttachOptions) (GTK_FILL),
+                         (GtkAttachOptions) (0), 0, 0);
+
+       cmd_entry = gtk_entry_new ();
+       gtk_widget_show (cmd_entry);
+       gtk_table_attach (GTK_TABLE (table), cmd_entry, 1, 2, 1, 2,
+                         (GtkAttachOptions) (GTK_FILL|GTK_EXPAND),
+                         (GtkAttachOptions) (0), 0, 0);
 
        /* register / substitute / delete */
 
@@ -280,7 +288,7 @@ static void prefs_actions_create(MainWindow *mainwin)
 #if GTK_CHECK_VERSION(2, 8, 0)
        info_btn = gtk_button_new_from_stock(GTK_STOCK_INFO);
 #else
-       info_btn = gtk_button_new_with_label(_("Information"));
+       info_btn = gtk_button_new_with_label(_("Info..."));
 #endif
        gtk_widget_show(info_btn);
        gtk_box_pack_end(GTK_BOX(reg_hbox), info_btn, FALSE, FALSE, 0);
@@ -373,7 +381,7 @@ void prefs_actions_read_config(void)
 
                tmp = conv_codeset_strdup(buf, src_codeset, dest_codeset);
                if (!tmp) {
-                       g_warning("Faild to convert character set of action configuration\n");
+                       g_warning("Failed to convert character set of action configuration\n");
                        tmp = g_strdup(buf);
                }
 
@@ -400,7 +408,7 @@ void prefs_actions_write_config(void)
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, ACTIONS_RC, NULL);
        if ((pfile= prefs_write_open(rcpath)) == NULL) {
-               g_warning("failed to write configuration to file\n");
+               g_warning("Failed to write configuration to file\n");
                g_free(rcpath);
                return;
        }
@@ -413,7 +421,7 @@ void prefs_actions_write_config(void)
 
                act = conv_codeset_strdup(tmp, src_codeset, dest_codeset);
                if (!act) {
-                       g_warning("Faild to convert character set of action configuration\n");
+                       g_warning("Failed to convert character set of action configuration\n");
                        act = g_strdup(act);
                }
 
@@ -447,7 +455,7 @@ static void prefs_actions_set_dialog(void)
        gtk_list_store_clear(store);
 
        prefs_actions_list_view_insert_action(actions.actions_list_view,
-                                             NULL, _("New"), FALSE);
+                                             NULL, _("(New)"), FALSE);
 
        for (cur = prefs_common.actions_list; cur != NULL; cur = cur->next) {
                gchar *action = (gchar *) cur->data;
@@ -560,8 +568,7 @@ static gint prefs_actions_clist_set_row(GtkTreeIter *row)
        }
 
        if (action_get_type(entry_text) == ACTION_ERROR) {
-               alertpanel_error(_("The command\n%s\nhas a syntax error."), 
-                                entry_text);
+               alertpanel_error(_("The command\n%s\nhas a syntax error."), entry_text);
                return -1;
        }
 
@@ -815,6 +822,7 @@ static gchar *actions_desc_strings[] = {
        "     %h",  N_("for a user provided hidden argument (e.g. password)"),
        "     %s",  N_("for the text selection"),
        "  %as{}",  N_("apply filtering actions between {} to selected messages"),
+       "     %%",  N_("for a literal %"),
        NULL, NULL
 };
 
@@ -889,7 +897,7 @@ static GtkWidget *prefs_actions_list_view_create(void)
        list_view = GTK_TREE_VIEW(gtk_tree_view_new_with_model(model));
        g_object_unref(model);  
        
-       gtk_tree_view_set_rules_hint(list_view, prefs_common.enable_rules_hint);
+       gtk_tree_view_set_rules_hint(list_view, prefs_common.use_stripes_everywhere);
        gtk_tree_view_set_reorderable(list_view, TRUE);
 
        selector = gtk_tree_view_get_selection(list_view);