[gupnp-tools] universal-cp: Select first combobox value by default



commit ef380cb4a581e6424e69e7f777c009a9c4e91d70
Author: Jussi Kukkonen <jussi kukkonen intel com>
Date:   Wed Sep 18 23:36:07 2013 +0300

    universal-cp: Select first combobox value by default
    
    Even if a restricted value list does not have a default value, it makes
    sense to select one of the values in the combobox: it might save the
    user a button press.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=708370

 src/universal-cp/action-dialog.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/universal-cp/action-dialog.c b/src/universal-cp/action-dialog.c
index 8045da2..74c22f0 100644
--- a/src/universal-cp/action-dialog.c
+++ b/src/universal-cp/action-dialog.c
@@ -196,8 +196,9 @@ create_widget_for_argument (GUPnPServiceActionArgInfo *arg_info,
                                                 NULL,
                                                 (const char *) node->data);
 
-                                if (default_str != NULL &&
-                                    strcmp (default_str, node->data) == 0) {
+                                if (node == variable->allowed_values ||
+                                    (default_str != NULL &&
+                                     strcmp (default_str, node->data) == 0)) {
                                         gtk_combo_box_set_active (
                                                         GTK_COMBO_BOX (widget),
                                                         index);


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