[gnome-bluetooth] wizard: only enable "PIN options" button if device is selected



commit ccbc47e9391ca6554dedbd47b7e106cf5140e6f4
Author: Gustavo Padovan <gustavo padovan collabora co uk>
Date:   Thu May 23 20:41:28 2013 -0300

    wizard: only enable "PIN options" button if device is selected
    
    Do not allow the user to configure PIN Options if no device is selected
    
    https://bugzilla.gnome.org/show_bug.cgi?id=685717

 wizard/main.c    |    6 +++++-
 wizard/wizard.ui |    1 +
 2 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/wizard/main.c b/wizard/main.c
index b553231..3fe0224 100644
--- a/wizard/main.c
+++ b/wizard/main.c
@@ -728,8 +728,12 @@ select_device_changed (BluetoothChooser *selector,
        set_page_search_complete ();
 
        /* Device was deselected */
-       if (address == NULL)
+       if (address == NULL) {
+               gtk_widget_set_sensitive (pin_option_button, FALSE);
                return;
+       }
+
+       gtk_widget_set_sensitive (pin_option_button, TRUE);
 
        if (bluetooth_chooser_get_selected_device_info (selector, "legacypairing", &value) != FALSE) {
                legacypairing = g_value_get_int (&value);
diff --git a/wizard/wizard.ui b/wizard/wizard.ui
index 6575370..b685f28 100644
--- a/wizard/wizard.ui
+++ b/wizard/wizard.ui
@@ -35,6 +35,7 @@
           <object class="GtkButton" id="pin_option_button">
             <property name="label" translatable="yes">PIN _options...</property>
             <property name="visible">True</property>
+            <property name="sensitive">False</property>
             <property name="can_focus">True</property>
             <property name="receives_default">True</property>
             <property name="use_underline">True</property>


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