summaryrefslogtreecommitdiff
path: root/panels/printers/pp-options-dialog.c
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2018-11-23 12:18:05 +1300
committerRobert Ancell <robert.ancell@canonical.com>2019-09-10 12:36:39 +1200
commitb842a33316f76e0ee7eb40365ef7f17488e1ff53 (patch)
treee07eb2a0cf104652829c4de3228c6deeacffb9cd /panels/printers/pp-options-dialog.c
parent015c79411ad52de8123b4eb71f961bbbd2f6c6b3 (diff)
downloadgnome-control-center-b842a33316f76e0ee7eb40365ef7f17488e1ff53.tar.gz
printers: Move callbacks into .ui file
Diffstat (limited to 'panels/printers/pp-options-dialog.c')
-rw-r--r--panels/printers/pp-options-dialog.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/panels/printers/pp-options-dialog.c b/panels/printers/pp-options-dialog.c
index 6039262f1..10abd3147 100644
--- a/panels/printers/pp-options-dialog.c
+++ b/panels/printers/pp-options-dialog.c
@@ -49,7 +49,6 @@ struct _PpOptionsDialog {
GtkNotebook *notebook;
GtkSpinner *spinner;
GtkStack *stack;
- GtkButton *test_page_button;
gchar *printer_name;
@@ -483,15 +482,13 @@ tab_add (PpOptionsDialog *self,
}
static void
-category_selection_changed_cb (GtkTreeSelection *selection,
- gpointer user_data)
+category_selection_changed_cb (PpOptionsDialog *self)
{
- PpOptionsDialog *self = (PpOptionsDialog *) user_data;
- GtkTreeModel *model;
- GtkTreeIter iter;
- gint id = -1;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ gint id = -1;
- if (gtk_tree_selection_get_selected (selection, &model, &iter))
+ if (gtk_tree_selection_get_selected (self->categories_selection, &model, &iter))
{
gtk_tree_model_get (model, &iter,
CATEGORY_IDS_COLUMN, &id,
@@ -679,10 +676,6 @@ populate_options_real (PpOptionsDialog *self)
tab_add (self, C_("Printer Option Group", "Advanced"), advanced_tab_grid);
/* Select the first option group */
- g_signal_connect (self->categories_selection,
- "changed",
- G_CALLBACK (category_selection_changed_cb), self);
-
if ((model = gtk_tree_view_get_model (self->categories_treeview)) != NULL &&
gtk_tree_model_get_iter_first (model, &iter))
gtk_tree_selection_select_iter (self->categories_selection, &iter);
@@ -842,11 +835,9 @@ print_test_page_cb (GObject *source_object,
}
static void
-test_page_cb (GtkButton *button,
- gpointer user_data)
+test_page_cb (PpOptionsDialog *self)
{
- PpOptionsDialog *self = (PpOptionsDialog*) user_data;
- gint i;
+ gint i;
if (self->printer_name)
{
@@ -918,9 +909,6 @@ pp_options_dialog_new (gchar *printer_name,
self->sensitive = sensitive;
- /* connect signals */
- g_signal_connect (self->test_page_button, "clicked", G_CALLBACK (test_page_cb), self);
-
gtk_window_set_title (GTK_WINDOW (self), printer_name);
self->populating_dialog = TRUE;
@@ -975,7 +963,9 @@ pp_options_dialog_class_init (PpOptionsDialogClass *klass)
gtk_widget_class_bind_template_child (widget_class, PpOptionsDialog, notebook);
gtk_widget_class_bind_template_child (widget_class, PpOptionsDialog, spinner);
gtk_widget_class_bind_template_child (widget_class, PpOptionsDialog, stack);
- gtk_widget_class_bind_template_child (widget_class, PpOptionsDialog, test_page_button);
+
+ gtk_widget_class_bind_template_callback (widget_class, category_selection_changed_cb);
+ gtk_widget_class_bind_template_callback (widget_class, test_page_cb);
}
void