Code cleanup based on feedback.

This commit is contained in:
Brandon Nielsen 2021-07-21 14:51:44 -05:00 committed by Marek Kašík
parent a73a095d76
commit c3c58aae38
3 changed files with 14 additions and 13 deletions

View file

@ -944,17 +944,18 @@ new_printer_dialog_response_cb (GtkDialog *_dialog,
PpNewPrinterDialog *pp_new_printer_dialog = PP_NEW_PRINTER_DIALOG (_dialog);
g_autoptr(PpNewPrinter) new_printer = NULL;
if (response_id == GTK_RESPONSE_OK) {
new_printer = pp_new_printer_dialog_get_new_printer (pp_new_printer_dialog);
g_object_get(G_OBJECT (new_printer), "name", &self->new_printer_name, NULL);
if (response_id == GTK_RESPONSE_OK)
{
new_printer = pp_new_printer_dialog_get_new_printer (pp_new_printer_dialog);
g_object_get(G_OBJECT (new_printer), "name", &self->new_printer_name, NULL);
actualize_printers_list (self);
actualize_printers_list (self);
pp_new_printer_add_async (new_printer,
cc_panel_get_cancellable (CC_PANEL (self)),
printer_add_async_cb,
self);
}
pp_new_printer_add_async (new_printer,
cc_panel_get_cancellable (CC_PANEL (self)),
printer_add_async_cb,
self);
}
gtk_widget_destroy (GTK_WIDGET (pp_new_printer_dialog));
self->pp_new_printer_dialog = NULL;
@ -973,7 +974,7 @@ printer_add_cb (CcPrintersPanel *self)
gtk_window_set_transient_for (GTK_WINDOW (self->pp_new_printer_dialog),
GTK_WINDOW (toplevel));
gtk_widget_show (self->pp_new_printer_dialog);
gtk_widget_show (GTK_WIDGET (self->pp_new_printer_dialog));
}
static void

View file

@ -219,7 +219,7 @@ select_ppd_in_dialog (PpDetailsDialog *self)
gtk_window_set_transient_for (GTK_WINDOW (self->pp_ppd_selection_dialog),
GTK_WINDOW (self));
gtk_widget_show (self->pp_ppd_selection_dialog);
gtk_widget_show (GTK_WIDGET (self->pp_ppd_selection_dialog));
}
}

View file

@ -390,7 +390,7 @@ device_selection_changed_cb (PpNewPrinterDialog *self)
gtk_widget_set_sensitive (GTK_WIDGET (self->unlock_button), authentication_needed);
if (authentication_needed)
gtk_stack_set_visible_child_name (self->headerbar_topright_buttons, "unlock-button");
gtk_stack_set_visible_child_name (self->headerbar_topright_buttons, "unlock_button");
else
gtk_stack_set_visible_child_name (self->headerbar_topright_buttons, ADDPRINTER_PAGE);
}
@ -1755,7 +1755,7 @@ new_printer_dialog_response_cb (PpNewPrinterDialog *self,
GTK_WINDOW (self));
/* New device will be set at return from ppd selection */
gtk_widget_show (self->ppd_selection_dialog);
gtk_widget_show (GTK_WIDGET (self->ppd_selection_dialog));
}
else
{