static void
init_app_indicator (DrWright *dr)
{
    GtkWidget *indicator_menu;

    dr->indicator =
        app_indicator_new_with_path ("typing-break-indicator",
                                     TYPING_MONITOR_ACTIVE_ICON,
                                     APP_INDICATOR_CATEGORY_APPLICATION_STATUS,
                                     IMAGEDIR);
    if (dr->enabled) {
        app_indicator_set_status (dr->indicator,
                                  APP_INDICATOR_STATUS_ACTIVE);
    } else {
        app_indicator_set_status (dr->indicator,
                                  APP_INDICATOR_STATUS_PASSIVE);
    }

    indicator_menu = gtk_ui_manager_get_widget (dr->ui_manager, "/Pop");
    app_indicator_set_menu (dr->indicator, GTK_MENU (indicator_menu));
    app_indicator_set_attention_icon (dr->indicator, TYPING_MONITOR_ATTENTION_ICON);

    update_status (dr);
    update_app_indicator (dr);
}
Beispiel #2
0
gboolean tray_appindicator_create(gpointer data)
{
  if (is_exist_tray_appindicator())
    return FALSE;

  if (tray_appindicator) {
    if (app_indicator_get_status (tray_appindicator) != APP_INDICATOR_STATUS_ACTIVE) {
      app_indicator_set_status (tray_appindicator, APP_INDICATOR_STATUS_ACTIVE);
      destroy_other_tray();
    }
  } else {
    destroy_other_tray();

    if (!tray_appindicator_load_icon(HIME_TRAY_PNG, HIME_TRAY_PNG, iconame, icondir))
      return FALSE;

    tray_appindicator = app_indicator_new_with_path ("hime", iconame, APP_INDICATOR_CATEGORY_APPLICATION_STATUS, icondir);
    if(tray_appindicator == NULL)
      return TRUE;

    app_indicator_set_status (tray_appindicator, APP_INDICATOR_STATUS_ACTIVE);
    GtkWidget *menu = NULL;
    menu = create_tray_menu(mitems);
    app_indicator_set_secondary_activate_target(tray_appindicator, mitems[0].item);
    app_indicator_set_menu (tray_appindicator, GTK_MENU (menu));
  }

  load_tray_appindicator();
  return FALSE;
}
static gboolean
indicator_load(PurplePlugin *plugin) {
  indicator_docklet_init(plugin, &ui_ops);

  AppIndicator *indicator =
    app_indicator_new_with_path("pidgin", PIDGIN_STOCK_TRAY_AVAILABLE,
                                APP_INDICATOR_CATEGORY_APPLICATION_STATUS,
                                DATADIR G_DIR_SEPARATOR_S "pixmaps" G_DIR_SEPARATOR_S "pidgin" G_DIR_SEPARATOR_S "tray");

  sIndicator = indicator;

  app_indicator_set_status(indicator, APP_INDICATOR_STATUS_ACTIVE);
  indicator_update_icon(purple_savedstatus_get_type(purple_savedstatus_get_current()),
                        FALSE, FALSE);

  void *plugins_handle = purple_plugins_get_handle();
  purple_signal_connect(plugins_handle, "plugin-load", plugin->handle,
                        PURPLE_CALLBACK(indicator_build_menu), indicator);
  purple_signal_connect(plugins_handle, "plugin-unload", plugin->handle,
                        PURPLE_CALLBACK(indicator_build_menu), indicator);
  indicator_build_menu(NULL, indicator);

  plugin->extra = indicator;

  pidgin_blist_visibility_manager_add();

  return TRUE;
}
Beispiel #4
0
	Main_window::Gui::Gui(void)
	:
		has_been_showed(false),
		iconified(false),
		use_appindicator(false)
	{
		#if HAVE_APP_INDICATOR
			this->appindicator = app_indicator_new_with_path(APP_UNIX_NAME, APP_UNIX_NAME,
				APP_INDICATOR_CATEGORY_APPLICATION_STATUS, APP_CUSTOM_ICONS_PATH);
		#endif
	}
Beispiel #5
0
void startup(GApplication *app,
             gpointer user_data)
{
  GtkMenu *tray_menu;
  GtkWindow *window;
  gchar *theme_path;
  
  /* set ui */
  builder = gtk_builder_new();
  gtk_builder_add_from_resource(builder, "/ui/calendar.glade", NULL);
  gtk_builder_connect_signals(builder, NULL);
  
  window = GTK_WINDOW(gtk_builder_get_object(builder, "window"));
  tray_menu = GTK_MENU(gtk_builder_get_object(builder, "tray_menu"));
  
  /* set gtkapplication window */
  gtk_application_add_window(GTK_APPLICATION(app), window);
  
  /* initialize our time */
  time_gen();
  mytime = today;
  
  /* prepare appindicator */
  theme_path = g_build_filename(DATADIR, "icons", "hicolor", "256x256", NULL);
  indicator = app_indicator_new_with_path("Acal", "persian-calendar-1",
                                APP_INDICATOR_CATEGORY_APPLICATION_STATUS,
				theme_path);
  app_indicator_set_status(indicator, APP_INDICATOR_STATUS_ACTIVE);
  app_indicator_set_menu(indicator, tray_menu);
  
  /* show initial tray & prepare cal */
  update_tray();
  cal_gen();
  
  /* add timer to update tray */
  g_timeout_add_seconds(3, check_update_tray, (gpointer)indicator);
}