aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Barth <david.barth@canonical.com>2016-02-03 15:47:29 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-08-29 14:35:03 +0200
commit7357c8fbeafece1a31a57c7483e47fc3964ecd68 (patch)
tree56bbae25dbd637862063c3bedc03fdfd14433d81 /src
parent1eace0aeb116ca1a93a2bad1e25bfa5f8c50b1d8 (diff)
downloadayatana-indicator-datetime-7357c8fbeafece1a31a57c7483e47fc3964ecd68.tar.gz
ayatana-indicator-datetime-7357c8fbeafece1a31a57c7483e47fc3964ecd68.tar.bz2
ayatana-indicator-datetime-7357c8fbeafece1a31a57c7483e47fc3964ecd68.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));