From 829e06d4a516b4fe0ae21c6b23b2ff088ca8cb68 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Orsini Date: Fri, 25 Apr 2014 10:21:17 +0200 Subject: [PATCH] added 'launch on session startup' setting --- NEWS | 5 ++++- src/ui_pref.c | 9 ++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index c410154..f8fc42c 100644 --- a/NEWS +++ b/NEWS @@ -5,9 +5,12 @@ v0.8.0.7 -------- * smaller and more consistent with ubuntu themes appindicator icons. -* sensors displayed directly in the top bar. +* sensors displayed directly in the top bar (experimental). * improved status icon in hicolor theme to fit well with white background. (LP: #1310323). +* psensor not autostarted by default. +* added a setting to launch psensor on session startup. (Closes: + #728754). v0.8.0.6 -------- diff --git a/src/ui_pref.c b/src/ui_pref.c index aae6556..4dd4bf8 100644 --- a/src/ui_pref.c +++ b/src/ui_pref.c @@ -23,6 +23,7 @@ #include "cfg.h" #include "ui_pref.h" #include "ui_color.h" +#include GdkColor *color_to_gdkcolor(struct color *color) { @@ -51,7 +52,7 @@ void ui_pref_dialog_run(struct ui_psensor *ui) GtkComboBox *w_sensorlist_pos; GtkToggleButton *w_hide_window_decoration, *w_keep_window_below, *w_enable_menu, *w_enable_launcher_counter, *w_hide_on_startup, - *w_win_restore, *w_slog_enabled; + *w_win_restore, *w_slog_enabled, *w_autostart; GtkComboBoxText *w_temp_unit; GtkEntry *w_notif_script; char *notif_script; @@ -126,6 +127,10 @@ void ui_pref_dialog_run(struct ui_psensor *ui) gtk_toggle_button_set_active(w_keep_window_below, cfg->window_keep_below_enabled); + w_autostart = GTK_TOGGLE_BUTTON + (gtk_builder_get_object(builder, "autostart")); + gtk_toggle_button_set_active(w_autostart, pxdg_is_autostarted()); + w_enable_menu = GTK_TOGGLE_BUTTON (gtk_builder_get_object(builder, "enable_menu")); gtk_toggle_button_set_active(w_enable_menu, !cfg->menu_bar_disabled); @@ -240,6 +245,8 @@ void ui_pref_dialog_run(struct ui_psensor *ui) config_save(cfg); + pxdg_set_autostart(gtk_toggle_button_get_active(w_autostart)); + pthread_mutex_unlock(&ui->sensors_mutex); ui_window_update(ui); -- 2.7.4