From c7bd4428399588dc777cdca45f5f415f37cfec66 Mon Sep 17 00:00:00 2001 From: Felipe Borges Date: Wed, 25 Aug 2021 16:30:06 +0200 Subject: [PATCH] network: Show configuration button during wifi association While connecting to a Wifi network g-c-c would hide the button that launches the connection preferences dialog. This is inconvenient when network manager keeps on attempting to reconnect to a misconfigured network. These changes rework the logic of the buttons by always presenting the configuration button and toggling the visibility of the spinner accordingly. Fixes #493 --- panels/network/cc-wifi-connection-row.c | 9 +-- panels/network/cc-wifi-connection-row.ui | 73 ++++++++---------------- 2 files changed, 25 insertions(+), 57 deletions(-) diff --git a/panels/network/cc-wifi-connection-row.c b/panels/network/cc-wifi-connection-row.c index cee92db61..d1ded0fc9 100644 --- a/panels/network/cc-wifi-connection-row.c +++ b/panels/network/cc-wifi-connection-row.c @@ -33,7 +33,6 @@ struct _CcWifiConnectionRow NMConnection *connection; GtkLabel *active_label; - GtkStack *button_stack; GtkCheckButton *checkbutton; GtkSpinner *connecting_spinner; GtkImage *encrypted_icon; @@ -240,19 +239,14 @@ update_ui (CcWifiConnectionRow *self) strength = nm_access_point_get_strength (best_ap); } + gtk_widget_set_visible (GTK_WIDGET (self->connecting_spinner), connecting); if (connecting) { - gtk_stack_set_visible_child_name (self->button_stack, "connecting"); gtk_spinner_start (self->connecting_spinner); } else { gtk_spinner_stop (self->connecting_spinner); - - if (self->connection) - gtk_stack_set_visible_child_name (self->button_stack, "configure"); - else - gtk_stack_set_visible_child_name (self->button_stack, "empty"); } gtk_widget_set_visible (GTK_WIDGET (self->active_label), active); @@ -459,7 +453,6 @@ cc_wifi_connection_row_class_init (CcWifiConnectionRowClass *klass) gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/network/cc-wifi-connection-row.ui"); gtk_widget_class_bind_template_child (widget_class, CcWifiConnectionRow, active_label); - gtk_widget_class_bind_template_child (widget_class, CcWifiConnectionRow, button_stack); 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); diff --git a/panels/network/cc-wifi-connection-row.ui b/panels/network/cc-wifi-connection-row.ui index 38bb8a988..39bb6db8b 100644 --- a/panels/network/cc-wifi-connection-row.ui +++ b/panels/network/cc-wifi-connection-row.ui @@ -72,64 +72,39 @@ - - button_stack + + connecting_spinner True False - end - False + center + center + + + + + options_button + True + True + True + center + center + - - options_button - True - True - True - center - center - - - - True - False - emblem-system-symbolic - 1 - - - - - Options… - - - - - - configure - - - - - connecting_spinner + True False - center - center + emblem-system-symbolic + 1 - - connecting - 1 - - - - True - empty_box + + + Options… - - empty - +