diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-12-08 23:08:53 +0000 |
---|---|---|
committer | CI Train Bot <ci-train-bot@canonical.com> | 2014-12-08 23:08:53 +0000 |
commit | 6de98acd45d855789fdd4bfdf45fa826eef22828 (patch) | |
tree | e79780602c455ddad496c8c387ee6e4638184c18 | |
parent | 13688fe9fffc1d9dad3bf5918efcc8221846c82b (diff) | |
parent | 9f29b40133fc419a7a74379c55d63c105a4c2c16 (diff) | |
download | ayatana-indicator-datetime-6de98acd45d855789fdd4bfdf45fa826eef22828.tar.gz ayatana-indicator-datetime-6de98acd45d855789fdd4bfdf45fa826eef22828.tar.bz2 ayatana-indicator-datetime-6de98acd45d855789fdd4bfdf45fa826eef22828.zip |
Change notifications for calendar events s.t. the sound is nonrepeating and the notification is temporary, not requiring user interaction to disappear. Fixes: #1320880
Approved by: Ted Gould
-rw-r--r-- | src/snap.cpp | 13 | ||||
-rw-r--r-- | tests/manual | 10 |
2 files changed, 19 insertions, 4 deletions
diff --git a/src/snap.cpp b/src/snap.cpp index 6d2957d..ee96007 100644 --- a/src/snap.cpp +++ b/src/snap.cpp @@ -63,13 +63,19 @@ public: appointment_func snooze, appointment_func ok) { + /* Alarms and calendar events are treated differently. + Alarms should require manual intervention to dismiss. + Calendar events are less urgent and shouldn't require manual + intervention and shouldn't loop the sound. */ + const bool interactive = appointment.is_ubuntu_alarm() && m_engine->supports_actions(); + // force the system to stay awake auto awake = std::make_shared<uin::Awake>(m_engine->app_name()); // create the sound... const auto uri = get_alarm_uri(appointment, m_settings); const auto volume = m_settings->alarm_volume.get(); - const bool loop = m_engine->supports_actions(); + const bool loop = interactive; auto sound = std::make_shared<uin::Sound>(uri, volume, loop); // create the haptic feedback... @@ -80,12 +86,9 @@ public: // show a notification... const auto minutes = std::chrono::minutes(m_settings->alarm_duration.get()); - const bool interactive = m_engine->supports_actions(); uin::Builder b; b.set_body (appointment.summary); b.set_icon_name ("alarm-clock"); - b.add_hint (uin::Builder::HINT_SNAP); - b.add_hint (uin::Builder::HINT_AFFIRMATIVE_HINT); b.add_hint (uin::Builder::HINT_NONSHAPED_ICON); const char * timefmt; @@ -104,6 +107,8 @@ public: g_free (title); b.set_timeout (std::chrono::duration_cast<std::chrono::seconds>(minutes)); if (interactive) { + b.add_hint (uin::Builder::HINT_SNAP); + b.add_hint (uin::Builder::HINT_AFFIRMATIVE_HINT); b.add_action ("ok", _("OK")); b.add_action ("snooze", _("Snooze")); } diff --git a/tests/manual b/tests/manual index 2062fd1..c2522aa 100644 --- a/tests/manual +++ b/tests/manual @@ -48,6 +48,16 @@ Test-case indicator-datetime/disabled-alarms <dd>When the alarm is enabled, the alarm icon should reappear.</dd> </dl> +Test-case indicator-datetime/calendar-event-notification +<dl> + <dt>In the calendar app, create and save a new upcoming calendar event that will occur in the next few minutes.</dt> + <dd>The datetime indicator's event list should update itself to show this new event.</dd> + <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> + <dt>Wait for the event's time to be reached</dt> + <dd>The datetime indicator should pop up a non-interactive notification that plays a nonlooping sound.</dd> + <dd>The notification should disappear after a moment without requiring user intervention.</dd> +</dl> + Test-case indicator-datetime/alarm-timezone <dl> <dt>In ubuntu-system-settings, change your timezone to a zone you're not in</dt> |