Merge lp:~binli/ubuntu/precise/gnome-control-center/lp1291862 into lp:ubuntu/precise-updates/gnome-control-center

Proposed by Bin Li
Status: Merged
Merge reported by: Sebastien Bacher
Merged at revision: not available
Proposed branch: lp:~binli/ubuntu/precise/gnome-control-center/lp1291862
Merge into: lp:ubuntu/precise-updates/gnome-control-center
Diff against target: 150 lines (+130/-0)
3 files modified
debian/changelog (+6/-0)
debian/patches/fix-input-device-bar-status.patch (+123/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~binli/ubuntu/precise/gnome-control-center/lp1291862
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
Bin Li (community) Needs Resubmitting
PS Jenkins bot Pending
Review via email: mp+211265@code.launchpad.net

Description of the change

    First enable input bar when an new input device is added, backport from
    unity-control-center.
    Second, disable input bar when there are not input devices.

To post a comment you must log in.
265. By Bin Li

just provide the patch, and restore panels/sound-nua/gvc-mixer-dialog.c

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for the work, could you update the change to match what was uploaded to trusty in https://code.launchpad.net/~binli/unity-control-center/1291862/+merge/211258 ?

review: Needs Fixing
266. By Bin Li

sync with trusty's change

267. By Bin Li

update the changelog

268. By Bin Li

tiny change for format

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

> Thanks for the work, could you update the change to match what was uploaded to
> trusty in https://code.launchpad.net/~binli/unity-control-
> center/1291862/+merge/211258 ?

Done, please review it again, thanks!

review: Needs Resubmitting
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks, I merged that to the packaging vcs lp:~ubuntu-desktop/gnome-control-center/precise and uploaded the version, it's waiting in the SRU review queue next

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2013-10-30 11:33:55 +0000
3+++ debian/changelog 2014-04-01 10:32:10 +0000
4@@ -1,3 +1,9 @@
5+gnome-control-center (1:3.4.2-0ubuntu0.13.2) precise; urgency=medium
6+
7+ * Disable the input/output bar when no input/output devices (LP: #1291862)
8+
9+ -- Bin Li <bin.li@canonical.com> Thu, 13 Mar 2014 18:55:05 +0800
10+
11 gnome-control-center (1:3.4.2-0ubuntu0.13.1) precise; urgency=low
12
13 * Add 20 minutes and 2 hours options for the suspend time in system
14
15=== added file 'debian/patches/fix-input-device-bar-status.patch'
16--- debian/patches/fix-input-device-bar-status.patch 1970-01-01 00:00:00 +0000
17+++ debian/patches/fix-input-device-bar-status.patch 2014-04-01 10:32:10 +0000
18@@ -0,0 +1,123 @@
19+Index: gnome-control-center/panels/sound-nua/gvc-mixer-dialog.c
20+===================================================================
21+--- gnome-control-center.orig/panels/sound-nua/gvc-mixer-dialog.c 2014-04-01 18:27:58.040627755 +0800
22++++ gnome-control-center/panels/sound-nua/gvc-mixer-dialog.c 2014-04-01 18:29:29.240036086 +0800
23+@@ -721,7 +721,11 @@
24+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (dialog->priv->input_treeview));
25+
26+ if (gtk_tree_model_get_iter_first (model, &iter) == FALSE){
27+- g_warning ("The tree is empty => we have no devices so cannot set the active input");
28++ /* When there are no device we need disable the input bar and set the original name */
29++ gtk_label_set_label (GTK_LABEL(dialog->priv->selected_input_label),
30++ _("Settings for the selected device"));
31++ gtk_widget_set_sensitive (dialog->priv->input_bar, FALSE);
32++ g_debug ("The tree is empty => we have no devices so cannot set the active input");
33+ return;
34+ }
35+
36+@@ -850,7 +854,11 @@
37+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (dialog->priv->output_treeview));
38+
39+ if (gtk_tree_model_get_iter_first (model, &iter) == FALSE){
40+- g_warning ("The tree is empty => we have no devices in the tree => cannot set the active output");
41++ /* When there are no device we need disable the output bar and set the original name */
42++ gtk_label_set_label (GTK_LABEL(dialog->priv->selected_output_label),
43++ _("Settings for the selected device"));
44++ gtk_widget_set_sensitive (dialog->priv->output_bar, FALSE);
45++ g_debug ("The tree is empty => we have no devices in the tree => cannot set the active output");
46+ return;
47+ }
48+
49+@@ -1328,7 +1336,11 @@
50+ guint id,
51+ GvcMixerDialog *dialog)
52+ {
53++ gboolean is_first_device;
54++ GtkTreeModel *model;
55++ GtkTreeIter iter;
56+ GvcMixerUIDevice* out = NULL;
57++
58+ out = gvc_mixer_control_lookup_output_id (control, id);
59+
60+ if (out == NULL) {
61+@@ -1336,7 +1348,12 @@
62+ return;
63+ }
64+
65++ model = gtk_tree_view_get_model (GTK_TREE_VIEW (dialog->priv->output_treeview));
66++ is_first_device = !gtk_tree_model_get_iter_first (model, &iter);
67++
68+ add_output_ui_entry (dialog, out);
69++ if (is_first_device)
70++ active_output_update (dialog, out);
71+ }
72+
73+ static void
74+@@ -1374,14 +1391,25 @@
75+ guint id,
76+ GvcMixerDialog *dialog)
77+ {
78++ gboolean is_first_device;
79++ GtkTreeModel *model;
80++ GtkTreeIter iter;
81+ GvcMixerUIDevice* in = NULL;
82++
83+ in = gvc_mixer_control_lookup_input_id (control, id);
84+
85+ if (in == NULL) {
86+ g_warning ("on_control_input_added - tried to fetch an input of id %u but got nothing", id);
87+ return;
88+ }
89++
90++ model = gtk_tree_view_get_model (GTK_TREE_VIEW (dialog->priv->input_treeview));
91++ is_first_device = !gtk_tree_model_get_iter_first (model, &iter);
92++
93+ add_input_ui_entry (dialog, in);
94++ /* update input bar when new input device added */
95++ if (is_first_device)
96++ active_input_update (dialog, in);
97+ }
98+
99+ static void
100+@@ -1390,6 +1418,7 @@
101+ GvcMixerDialog *dialog)
102+ {
103+ GtkWidget *bar;
104++ gboolean is_last_device;
105+ gboolean found;
106+ GtkTreeIter iter;
107+ GtkTreeModel *model;
108+@@ -1413,7 +1442,12 @@
109+ if (found) {
110+ gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
111+ }
112+-}
113++
114++ /* Disable output bar when all output devices removed */
115++ is_last_device = !gtk_tree_model_get_iter_first (model, &iter);
116++ if (is_last_device)
117++ active_output_update (dialog, out);
118++}
119+
120+
121+
122+@@ -1424,6 +1458,7 @@
123+ {
124+ GtkWidget *bar;
125+ gboolean found;
126++ gboolean is_last_device;
127+ GtkTreeIter iter;
128+ GtkTreeModel *model;
129+
130+@@ -1446,6 +1481,11 @@
131+ if (found) {
132+ gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
133+ }
134++
135++ /* Disable input bar when all input devices removed */
136++ is_last_device = !gtk_tree_model_get_iter_first (model, &iter);
137++ if (is_last_device)
138++ active_input_update (dialog, in);
139+ }
140+
141+ static void
142
143=== modified file 'debian/patches/series'
144--- debian/patches/series 2013-10-30 11:33:55 +0000
145+++ debian/patches/series 2014-04-01 10:32:10 +0000
146@@ -43,3 +43,4 @@
147 remove-manual-proxy-in-auto.patch
148 use_rfkill_airplane_mode.patch
149 more-power-suspend-options.patch
150+fix-input-device-bar-status.patch

Subscribers

People subscribed via source and target branches

to all changes: