summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-02-17 21:40:36 -0500
committerMatthias Clasen <mclasen@redhat.com>2014-02-17 21:40:36 -0500
commit2392b1e534c8e176ecff773ff22699de2d4bf358 (patch)
tree17befeb9eb853e3d124eae222b0daa5e4260c0da
parent0ff0fdfefbba86f3dc7713cf55bbf00194274fe3 (diff)
downloadgtk+-2392b1e534c8e176ecff773ff22699de2d4bf358.tar.gz
Make print dialog destruction work
This was also causing the templates test to fail.
-rw-r--r--gtk/gtkprintunixdialog.c13
-rw-r--r--gtk/resources/ui/gtkprintunixdialog.ui1
2 files changed, 10 insertions, 4 deletions
diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c
index 052271b225..170f36883c 100644
--- a/gtk/gtkprintunixdialog.c
+++ b/gtk/gtkprintunixdialog.c
@@ -121,7 +121,7 @@
static GObject *gtk_print_unix_dialog_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
-static void gtk_print_unix_dialog_destroy (GtkPrintUnixDialog *dialog);
+static void gtk_print_unix_dialog_destroy (GtkWidget *widget);
static void gtk_print_unix_dialog_finalize (GObject *object);
static void gtk_print_unix_dialog_set_property (GObject *object,
guint prop_id,
@@ -400,6 +400,7 @@ gtk_print_unix_dialog_class_init (GtkPrintUnixDialogClass *class)
object_class->get_property = gtk_print_unix_dialog_get_property;
widget_class->style_updated = gtk_print_unix_dialog_style_updated;
+ widget_class->destroy = gtk_print_unix_dialog_destroy;
g_object_class_install_property (object_class,
PROP_PAGE_SETUP,
@@ -538,7 +539,6 @@ gtk_print_unix_dialog_class_init (GtkPrintUnixDialogClass *class)
gtk_widget_class_bind_template_child_private (widget_class, GtkPrintUnixDialog, number_up_layout);
/* Callbacks handled in the UI */
- gtk_widget_class_bind_template_callback (widget_class, gtk_print_unix_dialog_destroy);
gtk_widget_class_bind_template_callback (widget_class, redraw_page_layout_preview);
gtk_widget_class_bind_template_callback (widget_class, error_dialogs);
gtk_widget_class_bind_template_callback (widget_class, emit_ok_response);
@@ -812,10 +812,14 @@ gtk_print_unix_dialog_constructor (GType type,
}
static void
-gtk_print_unix_dialog_destroy (GtkPrintUnixDialog *dialog)
+gtk_print_unix_dialog_destroy (GtkWidget *widget)
{
+ GtkPrintUnixDialog *dialog = GTK_PRINT_UNIX_DIALOG (widget);
+
/* Make sure we don't destroy custom widgets owned by the backends */
clear_per_printer_ui (dialog);
+
+ GTK_WIDGET_CLASS (gtk_print_unix_dialog_parent_class)->destroy (widget);
}
static void
@@ -1949,6 +1953,9 @@ clear_per_printer_ui (GtkPrintUnixDialog *dialog)
{
GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ if (priv->finishing_table == NULL)
+ return;
+
gtk_container_foreach (GTK_CONTAINER (priv->finishing_table),
(GtkCallback)gtk_widget_destroy, NULL);
gtk_container_foreach (GTK_CONTAINER (priv->image_quality_table),
diff --git a/gtk/resources/ui/gtkprintunixdialog.ui b/gtk/resources/ui/gtkprintunixdialog.ui
index 0f623852b5..9d428aba4c 100644
--- a/gtk/resources/ui/gtkprintunixdialog.ui
+++ b/gtk/resources/ui/gtkprintunixdialog.ui
@@ -50,7 +50,6 @@
<template class="GtkPrintUnixDialog" parent="GtkDialog">
<property name="can_focus">False</property>
<property name="type_hint">normal</property>
- <signal name="destroy" handler="gtk_print_unix_dialog_destroy" swapped="no"/>
<signal name="notify::page-setup" handler="redraw_page_layout_preview" swapped="no"/>
<signal name="response" handler="error_dialogs" swapped="no"/>
<child internal-child="vbox">