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);
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;
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"),
#include "procmsg.h"
#include "gtkstext.h"
#include "mimeview.h"
+#include "description_window.h"
#include "textview.h"
typedef enum
gint source,
GdkInputCondition cond);
+
void prefs_actions_open(MainWindow *mainwin)
{
#if 0
GtkWidget *cond_scrolledwin;
GtkWidget *cond_clist;
- GtkWidget *help_vbox;
- GtkWidget *help_label;
- GtkWidget *help_toggle;
+ GtkWidget *help_button;
GtkWidget *btn_vbox;
GtkWidget *up_btn;
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);
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);
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)
{
}
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);
+}