add support of smooth curves in the preferences.
authorJean-Philippe Orsini <jeanfi@gmail.com>
Sun, 14 Sep 2014 17:53:03 +0000 (19:53 +0200)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Sun, 14 Sep 2014 17:53:03 +0000 (19:53 +0200)
src/ui_pref.c

index 55e2bb2..72322f4 100644 (file)
@@ -54,7 +54,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_autostart;
+               *w_win_restore, *w_slog_enabled, *w_autostart, *w_smooth_curves;
        GtkComboBoxText *w_temp_unit;
        GtkEntry *w_notif_script;
        char *notif_script;
@@ -142,6 +142,11 @@ void ui_pref_dialog_run(struct ui_psensor *ui)
        gtk_toggle_button_set_active(w_enable_launcher_counter,
                                     !cfg->unity_launcher_count_disabled);
 
+       w_smooth_curves = GTK_TOGGLE_BUTTON
+               (gtk_builder_get_object(builder, "graph_smooth_curves"));
+       gtk_toggle_button_set_active(w_smooth_curves,
+                                    config_is_smooth_curves_enabled());
+
        w_slog_enabled = GTK_TOGGLE_BUTTON
                (gtk_builder_get_object(builder, "enable_slog"));
        gtk_toggle_button_set_active(w_slog_enabled, cfg->slog_enabled);
@@ -249,6 +254,9 @@ void ui_pref_dialog_run(struct ui_psensor *ui)
 
                config_save(cfg);
 
+               config_set_smooth_curves_enabled
+                       (gtk_toggle_button_get_active(w_smooth_curves));
+
                pxdg_set_autostart(gtk_toggle_button_get_active(w_autostart));
 
                pthread_mutex_unlock(&ui->sensors_mutex);