Merge lp:~jonas-drange/ubuntu-system-settings/sound-other-vibrations into lp:ubuntu-system-settings

Proposed by Jonas G. Drange on 2014-10-31
Status: Merged
Approved by: Sebastien Bacher on 2015-01-28
Approved revision: 1163
Merged at revision: 1300
Proposed branch: lp:~jonas-drange/ubuntu-system-settings/sound-other-vibrations
Merge into: lp:ubuntu-system-settings
Diff against target: 115 lines (+44/-1)
4 files modified
debian/control (+1/-1)
plugins/sound/PageComponent.qml (+16/-0)
plugins/sound/sound.cpp (+20/-0)
plugins/sound/sound.h (+7/-0)
To merge this branch: bzr merge lp:~jonas-drange/ubuntu-system-settings/sound-other-vibrations
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing on 2015-01-28
Sebastien Bacher (community) 2014-10-31 Approve on 2015-01-28
Review via email: mp+240261@code.launchpad.net

Commit Message

[sound] let user toggle other vibrate setting

Description of the Change

[sound] let user toggle other vibrate setting

To post a comment you must log in.
Sebastien Bacher (seb128) wrote :

Thanks, could you drop the whitespace changes? Could you also give details on why is the Item{} needed, shouldn't a Divider{} be used there instead?

Jonas G. Drange (jonas-drange) wrote :

> Thanks, could you drop the whitespace changes? Could you also give details on
> why is the Item{} needed, shouldn't a Divider{} be used there instead?
Dropped the whitespace. Divider was not used because I misinterpreted the design. Thanks!

Sebastien Bacher (seb128) wrote :

Thanks, sorry I didn't catch that during the first review but it looks like you should update the code with changes similar to the ones in https://code.launchpad.net/~nick-dedekind/ubuntu-system-settings/lp1336715.check.sync/+merge/239494

24 + checked: backendInfo.otherVibrate
25 +
26 + onClicked: backendInfo.otherVibrate = checked

is likely to have some backend/ui being out of sync issues

the new item should also probably not have "showDivider: false", the design has a separator after the bottom item it seems

Sebastien Bacher (seb128) wrote :

the bottom item should also not use "showDivider: false", the design has a line after it

do we need to update a recommends to the schemas for the new property used as well?

review: Needs Fixing
Jonas G. Drange (jonas-drange) wrote :

Thanks, @seb128. We indeed do. I've been told that we would land the schema, this branch as well as the UITK branch together. How would we determine what to recommend? gsettings-ubuntu-touch-schemas version + 1 ?

Sebastien Bacher (seb128) wrote :

the usual way would be to update the gsettings-ubuntu-touch-schemas version from 0.0.3 to 0.0.4 and adjust the depends there to be >= 0.0.4, which makes it not depends on the snapshot version

Sebastien Bacher (seb128) wrote :

looks good, thanks

review: Approve
1164. By Jonas G. Drange on 2015-02-11

