[gnome-system-monitor: 1/4] Only resume proctable refreshes if started



commit af5ff4d544a42845d0026d0230fff3163ea9ebe1
Author: Robert Roth <robert roth off gmail com>
Date:   Thu Feb 6 00:50:52 2014 +0200

    Only resume proctable refreshes if started

 src/application.cpp |    9 ++++++---
 src/interface.cpp   |    1 +
 src/proctable.cpp   |   17 +++++++++--------
 3 files changed, 16 insertions(+), 11 deletions(-)
---
diff --git a/src/application.cpp b/src/application.cpp
index eb52bbc..02d8e23 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -25,7 +25,9 @@ cb_solaris_mode_changed (GSettings *settings, const gchar *key, gpointer data)
 
     app->config.solaris_mode = g_settings_get_boolean(settings, key);
     app->cpu_graph->clear_background();
-    proctable_update (app);
+    if (app->timeout) {
+        proctable_update (app);
+    }
 }
 
 static void
@@ -57,8 +59,9 @@ cb_timeouts_changed (GSettings *settings, const gchar *key, gpointer data)
         app->config.update_interval = g_settings_get_int (settings, key);
 
         app->smooth_refresh->reset();
-
-        proctable_reset_timeout (app);
+        if (app->timeout) {
+            proctable_reset_timeout (app);
+        }
     } else if (strcmp (key, GSM_SETTING_GRAPH_UPDATE_INTERVAL) == 0) {
         app->config.graph_update_interval = g_settings_get_int (settings, key);
         load_graph_change_speed(app->cpu_graph,
diff --git a/src/interface.cpp b/src/interface.cpp
index a383bb5..f47b030 100644
--- a/src/interface.cpp
+++ b/src/interface.cpp
@@ -511,6 +511,7 @@ update_page_activities (GsmApplication *app)
     if (strcmp (current_page, "processes") == 0) {
         GAction *search_action = g_action_map_lookup_action (G_ACTION_MAP (app->main_window),
                                                              "search");
+        proctable_update (app);
         proctable_thaw (app);
 
         gtk_widget_show (app->end_process_button);
diff --git a/src/proctable.cpp b/src/proctable.cpp
index c5892fb..7f97cd3 100644
--- a/src/proctable.cpp
+++ b/src/proctable.cpp
@@ -289,21 +289,23 @@ static void
 cb_show_dependencies_changed (GSettings *settings, const gchar *key, gpointer data)
 {
     GsmApplication *app = (GsmApplication *) data;
-
-    gtk_tree_view_set_show_expanders (GTK_TREE_VIEW (app->tree),
+    if (app->timeout) {
+        gtk_tree_view_set_show_expanders (GTK_TREE_VIEW (app->tree),
                                       g_settings_get_boolean (settings, GSM_SETTING_SHOW_DEPENDENCIES));
 
-    proctable_clear_tree (app);
-    proctable_update (app);
+        proctable_clear_tree (app);
+        proctable_update (app);
+    }
 }
 
 static void
 cb_show_whose_processes_changed (GSettings *settings, const gchar *key, gpointer data)
 {
     GsmApplication *app = (GsmApplication *) data;
-
-    proctable_clear_tree (app);
-    proctable_update (app);
+    if (app->timeout) {
+        proctable_clear_tree (app);
+        proctable_update (app);
+    }
 }
 
 GtkWidget *
@@ -1101,7 +1103,6 @@ proctable_update (GsmApplication *app)
     glibtop_cpu cpu;
     int which = 0;
     int arg = 0;
-
     char *whose_processes = g_settings_get_string (app->settings, GSM_SETTING_SHOW_WHOSE_PROCESSES);
     if (strcmp (whose_processes, "all") == 0) {
         which = GLIBTOP_KERN_PROC_ALL;


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