diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-10-25 09:31:24 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-10-25 09:31:24 +0000 |
commit | 3b06a8bc4c06d2516b2a1a7dd3e69ffda65c3656 (patch) | |
tree | 5fe57426b0b212ac65a30686631dfb8a73c03590 /src/messageview.c | |
parent | 0cf3893a84098f7bdabe7458ba2bd75f210d5687 (diff) |
display confirmation dialog instead of input dialog when printing.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@684 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/messageview.c')
-rw-r--r-- | src/messageview.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/messageview.c b/src/messageview.c index ef452c7f..cea04ba8 100644 --- a/src/messageview.c +++ b/src/messageview.c @@ -714,26 +714,33 @@ static void save_as_cb(gpointer data, guint action, GtkWidget *widget) static void print_cb(gpointer data, guint action, GtkWidget *widget) { MessageView *messageview = (MessageView *)data; - gchar *cmdline; + const gchar *cmdline; + gchar *msg; gchar *p; if (!messageview->msginfo) return; - cmdline = input_dialog(_("Print"), - _("Enter the print command line:\n" - "(`%s' will be replaced with file name)"), - prefs_common.print_cmd); - if (!cmdline) return; - if (!(p = strchr(cmdline, '%')) || *(p + 1) != 's' || - strchr(p + 2, '%')) { + cmdline = prefs_common.print_cmd; + + msg = g_strconcat + (_("The message will be printed with the following command:"), + "\n\n", cmdline ? cmdline : _("(Default print command)"), + NULL); + if (alertpanel(_("Print"), msg, GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL) + != G_ALERTDEFAULT) { + g_free(msg); + return; + } + g_free(msg); + + if (cmdline && (!(p = strchr(cmdline, '%')) || *(p + 1) != 's' || + strchr(p + 2, '%'))) { alertpanel_error(_("Print command line is invalid:\n`%s'"), cmdline); - g_free(cmdline); return; } procmsg_print_message(messageview->msginfo, cmdline); - g_free(cmdline); } static void close_cb(gpointer data, guint action, GtkWidget *widget) |