diff options
author | Renato Araujo Oliveira Filho <renato.filho@canonical.com> | 2016-03-16 11:42:06 -0300 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-08-29 14:37:39 +0200 |
commit | c62f5c257ef2874f7abccd727c3915ee456dec59 (patch) | |
tree | 2d6a336ba5cafb869ef54453d38c33357327ce57 /src/actions-live.cpp | |
parent | 0fee0c157594ca750c3a253e984203cc3abe7cd5 (diff) | |
download | ayatana-indicator-datetime-c62f5c257ef2874f7abccd727c3915ee456dec59.tar.gz ayatana-indicator-datetime-c62f5c257ef2874f7abccd727c3915ee456dec59.tar.bz2 ayatana-indicator-datetime-c62f5c257ef2874f7abccd727c3915ee456dec59.zip |
calls 'calendar://eventId=<event-id>' when clicking on an event in the indicator.
Diffstat (limited to 'src/actions-live.cpp')
-rw-r--r-- | src/actions-live.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/actions-live.cpp b/src/actions-live.cpp index 271d2f3..6ac1878 100644 --- a/src/actions-live.cpp +++ b/src/actions-live.cpp @@ -25,6 +25,8 @@ #include <glib.h> +#include <sstream> + namespace ayatana { namespace indicator { namespace datetime { @@ -159,15 +161,27 @@ void LiveActions::phone_open_appointment(const Appointment& appt) phone_open_alarm_app(); break; + case Appointment::EVENT: + if (!appt.source_uid.empty() && !appt.uid.empty()) + { + std::stringstream cmd; + // event-id format: <source-id>/<event-id> + cmd << "calendar://eventid=" + << appt.source_uid + << "/" + << appt.uid; + dispatch_url(cmd.str()); + break; + } default: phone_open_calendar_app(appt.begin); } } -void LiveActions::phone_open_calendar_app(const DateTime&) +void LiveActions::phone_open_calendar_app(const DateTime& dt) { - // does calendar app have a mechanism for specifying dates? - dispatch_url("appid://com.ubuntu.calendar/calendar/current-user-version"); + auto cmd = dt.format("calendar:///?startdate=%Y%m%dT%H%M%SZ"); + dispatch_url(cmd); } void LiveActions::phone_open_settings_app() |