summaryrefslogtreecommitdiff
path: root/gtk/gtkprintoperation-unix.c
diff options
context:
space:
mode:
authorMarek Kasik <mkasik@redhat.com>2009-04-21 13:06:49 +0200
committerMarek Kasik <mkasik@redhat.com>2009-04-21 13:06:49 +0200
commit6e121ee85e7c796b33d2f6635744ab3f0d0f65e2 (patch)
tree465e3d7a9e02f5350131294bf6162c0f9008cb68 /gtk/gtkprintoperation-unix.c
parent405955749103dcfdf582b6ae4f053c66837a6281 (diff)
downloadgtk+-6e121ee85e7c796b33d2f6635744ab3f0d0f65e2.tar.gz
Allow the custom widget to actualize on a printer change
Passes print settings and page setup to the custom widget through a new "update-custom-widget" signal (#564854).
Diffstat (limited to 'gtk/gtkprintoperation-unix.c')
-rw-r--r--gtk/gtkprintoperation-unix.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gtk/gtkprintoperation-unix.c b/gtk/gtkprintoperation-unix.c
index 6ec4ebdd8c..bec565c01f 100644
--- a/gtk/gtkprintoperation-unix.c
+++ b/gtk/gtkprintoperation-unix.c
@@ -363,6 +363,26 @@ job_status_changed_cb (GtkPrintJob *job,
}
+static void
+printer_changed_cb (GtkPrintUnixDialog *print_dialog,
+ GParamSpec *pspec,
+ gpointer user_data)
+{
+ GtkPageSetup *page_setup;
+ GtkPrintSettings *print_settings;
+ GtkPrintOperation *op = user_data;
+ GtkPrintOperationPrivate *priv = op->priv;
+
+ page_setup = gtk_print_unix_dialog_get_page_setup (print_dialog);
+ print_settings = gtk_print_unix_dialog_get_settings (print_dialog);
+
+ g_signal_emit_by_name (op,
+ "update-custom-widget",
+ priv->custom_widget,
+ page_setup,
+ print_settings);
+}
+
static GtkWidget *
get_print_dialog (GtkPrintOperation *op,
GtkWindow *parent)
@@ -409,6 +429,8 @@ get_print_dialog (GtkPrintOperation *op,
gtk_print_unix_dialog_add_custom_tab (GTK_PRINT_UNIX_DIALOG (pd),
priv->custom_widget, label);
+
+ g_signal_connect (pd, "notify::selected-printer", (GCallback) printer_changed_cb, op);
}
return pd;