Merge lp:~ted/evolution-indicator/command-items into lp:evolution-indicator

Proposed by Ted Gould
Status: Merged
Merged at revision: not available
Proposed branch: lp:~ted/evolution-indicator/command-items
Merge into: lp:evolution-indicator
Prerequisite: lp:~ted/evolution-indicator/libindicate-update
Diff against target: 45 lines (+29/-0)
1 file modified
src/evolution-indicator.c (+29/-0)
To merge this branch: bzr merge lp:~ted/evolution-indicator/command-items
Reviewer Review Type Date Requested Status
Indicator Applet Developers Pending
Review via email: mp+20624@code.launchpad.net

Description of the change

Adds in command items to display in the messaging menu.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/evolution-indicator.c'
2--- src/evolution-indicator.c 2010-03-04 05:13:16 +0000
3+++ src/evolution-indicator.c 2010-03-04 05:13:16 +0000
4@@ -671,6 +671,19 @@
5 update_accounts ();
6 }
7
8+#define EVO_CONTACTS_CMD "evolution -c contacts"
9+#define EVO_COMPOSE_CMD "evolution mailto:"
10+
11+static void
12+command_item_activate (DbusmenuMenuitem * mi, guint timestamp, gpointer user_data)
13+{
14+ gchar * command = (gchar *)user_data;
15+ if (!g_spawn_command_line_async(command, NULL)) {
16+ g_warning("Unable to execute command '%s'", command);
17+ }
18+ return;
19+}
20+
21 int
22 e_plugin_lib_enable (EPluginLib *ep, int enable)
23 {
24@@ -710,6 +723,22 @@
25 g_signal_connect (server, "server-display",
26 G_CALLBACK (show_evolution), NULL);
27
28+ DbusmenuServer * menu_server = dbusmenu_server_new("/messaging/commands");
29+ DbusmenuMenuitem * root = dbusmenu_menuitem_new();
30+
31+ DbusmenuMenuitem * mi = dbusmenu_menuitem_new();
32+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Compose New Message"));
33+ g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(command_item_activate), EVO_COMPOSE_CMD);
34+ dbusmenu_menuitem_child_append(root, mi);
35+
36+ mi = dbusmenu_menuitem_new();
37+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Contacts"));
38+ g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(command_item_activate), EVO_CONTACTS_CMD);
39+ dbusmenu_menuitem_child_append(root, mi);
40+
41+ dbusmenu_server_set_root(menu_server, root);
42+ indicate_server_set_menu(server, menu_server);
43+
44 client = gconf_client_get_default ();
45 gconf_client_add_dir (client, CONF_DIR, GCONF_CLIENT_PRELOAD_NONE, NULL);
46

Subscribers

People subscribed via source and target branches