~ubuntu-branches/ubuntu/maverick/indicator-applet/maverick

« back to all changes in this revision

Viewing changes to src/applet-main.c

  • Committer: Bazaar Package Importer
  • Author(s): Ted Gould
  • Date: 2010-01-08 08:53:18 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: james.westby@ubuntu.com-20100108085318-sloka5g4ai091fks
Tags: upstream-0.3.1
ImportĀ upstreamĀ versionĀ 0.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 * main
41
41
 * ***********/
42
42
 
 
43
#ifdef INDICATOR_APPLET
43
44
PANEL_APPLET_BONOBO_FACTORY ("OAFIID:GNOME_IndicatorApplet_Factory",
44
45
               PANEL_TYPE_APPLET,
45
46
               "indicator-applet", "0",
46
47
               applet_fill_cb, NULL);
 
48
#endif
 
49
#ifdef INDICATOR_APPLET_SESSION
 
50
PANEL_APPLET_BONOBO_FACTORY ("OAFIID:GNOME_FastUserSwitchApplet_Factory",
 
51
               PANEL_TYPE_APPLET,
 
52
               "indicator-applet-session", "0",
 
53
               applet_fill_cb, NULL);
 
54
#endif
 
55
#ifdef INDICATOR_APPLET_COMPLETE
 
56
PANEL_APPLET_BONOBO_FACTORY ("OAFIID:GNOME_IndicatorAppletComplete_Factory",
 
57
               PANEL_TYPE_APPLET,
 
58
               "indicator-applet-complete", "0",
 
59
               applet_fill_cb, NULL);
 
60
#endif
47
61
 
48
62
/*************
49
63
 * init function
188
202
        gtk_show_about_dialog(NULL,
189
203
                "version", VERSION,
190
204
                "copyright", "Copyright \xc2\xa9 2009 Canonical, Ltd.",
 
205
#ifdef INDICATOR_APPLET_SESSION
 
206
                "comments", _("A place to adjust your status, change users or exit your session."),
 
207
#else
191
208
                "comments", _("An applet to hold all of the system indicators."),
 
209
#endif
192
210
                "authors", authors,
193
211
                "license", license_i18n,
194
212
                "wrap-license", TRUE,
227
245
        gint indicators_loaded = 0;
228
246
        static gboolean first_time = FALSE;
229
247
 
 
248
#ifdef INDICATOR_APPLET_SESSION
 
249
        /* check if we are running stracciatella session */
 
250
        if (g_strcmp0(g_getenv("GDMSESSION"), "gnome-stracciatella") == 0) {
 
251
                g_debug("Running stracciatella GNOME session, disabling myself");
 
252
                return TRUE;
 
253
        }
 
254
#endif
 
255
 
230
256
        if (!first_time)
231
257
        {
232
258
                first_time = TRUE;
 
259
#ifdef INDICATOR_APPLET
233
260
                g_set_application_name(_("Indicator Applet"));
 
261
#endif
 
262
#ifdef INDICATOR_APPLET_SESSION
 
263
                g_set_application_name(_("Indicator Applet Session"));
 
264
#endif
 
265
#ifdef INDICATOR_APPLET_COMPLETE
 
266
                g_set_application_name(_("Indicator Applet Complete"));
 
267
#endif
234
268
        }
235
269
 
236
270
        /* Set panel options */
237
271
        gtk_container_set_border_width(GTK_CONTAINER (applet), 0);
238
272
        panel_applet_set_flags(applet, PANEL_APPLET_EXPAND_MINOR);
239
273
        panel_applet_setup_menu(applet, menu_xml, menu_verbs, NULL);
240
 
    atk_object_set_name (gtk_widget_get_accessible (GTK_WIDGET (applet)),
241
 
                         "indicator-applet");
 
274
#ifdef INDICATOR_APPLET
 
275
        atk_object_set_name (gtk_widget_get_accessible (GTK_WIDGET (applet)),
 
276
                             "indicator-applet");
 
277
#endif
 
278
#ifdef INDICATOR_APPLET_SESSION
 
279
        atk_object_set_name (gtk_widget_get_accessible (GTK_WIDGET (applet)),
 
280
                             "indicator-applet-session");
 
281
#endif
 
282
#ifdef INDICATOR_APPLET_COMPLETE
 
283
        atk_object_set_name (gtk_widget_get_accessible (GTK_WIDGET (applet)),
 
284
                             "indicator-applet-complete");
 
285
#endif
242
286
  
243
287
        /* Init some theme/icon stuff */
244
288
        gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(),
286
330
 
287
331
                const gchar * name;
288
332
                while ((name = g_dir_read_name(dir)) != NULL) {
 
333
#ifdef INDICATOR_APPLET
289
334
                        if (!g_strcmp0(name, "libsession.so")) {
290
335
                                continue;
291
336
                        }
 
337
                        if (!g_strcmp0(name, "libme.so")) {
 
338
                                continue;
 
339
                        }
 
340
#endif
 
341
#ifdef INDICATOR_APPLET_SESSION
 
342
                        if (g_strcmp0(name, "libsession.so") && g_strcmp0(name, "libme.so")) {
 
343
                                continue;
 
344
                        }
 
345
#endif
292
346
                        if (load_module(name, menubar)) {
293
347
                                indicators_loaded++;
294
348
                        }