aboutsummaryrefslogtreecommitdiff
path: root/src/app-section.c
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2012-06-03 12:59:43 +0200
committerLars Uebernickel <lars.uebernickel@canonical.com>2012-06-03 12:59:43 +0200
commit98538a540ba7a741a68b4cff6d3e192a43d61077 (patch)
tree170fe2cc8c1168ac1497d2731f2cbb32710e54a4 /src/app-section.c
parent76b172f49929b8feb1375df830042f6d47121f67 (diff)
downloadayatana-indicator-messages-98538a540ba7a741a68b4cff6d3e192a43d61077.tar.gz
ayatana-indicator-messages-98538a540ba7a741a68b4cff6d3e192a43d61077.tar.bz2
ayatana-indicator-messages-98538a540ba7a741a68b4cff6d3e192a43d61077.zip
Reexport application actions
Diffstat (limited to 'src/app-section.c')
-rw-r--r--src/app-section.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/app-section.c b/src/app-section.c
index 6218f37..f23f412 100644
--- a/src/app-section.c
+++ b/src/app-section.c
@@ -54,6 +54,7 @@ struct _AppSectionPrivate
enum {
PROP_0,
PROP_APPINFO,
+ PROP_ACTIONS,
NUM_PROPERTIES
};
@@ -97,6 +98,12 @@ app_section_class_init (AppSectionClass *klass)
G_TYPE_APP_INFO,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
+ properties[PROP_ACTIONS] = g_param_spec_object ("actions",
+ "Actions",
+ "The actions exported by this application",
+ G_TYPE_ACTION_GROUP,
+ G_PARAM_READABLE);
+
g_object_class_install_properties (object_class, NUM_PROPERTIES, properties);
}
@@ -247,6 +254,9 @@ app_section_set_app_info (AppSection *self,
g_free(name);
}
+ g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_APPINFO]);
+ g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_ACTIONS]);
+
g_free(label);
g_object_unref (launch);
}
@@ -306,6 +316,13 @@ app_section_get_desktop (AppSection * self)
return NULL;
}
+GActionGroup *
+app_section_get_actions (AppSection *self)
+{
+ AppSectionPrivate * priv = APP_SECTION_GET_PRIVATE(self);
+ return priv->actions ? priv->actions : G_ACTION_GROUP (priv->static_shortcuts);
+}
+
GMenuModel *
app_section_get_menu (AppSection *self)
{
@@ -381,6 +398,8 @@ app_section_set_object_path (AppSection *self,
priv->name_watch_id = g_bus_watch_name_on_connection (bus, bus_name, 0,
NULL, application_vanished,
self, NULL);
+
+ g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_ACTIONS]);
}
/*
@@ -402,5 +421,7 @@ app_section_unset_object_path (AppSection *self)
}
g_clear_object (&priv->actions);
g_clear_object (&priv->remote_menu);
+
+ g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_ACTIONS]);
}