[network-manager-applet/lr/mobile-wizard-fixes: 6/8] nma/mobile-wizard: hide the dev combo if we're not choosing a device



commit 01e8115d92a20517bf2706d8b9d26f74d6cefa9a
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Fri Mar 15 16:47:01 2019 +0100

    nma/mobile-wizard: hide the dev combo if we're not choosing a device
    
    It's just not nice.

 src/libnma/nma-mobile-wizard.c  | 9 +++++++--
 src/libnma/nma-mobile-wizard.ui | 4 +---
 2 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/src/libnma/nma-mobile-wizard.c b/src/libnma/nma-mobile-wizard.c
index b364a11d..4d47209b 100644
--- a/src/libnma/nma-mobile-wizard.c
+++ b/src/libnma/nma-mobile-wizard.c
@@ -67,6 +67,7 @@ typedef struct {
        gboolean will_connect_after;
 
        /* Intro page */
+       GtkLabel *dev_combo_label;
        GtkComboBox *dev_combo;
        GtkLabel *provider_name_label;
        GtkLabel *plan_name_label;
@@ -1129,7 +1130,6 @@ intro_remove_all_devices (NMAMobileWizard *self)
 
        /* Select the "Any device" item */
        gtk_combo_box_set_active (priv->dev_combo, 0);
-       gtk_widget_set_sensitive (GTK_WIDGET (priv->dev_combo), FALSE);
 }
 
 static void
@@ -1404,6 +1404,7 @@ nma_mobile_wizard_class_init (NMAMobileWizardClass *klass)
 
 
        gtk_widget_class_bind_template_child_private (widget_class, NMAMobileWizard, dev_combo);
+       gtk_widget_class_bind_template_child_private (widget_class, NMAMobileWizard, dev_combo_label);
        gtk_widget_class_bind_template_child_private (widget_class, NMAMobileWizard, country_page);
        gtk_widget_class_bind_template_child_private (widget_class, NMAMobileWizard, country_view);
        gtk_widget_class_bind_template_child_private (widget_class, NMAMobileWizard, providers_page);
@@ -1500,8 +1501,12 @@ nma_mobile_wizard_new (GtkWindow *parent,
                priv->family = NMA_MOBILE_FAMILY_3GPP;
        else if (modem_caps & NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO)
                priv->family = NMA_MOBILE_FAMILY_CDMA;
-       if (priv->family)
+       if (priv->family) {
                priv->initial_family = TRUE;  /* Skip device selection */
+       } else {
+               gtk_widget_show (GTK_WIDGET (priv->dev_combo_label));
+               gtk_widget_show (GTK_WIDGET (priv->dev_combo));
+       }
 
        gtk_assistant_set_forward_page_func (GTK_ASSISTANT (self),
                                             forward_func, self, NULL);
diff --git a/src/libnma/nma-mobile-wizard.ui b/src/libnma/nma-mobile-wizard.ui
index 3f6637af..5e5f2a62 100644
--- a/src/libnma/nma-mobile-wizard.ui
+++ b/src/libnma/nma-mobile-wizard.ui
@@ -137,8 +137,7 @@
           </packing>
         </child>
         <child>
-          <object class="GtkLabel">
-            <property name="visible">True</property>
+          <object class="GtkLabel" id="dev_combo_label">
             <property name="can_focus">False</property>
             <property name="valign">end</property>
             <property name="vexpand">True</property>
@@ -154,7 +153,6 @@
         </child>
         <child>
           <object class="GtkComboBox" id="dev_combo">
-            <property name="visible">True</property>
             <property name="sensitive">False</property>
             <property name="can_focus">False</property>
             <property name="model">dev_store</property>


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