diff options
author | raveit <[email protected]> | 2013-07-04 17:51:49 +0200 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2013-09-19 16:08:51 +0200 |
commit | dfe505522c630863438c3649e2a028f14e1138fa (patch) | |
tree | b5781adb53e65eb20173d5b1ed5cea2b37ce35c9 | |
parent | 1a171bb32733f3599a29a3fe184dff10e6d1bceb (diff) | |
download | pluma-dfe505522c630863438c3649e2a028f14e1138fa.tar.bz2 pluma-dfe505522c630863438c3649e2a028f14e1138fa.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" */ |