From 71e00c80d57e50072fccf9b92b7cf82778b7315f Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Fri, 21 Sep 2018 10:59:56 +0100 Subject: [PATCH] Bug fix #160: Replace print dialog by standard GTK dialog https://github.com/BestImageViewer/geeqie/issues/160 Ensure print dialog has a parent window Eliminate run-time error --- src/collect-table.c | 2 +- src/print.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/collect-table.c b/src/collect-table.c index f3b57c18..50bce3c1 100644 --- a/src/collect-table.c +++ b/src/collect-table.c @@ -904,7 +904,7 @@ static void collection_table_popup_print_cb(GtkWidget *widget, gpointer data) fd = (ct->click_info) ? ct->click_info->fd : NULL; - print_window_new(fd, collection_table_selection_get_list(ct), collection_table_get_list(ct), ct->listview); + print_window_new(fd, collection_table_selection_get_list(ct), collection_table_get_list(ct), gtk_widget_get_toplevel(ct->listview)); } static void collection_table_popup_show_names_cb(GtkWidget *widget, gpointer data) diff --git a/src/print.c b/src/print.c index 4dc09199..8b7bf2f1 100644 --- a/src/print.c +++ b/src/print.c @@ -491,6 +491,11 @@ void print_window_new(FileData *fd, GList *selection, GList *list, GtkWidget *pa pw->source_selection = file_data_process_groups_in_selection(selection, FALSE, NULL); pw->text_fields = options->printer.text_fields; + if (print_layout_page_count(pw) == 0) + { + return; + } + vbox = gtk_vbox_new(FALSE, 0); gtk_container_set_border_width(GTK_CONTAINER(vbox), PREF_PAD_BORDER); gtk_widget_show(vbox); -- 2.20.1