aboutsummaryrefslogtreecommitdiff
path: root/src/printing.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-12-13 06:55:21 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-12-13 06:55:21 +0000
commitc38f75ca2d327c93bba14ff72f14bfe7856609a1 (patch)
tree22cd7e386bd04a37635d60b52eae69f99e899e95 /src/printing.c
parentaae887a3faf1afb0c8b4760e16fa3480d920e086 (diff)
implemented page setup.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1420 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/printing.c')
-rw-r--r--src/printing.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/printing.c b/src/printing.c
index 0aa0c01d..595d8244 100644
--- a/src/printing.c
+++ b/src/printing.c
@@ -74,6 +74,8 @@ typedef struct
gboolean all_headers;
} PrintData;
+static GtkPrintSettings *settings = NULL;
+static GtkPageSetup *page_setup = NULL;
static gint get_header_data(MsgPrintInfo *mpinfo, PrintData *print_data)
{
@@ -418,7 +420,6 @@ static void draw_page(GtkPrintOperation *operation, GtkPrintContext *context,
gint printing_print_messages_gtk(GSList *mlist, MimeInfo *partinfo,
gboolean all_headers)
{
- static GtkPrintSettings *settings = NULL;
GtkPrintOperation *op;
GtkPrintOperationResult res;
PrintData *print_data;
@@ -452,6 +453,8 @@ gint printing_print_messages_gtk(GSList *mlist, MimeInfo *partinfo,
if (settings)
gtk_print_operation_set_print_settings(op, settings);
+ if (page_setup)
+ gtk_print_operation_set_default_page_setup(op, page_setup);
res = gtk_print_operation_run
(op, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
@@ -484,6 +487,22 @@ gint printing_print_messages_gtk(GSList *mlist, MimeInfo *partinfo,
return 0;
}
+void printing_page_setup_gtk(void)
+{
+ GtkPageSetup *new_page_setup;
+
+ if (settings == NULL)
+ settings = gtk_print_settings_new();
+
+ new_page_setup = gtk_print_run_page_setup_dialog
+ (GTK_WINDOW(main_window_get()->window), page_setup, settings);
+
+ if (page_setup)
+ g_object_unref(page_setup);
+
+ page_setup = new_page_setup;
+}
+
#endif /* GTK_CHECK_VERSION(2, 10, 0) */
static gint check_command_line(const gchar *cmdline)