added slog enable checkbox
authorJean-Philippe Orsini <jeanfi@gmail.com>
Sat, 25 Aug 2012 10:27:34 +0000 (10:27 +0000)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Sat, 25 Aug 2012 10:27:34 +0000 (10:27 +0000)
configure
po/Makefile.in
src/cfg.c
src/cfg.h
src/glade/psensor-pref.glade
src/ui_pref.c

index f4201f5..a61f997 100755 (executable)
--- a/configure
+++ b/configure
@@ -4670,13 +4670,12 @@ fi
 done
 
 
-for ac_header in arpa/inet.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h sys/time.h unistd.h getopt.h
+for ac_header in stdbool.h
 do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  ac_fn_c_check_header_mongrel "$LINENO" "stdbool.h" "ac_cv_header_stdbool_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdbool_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_STDBOOL_H 1
 _ACEOF
 
 fi
index 70e0621..e5e2145 100644 (file)
@@ -21,7 +21,7 @@ srcdir = .
 top_srcdir = ..
 
 
-prefix = /usr/local
+prefix = /tmp
 exec_prefix = ${prefix}
 datarootdir = ${prefix}/share
 datadir = ${datarootdir}
index f0e53aa..5a6f8e8 100644 (file)
--- a/src/cfg.c
+++ b/src/cfg.c
@@ -91,6 +91,8 @@ static const char *KEY_INTERFACE_WINDOW_DIVIDER_POS
 static const char *KEY_INTERFACE_TEMPERATURE_UNIT
 = "/apps/psensor/interface/temperature_unit";
 
+static const char *KEY_SLOG_ENABLED = "/apps/psensor/slog/enabled";
+
 static GConfClient *client;
 
 static char *get_string(const char *key, const char *default_value)
@@ -385,6 +387,15 @@ void config_set_appindicator_enabled(const char *sid, bool enabled)
        free(key);
 }
 
+static bool is_slog_enabled()
+{
+       return gconf_client_get_bool(client, KEY_SLOG_ENABLED, NULL);
+}
+
+static void set_slog_enabled(bool enabled)
+{
+       gconf_client_set_bool(client, KEY_SLOG_ENABLED, enabled, NULL);
+}
 
 static bool is_window_decoration_enabled()
 {
@@ -446,6 +457,7 @@ struct config *config_load()
        c->sensorlist_position = get_sensorlist_position();
        c->window_decoration_enabled = is_window_decoration_enabled();
        c->window_keep_below_enabled = is_window_keep_below_enabled();
+       c->slog_enabled = is_slog_enabled();
 
        c->sensor_update_interval
            = gconf_client_get_int(client, KEY_SENSOR_UPDATE_INTERVAL, NULL);
@@ -526,6 +538,7 @@ void config_save(const struct config *c)
        set_sensorlist_position(c->sensorlist_position);
        set_window_decoration_enabled(c->window_decoration_enabled);
        set_window_keep_below_enabled(c->window_keep_below_enabled);
+       set_slog_enabled(c->slog_enabled);
 
        gconf_client_set_int(client,
                             KEY_GRAPH_UPDATE_INTERVAL,
index 4319db9..97fe357 100644 (file)
--- a/src/cfg.h
+++ b/src/cfg.h
@@ -72,6 +72,8 @@ struct config {
        int hide_on_startup;
 
        enum temperature_unit temperature_unit;
+
+       bool slog_enabled;
 };
 
 /*
index e7dcf9f..de298d8 100644 (file)
                     <property name="height">1</property>
                   </packing>
                 </child>
+                <child>
+                  <object class="GtkCheckButton" id="enable_slog">
+                    <property name="label" translatable="yes">Enable log of measures</property>
+                    <property name="use_action_appearance">False</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="margin_left">4</property>
+                    <property name="margin_right">4</property>
+                    <property name="margin_top">4</property>
+                    <property name="margin_bottom">4</property>
+                    <property name="use_action_appearance">False</property>
+                    <property name="xalign">0</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">1</property>
+                    <property name="width">3</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
               </object>
               <packing>
                 <property name="position">2</property>
                 <property name="tab_fill">False</property>
               </packing>
             </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <placeholder/>
+            </child>
           </object>
           <packing>
             <property name="expand">False</property>
index bbca2a8..8748365 100644 (file)
@@ -52,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_win_restore, *w_slog_enabled;
        GtkComboBoxText *w_temp_unit;
 
        cfg = ui->config;
@@ -126,6 +126,10 @@ void ui_pref_dialog_run(struct ui_psensor *ui)
        gtk_toggle_button_set_active(w_enable_launcher_counter,
                                     !cfg->unity_launcher_count_disabled);
 
+       w_slog_enabled = GTK_TOGGLE_BUTTON
+               (gtk_builder_get_object(builder, "enable_slog"));
+       gtk_toggle_button_set_active(w_slog_enabled, cfg->slog_enabled);
+
        w_hide_on_startup
                = GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder,
                                                           "hide_on_startup"));
@@ -209,6 +213,9 @@ void ui_pref_dialog_run(struct ui_psensor *ui)
                cfg->window_restore_enabled
                        = gtk_toggle_button_get_active(w_win_restore);
 
+               cfg->slog_enabled
+                       = gtk_toggle_button_get_active(w_slog_enabled);
+
                cfg->temperature_unit
                        = gtk_combo_box_get_active(GTK_COMBO_BOX(w_temp_unit));