~robert-ancell/unity-greeter/trunk

« back to all changes in this revision

Viewing changes to src/user-list.vala

  • Committer: Robert Ancell
  • Date: 2011-08-08 10:21:25 UTC
  • mfrom: (71.3.1 unity-greeter.up)
  • Revision ID: robert.ancell@canonical.com-20110808102125-ts5r310w3vidirai
merge indicator setup branch:

Show diffs side-by-side

added added

removed removed

Lines of Context:
147
147
 
148
148
        options_menu = new Gtk.Menu ();
149
149
 
 
150
        setup_indicators ();
 
151
    }
 
152
 
 
153
    async void setup_indicators ()
 
154
    {
 
155
        /* Set env var that will tell indicators to reduce functionality *.
 
156
        GLib.Environment.set_variable ("INDICATOR_GREETER_MODE", "1", true);
 
157
 
 
158
        /* And also set it in the DBus activation environment so that any
 
159
         * indicator services pick it up. */
 
160
        try
 
161
        {
 
162
            var proxy = new GLib.DBusProxy.for_bus_sync (GLib.BusType.SESSION,
 
163
                                                         GLib.DBusProxyFlags.NONE, null, 
 
164
                                                         "org.freedesktop.DBus",
 
165
                                                         "/org/freedesktop/DBus",
 
166
                                                         "org.freedesktop.DBus",
 
167
                                                         null);
 
168
 
 
169
            var builder = new GLib.VariantBuilder (GLib.VariantType.ARRAY);
 
170
            builder.add ("{ss}", "INDICATOR_GREETER_MODE", "1");
 
171
 
 
172
            yield proxy.call ("UpdateActivationEnvironment",
 
173
                              new GLib.Variant ("(a{ss})", builder),
 
174
                              GLib.DBusCallFlags.NONE, -1, null);
 
175
        }
 
176
        catch (Error e)
 
177
        {
 
178
            warning ("Could not get set environment for indicators: %s", e.message);
 
179
            return;
 
180
        }
 
181
 
150
182
        load_indicator ("/usr/lib/indicators3/6/libsession.so");
151
183
        load_indicator ("/usr/lib/indicators3/6/libdatetime.so");
152
184
        load_indicator ("/usr/lib/indicators3/6/libpower.so");