Merge lp:~artmello/indicator-datetime/indicator-datetime-remove_notification_list_check into lp:indicator-datetime

Proposed by Arthur Mello
Status: Needs review
Proposed branch: lp:~artmello/indicator-datetime/indicator-datetime-remove_notification_list_check
Merge into: lp:indicator-datetime
Diff against target: 214 lines (+1/-44)
10 files modified
include/datetime/settings-live.h (+0/-1)
include/datetime/settings-shared.h (+0/-1)
include/datetime/settings.h (+0/-1)
include/notifications/notifications.h (+0/-3)
src/notifications.cpp (+0/-11)
src/settings-live.cpp (+0/-12)
src/snap.cpp (+1/-10)
tests/test-notification.cpp (+0/-2)
tests/test-settings.cpp (+0/-1)
tests/test-sound.cpp (+0/-2)
To merge this branch: bzr merge lp:~artmello/indicator-datetime/indicator-datetime-remove_notification_list_check
Reviewer Review Type Date Requested Status
Indicator Applet Developers Pending
Review via email: mp+301216@code.launchpad.net

Commit message

Do not check if calendar can use Notification list
Always display calendar notification to Notification List if notifications are enabled for calendar-app

Description of the change

Do not check if calendar can use Notification list
Always display calendar notification to Notification List if notifications are enabled for calendar-app

To post a comment you must log in.

Unmerged revisions

460. By Arthur Mello

