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
=== modified file 'src/evolution-indicator.c'
--- src/evolution-indicator.c 2010-03-04 05:13:16 +0000
+++ src/evolution-indicator.c 2010-03-04 05:13:16 +0000
@@ -671,6 +671,19 @@
671 update_accounts ();671 update_accounts ();
672}672}
673673
674#define EVO_CONTACTS_CMD "evolution -c contacts"
675#define EVO_COMPOSE_CMD "evolution mailto:"
676
677static void
678command_item_activate (DbusmenuMenuitem * mi, guint timestamp, gpointer user_data)
679{
680 gchar * command = (gchar *)user_data;
681 if (!g_spawn_command_line_async(command, NULL)) {
682 g_warning("Unable to execute command '%s'", command);
683 }
684 return;
685}
686
674int687int
675e_plugin_lib_enable (EPluginLib *ep, int enable)688e_plugin_lib_enable (EPluginLib *ep, int enable)
676{689{
@@ -710,6 +723,22 @@
710 g_signal_connect (server, "server-display",723 g_signal_connect (server, "server-display",
711 G_CALLBACK (show_evolution), NULL);724 G_CALLBACK (show_evolution), NULL);
712725
726 DbusmenuServer * menu_server = dbusmenu_server_new("/messaging/commands");
727 DbusmenuMenuitem * root = dbusmenu_menuitem_new();
728
729 DbusmenuMenuitem * mi = dbusmenu_menuitem_new();
730 dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Compose New Message"));
731 g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(command_item_activate), EVO_COMPOSE_CMD);
732 dbusmenu_menuitem_child_append(root, mi);
733
734 mi = dbusmenu_menuitem_new();
735 dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Contacts"));
736 g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(command_item_activate), EVO_CONTACTS_CMD);
737 dbusmenu_menuitem_child_append(root, mi);
738
739 dbusmenu_server_set_root(menu_server, root);
740 indicate_server_set_menu(server, menu_server);
741
713 client = gconf_client_get_default ();742 client = gconf_client_get_default ();
714 gconf_client_add_dir (client, CONF_DIR, GCONF_CLIENT_PRELOAD_NONE, NULL);743 gconf_client_add_dir (client, CONF_DIR, GCONF_CLIENT_PRELOAD_NONE, NULL);
715744

Subscribers

People subscribed via source and target branches