0.8.8claws59
authorChristoph Hohmann <reboot@gmx.ch>
Mon, 6 Jan 2003 22:01:43 +0000 (22:01 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Mon, 6 Jan 2003 22:01:43 +0000 (22:01 +0000)
* src/prefs_actions.c
        use new description window for syntax help
* src/gtk/description_window.c
        fix display of descriptions with column count != 2

patch by Ivan Francolin Martinez (ivanfm@users.sourceforge.net)

ChangeLog.claws
configure.in
src/gtk/description_window.c
src/prefs_actions.c

index 6b5331e88b62e8937430d0d612b15dca7324bd59..f663786ab0c00198bde9926f7bd3c83ffede6153 100644 (file)
@@ -1,3 +1,10 @@
+2003-01-06 [Ivan Francolin Martinez (ivanfm@users.sourceforge.net)]    0.8.8claws59
+
+       * src/prefs_actions.c
+               use new description window for syntax help
+       * src/gtk/description_window.c
+               fix display of descriptions with column count != 2
+
 2003-01-06 [Ivan Francolin Martinez (ivanfm@users.sourceforge.net)]    0.8.8claws58
 
        * src/quote_fmt.c
index 69a43024a8959974fd9c9291c8c3c153635b5c31..d98756d8cb20e4f4475703e1498317e744f9cec4 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws58
+EXTRA_VERSION=claws59
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index de7a5981a8c11091eaf9ba8a0149382ef85cdbc5..21925e1e6aa39a6477c8ef91f8fc8eb5ea64a8fa 100644 (file)
@@ -55,6 +55,8 @@ static void description_create(DescriptionWindow * dwindow)
        GtkWidget *scrolledwin;
        int i;
        int sz;
+       int line;
+       int j;
 
        dwindow->window = gtk_window_new(GTK_WINDOW_DIALOG);
        gtk_widget_set_usize(dwindow->window,400,450);
@@ -82,6 +84,7 @@ static void description_create(DescriptionWindow * dwindow)
 
        gtk_table_set_col_spacings(GTK_TABLE(table), 10);
 
+       line = 0;
        for(i = 0; dwindow->symbol_table[i] != NULL; i = i + dwindow->columns) {
                if(dwindow->symbol_table[i][0] != '\0') {
                        GtkWidget *label;
@@ -89,26 +92,28 @@ static void description_create(DescriptionWindow * dwindow)
                        label = gtk_label_new(dwindow->symbol_table[i]);
                        gtk_misc_set_alignment (GTK_MISC(label), 0, 0);
                        gtk_table_attach(GTK_TABLE(table), label,
-                                        0, 1, i, i+1,
-                                        GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL,
-                                        0, 0);
-                                        
-                       label = gtk_label_new(gettext(dwindow->symbol_table[i+1]));
-                       gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
-                       gtk_misc_set_alignment (GTK_MISC(label), 0, 0);
-                       gtk_table_attach(GTK_TABLE(table), label,
-                                        1, 2, i, i+1,
+                                        0, 1, line, line+1,
                                         GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL,
                                         0, 0);
+                       for (j = 1; j < dwindow->columns; j++) {
+                               label = gtk_label_new(gettext(dwindow->symbol_table[i+j]));
+                               gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
+                               gtk_misc_set_alignment (GTK_MISC(label), 0, 0);
+                               gtk_table_attach(GTK_TABLE(table), label,
+                                                j, j+1, line, line+1,
+                                                GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL,
+                                                0, 0);
+                       }
                } else {
                        GtkWidget *separator;
                        
                        separator = gtk_hseparator_new();
                        gtk_table_attach(GTK_TABLE(table), separator,
-                                        0, 2, i, i+1,
+                                        0, 2, line, line+1,
                                         GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL,
                                         0, 4);
                }
+               line++;
        }
 
        gtkut_button_set_create(&hbbox, &ok_btn, _("OK"),
index 3944e757187921f10380633f7ee8a56630ed26f7..f61c049caed3914f0254e727c64544a74110f749 100644 (file)
@@ -50,6 +50,7 @@
 #include "procmsg.h"
 #include "gtkstext.h"
 #include "mimeview.h"
+#include "description_window.h"
 #include "textview.h"
 
 typedef enum
@@ -217,6 +218,7 @@ static void catch_status            (gpointer                data,
                                         gint                    source,
                                         GdkInputCondition       cond);
 
+
 void prefs_actions_open(MainWindow *mainwin)
 {
 #if 0
@@ -264,9 +266,7 @@ static void prefs_actions_create(MainWindow *mainwin)
        GtkWidget *cond_scrolledwin;
        GtkWidget *cond_clist;
 
-       GtkWidget *help_vbox;
-       GtkWidget *help_label;
-       GtkWidget *help_toggle;
+       GtkWidget *help_button;
 
        GtkWidget *btn_vbox;
        GtkWidget *up_btn;
@@ -333,30 +333,6 @@ static void prefs_actions_create(MainWindow *mainwin)
 
        gtk_widget_show_all(entry_vbox);
 
-       help_vbox = gtk_vbox_new(FALSE, 8);
-       gtk_box_pack_start(GTK_BOX(vbox1), help_vbox, FALSE, FALSE, 0);
-
-       help_label = gtk_label_new
-               (_("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 %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."));
-       gtk_misc_set_alignment(GTK_MISC(help_label), 0, 0.5);
-       gtk_label_set_justify(GTK_LABEL(help_label), GTK_JUSTIFY_LEFT);
-       gtk_widget_show(help_label);
-       gtk_box_pack_start(GTK_BOX(help_vbox), help_label, FALSE, FALSE, 0);
-       gtk_widget_hide(help_vbox);
-
        /* register / substitute / delete */
 
        reg_hbox = gtk_hbox_new(FALSE, 4);
@@ -391,11 +367,11 @@ static void prefs_actions_create(MainWindow *mainwin)
        gtk_signal_connect(GTK_OBJECT(del_btn), "clicked",
                           GTK_SIGNAL_FUNC(prefs_actions_delete_cb), NULL);
 
-       help_toggle = gtk_toggle_button_new_with_label(_(" Syntax help "));
-       gtk_widget_show(help_toggle);
-       gtk_box_pack_end(GTK_BOX(reg_hbox), help_toggle, FALSE, FALSE, 0);
-       gtk_signal_connect(GTK_OBJECT(help_toggle), "toggled",
-                          GTK_SIGNAL_FUNC(prefs_actions_help_cb), help_vbox);
+       help_button = gtk_button_new_with_label(_(" Syntax help "));
+       gtk_widget_show(help_button);
+       gtk_box_pack_end(GTK_BOX(reg_hbox), help_button, FALSE, FALSE, 0);
+       gtk_signal_connect(GTK_OBJECT(help_button), "clicked",
+                          GTK_SIGNAL_FUNC(prefs_actions_help_cb), NULL);
 
        cond_hbox = gtk_hbox_new(FALSE, 8);
        gtk_widget_show(cond_hbox);
@@ -452,13 +428,6 @@ static void prefs_actions_create(MainWindow *mainwin)
        actions.actions_clist = cond_clist;
 }
 
-static void prefs_actions_help_cb(GtkWidget *w, gpointer data)
-{
-       if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)))
-               gtk_widget_show(GTK_WIDGET(data));
-       else
-               gtk_widget_hide(GTK_WIDGET(data));
-}
 
 void prefs_actions_read_config(void)
 {
@@ -1837,3 +1806,40 @@ static void catch_output(gpointer data, gint source, GdkInputCondition cond)
        }
        wait_for_children(child_info->children);
 }
+
+/*
+ * Strings describing action format strings
+ * 
+ * When adding new lines, remember to put 2 strings for each line
+ */
+static gchar *actions_desc_strings[] = {
+       "Menu name:",
+       "   Use / in menu name to make submenus.",
+       "",
+       "Command line:",
+       "   Begin with:",
+       "     | to send message body or selection to command",
+       "     > to send user provided text to command",
+       "     * to send user provided hidden text to command",
+       " End with:",
+       "     | to replace message body or selection with command output",
+       "     > to insert command's output without replacing old text",
+       "     & to run command asynchronously",
+       " Use %f for message file name",
+       "     %F for the list of the file names of selected messages",
+       "     %p for the selected message MIME part.",
+       NULL
+};
+
+static DescriptionWindow actions_desc_win = { 
+        NULL, 
+        1,
+        N_("Description of symbols"),
+        actions_desc_strings
+};
+
+
+static void prefs_actions_help_cb(GtkWidget *w, gpointer data)
+{
+       description_window_create(&actions_desc_win);
+}