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

Subscribers

People subscribed via source and target branches

to all changes: