added 'launch on session startup' setting
authorJean-Philippe Orsini <jeanfi@gmail.com>
Fri, 25 Apr 2014 08:21:17 +0000 (10:21 +0200)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Fri, 25 Apr 2014 08:21:17 +0000 (10:21 +0200)
NEWS
src/ui_pref.c

diff --git a/NEWS b/NEWS
index c410154..f8fc42c 100644 (file)
--- 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
 --------
index aae6556..4dd4bf8 100644 (file)
@@ -23,6 +23,7 @@
 #include "cfg.h"
 #include "ui_pref.h"
 #include "ui_color.h"
+#include <pxdg.h>
 
 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);