Commit 08612b2f authored by Victor Ananjevsky's avatar Victor Ananjevsky

fix hadling previously saved print settings

parent 0b9cc3a7
......@@ -245,6 +245,11 @@ yad_print_run (void)
}
g_free (fn);
if (!print_settings)
print_settings = gtk_print_settings_new ();
if (!page_setup)
page_setup = gtk_page_setup_new ();
/* create print dialog */
dlg = gtk_print_unix_dialog_new (options.data.dialog_title, NULL);
gtk_window_set_type_hint (GTK_WINDOW (dlg), GDK_WINDOW_TYPE_HINT_NORMAL);
......@@ -256,18 +261,13 @@ yad_print_run (void)
pcap |= GTK_PRINT_CAPABILITY_PREVIEW;
gtk_print_unix_dialog_set_manual_capabilities (GTK_PRINT_UNIX_DIALOG (dlg), pcap);
if (print_settings)
gtk_print_unix_dialog_set_settings (GTK_PRINT_UNIX_DIALOG (dlg), print_settings);
else
print_settings = gtk_print_settings_new ();
if (page_setup)
gtk_print_unix_dialog_set_page_setup (GTK_PRINT_UNIX_DIALOG (dlg), page_setup);
uri = g_build_filename (g_get_current_dir (), "yad.pdf", NULL);
gtk_print_settings_set (print_settings, "output-uri", g_filename_to_uri (uri, NULL, NULL));
g_free (uri);
gtk_print_unix_dialog_set_settings (GTK_PRINT_UNIX_DIALOG (dlg), print_settings);
gtk_print_unix_dialog_set_page_setup (GTK_PRINT_UNIX_DIALOG (dlg), page_setup);
/* set window behavior */
gtk_widget_set_name (dlg, "yad-dialog-window");
if (options.data.sticky)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment