printers: Remove use of gtk_widget_show_all

It is removed in GTK 4.
This commit is contained in:
Robert Ancell 2020-11-10 12:17:54 +13:00 committed by Marek Kašík
parent 25963ccf8c
commit ae1a37b009
10 changed files with 30 additions and 14 deletions

View file

@ -721,6 +721,7 @@ add_printer_entry (CcPrintersPanel *self,
content = (GtkWidget*) gtk_builder_get_object (self->builder, "content");
printer_entry = pp_printer_entry_new (printer, self->is_authorized);
gtk_widget_show (GTK_WIDGET (printer_entry));
widgets = pp_printer_entry_get_size_group_widgets (printer_entry);
for (l = widgets; l != NULL; l = l->next)
@ -744,7 +745,6 @@ add_printer_entry (CcPrintersPanel *self,
G_CONNECT_SWAPPED);
gtk_list_box_insert (GTK_LIST_BOX (content), GTK_WIDGET (printer_entry), -1);
gtk_widget_show_all (content);
g_hash_table_insert (self->printer_entries, g_strdup (printer.name), printer_entry);
}
@ -1292,5 +1292,5 @@ Please check your installation");
pp_cups_connection_test_async (self->cups, cc_panel_get_cancellable (CC_PANEL (self)), connection_test_cb, self);
gtk_container_add (GTK_CONTAINER (self), top_widget);
gtk_widget_show_all (GTK_WIDGET (self));
gtk_widget_show (GTK_WIDGET (self));
}

View file

@ -323,6 +323,7 @@
</style>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="pixel_size">48</property>
<property name="icon_name">dialog-password-symbolic</property>
</object>
@ -334,6 +335,7 @@
</child>
<child>
<object class="GtkLabel" id="authentication-title">
<property name="visible">True</property>
<property name="label" translatable="yes">Authentication Required</property>
<property name="xalign">0</property>
<attributes>
@ -347,6 +349,7 @@
</child>
<child>
<object class="GtkLabel" id="authentication-text">
<property name="visible">True</property>
<property name="wrap">True</property>
<property name="max_width_chars">36</property>
<property name="xalign">0</property>
@ -359,6 +362,7 @@
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Username</property>
</object>
<packing>
@ -368,6 +372,7 @@
</child>
<child>
<object class="GtkEntry" id="username-entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="activates_default">True</property>
@ -380,6 +385,7 @@
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Password</property>
</object>
<packing>
@ -389,6 +395,7 @@
</child>
<child>
<object class="GtkEntry" id="password-entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="visibility">False</property>
<property name="invisible_char">●</property>

View file

