*
* 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
*
* 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
ACTION_USER_STR = 1 << 9,
ACTION_USER_HIDDEN_STR = 1 << 10,
ACTION_SELECTION_STR = 1 << 11,
ACTION_USER_STR = 1 << 9,
ACTION_USER_HIDDEN_STR = 1 << 10,
ACTION_SELECTION_STR = 1 << 11,
static guint get_action_type (gchar *action);
static gboolean execute_actions (gchar *action,
GtkCTree *ctree,
GtkWidget *text,
static guint get_action_type (gchar *action);
static gboolean execute_actions (gchar *action,
GtkCTree *ctree,
GtkWidget *text,
gtk_signal_connect(GTK_OBJECT(reg_btn), "clicked",
GTK_SIGNAL_FUNC(prefs_actions_register_cb), NULL);
gtk_signal_connect(GTK_OBJECT(reg_btn), "clicked",
GTK_SIGNAL_FUNC(prefs_actions_register_cb), NULL);
gtk_widget_show(subst_btn);
gtk_box_pack_start(GTK_BOX(btn_hbox), subst_btn, FALSE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT(subst_btn), "clicked",
gtk_widget_show(subst_btn);
gtk_box_pack_start(GTK_BOX(btn_hbox), subst_btn, FALSE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT(subst_btn), "clicked",
static gchar *parse_action_cmd(gchar *action, MsgInfo *msginfo,
GtkCTree *ctree, MimeView *mimeview,
static gchar *parse_action_cmd(gchar *action, MsgInfo *msginfo,
GtkCTree *ctree, MimeView *mimeview,
default:
cmd = g_string_append_c(cmd, p[0]);
cmd = g_string_append_c(cmd, p[1]);
default:
cmd = g_string_append_c(cmd, p[0]);
cmd = g_string_append_c(cmd, p[1]);
- TextView *textview = NULL;
- gchar *buf,
- *action;
- MimeView *mimeview = NULL;
- GdkFont *msgfont = NULL;
- guint body_pos = 0;
- GtkWidget *text = NULL;
+ TextView *textview = NULL;
+ MimeView *mimeview = NULL;
+ gchar *buf;
+ gchar *action;
+ GtkWidget *text = NULL;
+ GdkFont *msgfont = NULL;
+ guint body_pos = 0;
msgview->mimeview->textview &&
msgview->mimeview->textview->text)
textview = msgview->mimeview->textview;
msgview->mimeview->textview &&
msgview->mimeview->textview->text)
textview = msgview->mimeview->textview;
execute_actions(action, ctree, text, msgfont, body_pos, mimeview);
}
execute_actions(action, ctree, text, msgfont, body_pos, mimeview);
}
-static gboolean execute_actions(gchar *action,
- GtkCTree *ctree,
- GtkWidget *text,
- GdkFont *msgfont,
- gint body_pos,
- MimeView *mimeview)
+static gboolean execute_actions(gchar *action, GtkCTree *ctree,
+ GtkWidget *text, GdkFont *msgfont,
+ gint body_pos, MimeView *mimeview)
{
GList *cur, *selection = NULL;
GSList *children_list = NULL;
{
GList *cur, *selection = NULL;
GSList *children_list = NULL;
if (action_type & (ACTION_USER_STR))
if (!(user_str = get_user_string(action, ACTION_USER_STR)))
return FALSE;
if (action_type & (ACTION_USER_STR))
if (!(user_str = get_user_string(action, ACTION_USER_STR)))
return FALSE;
- if (!(user_hidden_str = get_user_string(action,
- ACTION_USER_HIDDEN_STR)))
+ if (!(user_hidden_str =
+ get_user_string(action, ACTION_USER_HIDDEN_STR)))
children = g_new0(Children, 1);
if (action_type & ACTION_SINGLE) {
children = g_new0(Children, 1);
if (action_type & ACTION_SINGLE) {
break;
}
cmd = parse_action_cmd(action, msginfo, ctree,
break;
}
cmd = parse_action_cmd(action, msginfo, ctree,
user_hidden_str, sel_str);
if (!cmd) {
debug_print("Action command error\n");
user_hidden_str, sel_str);
if (!cmd) {
debug_print("Action command error\n");
{
if (event && event->keyval == GDK_Escape)
hide_io_dialog_cb(widget, data);
{
if (event && event->keyval == GDK_Escape)
hide_io_dialog_cb(widget, data);
if (children->input_hbox)
gtk_widget_set_sensitive(children->input_hbox, FALSE);
gtk_widget_grab_focus(children->close_btn);
if (children->input_hbox)
gtk_widget_set_sensitive(children->input_hbox, FALSE);
gtk_widget_grab_focus(children->close_btn);
-static gboolean user_string_dialog_delete_cb(GtkWidget *widget,
- GdkEvent *event,
- gpointer data)
+static gboolean user_string_dialog_delete_cb(GtkWidget *widget,
+ GdkEvent *event, gpointer data)
static void user_string_dialog_activate_cb(GtkWidget *widget, gpointer data)
{
UserStringDialog *user_dialog = (UserStringDialog *) data;
static void user_string_dialog_activate_cb(GtkWidget *widget, gpointer data)
{
UserStringDialog *user_dialog = (UserStringDialog *) data;
user_dialog->user_str =
gtk_editable_get_chars(GTK_EDITABLE(user_dialog->entry), 0, -1);
gtk_widget_destroy(user_dialog->dialog);
}
user_dialog->user_str =
gtk_editable_get_chars(GTK_EDITABLE(user_dialog->entry), 0, -1);
gtk_widget_destroy(user_dialog->dialog);
}
dialog = gtk_dialog_new();
gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, FALSE, FALSE);
dialog = gtk_dialog_new();
gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, FALSE, FALSE);
- gtk_container_set_border_width(
- GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), 8);
- gtk_container_set_border_width(
- GTK_CONTAINER(GTK_DIALOG(dialog)->action_area), 5);
+ gtk_container_set_border_width
+ (GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), 8);
+ gtk_container_set_border_width
+ (GTK_CONTAINER(GTK_DIALOG(dialog)->action_area), 5);
- case ACTION_USER_HIDDEN_STR:
- gtk_window_set_title(GTK_WINDOW(dialog),
- _("Action's user hidden argument"));
- label_text = g_strdup_printf(_("Enter the '%%h' "
- "argument for the following "
- "action:\n%s"), action);
- break;
- case ACTION_USER_STR:
- gtk_window_set_title(GTK_WINDOW(dialog),
- _("Action's user argument"));
- label_text = g_strdup_printf(_("Enter the '%%u' "
- "argument for the following "
- "action:\n%s"), action);
- break;
- default:
- label_text = NULL;
- debug_print("Unsupported action type %d", type);
+ case ACTION_USER_HIDDEN_STR:
+ gtk_window_set_title(GTK_WINDOW(dialog),
+ _("Action's hidden user argument"));
+ label_text = g_strdup_printf(_("Enter the '%%h' "
+ "argument for the following "
+ "action:\n%s"), action);
+ break;
+ case ACTION_USER_STR:
+ gtk_window_set_title(GTK_WINDOW(dialog),
+ _("Action's user argument"));
+ label_text = g_strdup_printf(_("Enter the '%%u' "
+ "argument for the following "
+ "action:\n%s"), action);
+ break;
+ default:
+ label_text = NULL;
+ debug_print("Unsupported action type %d", type);
}
label = gtk_label_new(label_text);
g_free(label_text);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), label,
TRUE, TRUE, 0);
}
label = gtk_label_new(label_text);
g_free(label_text);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), label,
TRUE, TRUE, 0);
type != ACTION_USER_HIDDEN_STR);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), entry,
TRUE, TRUE, 0);
type != ACTION_USER_HIDDEN_STR);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), entry,
TRUE, TRUE, 0);
gtk_box_pack_end(GTK_BOX(GTK_DIALOG(dialog)->action_area),
ok_button, TRUE, TRUE, 0);
gtk_box_pack_end(GTK_BOX(GTK_DIALOG(dialog)->action_area),
ok_button, TRUE, TRUE, 0);
cancel_button = gtk_button_new_with_label(_("Cancel"));
gtk_box_pack_end(GTK_BOX(GTK_DIALOG(dialog)->action_area),
cancel_button, TRUE, TRUE, 0);
cancel_button = gtk_button_new_with_label(_("Cancel"));
gtk_box_pack_end(GTK_BOX(GTK_DIALOG(dialog)->action_area),
cancel_button, TRUE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT(entry), "activate",
GTK_SIGNAL_FUNC(user_string_dialog_activate_cb),
&user_dialog);
gtk_signal_connect(GTK_OBJECT(entry), "activate",
GTK_SIGNAL_FUNC(user_string_dialog_activate_cb),
&user_dialog);
GTK_SIGNAL_FUNC(user_string_dialog_activate_cb),
&user_dialog);
gtk_signal_connect_object(GTK_OBJECT(cancel_button), "clicked",
GTK_SIGNAL_FUNC(user_string_dialog_activate_cb),
&user_dialog);
gtk_signal_connect_object(GTK_OBJECT(cancel_button), "clicked",