From 8b3ff84240470f403a93b577a6cec1a10311512d Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Wed, 16 Mar 2016 11:42:06 -0300 Subject: calls 'calendar://eventId=' when clicking on an event in the indicator. --- src/actions-live.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'src/actions-live.cpp') 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 +#include + 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: / + 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() -- cgit v1.2.3