diff options
author | Ted Gould <ted@gould.cx> | 2010-07-07 16:44:55 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-07-07 16:44:55 -0500 |
commit | 515a3e5f9068e5eb06765c47ba90e2857a22c264 (patch) | |
tree | b5f6080777d18f4bead781e59e0c165ea8ee9141 | |
parent | 4a8b1c170bde2526aea845e628894e1cceaa92d5 (diff) | |
download | ayatana-indicator-datetime-515a3e5f9068e5eb06765c47ba90e2857a22c264.tar.gz ayatana-indicator-datetime-515a3e5f9068e5eb06765c47ba90e2857a22c264.tar.bz2 ayatana-indicator-datetime-515a3e5f9068e5eb06765c47ba90e2857a22c264.zip |
Activating the settings
-rw-r--r-- | src/datetime-service.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c index 9154db5..ad64417 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -15,10 +15,22 @@ static GMainLoop * mainloop = NULL; static DbusmenuServer * server = NULL; static DbusmenuMenuitem * root = NULL; -/* Items */ +/* Global Items */ static DbusmenuMenuitem * date = NULL; static DbusmenuMenuitem * calendar = NULL; +/* Run a particular program based on an activation */ +static void +activate_cb (DbusmenuMenuitem * menuitem, guint timestamp, const gchar *command) +{ + GError * error = NULL; + + if (!g_spawn_command_line_async(command, &error)) { + g_warning("Unable to start %s: %s", (char *)command, error->message); + g_error_free(error); + } +} + /* Does the work to build the default menu, really calls out to other functions but this is the core to clean up the main function. */ @@ -50,7 +62,7 @@ build_menus (DbusmenuMenuitem * root) dbusmenu_menuitem_property_set (settings, DBUSMENU_MENUITEM_PROP_LABEL, _("Set Time and Date...")); /* insensitive until we check for available apps */ dbusmenu_menuitem_property_set_bool(settings, DBUSMENU_MENUITEM_PROP_ENABLED, FALSE); - //g_signal_connect(G_OBJECT(settings), DBUSMENU_MENUITEM_SIGNAL_ACTIVATE, G_CALLBACK(activate_cb), "time-admin"); + g_signal_connect(G_OBJECT(settings), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_cb), "time-admin"); dbusmenu_menuitem_child_append(root, settings); return; |