static struct psensor **sensors;
static GtkMenuItem **menu_items;
-static int appindicator_supported = 1;
+static bool appindicator_supported = true;
static AppIndicator *indicator;
static struct ui_psensor *ui_psensor;
void ui_appindicator_cb_preferences(GtkMenuItem *mi, gpointer data)
{
-#ifdef HAVE_APPINDICATOR_029
- gdk_threads_enter();
-#endif
-
ui_pref_dialog_run((struct ui_psensor *)data);
-
-#ifdef HAVE_APPINDICATOR_029
- gdk_threads_leave();
-#endif
}
void ui_appindicator_cb_sensor_preferences(GtkMenuItem *mi, gpointer data)
{
struct ui_psensor *ui = data;
-#ifdef HAVE_APPINDICATOR_029
- gdk_threads_enter();
-#endif
-
if (ui->sensors && *ui->sensors)
ui_sensorpref_dialog_run(*ui->sensors, ui);
-
-#ifdef HAVE_APPINDICATOR_029
- gdk_threads_leave();
-#endif
}
static void
GtkMenuItem **m;
if (!sensors)
- return ;
+ return;
for (s = sensors, m = menu_items; *s; s++, m++)
update_menu_item(*m, *s, use_celsius);
if (is_temp_type((*p)->type))
str = "999UUU";
- else if (is_fan_type((*p)->type))
+ else if ((*p)->type & SENSOR_TYPE_RPM)
str = "999UUU";
- else /* cpu load */
+ else /* percent */
str = "999%";
if (guide == NULL) {
log_debug("ui_appindicator.unity_fallback()");
- appindicator_supported = 0;
+ appindicator_supported = false;
ico = ui_status_get_icon(ui_psensor);
ui_status_set_visible(0);
- appindicator_supported = 1;
+ appindicator_supported = true;
}
void ui_appindicator_update_menu(struct ui_psensor *ui)
ui_appindicator_update_menu(ui);
}
-int is_appindicator_supported()
+bool is_appindicator_supported(void)
{
return appindicator_supported;
}
-void ui_appindicator_cleanup()
+void ui_appindicator_cleanup(void)
{
free(sensors);
}