aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Barth <david.barth@canonical.com>2016-02-03 15:47:29 +0100
committerRobert Tari <robert@tari.in>2021-07-01 02:01:35 +0200
commit990df2335fddc985aa789d82d184eaa83409b73b (patch)
tree97a1362893f150866e0829e34550247849c287c6 /src
parent1e41f6a165a3cd636f98b513a044d85522108ae1 (diff)
downloadayatana-indicator-datetime-990df2335fddc985aa789d82d184eaa83409b73b.tar.gz
ayatana-indicator-datetime-990df2335fddc985aa789d82d184eaa83409b73b.tar.bz2
ayatana-indicator-datetime-990df2335fddc985aa789d82d184eaa83409b73b.zip
adjust title and notification icon according to the event type
Diffstat (limited to 'src')
-rw-r--r--src/snap.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/snap.cpp b/src/snap.cpp
index 934ad19..9c2b4b6 100644
--- a/src/snap.cpp
+++ b/src/snap.cpp
@@ -122,7 +122,7 @@ public:
const auto minutes = std::chrono::minutes(m_settings->alarm_duration.get());
ain::Builder b;
b.set_body (appointment.summary);
- b.set_icon_name ("alarm-clock");
+ b.set_icon_name (appointment.is_ubuntu_alarm() ? "alarm-clock" : "reminder");
b.add_hint (ain::Builder::HINT_NONSHAPED_ICON);
const char * timefmt;
@@ -136,7 +136,14 @@ public:
timefmt = _("%a, %H:%M");
}
const auto timestr = appointment.begin.format(timefmt);
- auto title = g_strdup_printf(_("Alarm %s"), timestr.c_str());
+
+ const char * titlefmt;
+ if (appointment.is_ubuntu_alarm()) {
+ titlefmt = _("Alarm %s");
+ } else {
+ titlefmt = _("Event %s");
+ }
+ auto title = g_strdup_printf(titlefmt, timestr.c_str());
b.set_title (title);
g_free (title);
b.set_timeout (std::chrono::duration_cast<std::chrono::seconds>(minutes));