aboutsummaryrefslogtreecommitdiff
path: root/src/printing.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-12-04 04:46:03 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-12-04 04:46:03 +0000
commite745bf5517fa827e02bbf0ff94fbed323643f542 (patch)
tree5210fc8064a3a37ca1072bb1bd3f0108cd91e09f /src/printing.c
parent3d57ec9b7ae57f6ce27116300f2a71adadead0d0 (diff)
show confirmation dialog when printing MIME part.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1389 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/printing.c')
-rw-r--r--src/printing.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/printing.c b/src/printing.c
index b83d10a3..ed609d0d 100644
--- a/src/printing.c
+++ b/src/printing.c
@@ -220,15 +220,10 @@ gint printing_print_messages_gtk(GSList *mlist, gboolean all_headers)
#endif /* GTK_CHECK_VERSION(2, 10, 0) */
-gint printing_print_messages_with_command(GSList *mlist, gboolean all_headers,
- const gchar *cmdline)
+static gint check_command_line(const gchar *cmdline)
{
- MsgInfo *msginfo;
- GSList *cur;
gchar *msg;
- g_return_val_if_fail(mlist != NULL, -1);
-
msg = g_strconcat
(_("The message will be printed with the following command:"),
"\n\n", cmdline ? cmdline : _("(Default print command)"),
@@ -236,7 +231,7 @@ gint printing_print_messages_with_command(GSList *mlist, gboolean all_headers,
if (alertpanel(_("Print"), msg, GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL)
!= G_ALERTDEFAULT) {
g_free(msg);
- return 0;
+ return -2;
}
g_free(msg);
@@ -246,6 +241,20 @@ gint printing_print_messages_with_command(GSList *mlist, gboolean all_headers,
return -1;
}
+ return 0;
+}
+
+gint printing_print_messages_with_command(GSList *mlist, gboolean all_headers,
+ const gchar *cmdline)
+{
+ MsgInfo *msginfo;
+ GSList *cur;
+
+ g_return_val_if_fail(mlist != NULL, -1);
+
+ if (check_command_line(cmdline) < 0)
+ return -1;
+
for (cur = mlist; cur != NULL; cur = cur->next) {
msginfo = (MsgInfo *)cur->data;
if (msginfo)
@@ -277,6 +286,9 @@ gint printing_print_message(MsgInfo *msginfo, gboolean all_headers)
gint printing_print_message_part(MsgInfo *msginfo, MimeInfo *partinfo)
{
+ if (check_command_line(prefs_common.print_cmd) < 0)
+ return -1;
procmsg_print_message_part(msginfo, partinfo, prefs_common.print_cmd,
FALSE);
+ return 0;
}