aboutsummaryrefslogtreecommitdiff
path: root/src/session-service.c
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-07-22 10:24:02 -0500
committerTed Gould <ted@canonical.com>2009-07-22 10:24:02 -0500
commit54b1242df348e8576b4457ea4297d57807f4ce42 (patch)
tree56563da76307a2246c19e81330ca5ec492f810b7 /src/session-service.c
parent6b1103051fa560a06697e7da9a6820deec888b67 (diff)
downloadayatana-indicator-session-54b1242df348e8576b4457ea4297d57807f4ce42.tar.gz
ayatana-indicator-session-54b1242df348e8576b4457ea4297d57807f4ce42.tar.bz2
ayatana-indicator-session-54b1242df348e8576b4457ea4297d57807f4ce42.zip
Switching to having a single handler and then everyone calling it with a parameter.
Diffstat (limited to 'src/session-service.c')
-rw-r--r--src/session-service.c41
1 files changed, 7 insertions, 34 deletions
diff --git a/src/session-service.c b/src/session-service.c
index 80d4172..55e60df 100644
--- a/src/session-service.c
+++ b/src/session-service.c
@@ -13,37 +13,10 @@ static DbusmenuMenuitem * root_menuitem = NULL;
static GMainLoop * mainloop = NULL;
static void
-log_out (DbusmenuMenuitem * mi, gpointer userdata)
+show_dialog (DbusmenuMenuitem * mi, gchar * type)
{
- g_debug("Log Out");
- return;
-}
-
-static void
-suspend (DbusmenuMenuitem * mi, gpointer userdata)
-{
- g_debug("Suspend");
- return;
-}
+ g_debug("Showing dialog '%s'", type);
-static void
-hibernate (DbusmenuMenuitem * mi, gpointer userdata)
-{
- g_debug("Hibernate");
- return;
-}
-
-static void
-restart (DbusmenuMenuitem * mi, gpointer userdata)
-{
- g_debug("Restart");
- return;
-}
-
-static void
-shutdown (DbusmenuMenuitem * mi, gpointer userdata)
-{
- g_debug("Shutdown");
return;
}
@@ -54,27 +27,27 @@ create_items (DbusmenuMenuitem * root) {
mi = dbusmenu_menuitem_new();
dbusmenu_menuitem_property_set(mi, "label", _("Log Out"));
dbusmenu_menuitem_child_append(root, mi);
- g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(log_out), NULL);
+ g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "logout");
mi = dbusmenu_menuitem_new();
dbusmenu_menuitem_property_set(mi, "label", _("Suspend"));
dbusmenu_menuitem_child_append(root, mi);
- g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(suspend), NULL);
+ g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "suspend");
mi = dbusmenu_menuitem_new();
dbusmenu_menuitem_property_set(mi, "label", _("Hibernate"));
dbusmenu_menuitem_child_append(root, mi);
- g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(hibernate), NULL);
+ g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "hibernate");
mi = dbusmenu_menuitem_new();
dbusmenu_menuitem_property_set(mi, "label", _("Restart"));
dbusmenu_menuitem_child_append(root, mi);
- g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(restart), NULL);
+ g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "restart");
mi = dbusmenu_menuitem_new();
dbusmenu_menuitem_property_set(mi, "label", _("Shutdown"));
dbusmenu_menuitem_child_append(root, mi);
- g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(shutdown), NULL);
+ g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "shutdown");
return;
}