Do not check if calendar can use Notification list
Always display calendar notification to Notification List if notifications are enabled for calendar-app

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'include/datetime/settings-live.h'
--- include/datetime/settings-live.h 2016-07-04 19:30:18 +0000
+++ include/datetime/settings-live.h 2016-07-26 20:32:13 +0000
@@ -69,7 +69,6 @@
69 void update_cal_notification_sounds();69 void update_cal_notification_sounds();
70 void update_cal_notification_vibrations();70 void update_cal_notification_vibrations();
71 void update_cal_notification_bubbles();71 void update_cal_notification_bubbles();
72 void update_cal_notification_list();
73 void update_vibrate_silent_mode();72 void update_vibrate_silent_mode();
7473
75 GSettings* m_settings;74 GSettings* m_settings;
7675
=== modified file 'include/datetime/settings-shared.h'
--- include/datetime/settings-shared.h 2016-07-04 19:30:18 +0000
+++ include/datetime/settings-shared.h 2016-07-26 20:32:13 +0000
@@ -60,6 +60,5 @@
60#define SETTINGS_NOTIFY_SOUNDS_KEY "use-sounds-notifications"60#define SETTINGS_NOTIFY_SOUNDS_KEY "use-sounds-notifications"
61#define SETTINGS_NOTIFY_VIBRATIONS_KEY "use-vibrations-notifications"61#define SETTINGS_NOTIFY_VIBRATIONS_KEY "use-vibrations-notifications"
62#define SETTINGS_NOTIFY_BUBBLES_KEY "use-bubbles-notifications"62#define SETTINGS_NOTIFY_BUBBLES_KEY "use-bubbles-notifications"
63#define SETTINGS_NOTIFY_LIST_KEY "use-list-notifications"
6463
65#endif // INDICATOR_DATETIME_SETTINGS_SHARED64#endif // INDICATOR_DATETIME_SETTINGS_SHARED
6665
=== modified file 'include/datetime/settings.h'
--- include/datetime/settings.h 2016-07-04 19:30:18 +0000
+++ include/datetime/settings.h 2016-07-26 20:32:13 +0000
@@ -66,7 +66,6 @@
66 core::Property<bool> cal_notification_sounds;66 core::Property<bool> cal_notification_sounds;
67 core::Property<bool> cal_notification_vibrations;67 core::Property<bool> cal_notification_vibrations;
68 core::Property<bool> cal_notification_bubbles;68 core::Property<bool> cal_notification_bubbles;
69 core::Property<bool> cal_notification_list;
70 core::Property<bool> vibrate_silent_mode;69 core::Property<bool> vibrate_silent_mode;
71};70};
7271
7372
=== modified file 'include/notifications/notifications.h'
--- include/notifications/notifications.h 2016-06-30 00:37:56 +0000
+++ include/notifications/notifications.h 2016-07-26 20:32:13 +0000
@@ -80,9 +80,6 @@
80 /** Sets if a notification bubble should be displayed. */80 /** Sets if a notification bubble should be displayed. */
81 void set_show_notification_bubble (bool show);81 void set_show_notification_bubble (bool show);
8282
83 /** Sets if notification should be posted to messaging menu after it is closed. */
84 void set_post_to_messaging_menu (bool post);
85
8683
87private:84private:
88 friend class Engine;85 friend class Engine;
8986
=== modified file 'src/notifications.cpp'
--- src/notifications.cpp 2016-06-30 00:37:56 +0000
+++ src/notifications.cpp 2016-07-26 20:32:13 +0000
@@ -62,7 +62,6 @@
62 std::function<void(const std::string&)> m_closed_callback;62 std::function<void(const std::string&)> m_closed_callback;
63 std::function<void()> m_timeout_callback;63 std::function<void()> m_timeout_callback;
64 bool m_show_notification_bubble;64 bool m_show_notification_bubble;
65 bool m_post_to_messaging_menu;
66};65};
6766
68Builder::Builder():67Builder::Builder():
@@ -134,12 +133,6 @@
134 impl->m_show_notification_bubble = show;133 impl->m_show_notification_bubble = show;
135}134}
136135
137void
138Builder::set_post_to_messaging_menu (bool post)
139{
140 impl->m_post_to_messaging_menu = post;
141}
142
143/***136/***
144****137****
145***/138***/
@@ -301,10 +294,6 @@
301294
302 std::string post(const Builder::Impl& data)295 std::string post(const Builder::Impl& data)
303 {296 {
304 if (!data.m_post_to_messaging_menu) {
305 return "";
306 }
307
308 if (!m_messaging_app) {297 if (!m_messaging_app) {
309 return std::string();298 return std::string();
310 }299 }
311300
=== modified file 'src/settings-live.cpp'
--- src/settings-live.cpp 2016-07-04 19:30:18 +0000
+++ src/settings-live.cpp 2016-07-26 20:32:13 +0000
@@ -69,7 +69,6 @@
69 update_cal_notification_sounds();69 update_cal_notification_sounds();
70 update_cal_notification_vibrations();70 update_cal_notification_vibrations();
71 update_cal_notification_bubbles();71 update_cal_notification_bubbles();
72 update_cal_notification_list();
73 update_vibrate_silent_mode();72 update_vibrate_silent_mode();
7473
75 // now listen for clients to change the properties s.t. we can sync update GSettings74 // now listen for clients to change the properties s.t. we can sync update GSettings
@@ -175,10 +174,6 @@
175 g_settings_set_boolean(m_settings_cal_notification, SETTINGS_NOTIFY_BUBBLES_KEY, value);174 g_settings_set_boolean(m_settings_cal_notification, SETTINGS_NOTIFY_BUBBLES_KEY, value);
176 });175 });
177176
178 cal_notification_list.changed().connect([this](bool value){
179 g_settings_set_boolean(m_settings_cal_notification, SETTINGS_NOTIFY_LIST_KEY, value);
180 });
181
182 vibrate_silent_mode.changed().connect([this](bool value){177 vibrate_silent_mode.changed().connect([this](bool value){
183 g_settings_set_boolean(m_settings_general_notification, SETTINGS_VIBRATE_SILENT_KEY, value);178 g_settings_set_boolean(m_settings_general_notification, SETTINGS_VIBRATE_SILENT_KEY, value);
184 });179 });
@@ -328,11 +323,6 @@
328 cal_notification_bubbles.set(g_settings_get_boolean(m_settings_cal_notification, SETTINGS_NOTIFY_BUBBLES_KEY));323 cal_notification_bubbles.set(g_settings_get_boolean(m_settings_cal_notification, SETTINGS_NOTIFY_BUBBLES_KEY));
329}324}
330325
331void LiveSettings::update_cal_notification_list()
332{
333 cal_notification_list.set(g_settings_get_boolean(m_settings_cal_notification, SETTINGS_NOTIFY_LIST_KEY));
334}
335
336void LiveSettings::update_vibrate_silent_mode()326void LiveSettings::update_vibrate_silent_mode()
337{327{
338 vibrate_silent_mode.set(g_settings_get_boolean(m_settings_general_notification, SETTINGS_VIBRATE_SILENT_KEY));328 vibrate_silent_mode.set(g_settings_get_boolean(m_settings_general_notification, SETTINGS_VIBRATE_SILENT_KEY));
@@ -360,8 +350,6 @@
360 update_cal_notification_vibrations();350 update_cal_notification_vibrations();
361 else if (key == SETTINGS_NOTIFY_BUBBLES_KEY)351 else if (key == SETTINGS_NOTIFY_BUBBLES_KEY)
362 update_cal_notification_bubbles();352 update_cal_notification_bubbles();
363 else if (key == SETTINGS_NOTIFY_LIST_KEY)
364 update_cal_notification_list();
365}353}
366354
367/***355/***
368356
=== modified file 'src/snap.cpp'
--- src/snap.cpp 2016-07-04 23:44:47 +0000
+++ src/snap.cpp 2016-07-26 20:32:13 +0000
@@ -97,10 +97,7 @@
97 const bool interactive = appointment.is_ubuntu_alarm() && m_engine->supports_actions();97 const bool interactive = appointment.is_ubuntu_alarm() && m_engine->supports_actions();
9898
99 // force the system to stay awake99 // force the system to stay awake
100 std::shared_ptr<uin::Awake> awake;100 std::shared_ptr<uin::Awake> awake = std::make_shared<uin::Awake>(m_engine->app_name());
101 if (appointment.is_ubuntu_alarm() || calendar_bubbles_enabled() || calendar_list_enabled()) {
102 awake = std::make_shared<uin::Awake>(m_engine->app_name());
103 }
104101
105 // calendar events are muted in silent mode; alarm clocks never are102 // calendar events are muted in silent mode; alarm clocks never are
106 std::shared_ptr<uin::Sound> sound;103 std::shared_ptr<uin::Sound> sound;
@@ -185,7 +182,6 @@
185 }182 }
186183
187 b.set_show_notification_bubble(appointment.is_ubuntu_alarm() || calendar_bubbles_enabled());184 b.set_show_notification_bubble(appointment.is_ubuntu_alarm() || calendar_bubbles_enabled());
188 b.set_post_to_messaging_menu(appointment.is_ubuntu_alarm() || calendar_list_enabled());
189185
190 const auto key = m_engine->show(b);186 const auto key = m_engine->show(b);
191 if (key)187 if (key)
@@ -214,11 +210,6 @@
214 return m_settings->cal_notification_bubbles.get();210 return m_settings->cal_notification_bubbles.get();
215 }211 }
216212
217 bool calendar_list_enabled() const
218 {
219 return m_settings->cal_notification_list.get();
220 }
221
222 bool vibrate_in_silent_mode_enabled() const213 bool vibrate_in_silent_mode_enabled() const
223 {214 {
224 return m_settings->vibrate_silent_mode.get();215 return m_settings->vibrate_silent_mode.get();
225216
=== modified file 'tests/test-notification.cpp'
--- tests/test-notification.cpp 2016-06-24 12:26:06 +0000
+++ tests/test-notification.cpp 2016-07-26 20:32:13 +0000
@@ -122,7 +122,6 @@
122 settings->cal_notification_sounds.set(test_disabled.cal_notification_enabled);122 settings->cal_notification_sounds.set(test_disabled.cal_notification_enabled);
123 settings->cal_notification_vibrations.set(test_disabled.cal_notification_enabled);123 settings->cal_notification_vibrations.set(test_disabled.cal_notification_enabled);
124 settings->cal_notification_bubbles.set(test_disabled.cal_notification_enabled);124 settings->cal_notification_bubbles.set(test_disabled.cal_notification_enabled);
125 settings->cal_notification_list.set(test_disabled.cal_notification_enabled);
126125
127 // set test case properties: haptic mode126 // set test case properties: haptic mode
128 settings->alarm_haptic.set(test_haptic.haptic_mode);127 settings->alarm_haptic.set(test_haptic.haptic_mode);
@@ -234,7 +233,6 @@
234 settings->cal_notification_sounds.set(true);233 settings->cal_notification_sounds.set(true);
235 settings->cal_notification_vibrations.set(true);234 settings->cal_notification_vibrations.set(true);
236 settings->cal_notification_bubbles.set(true);235 settings->cal_notification_bubbles.set(true);
237 settings->cal_notification_list.set(true);
238236
239 // walk through the tests237 // walk through the tests
240 for (const auto& test : tests)238 for (const auto& test : tests)
241239
=== modified file 'tests/test-settings.cpp'
--- tests/test-settings.cpp 2016-07-01 19:46:40 +0000
+++ tests/test-settings.cpp 2016-07-26 20:32:13 +0000
@@ -237,5 +237,4 @@
237 TestBoolProperty(m_gsettings_cal_notification, m_settings->cal_notification_sounds, SETTINGS_NOTIFY_SOUNDS_KEY);237 TestBoolProperty(m_gsettings_cal_notification, m_settings->cal_notification_sounds, SETTINGS_NOTIFY_SOUNDS_KEY);
238 TestBoolProperty(m_gsettings_cal_notification, m_settings->cal_notification_vibrations, SETTINGS_NOTIFY_VIBRATIONS_KEY);238 TestBoolProperty(m_gsettings_cal_notification, m_settings->cal_notification_vibrations, SETTINGS_NOTIFY_VIBRATIONS_KEY);
239 TestBoolProperty(m_gsettings_cal_notification, m_settings->cal_notification_bubbles, SETTINGS_NOTIFY_BUBBLES_KEY);239 TestBoolProperty(m_gsettings_cal_notification, m_settings->cal_notification_bubbles, SETTINGS_NOTIFY_BUBBLES_KEY);
240 TestBoolProperty(m_gsettings_cal_notification, m_settings->cal_notification_list, SETTINGS_NOTIFY_LIST_KEY);
241}240}
242241
=== modified file 'tests/test-sound.cpp'
--- tests/test-sound.cpp 2016-06-23 19:04:50 +0000
+++ tests/test-sound.cpp 2016-07-26 20:32:13 +0000
@@ -63,7 +63,6 @@
63 settings->cal_notification_sounds.set(true);63 settings->cal_notification_sounds.set(true);
64 settings->cal_notification_vibrations.set(true);64 settings->cal_notification_vibrations.set(true);
65 settings->cal_notification_bubbles.set(true);65 settings->cal_notification_bubbles.set(true);
66 settings->cal_notification_list.set(true);
6766
68 make_interactive();67 make_interactive();
6968
@@ -160,7 +159,6 @@
160 settings->cal_notification_sounds.set(true);159 settings->cal_notification_sounds.set(true);
161 settings->cal_notification_vibrations.set(true);160 settings->cal_notification_vibrations.set(true);
162 settings->cal_notification_bubbles.set(true);161 settings->cal_notification_bubbles.set(true);
163 settings->cal_notification_list.set(true);
164162
165 const struct {163 const struct {
166 Appointment appointment;164 Appointment appointment;

Subscribers

People subscribed via source and target branches