diff options
| author | raveit <[email protected]> | 2013-07-04 17:51:49 +0200 |
|---|---|---|
| committer | infirit <[email protected]> | 2013-12-17 17:52:35 +0100 |
| commit | 126a42c87f4a201e41a333b9ba007782d5c77be0 (patch) | |
| tree | ba6f6ae83b463be15a2e19d6dfa347b78424d7f4 | |
| parent | 62b77b85f882b23ddee7feb9e65cc73f78e36815 (diff) | |
| download | pluma-126a42c87f4a201e41a333b9ba007782d5c77be0.tar.bz2 pluma-126a42c87f4a201e41a333b9ba007782d5c77be0.tar.xz | |
print to file fix
| -rw-r--r-- | pluma/pluma-tab.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/pluma/pluma-tab.c b/pluma/pluma-tab.c index e795b83a..46d9681b 100644 --- a/pluma/pluma-tab.c +++ b/pluma/pluma-tab.c @@ -2238,6 +2238,8 @@ get_print_settings (PlumaTab *tab) { gpointer data; PlumaDocument *doc; + GtkPrintSettings *settings; + gchar *uri, *name; doc = pluma_tab_get_document (tab); @@ -2246,12 +2248,24 @@ get_print_settings (PlumaTab *tab) if (data == NULL) { - return _pluma_app_get_default_print_settings (pluma_app_get_default()); + settings = _pluma_app_get_default_print_settings (pluma_app_get_default()); } else { - return gtk_print_settings_copy (GTK_PRINT_SETTINGS (data)); + settings = gtk_print_settings_copy (GTK_PRINT_SETTINGS (data)); } + + name = pluma_document_get_short_name_for_display (doc); + uri = g_strconcat ("file://", + g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS), + "/", name, ".pdf", NULL); + + gtk_print_settings_set (settings, GTK_PRINT_SETTINGS_OUTPUT_URI, uri); + + g_free (uri); + g_free (name); + + return settings; } /* FIXME: show the message area only if the operation will be "long" */ |
