diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2012-06-03 08:33:31 +0200 |
---|---|---|
committer | Lars Uebernickel <lars.uebernickel@canonical.com> | 2012-06-03 08:33:31 +0200 |
commit | 6872c840672049695904d61c1a3baba22c6d9627 (patch) | |
tree | d2393b4131adc1508f14c3977ef0d854ca36a25f /src/messages-service.c | |
parent | a6d889c175d136cfb1d63a9c04bb2156f210a09e (diff) | |
download | ayatana-indicator-messages-6872c840672049695904d61c1a3baba22c6d9627.tar.gz ayatana-indicator-messages-6872c840672049695904d61c1a3baba22c6d9627.tar.bz2 ayatana-indicator-messages-6872c840672049695904d61c1a3baba22c6d9627.zip |
Add GActionMuxer
This is a new implementation of an action muxer with the same interface as the
one in the gtk tree. Its implementation is considerably simpler, mostly
because it doesn't need to implement GActionObservable.
In addition to muxing different action groups with the <prefix>.<action_name>
scheme, it has the notion of global, prefix-less actions. Indicator-messages
needs those for the status and clear actions.
Diffstat (limited to 'src/messages-service.c')
-rw-r--r-- | src/messages-service.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/messages-service.c b/src/messages-service.c index 28a64a0..c1069b8 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -34,12 +34,14 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include "dbus-data.h" #include "messages-service-dbus.h" #include "status-items.h" +#include "gactionmuxer.h" static IndicatorService * service = NULL; static GHashTable *applications; static GDBusConnection *bus; static GSimpleActionGroup *actions; +static GActionMuxer *action_muxer; static GMenu *menu; static GSettings *settings; static GMainLoop * mainloop = NULL; @@ -296,8 +298,11 @@ main (int argc, char ** argv) actions = g_simple_action_group_new (); g_simple_action_group_add_entries (actions, entries, G_N_ELEMENTS (entries), NULL); + + action_muxer = g_action_muxer_new (); + g_action_muxer_insert (action_muxer, NULL, G_ACTION_GROUP (actions)); g_dbus_connection_export_action_group (bus, INDICATOR_MESSAGES_DBUS_OBJECT, - G_ACTION_GROUP (actions), &error); + G_ACTION_GROUP (action_muxer), &error); if (error) { g_warning ("unable to export action group on dbus: %s", error->message); g_error_free (error); |