Bug fix #160: Replace print dialog by standard GTK dialog
authorColin Clark <colin.clark@cclark.uk>
Fri, 21 Sep 2018 09:59:56 +0000 (10:59 +0100)
committerColin Clark <colin.clark@cclark.uk>
Fri, 21 Sep 2018 09:59:56 +0000 (10:59 +0100)
https://github.com/BestImageViewer/geeqie/issues/160

Ensure print dialog has a parent window
Eliminate run-time error

src/collect-table.c
src/print.c

index f3b57c1..50bce3c 100644 (file)
@@ -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)
index 4dc0919..8b7bf2f 100644 (file)
@@ -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);