@ -374,6 +374,7 @@ construct_widget (PpIPPOptionWidget *self)
{
case IPP_ATTRIBUTE_TYPE_BOOLEAN:
self->switch_button = gtk_switch_new ();
gtk_widget_show (self->switch_button);
gtk_box_pack_start (GTK_BOX (self), self->switch_button, FALSE, FALSE, 0);
g_signal_connect_object (self->switch_button, "notify::active", G_CALLBACK (switch_changed_cb), self, G_CONNECT_SWAPPED);
@ -381,6 +382,7 @@ construct_widget (PpIPPOptionWidget *self)
case IPP_ATTRIBUTE_TYPE_INTEGER:
self->combo = combo_box_new ();
gtk_widget_show (self->combo);
for (i = 0; i < self->option_supported->num_of_values; i++)
{
@ -399,6 +401,7 @@ construct_widget (PpIPPOptionWidget *self)
case IPP_ATTRIBUTE_TYPE_STRING:
self->combo = combo_box_new ();
gtk_widget_show (self->combo);
for (i = 0; i < self->option_supported->num_of_values; i++)
combo_box_append (self->combo,
@ -415,6 +418,7 @@ construct_widget (PpIPPOptionWidget *self)
self->option_supported->attribute_values[0].lower_range,
self->option_supported->attribute_values[0].upper_range,
1);
gtk_widget_show (self->spin_button);
gtk_box_pack_start (GTK_BOX (self), self->spin_button, FALSE, FALSE, 0);
g_signal_connect_object (self->spin_button, "value-changed", G_CALLBACK (spin_button_changed_cb), self, G_CONNECT_SWAPPED);

View file

@ -243,16 +243,19 @@ create_listbox_row (gpointer item,
}
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show (box);
g_object_set (box, "margin", 6, NULL);
gtk_container_set_border_width (GTK_CONTAINER (box), 2);
widget = gtk_label_new (pp_job_get_title (job));
gtk_widget_show (widget);
gtk_label_set_max_width_chars (GTK_LABEL (widget), 40);
gtk_label_set_ellipsize (GTK_LABEL (widget), PANGO_ELLIPSIZE_END);
gtk_widget_set_halign (widget, GTK_ALIGN_START);
gtk_box_pack_start (GTK_BOX (box), widget, TRUE, TRUE, 10);
widget = gtk_label_new (NULL);
gtk_widget_show (widget);
gtk_label_set_markup (GTK_LABEL (widget), state_string);
gtk_widget_set_halign (widget, GTK_ALIGN_END);
gtk_widget_set_margin_end (widget, 64);
@ -261,17 +264,17 @@ create_listbox_row (gpointer item,
widget = gtk_button_new_from_icon_name (pp_job_get_state (job) == IPP_JOB_HELD ? "media-playback-start-symbolic" : "media-playback-pause-symbolic",
GTK_ICON_SIZE_SMALL_TOOLBAR);
gtk_widget_show (widget);
g_signal_connect (widget, "clicked", G_CALLBACK (job_pause_cb), item);
gtk_widget_set_sensitive (widget, pp_job_get_auth_info_required (job) == NULL);
gtk_box_pack_start (GTK_BOX (box), widget, FALSE, FALSE, 4);
widget = gtk_button_new_from_icon_name ("edit-delete-symbolic",
GTK_ICON_SIZE_SMALL_TOOLBAR);
gtk_widget_show (widget);
g_signal_connect (widget, "clicked", G_CALLBACK (job_stop_cb), item);
gtk_box_pack_start (GTK_BOX (box), widget, FALSE, FALSE, 4);
gtk_widget_show_all (box);
return box;
}

View file

@ -195,7 +195,7 @@ pp_new_printer_dialog_new (GtkWindow *parent,
gtk_window_set_transient_for (GTK_WINDOW (self->dialog), GTK_WINDOW (parent));
gtk_widget_show_all (self->dialog);
gtk_widget_show (self->dialog);
return PP_NEW_PRINTER_DIALOG (self);
}

View file

@ -355,7 +355,7 @@ ipp_option_add (IPPAttribute *attr_supported,
printer_name);
if (widget)
{
gtk_widget_show_all (widget);
gtk_widget_show (widget);
gtk_widget_set_sensitive (widget, sensitive);
position = grid_get_height (grid);
@ -390,7 +390,7 @@ ppd_option_add (ppd_option_t option,
widget = (GtkWidget *) pp_ppd_option_widget_new (&option, printer_name);
if (widget)
{
gtk_widget_show_all (widget);
gtk_widget_show (widget);
gtk_widget_set_sensitive (widget, sensitive);
position = grid_get_height (grid);

View file

@ -388,12 +388,15 @@ construct_widget (PpPPDOptionWidget *self)
{
case PPD_UI_BOOLEAN:
self->switch_button = gtk_switch_new ();
gtk_widget_show (self->switch_button);
g_signal_connect_object (self->switch_button, "notify::active", G_CALLBACK (switch_changed_cb), self, G_CONNECT_SWAPPED);
gtk_box_pack_start (GTK_BOX (self), self->switch_button, FALSE, FALSE, 0);
break;
case PPD_UI_PICKONE:
self->combo = combo_box_new ();
gtk_widget_show (self->combo);
for (i = 0; i < self->option->num_choices; i++)
{
@ -408,6 +411,7 @@ construct_widget (PpPPDOptionWidget *self)
case PPD_UI_PICKMANY:
self->combo = combo_box_new ();
gtk_widget_show (self->combo);
for (i = 0; i < self->option->num_choices; i++)
{
@ -427,6 +431,7 @@ construct_widget (PpPPDOptionWidget *self)
self->image = gtk_image_new_from_icon_name ("dialog-warning-symbolic", GTK_ICON_SIZE_MENU);
if (!self->image)
self->image = gtk_image_new_from_icon_name ("dialog-warning", GTK_ICON_SIZE_MENU);
gtk_widget_show (self->image);
gtk_box_pack_start (GTK_BOX (self), self->image, FALSE, FALSE, 0);
gtk_widget_set_no_show_all (GTK_WIDGET (self->image), TRUE);

View file

@ -261,18 +261,13 @@ populate_dialog (PpPPDSelectionDialog *self)
g_signal_connect_object (gtk_tree_view_get_selection (manufacturers_treeview),
"changed", G_CALLBACK (manufacturer_selection_changed_cb), self, G_CONNECT_SWAPPED);
gtk_widget_show_all (self->dialog);
gtk_widget_show (self->dialog);
if (!self->list)
{
widget = (GtkWidget*)
gtk_builder_get_object (self->builder, "ppd-spinner");
gtk_widget_show (widget);
gtk_spinner_start (GTK_SPINNER (widget));
widget = (GtkWidget*)
gtk_builder_get_object (self->builder, "progress-label");
gtk_widget_show (widget);
}
else
{
@ -370,7 +365,6 @@ pp_ppd_selection_dialog_new (GtkWindow *parent,
populate_dialog (self);
gtk_window_present (GTK_WINDOW (self->dialog));
gtk_widget_show_all (GTK_WIDGET (self->dialog));
return PP_PPD_SELECTION_DIALOG (self);
}

View file

@ -55,6 +55,7 @@
<property name="can_focus">False</property>
<child>
<object class="GtkSpinner" id="ppd-spinner">
<property name="visible">True</property>
<property name="width_request">24</property>
<property name="height_request">24</property>
<property name="can_focus">False</property>
@ -68,6 +69,7 @@
</child>
<child>
<object class="GtkLabel" id="progress-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="label" translatable="yes">Loading drivers database…</property>

View file

@ -93,6 +93,7 @@
<child>
<object class="GtkStack" id="main-vbox">
<property name="visible">True</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>