Comment 6 for bug 1291862

Revision history for this message
Bin Li (binli) wrote :

After talked with Huiwang, we updated the patch.

When the input device list is null ,we reset the original value for label.

Index: gnome-control-center-3.4.2/panels/sound-nua/gvc-mixer-dialog.c
--- gnome-control-center-3.4.2.orig/panels/sound-nua/gvc-mixer-dialog.c 2014-03-13 16:16:03.291570375 +0800
+++ gnome-control-center-3.4.2/panels/sound-nua/gvc-mixer-dialog.c 2014-03-13 18:29:23.125618264 +0800
@@ -721,6 +721,10 @@
         model = gtk_tree_view_get_model (GTK_TREE_VIEW (dialog->priv->input_treeview));

         if (gtk_tree_model_get_iter_first (model, &iter) == FALSE){
+ /* When there are no device we need disable the input bar and set the original name */
+ gtk_label_set_label (GTK_LABEL(dialog->priv->selected_input_label),
+ _("Settings for the selected device"));
+ gtk_widget_set_sensitive (dialog->priv->input_bar, FALSE);
                 g_warning ("The tree is empty => we have no devices so cannot set the active input");
                 return;
         }
@@ -1382,6 +1386,8 @@
                return;
        }
        add_input_ui_entry (dialog, in);
+ /* update input bar when new input device added */
+ active_input_update (dialog, in);
 }

 static void
@@ -1446,6 +1452,8 @@
         if (found) {
                 gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
         }
+ /* update input bar when input device removed */
+ active_input_update (dialog, in);
 }

 static void