[gnome-system-monitor] Fixed load-graph update interval (fixes #77)



commit 845c65fc6a896ebd9102ef3c24e90b74e4ec5601
Author: Robert Roth <robert roth off gmail com>
Date:   Mon Jan 11 12:25:54 2021 +0200

    Fixed load-graph update interval (fixes #77)

 src/load-graph.cpp                                |  4 ++--
 src/org.gnome.gnome-system-monitor.gschema.xml.in |  4 ++--
 src/prefsdialog.cpp                               | 10 +++++-----
 3 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/src/load-graph.cpp b/src/load-graph.cpp
index 6b7d5382..955ab27d 100644
--- a/src/load-graph.cpp
+++ b/src/load-graph.cpp
@@ -975,7 +975,7 @@ load_graph_start (LoadGraph *graph)
         load_graph_update_data(graph);
         load_graph_update(graph);
 
-        graph->timer_index = g_timeout_add (graph->speed / graph->frames_per_unit,
+        graph->timer_index = g_timeout_add (graph->speed,
                                             load_graph_update,
                                             graph);
     }
@@ -1001,7 +1001,7 @@ load_graph_change_speed (LoadGraph *graph,
 
     if (graph->timer_index) {
         g_source_remove (graph->timer_index);
-        graph->timer_index = g_timeout_add (graph->speed / graph->frames_per_unit,
+        graph->timer_index = g_timeout_add (graph->speed,
                                             load_graph_update,
                                             graph);
     }
diff --git a/src/org.gnome.gnome-system-monitor.gschema.xml.in 
b/src/org.gnome.gnome-system-monitor.gschema.xml.in
index 1630026a..0bc26fc7 100644
--- a/src/org.gnome.gnome-system-monitor.gschema.xml.in
+++ b/src/org.gnome.gnome-system-monitor.gschema.xml.in
@@ -56,8 +56,8 @@
     </key>
 
     <key name="graph-update-interval" type="i">
-      <range min="250" max="100000"/>
-      <default>1000</default>
+      <range min="50" max="10000"/>
+      <default>100</default>
       <summary>Time in milliseconds between updates of the graphs</summary>
     </key>
 
diff --git a/src/prefsdialog.cpp b/src/prefsdialog.cpp
index 95cf86fb..d43f7d68 100644
--- a/src/prefsdialog.cpp
+++ b/src/prefsdialog.cpp
@@ -299,8 +299,8 @@ create_preferences_dialog (GsmApplication *app)
     update = (gfloat) app->config.graph_update_interval;
     spin_button = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "resources_interval_spinner"));          
                                       
     adjustment = gtk_spin_button_get_adjustment (spin_button);
-    gtk_adjustment_configure (adjustment, update / 1000.0, 0.25,
-                              100.0, 0.25, 1.0, 0);
+    gtk_adjustment_configure (adjustment, update / 1000.0, 0.05,
+                              10.0, 0.05, 0.5, 0);
     g_signal_connect (G_OBJECT (spin_button), "focus_out_event",
                       G_CALLBACK(SBU::callback),
                       &graph_interval_updater);
@@ -309,10 +309,10 @@ create_preferences_dialog (GsmApplication *app)
     GtkRange* range = GTK_RANGE (gtk_builder_get_object (builder, "graph_data_points_scale"));
     adjustment = gtk_range_get_adjustment (range);
     gtk_adjustment_configure (adjustment, update, 30,
-                                 600, 10, 50, 0);
+                              600, 10, 60, 0);
     g_signal_connect (G_OBJECT (range), "value-changed",
-                         G_CALLBACK(ScaleUpdater::callback),
-                                         &graph_points_updater);
+                      G_CALLBACK(ScaleUpdater::callback),
+                      &graph_points_updater);
 
     GtkCheckButton *bits_button = GTK_CHECK_BUTTON (gtk_builder_get_object (builder, "bits_button"));
     g_settings_bind(app->settings->gobj (), GSM_SETTING_NETWORK_IN_BITS,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]