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);
}
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 center- 3.4.2.orig/ panels/ sound-nua/ gvc-mixer- dialog. c 2014-03-13 16:16:03.291570375 +0800 center- 3.4.2/panels/ sound-nua/ gvc-mixer- dialog. c 2014-03-13 18:29:23.125618264 +0800 view_get_ model (GTK_TREE_VIEW (dialog- >priv-> input_treeview) );
--- gnome-control-
+++ gnome-control-
@@ -721,6 +721,10 @@
model = gtk_tree_
if (gtk_tree_ model_get_ iter_first (model, &iter) == FALSE){ dialog- >priv-> selected_ input_label) , set_sensitive (dialog- >priv-> input_bar, FALSE);
g_warning ("The tree is empty => we have no devices so cannot set the active input");
return;
return;
add_input_ ui_entry (dialog, in);
+ /* When there are no device we need disable the input bar and set the original name */
+ gtk_label_set_label (GTK_LABEL(
+ _("Settings for the selected device"));
+ gtk_widget_
}
@@ -1382,6 +1386,8 @@
}
+ /* update input bar when new input device added */
+ active_input_update (dialog, in);
}
static void
gtk_ list_store_ remove (GTK_LIST_STORE (model), &iter);
@@ -1446,6 +1452,8 @@
if (found) {
}
+ /* update input bar when input device removed */
+ active_input_update (dialog, in);
}
static void