[gnome-control-center/wifi-dont-show-conf-button-for-non-active-connections: 371/371] network: Show configuration button only for active/connecting connections




commit b7ddea853a7e551f1287d80995294cf389d66a47
Author: Felipe Borges <felipeborges gnome org>
Date:   Mon Oct 18 14:39:28 2021 +0200

    network: Show configuration button only for active/connecting connections
    
    In commit c7bd4428399588dc777cdca45f5f415f37cfec66 we started to
    show the configuration button for all rows, which fixes the original
    issue of not being able to tweak a connection during association but
    also introduces a regression of not having connection data to show
    for other connections in the list. This way, the configuration
    button will fail to create a net_connection_editor interface for
    rows that aren't associated with an active connection.
    
    Let's only show the configuration button when the NMActiveConnectionState
    is either NM_ACTIVE_CONNECTION_STATE_ACTIVATING or
    NM_ACTIVE_CONNECTION_STATE_ACTIVATED.
    
    Fixes #1494

 panels/network/cc-wifi-connection-row.c  | 3 +++
 panels/network/cc-wifi-connection-row.ui | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/panels/network/cc-wifi-connection-row.c b/panels/network/cc-wifi-connection-row.c
index da377ccd6..a4a7315ed 100644
--- a/panels/network/cc-wifi-connection-row.c
+++ b/panels/network/cc-wifi-connection-row.c
@@ -36,6 +36,7 @@ struct _CcWifiConnectionRow
   GtkCheckButton  *checkbutton;
   GtkSpinner      *connecting_spinner;
   GtkImage        *encrypted_icon;
+  GtkButton       *options_button;
   GtkImage        *strength_icon;
 };
 
@@ -249,6 +250,7 @@ update_ui (CcWifiConnectionRow *self)
     }
 
   gtk_widget_set_visible (GTK_WIDGET (self->active_label), active);
+  gtk_widget_set_visible (GTK_WIDGET (self->options_button), active || connecting);
 
   if (security != NM_AP_SEC_UNKNOWN && security != NM_AP_SEC_NONE && security != NM_AP_SEC_OWE)
     {
@@ -438,6 +440,7 @@ cc_wifi_connection_row_class_init (CcWifiConnectionRowClass *klass)
   gtk_widget_class_bind_template_child (widget_class, CcWifiConnectionRow, checkbutton);
   gtk_widget_class_bind_template_child (widget_class, CcWifiConnectionRow, connecting_spinner);
   gtk_widget_class_bind_template_child (widget_class, CcWifiConnectionRow, encrypted_icon);
+  gtk_widget_class_bind_template_child (widget_class, CcWifiConnectionRow, options_button);
   gtk_widget_class_bind_template_child (widget_class, CcWifiConnectionRow, strength_icon);
 
   gtk_widget_class_bind_template_callback (widget_class, configure_clicked_cb);
diff --git a/panels/network/cc-wifi-connection-row.ui b/panels/network/cc-wifi-connection-row.ui
index 6d4e618f8..71dab91e4 100644
--- a/panels/network/cc-wifi-connection-row.ui
+++ b/panels/network/cc-wifi-connection-row.ui
@@ -52,7 +52,7 @@
           </object>
         </child>
         <child>
-          <object class="GtkButton">
+          <object class="GtkButton" id="options_button">
             <property name="name">options_button</property>
             <property name="icon_name">emblem-system-symbolic</property>
             <property name="halign">center</property>


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