#include "template.h"
#include "undo.h"
#include "foldersel.h"
+#include "prefs_actions.h"
#if USE_GPGME
# include "rfc2015.h"
static gchar *compose_quote_fmt (Compose *compose,
MsgInfo *msginfo,
const gchar *fmt,
- const gchar *qmark);
+ const gchar *qmark,
+ const gchar *seltext);
static void compose_reply_set_entry (Compose *compose,
MsgInfo *msginfo,
static void compose_generic_reply(MsgInfo *msginfo, gboolean quote,
gboolean to_all,
gboolean ignore_replyto,
- gboolean followup_and_reply_to);
+ gboolean followup_and_reply_to,
+ const gchar *seltext);
void compose_headerentry_changed_cb (GtkWidget *entry,
ComposeHeaderEntry *headerentry);
"<control><alt>L", compose_wrap_line_all, 0, NULL},
{N_("/_Edit/Edit with e_xternal editor"),
"<shift><control>X", compose_ext_editor_cb, 0, NULL},
+ {N_("/_Edit/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_Edit/Actio_ns"), NULL, NULL, 0, "<Branch>"},
#if USE_PSPELL
{N_("/_Spelling"), NULL, NULL, 0, "<Branch>"},
{N_("/_Spelling/_Check all or check selection"),
msginfo->subject);
gtk_editable_set_editable(GTK_EDITABLE(c->subject_entry), FALSE);
- compose_quote_fmt(c, msginfo, "%M", NULL);
+ compose_quote_fmt(c, msginfo, "%M", NULL, NULL);
gtk_editable_set_editable(GTK_EDITABLE(c->text), FALSE);
ifactory = gtk_item_factory_from_widget(c->popupmenu);
*/
void compose_reply(MsgInfo *msginfo, gboolean quote, gboolean to_all,
- gboolean ignore_replyto)
+ gboolean ignore_replyto, const gchar *seltext)
{
- compose_generic_reply(msginfo, quote, to_all, ignore_replyto, FALSE);
+ compose_generic_reply(msginfo, quote, to_all, ignore_replyto, FALSE,
+ seltext);
}
void compose_followup_and_reply_to(MsgInfo *msginfo, gboolean quote,
gboolean to_all,
- gboolean ignore_replyto)
+ gboolean ignore_replyto,
+ const gchar *seltext)
{
- compose_generic_reply(msginfo, quote, to_all, ignore_replyto, TRUE);
+ compose_generic_reply(msginfo, quote, to_all, ignore_replyto, TRUE,
+ seltext);
}
static void compose_generic_reply(MsgInfo *msginfo, gboolean quote,
gboolean to_all,
gboolean ignore_replyto,
- gboolean followup_and_reply_to)
+ gboolean followup_and_reply_to,
+ const gchar *seltext)
{
Compose *compose;
PrefsAccount *account;
quote_str = compose_quote_fmt(compose, msginfo,
prefs_common.quotefmt,
- qmark);
+ qmark, seltext);
}
if (prefs_common.auto_sig)
gtk_stext_thaw(text);
gtk_widget_grab_focus(compose->text);
- if (prefs_common.auto_exteditor)
+ if (prefs_common.auto_exteditor)
compose_exec_ext_editor(compose);
}
}
Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
- gboolean as_attach)
+ gboolean as_attach, const gchar *seltext)
{
Compose *compose;
/* PrefsAccount *account; */
qmark = "> ";
quote_str = compose_quote_fmt(compose, msginfo,
- prefs_common.fw_quotefmt, qmark);
+ prefs_common.fw_quotefmt, qmark,
+ seltext);
compose_attach_parts(compose, msginfo);
}
}
static gchar *compose_quote_fmt(Compose *compose, MsgInfo *msginfo,
- const gchar *fmt, const gchar *qmark)
+ const gchar *fmt, const gchar *qmark,
+ const gchar *seltext)
{
GtkSText *text = GTK_STEXT(compose->text);
gchar *quote_str = NULL;
gint len;
if (qmark != NULL) {
- quote_fmt_init(msginfo, NULL);
+ quote_fmt_init(msginfo, NULL, NULL);
quote_fmt_scan_string(qmark);
quote_fmt_parse();
}
if (fmt && *fmt != '\0') {
- quote_fmt_init(msginfo, quote_str);
+ quote_fmt_init(msginfo, quote_str, seltext);
quote_fmt_scan_string(fmt);
quote_fmt_parse();
FolderItem *dest;
gchar * path;
- dest = foldersel_folder_sel(NULL, NULL);
+ dest = foldersel_folder_sel(NULL, FOLDER_SEL_COPY, NULL);
if (!dest) return;
path = folder_item_get_identifier(dest);
}
#endif
+ update_compose_actions_menu(ifactory, "/Edit/Actions", compose);
+
switch (prefs_common.toolbar_style) {
case TOOLBAR_NONE:
gtk_widget_hide(handlebox);
conv_get_current_charset_str(),
prefs_common.misspelled_col,
prefs_common.check_while_typing,
+ prefs_common.use_alternate,
GTK_STEXT(text));
if (!gtkpspell) {
alertpanel_error(_("Spell checker could not be started.\n%s"), gtkpspellcheckers->error_message);
memset(&dummyinfo, 0, sizeof(MsgInfo));
parsed_str = compose_quote_fmt(compose, &dummyinfo,
- tmpl->value, NULL);
+ tmpl->value, NULL, NULL);
} else {
if (prefs_common.quotemark && *prefs_common.quotemark)
qmark = prefs_common.quotemark;
qmark = "> ";
parsed_str = compose_quote_fmt(compose, compose->replyinfo,
- tmpl->value, qmark);
+ tmpl->value, qmark, NULL);
}
if (parsed_str && prefs_common.auto_sig)
g_snprintf(buf, sizeof(buf), def_cmd, file);
}
- cmdline = g_strsplit(buf, " ", 1024);
+ cmdline = strsplit_with_quote(buf, " ", 1024);
execvp(cmdline[0], cmdline);
perror("execvp");