Merge lp:~charlesk/indicator-datetime/lp-1320880-shorter-notifications-for-calendar-events into lp:indicator-datetime/15.04

Proposed by Charles Kerr on 2014-12-08
Status: Merged
Approved by: Charles Kerr on 2014-12-08
Approved revision: 390
Merged at revision: 391
Proposed branch: lp:~charlesk/indicator-datetime/lp-1320880-shorter-notifications-for-calendar-events
Merge into: lp:indicator-datetime/15.04
Prerequisite: lp:~charlesk/indicator-datetime/lp-1387231-honor-x-canonical-disabled-tag
Diff against target: 67 lines (+19/-4)
2 files modified
src/snap.cpp (+9/-4)
tests/manual (+10/-0)
To merge this branch: bzr merge lp:~charlesk/indicator-datetime/lp-1320880-shorter-notifications-for-calendar-events
Reviewer Review Type Date Requested Status
Ted Gould (community) 2014-12-08 Approve on 2014-12-08
PS Jenkins bot (community) continuous-integration Needs Fixing on 2014-12-08
Review via email: mp+243939@code.launchpad.net

Commit message

Change notifications for calendar events s.t. the sound is nonrepeating and the notification is temporary, not requiring user interaction to disappear.

Description of the change

Description of the Change
=========================

This branch culls the bugfix for bug #1320880 from my development branch so that it's easier to review and to backport in isolation.

It's a fairly simple patch: it changes notifications for calendar events s.t. the sound is nonrepeating and the notification is temporary, not requiring user interaction to disappear.

Checklist
=========

> Are there any related MPs required for this MP to build/function as expected? Please list.

This MP stacks on top of lp:~charlesk/indicator-datetime/lp-1387231-honor-x-canonical-disabled-tag

> Is your branch in sync with latest trunk? (e.g. bzr pull lp:trunk -> no changes)

Yes

> Did the code build without warnings?

Yes

> Did the tests run successfully?

Yes

> Did you perform an exploratory manual test run of your code change and any related functionality?

Yes

> If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?

N/A

> What device (or emulator) has your component test plan been executed successfully on?

Krillin running ubuntu-touch/ubuntu-rtm/14.09

> What manual tests are relevant for this MP?

indicator-datetime/calendar-event-notification

> Did you include a link to the MR Review Checklist Template to make your reviewer's life easier?

https://wiki.ubuntu.com/Process/Merges/Checklists/indicator-datetime

To post a comment you must log in.
Charles Kerr (charlesk) wrote :

This looks like a jenkins hiccup, but since the ci lab is moving it appears that s-jenkins is unreachable right now. So re-running ci will have to wait a bit.

Ted Gould (ted) wrote :

Minor nit. Top approve when ready (either way)

review: Approve
Charles Kerr (charlesk) wrote :

Comment added below; top-approving as per Ted's previous comment.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/snap.cpp'
2--- src/snap.cpp 2014-12-08 03:09:09 +0000
3+++ src/snap.cpp 2014-12-08 03:09:10 +0000
4@@ -63,13 +63,19 @@
5 appointment_func snooze,
6 appointment_func ok)
7 {
8+ /* Alarms and calendar events are treated differently.
9+ Alarms should require manual intervention to dismiss.
10+ Calendar events are less urgent and shouldn't require manual
11+ intervention and shouldn't loop the sound. */
12+ const bool interactive = appointment.is_ubuntu_alarm() && m_engine->supports_actions();
13+
14 // force the system to stay awake
15 auto awake = std::make_shared<uin::Awake>(m_engine->app_name());
16
17 // create the sound...
18 const auto uri = get_alarm_uri(appointment, m_settings);
19 const auto volume = m_settings->alarm_volume.get();
20- const bool loop = m_engine->supports_actions();
21+ const bool loop = interactive;
22 auto sound = std::make_shared<uin::Sound>(uri, volume, loop);
23
24 // create the haptic feedback...
25@@ -80,12 +86,9 @@
26
27 // show a notification...
28 const auto minutes = std::chrono::minutes(m_settings->alarm_duration.get());
29- const bool interactive = m_engine->supports_actions();
30 uin::Builder b;
31 b.set_body (appointment.summary);
32 b.set_icon_name ("alarm-clock");
33- b.add_hint (uin::Builder::HINT_SNAP);
34- b.add_hint (uin::Builder::HINT_AFFIRMATIVE_HINT);
35 b.add_hint (uin::Builder::HINT_NONSHAPED_ICON);
36
37 const char * timefmt;
38@@ -104,6 +107,8 @@
39 g_free (title);
40 b.set_timeout (std::chrono::duration_cast<std::chrono::seconds>(minutes));
41 if (interactive) {
42+ b.add_hint (uin::Builder::HINT_SNAP);
43+ b.add_hint (uin::Builder::HINT_AFFIRMATIVE_HINT);
44 b.add_action ("ok", _("OK"));
45 b.add_action ("snooze", _("Snooze"));
46 }
47
48=== modified file 'tests/manual'
49--- tests/manual 2014-12-08 03:09:09 +0000
50+++ tests/manual 2014-12-08 03:09:10 +0000
51@@ -48,6 +48,16 @@
52 <dd>When the alarm is enabled, the alarm icon should reappear.</dd>
53 </dl>
54
55+Test-case indicator-datetime/calendar-event-notification
56+<dl>
57+ <dt>In the calendar app, create and save a new upcoming calendar event that will occur in the next few minutes.</dt>
58+ <dd>The datetime indicator's event list should update itself to show this new event.</dd>
59+ <dd>Calendar events do not get the alarm icon, so no alarm icon should be shown in the header unless there is also an upcoming alarm set.</dd>
60+ <dt>Wait for the event's time to be reached</dt>
61+ <dd>The datetime indicator should pop up a non-interactive notification that plays a nonlooping sound.</dd>
62+ <dd>The notification should disappear after a moment without requiring user intervention.</dd>
63+</dl>
64+
65 Test-case indicator-datetime/alarm-timezone
66 <dl>
67 <dt>In ubuntu-system-settings, change your timezone to a zone you're not in</dt>

Subscribers

People subscribed via source and target branches