aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/actions-live.cpp20
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()