[gnome-control-center] printers: Remove use of gtk_widget_show_all



commit ae1a37b009e332f24d84f722a07253835dc799e6
Author: Robert Ancell <robert ancell canonical com>
Date:   Tue Nov 10 12:17:54 2020 +1300

    printers: Remove use of gtk_widget_show_all
    
    It is removed in GTK 4.

 panels/printers/cc-printers-panel.c       | 4 ++--
 panels/printers/new-printer-dialog.ui     | 7 +++++++
 panels/printers/pp-ipp-option-widget.c    | 4 ++++
 panels/printers/pp-jobs-dialog.c          | 7 +++++--
 panels/printers/pp-new-printer-dialog.c   | 2 +-
 panels/printers/pp-options-dialog.c       | 4 ++--
 panels/printers/pp-ppd-option-widget.c    | 5 +++++
 panels/printers/pp-ppd-selection-dialog.c | 8 +-------
 panels/printers/ppd-selection-dialog.ui   | 2 ++
 panels/printers/printers.ui               | 1 +
 10 files changed, 30 insertions(+), 14 deletions(-)
---
diff --git a/panels/printers/cc-printers-panel.c b/panels/printers/cc-printers-panel.c
index d8992e7a7..9d8505a1c 100644
--- a/panels/printers/cc-printers-panel.c
+++ b/panels/printers/cc-printers-panel.c
@@ -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));
 }
diff --git a/panels/printers/new-printer-dialog.ui b/panels/printers/new-printer-dialog.ui
index b011f31fc..978a10346 100644
--- a/panels/printers/new-printer-dialog.ui
+++ b/panels/printers/new-printer-dialog.ui
@@ -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>
diff --git a/panels/printers/pp-ipp-option-widget.c b/panels/printers/pp-ipp-option-widget.c
index cbaf1cdc7..00d56df39 100644
--- a/panels/printers/pp-ipp-option-widget.c
+++ b/panels/printers/pp-ipp-option-widget.c
@@ -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);
diff --git a/panels/printers/pp-jobs-dialog.c b/panels/printers/pp-jobs-dialog.c
index d629f9803..6e0dc6dad 100644
--- a/panels/printers/pp-jobs-dialog.c
+++ b/panels/printers/pp-jobs-dialog.c
@@ -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;
 }
 
diff --git a/panels/printers/pp-new-printer-dialog.c b/panels/printers/pp-new-printer-dialog.c
index 57de995c2..d26e5b7a7 100644
--- a/panels/printers/pp-new-printer-dialog.c
+++ b/panels/printers/pp-new-printer-dialog.c
@@ -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);
 }
diff --git a/panels/printers/pp-options-dialog.c b/panels/printers/pp-options-dialog.c
index 02dbadebb..d1164bd13 100644
--- a/panels/printers/pp-options-dialog.c
+++ b/panels/printers/pp-options-dialog.c
@@ -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);
 
diff --git a/panels/printers/pp-ppd-option-widget.c b/panels/printers/pp-ppd-option-widget.c
index 78dda5d6e..9b2520e06 100644
--- a/panels/printers/pp-ppd-option-widget.c
+++ b/panels/printers/pp-ppd-option-widget.c
@@ -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);
 
diff --git a/panels/printers/pp-ppd-selection-dialog.c b/panels/printers/pp-ppd-selection-dialog.c
index 17cdc4023..f3ae05c7b 100644
--- a/panels/printers/pp-ppd-selection-dialog.c
+++ b/panels/printers/pp-ppd-selection-dialog.c
@@ -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);
 }
diff --git a/panels/printers/ppd-selection-dialog.ui b/panels/printers/ppd-selection-dialog.ui
index 26bd22d76..b40a1b1ad 100644
--- a/panels/printers/ppd-selection-dialog.ui
+++ b/panels/printers/ppd-selection-dialog.ui
@@ -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>
diff --git a/panels/printers/printers.ui b/panels/printers/printers.ui
index d8f8af24a..843e7ed0e 100644
--- a/panels/printers/printers.ui
+++ b/panels/printers/printers.ui
@@ -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>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]