← Back to team overview

ayatana-commits team mailing list archive

[Branch ~indicator-applet-developers/indicator-applet/applet] Rev 383: Set the environment for the applet

 

Merge authors:
  Ted Gould (ted)
Related merge proposals:
  https://code.launchpad.net/~ted/indicator-applet/set-environment/+merge/54425
  proposed by: Ted Gould (ted)
  review: Approve - Conor Curran (cjcurran)
------------------------------------------------------------
revno: 383 [merge]
committer: Ted Gould <ted@xxxxxxxx>
branch nick: trunk
timestamp: Wed 2011-03-23 10:46:10 -0500
message:
  Set the environment for the applet
modified:
  src/applet-main.c


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

Your team ayatana-commits is subscribed to branch lp:indicator-applet.
To unsubscribe from this branch go to https://code.launchpad.net/~indicator-applet-developers/indicator-applet/applet/+edit-subscription
=== modified file 'src/applet-main.c'
--- src/applet-main.c	2011-02-17 20:51:09 +0000
+++ src/applet-main.c	2011-03-22 20:35:19 +0000
@@ -119,6 +119,28 @@
 gchar * hotkey_keycode = "<Super>F1";
 #endif
 
+/********************
+ * Environment Names
+ * *******************/
+#ifdef INDICATOR_APPLET
+#define INDICATOR_SPECIFIC_ENV  "indicator-applet-original"
+#endif
+#ifdef INDICATOR_APPLET_SESSION
+#define INDICATOR_SPECIFIC_ENV  "indicator-applet-session"
+#endif
+#ifdef INDICATOR_APPLET_COMPLETE
+#define INDICATOR_SPECIFIC_ENV  "indicator-applet-complete"
+#endif
+#ifdef INDICATOR_APPLET_APPMENU
+#define INDICATOR_SPECIFIC_ENV  "indicator-applet-appmenu"
+#endif
+
+static const gchar * indicator_env[] = {
+	"indicator-applet",
+	INDICATOR_SPECIFIC_ENV,
+	NULL
+};
+
 /*************
  * init function
  * ***********/
@@ -496,6 +518,9 @@
 	IndicatorObject * io = indicator_object_new_from_file(fullpath);
 	g_free(fullpath);
 
+	/* Set the environment it's in */
+	indicator_object_set_environment(io, (const GStrv)indicator_env);
+
 	/* Attach the 'name' to the object */
 	g_object_set_data(G_OBJECT(io), IO_DATA_ORDER_NUMBER, GINT_TO_POINTER(name2order(name)));