printers: Use gtk_stack_set_visible_child instead of names
This commit is contained in:
parent
2c28987e41
commit
1b999f36e2
2 changed files with 5 additions and 9 deletions
|
@ -42,6 +42,7 @@ struct _PpDetailsDialog {
|
|||
GtkDialog parent;
|
||||
|
||||
GtkLabel *dialog_title;
|
||||
GtkBox *loading_box;
|
||||
GtkEntry *printer_name_entry;
|
||||
GtkEntry *printer_location_entry;
|
||||
GtkLabel *printer_address_label;
|
||||
|
@ -121,14 +122,14 @@ get_ppd_names_cb (PPDName **names,
|
|||
gtk_label_set_text (self->printer_model_label, _("No suitable driver found"));
|
||||
}
|
||||
|
||||
gtk_stack_set_visible_child_name (self->printer_model_stack, "printer_model_label");
|
||||
gtk_stack_set_visible_child (self->printer_model_stack, GTK_WIDGET (self->printer_model_label));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
search_for_drivers (PpDetailsDialog *self)
|
||||
{
|
||||
gtk_stack_set_visible_child_name (self->printer_model_stack, "loading");
|
||||
gtk_stack_set_visible_child (self->printer_model_stack, GTK_WIDGET (self->loading_box));
|
||||
gtk_widget_set_sensitive (self->search_for_drivers_button, FALSE);
|
||||
|
||||
get_ppd_names_async (self->printer_name,
|
||||
|
@ -331,6 +332,7 @@ pp_details_dialog_class_init (PpDetailsDialogClass *klass)
|
|||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/printers/pp-details-dialog.ui");
|
||||
|
||||
gtk_widget_class_bind_template_child (widget_class, PpDetailsDialog, dialog_title);
|
||||
gtk_widget_class_bind_template_child (widget_class, PpDetailsDialog, loading_box);
|
||||
gtk_widget_class_bind_template_child (widget_class, PpDetailsDialog, printer_name_entry);
|
||||
gtk_widget_class_bind_template_child (widget_class, PpDetailsDialog, printer_location_entry);
|
||||
gtk_widget_class_bind_template_child (widget_class, PpDetailsDialog, printer_address_label);
|
||||
|
|
|
@ -142,12 +142,9 @@
|
|||
<property name="label">HP Inkjet Delux 9000</property>
|
||||
<property name="selectable">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">printer_model_label</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<object class="GtkBox" id="loading_box">
|
||||
<property name="visible">True</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="spacing">5</property>
|
||||
|
@ -166,9 +163,6 @@
|
|||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">loading</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue