#include "ui_sensorlist.h"
#include "ui_color.h"
#include "lmsensor.h"
+#include "slog.h"
#include "ui_pref.h"
#include "ui_graph.h"
#include "ui_status.h"
}
/*
- Updates the size of the sensor values if different than the
- configuration.
+ * Updates the size of the sensor values if different than the
+ * configuration.
*/
-void
+static void
update_psensor_values_size(struct psensor **sensors, struct config *cfg)
{
- struct psensor **cur;
+ struct psensor **cur, *s;
- cur = sensors;
- while (*cur) {
- struct psensor *s = *cur;
+ for (cur = sensors; *cur; cur++) {
+ s = *cur;
if (s->values_max_length != cfg->sensor_values_max_length)
psensor_values_resize(s,
cfg->sensor_values_max_length);
-
- cur++;
}
}
psensor_log_measures(sensors);
+ if (cfg->slog_enabled)
+ slog_write_sensors(sensors);
+
period = cfg->sensor_update_interval;
g_mutex_unlock(ui->sensors_mutex);
s->name = n;
}
+ s->appindicator_enabled = config_is_appindicator_enabled(s->id);
+
sensor_cur++;
}
}
exit(EXIT_SUCCESS);
case 'd':
log_level = atoi(optarg);
- log_printf(LOG_INFO, _("Enables debug mode."));
+ log_info(_("Enables debug mode."));
break;
case 'n':
new_instance = 1;
ui_appindicator_init(&ui);
#endif
- /*
- * show the window as soon as all gtk events have been processed
- * in order to ensure that the status icon is attempted to be
- * drawn before. If not, there is no way to detect that it is
- * visible.
- */
- g_idle_add((GSourceFunc)initial_window_show, &ui);
-
gdk_notify_startup_complete();
+ /*
+ * hack, did not find a cleaner solution.
+ * wait 2s to ensure that the status icon is attempted to be
+ * drawn before determining whether the main window must be
+ * show.
+ */
+ g_timeout_add(2000, (GSourceFunc)initial_window_show, &ui);
+
/* main loop */
gtk_main();