0.8.9claws5
[claws.git] / src / prefs_actions.c
index 828467d46502f7d7323c7590e21e8a3c1f2ee3bf..f78545c10aa0ffecd746247e4c15756f34451e5f 100644 (file)
@@ -208,7 +208,9 @@ static void update_io_dialog                (Children       *children);
 
 static void hide_io_dialog_cb          (GtkWidget      *widget,
                                         gpointer        data);
-
+static gint io_dialog_key_pressed_cb   (GtkWidget      *widget,
+                                        GdkEventKey    *event,
+                                        gpointer        data);
 static void catch_output               (gpointer                data,
                                         gint                    source,
                                         GdkInputCondition       cond);
@@ -549,8 +551,6 @@ static guint get_action_type(gchar *action)
                } else if (p[0] == '&') {
                        if (p[1] == 0x00)
                                action_type |= ACTION_ASYNC;
-                       else
-                               action_type = ACTION_ERROR;
                }
                p++;
        }
@@ -1523,6 +1523,15 @@ static void hide_io_dialog_cb(GtkWidget *w, gpointer data)
        }
 }
 
+static gint io_dialog_key_pressed_cb(GtkWidget *widget,
+                                    GdkEventKey        *event,
+                                    gpointer    data)
+{
+       if (event && event->keyval == GDK_Escape)
+               hide_io_dialog_cb(widget, data);
+       return TRUE;    
+}
+
 static void childinfo_close_pipes(ChildInfo *child_info)
 {
        if (child_info->tag_in > 0)
@@ -1567,6 +1576,11 @@ static void update_io_dialog(Children *children)
                gtk_widget_set_sensitive(children->close_btn, TRUE);
                if (children->input_hbox)
                        gtk_widget_set_sensitive(children->input_hbox, FALSE);
+               gtk_widget_grab_focus(children->close_btn);
+               gtk_signal_connect(GTK_OBJECT(children->dialog), 
+                                  "key_press_event",
+                                  GTK_SIGNAL_FUNC(io_dialog_key_pressed_cb),
+                                  children);
        }
 
        if (children->output) {
@@ -1794,29 +1808,29 @@ static void catch_output(gpointer data, gint source, GdkInputCondition cond)
  * When adding new lines, remember to put one string for each line
  */
 static gchar *actions_desc_strings[] = {
-       N_("Menu name:"),
-       N_("   Use / in menu name to make submenus."),
-       "",
-       N_("Command line:"),
-       N_("* Begin with:"),
-       N_("     | to send message body or selection to command"),
-       N_("     > to send user provided text to command"),
-       N_("     * to send user provided hidden text to command"),
-       N_("* End with:"),
-       N_("     | to replace message body or selection with command output"),
-       N_("     > to insert command's output without replacing old text"),
-       N_("     & to run command asynchronously"),
-       N_("* Use:"),
-       N_("     %f for message file name"),
-       N_("     %F for the list of the file names of selected messages"),
-       N_("     %p for the selected message MIME part."),
+       N_("Menu name:"), NULL,
+       "      ",   N_("Use / in menu name to make submenus."),
+       "", NULL,
+       N_("Command line:"), NULL,
+       N_("* Begin with:"), NULL,
+       "     |",   N_("to send message body or selection to command"),
+       "     >",   N_("to send user provided text to command"),
+       "     *",   N_("to send user provided hidden text to command"),
+       N_("* End with:"), NULL, 
+       "     |",   N_("to replace message body or selection with command output"),
+       "     >",   N_("to insert command's output without replacing old text"),
+       "     &",   N_("to run command asynchronously"),
+       N_("* Use:"), NULL, 
+       "     %f",  N_("for message file name"),
+       "     %F",  N_("for the list of the file names of selected messages"),
+       "     %p",  N_("for the selected message MIME part."),
        NULL
 };
 
 
 static DescriptionWindow actions_desc_win = { 
         NULL, 
-        1,
+        2,
         N_("Description of symbols"),
         actions_desc_strings
 };