application: Add 'open-event' action
This will be used by the search engine to open events.
This commit is contained in:
@@ -165,6 +165,24 @@ load_css_provider (GcalApplication *self)
|
|||||||
* Callbacks
|
* Callbacks
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
static void
|
||||||
|
gcal_application_open_event (GSimpleAction *sync,
|
||||||
|
GVariant *parameter,
|
||||||
|
gpointer app)
|
||||||
|
{
|
||||||
|
GcalApplication *self;
|
||||||
|
const gchar *event_uuid;
|
||||||
|
|
||||||
|
self = GCAL_APPLICATION (app);
|
||||||
|
event_uuid = g_variant_get_string (parameter, NULL);
|
||||||
|
g_assert (event_uuid != NULL);
|
||||||
|
|
||||||
|
g_debug ("Opening event %s", event_uuid);
|
||||||
|
|
||||||
|
gcal_window_open_event_by_uuid (GCAL_WINDOW (self->window), event_uuid);
|
||||||
|
gtk_window_present (GTK_WINDOW (self->window));
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gcal_application_sync (GSimpleAction *sync,
|
gcal_application_sync (GSimpleAction *sync,
|
||||||
GVariant *parameter,
|
GVariant *parameter,
|
||||||
@@ -397,6 +415,7 @@ gcal_application_startup (GApplication *app)
|
|||||||
GcalApplication *self;
|
GcalApplication *self;
|
||||||
|
|
||||||
static const GActionEntry gcal_app_entries[] = {
|
static const GActionEntry gcal_app_entries[] = {
|
||||||
|
{ "open-event", gcal_application_open_event, "s" },
|
||||||
{ "sync", gcal_application_sync },
|
{ "sync", gcal_application_sync },
|
||||||
{ "search", gcal_application_launch_search },
|
{ "search", gcal_application_launch_search },
|
||||||
{ "about", gcal_application_show_about },
|
{ "about", gcal_application_show_about },
|
||||||
|
|||||||
Reference in New Issue
Block a user