Merge lp:~seb128/telephony-service/sounds-events-from-gsettings into lp:telephony-service

Proposed by Sebastien Bacher
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 726
Merged at revision: 726
Proposed branch: lp:~seb128/telephony-service/sounds-events-from-gsettings
Merge into: lp:telephony-service
Diff against target: 139 lines (+20/-5)
6 files modified
CMakeLists.txt (+1/-0)
approver/CMakeLists.txt (+2/-0)
debian/control (+2/-0)
libtelephonyservice/CMakeLists.txt (+2/-1)
libtelephonyservice/ringtone.cpp (+11/-4)
libtelephonyservice/ringtone.h (+2/-0)
To merge this branch: bzr merge lp:~seb128/telephony-service/sounds-events-from-gsettings
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Gustavo Pichorim Boiko (community) Approve
Review via email: mp+178344@code.launchpad.net

Commit message

read the ringtone and new message sounds from gsettings

Description of the change

read the ringtone and new message sounds from gsettings

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

(that's a resubmit of https://code.launchpad.net/~seb128/phone-app/ringtone-in-gsettings/+merge/176968 which was against the phone-app and already got some reviews):

Notes copied:

Those changes are making the sounds to use for call/messages to be read from gsettings/customizable, see https://bugs.launchpad.net/phone-app/+bug/1202253 for some details

Note that I've not been able to actual test the runtime behaviour, because I don't have a working phone with a SIM ... is there any way to simulate phone calls on a desktop? The code build and is working fine in a standalone test application.

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

We opt-ed for storing the sound settings in a common schemas, the settings app is already writting the configuration there and the schemas is installed on the touch image

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

(the CI failed because libgsettings-qt-dev is not depending on libgsettings-qt, I've just submitted a fix for that)

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

I've pushed a new revision that adds code for silent mode (basically not playing the call/messaging sound if we are in silent mode)

That's the approch that was discussed/decided in https://blueprints.launchpad.net/ubuntu/+spec/touch-silent-mode

you can test settings the silent mode from the system settings or doing "gsettings set com.ubuntu.touch.sound silent-mode true" (or false to turn it off)

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

Looks good.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

hum, seems like the armhf builder hit a transient issue, could somebody re-approve it?

Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2013-07-30 18:04:03 +0000
3+++ CMakeLists.txt 2013-08-08 14:39:11 +0000
4@@ -59,6 +59,7 @@
5 pkg_check_modules(TP_QT5 REQUIRED TelepathyQt5)
6 pkg_check_modules(NOTIFY REQUIRED libnotify)
7 pkg_check_modules(MESSAGING_MENU REQUIRED messaging-menu)
8+pkg_check_modules(GSETTINGS REQUIRED gsettings-qt)
9
10 # Check if the messaging menu has the message header
11 set(CMAKE_REQUIRED_INCLUDES ${MESSAGING_MENU_INCLUDE_DIRS})
12
13=== modified file 'approver/CMakeLists.txt'
14--- approver/CMakeLists.txt 2013-07-29 22:56:27 +0000
15+++ approver/CMakeLists.txt 2013-08-08 14:39:11 +0000
16@@ -14,6 +14,7 @@
17 ${TP_QT5_INCLUDE_DIRS}
18 ${NOTIFY_INCLUDE_DIRS}
19 ${MESSAGING_MENU_INCLUDE_DIRS}
20+ ${GSETTINGS_INCLUDE_DIRS}
21 ${CMAKE_SOURCE_DIR}/libtelephonyservice
22 ${CMAKE_CURRENT_BINARY_DIR}
23 )
24@@ -27,6 +28,7 @@
25 ${TP_QT5_LIBRARIES}
26 ${NOTIFY_LIBRARIES}
27 ${MESSAGING_MENU_LIBRARIES}
28+ ${GSETTINGS_LIBRARIES}
29 telephonyservice
30 )
31
32
33=== modified file 'debian/control'
34--- debian/control 2013-07-25 19:36:32 +0000
35+++ debian/control 2013-08-08 14:39:11 +0000
36@@ -7,6 +7,7 @@
37 dh-translations,
38 libgl1-mesa-dev | libgl-dev,
39 libgles2-mesa-dev,
40+ libgsettings-qt-dev,
41 libicu-dev,
42 libmessaging-menu-dev,
43 libnotify-dev,
44@@ -31,6 +32,7 @@
45 Architecture: any
46 Depends: ${misc:Depends},
47 ${shlibs:Depends},
48+ gsettings-ubuntu-touch-schemas (>= 0.0.1+13.10.20130730),
49 libnotify4,
50 telepathy-mission-control-5,
51 telepathy-ofono,
52
53=== modified file 'libtelephonyservice/CMakeLists.txt'
54--- libtelephonyservice/CMakeLists.txt 2013-08-01 01:43:07 +0000
55+++ libtelephonyservice/CMakeLists.txt 2013-08-08 14:39:11 +0000
56@@ -12,6 +12,7 @@
57
58 include_directories(
59 ${TP_QT5_INCLUDE_DIRS}
60+ ${GSETTINGS_INCLUDE_DIRS}
61 )
62
63 if (USE_UBUNTU_PLATFORM_API)
64@@ -19,7 +20,7 @@
65 endif (USE_UBUNTU_PLATFORM_API)
66
67 add_library(telephonyservice STATIC ${library_SRCS} ${library_HDRS})
68-target_link_libraries(telephonyservice ${TP_QT5_LIBRARIES} ${UBUNTU_APP_LIB})
69+target_link_libraries(telephonyservice ${TP_QT5_LIBRARIES} ${UBUNTU_APP_LIB} ${GSETTINGS_LIBRARIES})
70
71 qt5_use_modules(telephonyservice Contacts Core DBus Multimedia Qml Quick)
72
73
74=== modified file 'libtelephonyservice/ringtone.cpp'
75--- libtelephonyservice/ringtone.cpp 2013-07-18 17:02:10 +0000
76+++ libtelephonyservice/ringtone.cpp 2013-08-08 14:39:11 +0000
77@@ -22,12 +22,11 @@
78 #include "ringtone.h"
79 #include <QDebug>
80
81-#define SOUND_PATH "/usr/share/sounds/ubuntu/stereo/"
82 Ringtone::Ringtone(QObject *parent) :
83 QObject(parent),
84- mCallAudioPlayer(this), mCallAudioPlaylist(this), mMessageAudioPlayer(this)
85+ mCallAudioPlayer(this), mCallAudioPlaylist(this), mMessageAudioPlayer(this), mSoundSettings("com.ubuntu.touch.sound")
86 {
87- mCallAudioPlaylist.addMedia(QUrl::fromLocalFile(SOUND_PATH "phone-incoming-call.ogg"));
88+ mCallAudioPlaylist.addMedia(QUrl::fromLocalFile(mSoundSettings.get("incomingCallSound").toString()));
89 mCallAudioPlaylist.setPlaybackMode(QMediaPlaylist::Loop);
90 mCallAudioPlaylist.setCurrentIndex(0);
91 }
92@@ -41,6 +40,10 @@
93
94 void Ringtone::playIncomingCallSound()
95 {
96+ if (mSoundSettings.get("silentMode") == true) {
97+ return;
98+ }
99+
100 if (mCallAudioPlayer.state() == QMediaPlayer::PlayingState) {
101 return;
102 }
103@@ -56,11 +59,15 @@
104
105 void Ringtone::playIncomingMessageSound()
106 {
107+ if (mSoundSettings.get("silentMode") == true) {
108+ return;
109+ }
110+
111 if (mMessageAudioPlayer.state() == QMediaPlayer::PlayingState) {
112 return;
113 }
114
115- mMessageAudioPlayer.setMedia(QUrl::fromLocalFile(SOUND_PATH "message-new-instant.ogg"));
116+ mMessageAudioPlayer.setMedia(QUrl::fromLocalFile(mSoundSettings.get("incomingMessageSound").toString()));
117 mMessageAudioPlayer.play();
118 }
119
120
121=== modified file 'libtelephonyservice/ringtone.h'
122--- libtelephonyservice/ringtone.h 2013-07-18 17:02:10 +0000
123+++ libtelephonyservice/ringtone.h 2013-08-08 14:39:11 +0000
124@@ -22,6 +22,7 @@
125 #ifndef RINGTONE_H
126 #define RINGTONE_H
127
128+#include <QGSettings>
129 #include <QObject>
130 #include <QMediaPlayer>
131 #include <QMediaPlaylist>
132@@ -47,6 +48,7 @@
133 QMediaPlaylist mCallAudioPlaylist;
134
135 QMediaPlayer mMessageAudioPlayer;
136+ QGSettings mSoundSettings;
137 };
138
139 #endif // RINGTONE_H

Subscribers

People subscribed via source and target branches