← Back to team overview

ayatana-commits team mailing list archive

[Branch ~indicator-applet-developers/evolution-indicator/trunk] Rev 59: Command items for running evolution.

 

Merge authors:
  Ted Gould (ted)
Related merge proposals:
  https://code.launchpad.net/~ted/evolution-indicator/command-items/+merge/20624
  proposed by: Ted Gould (ted)
------------------------------------------------------------
revno: 59 [merge]
committer: Ted Gould <ted@xxxxxxxx>
branch nick: trunk
timestamp: Thu 2010-03-04 11:19:09 -0600
message:
  Command items for running evolution.
modified:
  src/evolution-indicator.c


--
lp:evolution-indicator
https://code.launchpad.net/~indicator-applet-developers/evolution-indicator/trunk

Your team ayatana-commits is subscribed to branch lp:evolution-indicator.
To unsubscribe from this branch go to https://code.launchpad.net/~indicator-applet-developers/evolution-indicator/trunk/+edit-subscription.
=== modified file 'src/evolution-indicator.c'
--- src/evolution-indicator.c	2010-03-04 04:41:47 +0000
+++ src/evolution-indicator.c	2010-03-04 05:05:05 +0000
@@ -671,6 +671,19 @@
   update_accounts ();
 }
 
+#define EVO_CONTACTS_CMD  "evolution -c contacts"
+#define EVO_COMPOSE_CMD   "evolution mailto:";
+
+static void
+command_item_activate (DbusmenuMenuitem * mi, guint timestamp, gpointer user_data)
+{
+	gchar * command = (gchar *)user_data;
+	if (!g_spawn_command_line_async(command, NULL)) {
+		g_warning("Unable to execute command '%s'", command);
+	}
+	return;
+}
+
 int
 e_plugin_lib_enable (EPluginLib *ep, int enable)
 {
@@ -710,6 +723,22 @@
     g_signal_connect (server, "server-display",
                       G_CALLBACK (show_evolution), NULL);
 
+	DbusmenuServer * menu_server = dbusmenu_server_new("/messaging/commands");
+	DbusmenuMenuitem * root = dbusmenu_menuitem_new();
+
+	DbusmenuMenuitem * mi = dbusmenu_menuitem_new();
+	dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Compose New Message"));
+	g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(command_item_activate), EVO_COMPOSE_CMD);
+	dbusmenu_menuitem_child_append(root, mi);
+
+	mi = dbusmenu_menuitem_new();
+	dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Contacts"));
+	g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(command_item_activate), EVO_CONTACTS_CMD);
+	dbusmenu_menuitem_child_append(root, mi);
+
+	dbusmenu_server_set_root(menu_server, root);
+	indicate_server_set_menu(server, menu_server);
+
     client = gconf_client_get_default ();
     gconf_client_add_dir (client, CONF_DIR, GCONF_CLIENT_PRELOAD_NONE, NULL);