~audio-recorder/audio-recorder/trunk

« back to all changes in this revision

Viewing changes to src/systray-icon.c

  • Committer: Osmo Antero
  • Date: 2011-09-18 09:13:24 UTC
  • Revision ID: osmoma@gmail.com-20110918091324-wosqw4bzzhhyqz6m
VersionĀ 0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
276
276
    // Save this item
277
277
    g_object_set_data(G_OBJECT(menu), "menu-item-pause-recording", menu_item);
278
278
 
279
 
 
280
279
    // Notice:
281
 
    // The "About" dialog does not work right if it's fired from the AppIndicator menu.
 
280
    // The "About" dialog does not work right if it's fired from the AppIndicator (tray icon) menu.
282
281
    // Dialog buttons freeze the entire app.
 
282
 
283
283
    gboolean show_about_item = TRUE;
284
284
 
285
 
    /*
286
 
    // Check if the "indicator-applet" process is running?
287
 
    if (for_tray_icon) {
288
 
        GPid pid = get_PID("indicator-applet");
289
 
        show_about_item = (pid < 1);
 
285
#ifdef HAS_APP_INDICATOR
 
286
    // Do not show "About" item if AppIndicator library installed
 
287
    show_about_item = FALSE;
 
288
#endif
 
289
 
 
290
    if (!for_tray_icon) {
 
291
        // Right-click menu on [Start/Stop/Pause recording] button
 
292
 
 
293
        // Show About item
 
294
        show_about_item = TRUE;
290
295
    }
291
 
    */
292
296
 
293
297
    if (show_about_item) {
294
 
        // Menu item for "About" dialog
295
 
 
296
298
        // Separator line
297
299
        menu_item = gtk_separator_menu_item_new();
298
300
        gtk_widget_show(menu_item);
348
350
    }
349
351
 
350
352
    g_tray_icon = (GtkWidget*)app_indicator_new("audio-recorder application",
351
 
                  "audio-recorder-off",
352
 
                  APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
 
353
                  "audio-recorder-off", APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
353
354
 
354
355
    g_assert(IS_APP_INDICATOR(g_tray_icon));
355
356
 
426
427
 
427
428
    LOG_SYSTRAY("systray_set_icon. icon name:%s\n", icon_name);
428
429
 
429
 
    // Add pixmap path
 
430
    // Add pixmap path to icon_name.png
430
431
    gchar *filename = get_image_path(icon_name);
431
432
 
432
433
    // Set icon