hide othervibrate

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2015-02-05 14:30:24 +0000
3+++ debian/control 2015-02-11 16:05:14 +0000
4@@ -63,7 +63,7 @@
5 bluez (>= 4.36),
6 dbus-property-service [amd64 armhf i386],
7 gsettings-desktop-schemas,
8- gsettings-ubuntu-schemas (>= 0.0.2+14.10.20140815),
9+ gsettings-ubuntu-schemas (>= 0.0.4),
10 indicator-bluetooth (>> 0.0.6+13.10.20131010),
11 indicator-network (>= 0.5.0+13.10.20130918),
12 indicator-power (>= 12.10.6+15.04.20150130),
13
14=== modified file 'plugins/sound/PageComponent.qml'
15--- plugins/sound/PageComponent.qml 2015-01-29 10:16:17 +0000
16+++ plugins/sound/PageComponent.qml 2015-02-11 16:05:14 +0000
17@@ -231,6 +231,22 @@
18 text: i18n.tr("Lock sound")
19 visible: showAllUI
20 }
21+
22+ ListItem.Divider {
23+ visible: showAllUI
24+ }
25+
26+ ListItem.Standard {
27+ text: i18n.tr("Other vibrations")
28+ control: Switch {
29+ objectName: "otherVibrateSwitch"
30+ property bool serverChecked: backendInfo.otherVibrate
31+ onServerCheckedChanged: checked = serverChecked
32+ Component.onCompleted: checked = serverChecked
33+ onTriggered: backendInfo.otherVibrate = checked
34+ }
35+ visible: showAllUI
36+ }
37 }
38 }
39 }
40
41=== modified file 'plugins/sound/sound.cpp'
42--- plugins/sound/sound.cpp 2014-11-13 17:02:24 +0000
43+++ plugins/sound/sound.cpp 2015-02-11 16:05:14 +0000
44@@ -57,6 +57,8 @@
45 Q_EMIT incomingCallVibrateSilentModeChanged();
46 } else if (property == "IncomingMessageVibrateSilentMode") {
47 Q_EMIT incomingMessageVibrateSilentModeChanged();
48+ } else if (property == "OtherVibrate") {
49+ Q_EMIT otherVibrateChanged();
50 } else if (property == "DialpadSoundsEnabled") {
51 Q_EMIT dialpadSoundsEnabledChanged();
52 }
53@@ -71,6 +73,7 @@
54 Q_EMIT incomingMessageVibrateChanged();
55 Q_EMIT incomingCallVibrateSilentModeChanged();
56 Q_EMIT incomingMessageVibrateSilentModeChanged();
57+ Q_EMIT otherVibrateChanged();
58 Q_EMIT dialpadSoundsEnabledChanged();
59 }
60
61@@ -176,6 +179,23 @@
62 Q_EMIT(incomingMessageVibrateSilentModeChanged());
63 }
64
65+bool Sound::getOtherVibrate()
66+{
67+ return m_accountsService.getUserProperty(AS_INTERFACE,
68+ "OtherVibrate").toBool();
69+}
70+
71+void Sound::setOtherVibrate(bool enabled)
72+{
73+ if (enabled == getOtherVibrate())
74+ return;
75+
76+ m_accountsService.setUserProperty(AS_INTERFACE,
77+ "OtherVibrate",
78+ QVariant::fromValue(enabled));
79+ Q_EMIT(otherVibrateChanged());
80+}
81+
82 bool Sound::getDialpadSoundsEnabled()
83 {
84 return m_accountsService.getUserProperty(AS_INTERFACE,
85
86=== modified file 'plugins/sound/sound.h'
87--- plugins/sound/sound.h 2014-11-13 17:02:24 +0000
88+++ plugins/sound/sound.h 2015-02-11 16:05:14 +0000
89@@ -57,6 +57,10 @@
90 READ getIncomingMessageVibrateSilentMode
91 WRITE setIncomingMessageVibrateSilentMode
92 NOTIFY incomingMessageVibrateSilentModeChanged)
93+ Q_PROPERTY (bool otherVibrate
94+ READ getOtherVibrate
95+ WRITE setOtherVibrate
96+ NOTIFY otherVibrateChanged)
97
98 Q_PROPERTY (bool dialpadSoundsEnabled
99 READ getDialpadSoundsEnabled
100@@ -75,6 +79,7 @@
101 void incomingMessageVibrateChanged();
102 void incomingCallVibrateSilentModeChanged();
103 void incomingMessageVibrateSilentModeChanged();
104+ void otherVibrateChanged();
105 void dialpadSoundsEnabledChanged();
106
107 private:
108@@ -92,6 +97,8 @@
109 void setIncomingCallVibrateSilentMode(bool enabled);
110 bool getIncomingMessageVibrateSilentMode();
111 void setIncomingMessageVibrateSilentMode(bool enabled);
112+ bool getOtherVibrate();
113+ void setOtherVibrate(bool enabled);
114 bool getDialpadSoundsEnabled();
115 void setDialpadSoundsEnabled(bool enabled);
116

Subscribers

People subscribed via source and target branches