diff options
author | Renato Araujo Oliveira Filho <renato.filho@canonical.com> | 2016-03-16 11:42:06 -0300 |
---|---|---|
committer | Robert Tari <robert@tari.in> | 2021-07-01 16:22:38 +0200 |
commit | 8b3ff84240470f403a93b577a6cec1a10311512d (patch) | |
tree | 930a6d1245f7e29b886d8db97303a5c59dc63a2c | |
parent | 5b050c7f02284be9e97bf08ac80135cff5271c36 (diff) | |
download | ayatana-indicator-datetime-8b3ff84240470f403a93b577a6cec1a10311512d.tar.gz ayatana-indicator-datetime-8b3ff84240470f403a93b577a6cec1a10311512d.tar.bz2 ayatana-indicator-datetime-8b3ff84240470f403a93b577a6cec1a10311512d.zip |
calls 'calendar://eventId=<event-id>' when clicking on an event in the indicator.
-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() |