Merge lp:~darkxst/unity-control-center/gsettings3.16 into lp:unity-control-center

Proposed by Tim Lunn on 2015-07-19
Status: Merged
Approved by: Tim Lunn on 2015-08-19
Approved revision: 12819
Merged at revision: 12825
Proposed branch: lp:~darkxst/unity-control-center/gsettings3.16
Merge into: lp:unity-control-center
Diff against target: 323 lines (+81/-77)
5 files modified
configure.ac (+1/-1)
debian/control (+3/-2)
panels/keyboard/keyboard-general.c (+1/-1)
panels/mouse/gnome-mouse-properties.c (+62/-36)
panels/mouse/gnome-mouse-properties.ui (+14/-37)
To merge this branch: bzr merge lp:~darkxst/unity-control-center/gsettings3.16
Reviewer Review Type Date Requested Status
Unity Control Center development team 2015-07-19 Pending
Review via email: mp+265204@code.launchpad.net

Commit message

Cherry-pick upstream changes for relocated peripheral settings

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configure.ac'
2--- configure.ac 2015-02-12 14:09:23 +0000
3+++ configure.ac 2015-07-19 03:33:47 +0000
4@@ -116,7 +116,7 @@
5 NETWORK_MANAGER_REQUIRED_VERSION=0.8.992
6 LIBNOTIFY_REQUIRED_VERSION=0.7.3
7 GNOME_DESKTOP_REQUIRED_VERSION=3.5.91
8-SCHEMAS_REQUIRED_VERSION=3.7.2.2
9+SCHEMAS_REQUIRED_VERSION=3.15.4
10 LIBWACOM_REQUIRED_VERSION=0.7
11 CLUTTER_REQUIRED_VERSION=1.11.3
12 GOA_REQUIRED_VERSION=3.5.90
13
14=== modified file 'debian/control'
15--- debian/control 2015-03-12 19:18:11 +0000
16+++ debian/control 2015-07-19 03:33:47 +0000
17@@ -14,7 +14,7 @@
18 gnome-pkg-tools (>= 0.10),
19 unity-settings-daemon-dev,
20 libunity-settings-daemon-dev,
21- gsettings-desktop-schemas-dev (>= 3.7.2.2),
22+ gsettings-desktop-schemas-dev (>= 3.15.4),
23 hardening-wrapper,
24 intltool (>= 0.37.1),
25 libaccountsservice-dev (>= 0.6.30),
26@@ -73,7 +73,8 @@
27 adwaita-icon-theme,
28 gnome-menus (>= 2.12.0),
29 unity-settings-daemon,
30- gsettings-desktop-schemas (>= 3.5.91),
31+ gnome-settings-daemon-schemas (>= 3.16),
32+ gsettings-desktop-schemas (>= 3.15.4),
33 gsettings-ubuntu-schemas (>= 0.0.1+14.04.20140224),
34 ibus,
35 indicator-bluetooth,
36
37=== modified file 'panels/keyboard/keyboard-general.c'
38--- panels/keyboard/keyboard-general.c 2011-09-08 16:23:22 +0000
39+++ panels/keyboard/keyboard-general.c 2015-07-19 03:33:47 +0000
40@@ -76,7 +76,7 @@
41 keyboard_general_init (CcPanel *panel, GtkBuilder *builder)
42 {
43 if (keyboard_settings == NULL)
44- keyboard_settings = g_settings_new ("org.gnome.settings-daemon.peripherals.keyboard");
45+ keyboard_settings = g_settings_new ("org.gnome.desktop.peripherals.keyboard");
46
47 if (interface_settings == NULL)
48 interface_settings = g_settings_new ("org.gnome.desktop.interface");
49
50=== modified file 'panels/mouse/gnome-mouse-properties.c'
51--- panels/mouse/gnome-mouse-properties.c 2014-02-07 16:40:25 +0000
52+++ panels/mouse/gnome-mouse-properties.c 2015-07-19 03:33:47 +0000
53@@ -32,6 +32,8 @@
54 #include <unity-settings-daemon/gsd-enums.h>
55 #include <math.h>
56
57+#include <gdesktop-enums.h>
58+
59 #include "gnome-mouse-properties.h"
60 #include "gsd-input-helper.h"
61
62@@ -45,6 +47,7 @@
63 #define WID(x) (GtkWidget*) gtk_builder_get_object (dialog, x)
64
65 static GSettings *mouse_settings = NULL;
66+static GSettings *gsd_mouse_settings = NULL;
67 static GSettings *touchpad_settings = NULL;
68 static GdkDeviceManager *device_manager = NULL;
69 static guint device_added_id = 0;
70@@ -134,23 +137,38 @@
71 XFreeDeviceList (devicelist);
72 }
73
74-static void
75-pointer_speed_scale_event (GtkRange *scale, GtkBuilder *dialog)
76-{
77- gdouble value;
78- GSettings *settings;
79- GtkAdjustment *adjustment;
80-
81- if (GTK_WIDGET (scale) == WID ("pointer_speed_scale"))
82- settings = mouse_settings;
83- else
84- settings = touchpad_settings;
85-
86- g_settings_set_double (settings, "motion-acceleration", gtk_range_get_value (scale));
87-
88- adjustment = gtk_range_get_adjustment (scale);
89- value = gtk_adjustment_get_upper (adjustment) - gtk_range_get_value (scale) + 1;
90- g_settings_set_int (settings, "motion-threshold", value);
91+static gboolean
92+get_touchpad_enabled (GSettings *settings)
93+ {
94+ GDesktopDeviceSendEvents send_events;
95+
96+ send_events = g_settings_get_enum (settings, "send-events");
97+
98+ return send_events == G_DESKTOP_DEVICE_SEND_EVENTS_ENABLED;
99+}
100+
101+static gboolean
102+touchpad_enabled_get_mapping (GValue *value,
103+ GVariant *variant,
104+ gpointer user_data)
105+{
106+ gboolean enabled;
107+
108+ enabled = g_strcmp0 (g_variant_get_string (variant, NULL), "enabled") == 0;
109+ g_value_set_boolean (value, enabled);
110+ return TRUE;
111+}
112+
113+static GVariant *
114+touchpad_enabled_set_mapping (const GValue *value,
115+ const GVariantType *type,
116+ gpointer user_data)
117+{
118+ gboolean enabled;
119+
120+ enabled = g_value_get_boolean (value);
121+
122+ return g_variant_new_string (enabled ? "enabled" : "disabled");
123 }
124
125 /* Set up the property editors in the dialog. */
126@@ -171,7 +189,7 @@
127 G_CALLBACK (orientation_radio_button_release_event), NULL);
128
129 /* Double-click time */
130- g_settings_bind (mouse_settings, "double-click",
131+ g_settings_bind (gsd_mouse_settings, "double-click",
132 gtk_range_get_adjustment (GTK_RANGE (WID ("double_click_scale"))), "value",
133 G_SETTINGS_BIND_DEFAULT);
134
135@@ -179,9 +197,9 @@
136 mouse_present = mouse_is_present ();
137 gtk_widget_set_visible (WID ("mouse_vbox"), mouse_present);
138
139- g_signal_connect (WID ("pointer_speed_scale"), "value-changed",
140- G_CALLBACK (pointer_speed_scale_event), dialog);
141- g_settings_bind (mouse_settings, "motion-acceleration",
142+ gtk_scale_add_mark (GTK_SCALE (WID ("pointer_speed_scale")), 0,
143+ GTK_POS_TOP, NULL);
144+ g_settings_bind (mouse_settings, "speed",
145 gtk_range_get_adjustment (GTK_RANGE (WID ("pointer_speed_scale"))), "value",
146 G_SETTINGS_BIND_DEFAULT);
147
148@@ -189,29 +207,31 @@
149 touchpad_present = touchpad_is_present ();
150 gtk_widget_set_visible (WID ("touchpad_vbox"), touchpad_present);
151
152- g_settings_bind (touchpad_settings, "touchpad-enabled",
153- WID ("touchpad_enabled_switch"), "active",
154- G_SETTINGS_BIND_DEFAULT);
155- g_settings_bind (touchpad_settings, "touchpad-enabled",
156- WID ("touchpad_options_box"), "sensitive",
157- G_SETTINGS_BIND_GET);
158+ g_settings_bind_with_mapping (touchpad_settings, "send-events",
159+ WID ("touchpad_enabled_switch"), "active",
160+ G_SETTINGS_BIND_DEFAULT,
161+ touchpad_enabled_get_mapping,
162+ touchpad_enabled_set_mapping,
163+ NULL, NULL);
164+ g_settings_bind_with_mapping (touchpad_settings, "send-events",
165+ WID ("touchpad_options_box"), "sensitive",
166+ G_SETTINGS_BIND_GET,
167+ touchpad_enabled_get_mapping,
168+ touchpad_enabled_set_mapping,
169+ NULL, NULL);
170
171- g_settings_bind (touchpad_settings, "disable-while-typing",
172- WID ("disable_w_typing_toggle"), "active",
173- G_SETTINGS_BIND_DEFAULT);
174 g_settings_bind (touchpad_settings, "tap-to-click",
175 WID ("tap_to_click_toggle"), "active",
176 G_SETTINGS_BIND_DEFAULT);
177 g_settings_bind (touchpad_settings, "natural-scroll",
178 WID ("natural_scroll_toggle"), "active",
179 G_SETTINGS_BIND_DEFAULT);
180- g_settings_bind (touchpad_settings, "motion-acceleration",
181+ gtk_scale_add_mark (GTK_SCALE (WID ("touchpad_pointer_speed_scale")), 0,
182+ GTK_POS_TOP, NULL);
183+ g_settings_bind (touchpad_settings, "speed",
184 gtk_range_get_adjustment (GTK_RANGE (WID ("touchpad_pointer_speed_scale"))), "value",
185 G_SETTINGS_BIND_DEFAULT);
186
187- g_signal_connect (WID ("touchpad_pointer_speed_scale"), "value-changed",
188- G_CALLBACK (pointer_speed_scale_event), dialog);
189-
190 if (touchpad_present) {
191 synaptics_check_capabilities (dialog);
192 setup_scrollmethod_radios (dialog);
193@@ -273,8 +293,10 @@
194 GtkWidget *
195 gnome_mouse_properties_init (GtkBuilder *dialog)
196 {
197- mouse_settings = g_settings_new ("org.gnome.settings-daemon.peripherals.mouse");
198- touchpad_settings = g_settings_new ("org.gnome.settings-daemon.peripherals.touchpad");
199+
200+ mouse_settings = g_settings_new ("org.gnome.desktop.peripherals.mouse");
201+ gsd_mouse_settings = g_settings_new ("org.gnome.settings-daemon.peripherals.mouse");
202+ touchpad_settings = g_settings_new ("org.gnome.desktop.peripherals.touchpad");
203
204 device_manager = gdk_display_get_device_manager (gdk_display_get_default ());
205 device_added_id = g_signal_connect (device_manager, "device-added",
206@@ -295,6 +317,10 @@
207 g_object_unref (mouse_settings);
208 mouse_settings = NULL;
209 }
210+ if (gsd_mouse_settings != NULL) {
211+ g_object_unref (gsd_mouse_settings);
212+ mouse_settings = NULL;
213+ }
214 if (touchpad_settings != NULL) {
215 g_object_unref (touchpad_settings);
216 touchpad_settings = NULL;
217
218=== modified file 'panels/mouse/gnome-mouse-properties.ui'
219--- panels/mouse/gnome-mouse-properties.ui 2013-11-28 06:07:03 +0000
220+++ panels/mouse/gnome-mouse-properties.ui 2015-07-19 03:33:47 +0000
221@@ -2,18 +2,16 @@
222 <interface>
223 <!-- interface-requires gtk+ 3.0 -->
224 <object class="GtkAdjustment" id="adjustment1">
225- <property name="lower">1</property>
226- <property name="upper">10</property>
227- <property name="value">6</property>
228- <property name="step_increment">1</property>
229- <property name="page_increment">1</property>
230+ <property name="lower">-1</property>
231+ <property name="upper">1</property>
232+ <property name="step_increment">0.2</property>
233+ <property name="page_increment">0.2</property>
234 </object>
235 <object class="GtkAdjustment" id="adjustment11">
236- <property name="lower">1</property>
237- <property name="upper">10</property>
238- <property name="value">6</property>
239- <property name="step_increment">1</property>
240- <property name="page_increment">1</property>
241+ <property name="lower">-1</property>
242+ <property name="upper">1</property>
243+ <property name="step_increment">0.2</property>
244+ <property name="page_increment">0.2</property>
245 </object>
246 <object class="GtkAdjustment" id="adjustment4">
247 <property name="lower">100</property>
248@@ -72,6 +70,7 @@
249 <packing>
250 <property name="expand">True</property>
251 <property name="fill">True</property>
252+
253 <property name="position">0</property>
254 </packing>
255 </child>
256@@ -356,12 +355,12 @@
257 </packing>
258 </child>
259 <child>
260- <object class="GtkHScale" id="pointer_speed_scale">
261+ <object class="GtkScale" id="pointer_speed_scale">
262+ <property name="orientation">horizontal</property>
263 <property name="visible">True</property>
264 <property name="can_focus">True</property>
265 <property name="adjustment">adjustment1</property>
266 <property name="draw_value">False</property>
267- <property name="value_pos">right</property>
268 </object>
269 <packing>
270 <property name="expand">True</property>
271@@ -540,12 +539,12 @@
272 </packing>
273 </child>
274 <child>
275- <object class="GtkHScale" id="touchpad_pointer_speed_scale">
276+ <object class="GtkScale" id="touchpad_pointer_speed_scale">
277+ <property name="orientation">horizontal</property>
278 <property name="visible">True</property>
279 <property name="can_focus">True</property>
280 <property name="adjustment">adjustment11</property>
281 <property name="draw_value">False</property>
282- <property name="value_pos">right</property>
283 </object>
284 <packing>
285 <property name="expand">True</property>
286@@ -592,28 +591,6 @@
287 <property name="row_spacing">5</property>
288 <property name="column_spacing">10</property>
289 <child>
290- <object class="GtkCheckButton" id="disable_w_typing_toggle">
291- <property name="label" translatable="yes">Disable while _typing</property>
292- <property name="use_action_appearance">False</property>
293- <property name="visible">True</property>
294- <property name="can_focus">True</property>
295- <property name="receives_default">False</property>
296- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
297- <property name="use_action_appearance">False</property>
298- <property name="relief">none</property>
299- <property name="use_underline">True</property>
300- <property name="xalign">0</property>
301- <property name="active">True</property>
302- <property name="draw_indicator">True</property>
303- </object>
304- <packing>
305- <property name="left_attach">0</property>
306- <property name="top_attach">0</property>
307- <property name="width">1</property>
308- <property name="height">1</property>
309- </packing>
310- </child>
311- <child>
312 <object class="GtkCheckButton" id="tap_to_click_toggle">
313 <property name="label" translatable="yes">Tap to _click</property>
314 <property name="use_action_appearance">False</property>
315@@ -629,7 +606,7 @@
316 </object>
317 <packing>
318 <property name="left_attach">0</property>
319- <property name="top_attach">1</property>
320+ <property name="top_attach">0</property>
321 <property name="width">1</property>
322 <property name="height">1</property>
323 </packing>

Subscribers

People subscribed via source and target branches