aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--ChangeLog.ja6
-rw-r--r--src/messageview.c27
-rw-r--r--src/summaryview.c31
4 files changed, 48 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index 6be9dcf6..c9bc416c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2005-10-25
+ * src/messageview.c
+ src/summaryview.c: display confirmation dialog instead of input
+ dialog when printing.
+
+2005-10-25
+
* libsylph/procmsg.c: fixed a typo.
2005-10-25
diff --git a/ChangeLog.ja b/ChangeLog.ja
index 0eee20a0..e9c92a1e 100644
--- a/ChangeLog.ja
+++ b/ChangeLog.ja
@@ -1,5 +1,11 @@
2005-10-25
+ * src/messageview.c
+ src/summaryview.c: 印刷時は入力ダイアログの代わりに確認ダイアログ
+ を出すようにした。
+
+2005-10-25
+
* libsylph/procmsg.c: typo を修正。
2005-10-25
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)
diff --git a/src/summaryview.c b/src/summaryview.c
index 635fc4ca..2d5edf41 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -3004,33 +3004,40 @@ void summary_print(SummaryView *summaryview)
{
MsgInfo *msginfo;
GSList *mlist, *cur;
- gchar *cmdline;
+ const gchar *cmdline;
+ gchar *msg;
gchar *p;
if (gtk_tree_selection_count_selected_rows(summaryview->selection) == 0)
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;
}
mlist = summary_get_selected_msg_list(summaryview);
for (cur = mlist; cur != NULL; cur = cur->next) {
msginfo = (MsgInfo *)cur->data;
- if (msginfo) procmsg_print_message(msginfo, cmdline);
+ if (msginfo)
+ procmsg_print_message(msginfo, cmdline);
}
g_slist_free(mlist);
-
- g_free(cmdline);
}
gboolean summary_execute(SummaryView *summaryview)