[gnome-system-monitor/wip-charts: 2/25] Cleanup of deprecated options and old cpu graph
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-system-monitor/wip-charts: 2/25] Cleanup of deprecated options and old cpu graph
- Date: Sat, 17 Mar 2018 13:17:50 +0000 (UTC)
commit 27b2dd51bcb11e28f93ea4c52cb0ef57e3115aef
Author: Robert Roth <robert roth off gmail com>
Date: Sun Feb 11 02:42:58 2018 +0200
Cleanup of deprecated options and old cpu graph
src/application.cpp | 36 +++------------------
src/interface.cpp | 22 ++++---------
src/org.gnome.gnome-system-monitor.gschema.xml.in | 16 ---------
3 files changed, 12 insertions(+), 62 deletions(-)
---
diff --git a/src/application.cpp b/src/application.cpp
index eb66e58..05af5ac 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -24,29 +24,13 @@ static void
cb_solaris_mode_changed (Gio::Settings& settings, Glib::ustring key, GsmApplication* app)
{
app->config.solaris_mode = settings.get_boolean(key);
- app->cpu_graph->clear_background();
+ // app->cpu_graph->clear_background();
if (app->timeout) {
proctable_update (app);
}
}
static void
-cb_draw_stacked_changed (Gio::Settings& settings, Glib::ustring key, GsmApplication* app)
-{
- app->config.draw_stacked = settings.get_boolean(key);
- app->cpu_graph->clear_background();
- load_graph_reset(app->cpu_graph);
-}
-
-static void
-cb_draw_smooth_changed (Gio::Settings& settings, Glib::ustring key, GsmApplication* app)
-{
- app->config.draw_smooth = settings.get_boolean(key);
- app->cpu_graph->clear_background();
- load_graph_reset(app->cpu_graph);
-}
-
-static void
cb_network_in_bits_changed (Gio::Settings& settings, Glib::ustring key, GsmApplication* app)
{
app->config.network_in_bits = settings.get_boolean(key);
@@ -123,10 +107,10 @@ cb_color_changed (Gio::Settings& settings, Glib::ustring key, GsmApplication* ap
if (key == GSM_SETTING_CPU_COLORS) {
apply_cpu_color_settings(settings, app);
for (int i = 0; i < app->config.num_cpus; i++) {
- if(!gdk_rgba_equal(&app->cpu_graph->colors[i], &app->config.cpu_color[i])) {
- app->cpu_graph->colors[i] = app->config.cpu_color[i];
- break;
- }
+// if(!gdk_rgba_equal(&app->cpu_graph->colors[i], &app->config.cpu_color[i])) {
+ //app->cpu_graph->colors[i] = app->config.cpu_color[i];
+// break;
+// }
}
return;
}
@@ -159,16 +143,6 @@ GsmApplication::load_settings()
cb_solaris_mode_changed (*this->settings.operator->(), key, this);
});
- config.draw_stacked = this->settings->get_boolean (GSM_SETTING_DRAW_STACKED);
- this->settings->signal_changed(GSM_SETTING_DRAW_STACKED).connect ([this](const Glib::ustring& key) {
- cb_draw_stacked_changed (*this->settings.operator->(), key, this);
- });
-
- config.draw_smooth = this->settings->get_boolean (GSM_SETTING_DRAW_SMOOTH);
- this->settings->signal_changed(GSM_SETTING_DRAW_SMOOTH).connect ([this](const Glib::ustring& key) {
- cb_draw_smooth_changed (*this->settings.operator->(), key, this);
- });
-
config.network_in_bits = this->settings->get_boolean (GSM_SETTING_NETWORK_IN_BITS);
this->settings->signal_changed (GSM_SETTING_NETWORK_IN_BITS).connect ([this](const Glib::ustring& key) {
cb_network_in_bits_changed (*this->settings.operator->(), key, this);
diff --git a/src/interface.cpp b/src/interface.cpp
index 47dae96..51d4e93 100644
--- a/src/interface.cpp
+++ b/src/interface.cpp
@@ -192,16 +192,16 @@ static void
create_sys_view (GsmApplication *app, GtkBuilder * builder)
{
GtkBox *cpu_graph_box, *mem_graph_box, *net_graph_box;
- GtkLabel *label,*cpu_label;
+ GtkLabel *label, *cpu_label;
GtkGrid *table;
GsmColorButton *color_picker;
GtkCssProvider *provider;
LoadGraph *mem_graph, *net_graph;
- LoadGraph *cpu_graph;
+ //LoadGraph *cpu_graph;
GtkWidget *dzl_graph;
- gint i;
+ int i;
gchar *title_text;
gchar *label_text;
gchar *title_template;
@@ -216,9 +216,8 @@ create_sys_view (GsmApplication *app, GtkBuilder * builder)
cpu_graph_box = GTK_BOX (gtk_builder_get_object (builder, "cpu_graph_box"));
- cpu_graph = new LoadGraph(LOAD_GRAPH_CPU);
- dzl_graph = GTK_WIDGET(g_object_new (DZL_TYPE_CPU_GRAPH, "timespan", G_TIME_SPAN_MINUTE,
- "max-samples", 120, NULL));
+ dzl_graph = GTK_WIDGET(g_object_new (DZL_TYPE_CPU_GRAPH, "timespan", G_TIME_SPAN_MINUTE,
+ "max-samples", 60, NULL));
gtk_widget_set_size_request (GTK_WIDGET(dzl_graph), -1, 70);
gtk_widget_show (dzl_graph);
gtk_box_pack_start (cpu_graph_box,
@@ -241,7 +240,7 @@ create_sys_view (GsmApplication *app, GtkBuilder * builder)
gtk_grid_insert_row(cpu_table, (i+1)/cols);
}
gtk_grid_attach(cpu_table, GTK_WIDGET (temp_hbox), i%cols, i/cols, 1, 1);
- color_picker = gsm_color_button_new (&cpu_graph->colors.at(i), GSMCP_TYPE_CPU);
+ color_picker = gsm_color_button_new (&app->config.cpu_color[i], GSMCP_TYPE_CPU);
g_signal_connect (G_OBJECT (color_picker), "color-set",
G_CALLBACK (cb_cpu_color_changed), GINT_TO_POINTER (i));
gtk_box_pack_start (temp_hbox, GTK_WIDGET (color_picker), FALSE, TRUE, 0);
@@ -265,14 +264,11 @@ create_sys_view (GsmApplication *app, GtkBuilder * builder)
gtk_widget_set_halign (GTK_WIDGET (cpu_label), GTK_ALIGN_START);
gtk_box_pack_start (temp_hbox, GTK_WIDGET (cpu_label), FALSE, FALSE, 0);
gtk_widget_show (GTK_WIDGET (cpu_label));
- load_graph_get_labels(cpu_graph)->cpu[i] = cpu_label;
}
- app->cpu_graph = cpu_graph;
-
/** The memory box */
-
+
mem_graph_box = GTK_BOX (gtk_builder_get_object (builder, "mem_graph_box"));
mem_graph = new LoadGraph(LOAD_GRAPH_MEM);
@@ -595,11 +591,9 @@ update_page_activities (GsmApplication *app)
}
if (strcmp (current_page, "resources") == 0) {
- load_graph_start (app->cpu_graph);
load_graph_start (app->mem_graph);
load_graph_start (app->net_graph);
} else {
- load_graph_stop (app->cpu_graph);
load_graph_stop (app->mem_graph);
load_graph_stop (app->net_graph);
}
@@ -640,7 +634,6 @@ cb_main_window_state_changed (GtkWidget *window, GdkEventWindowState *event, gpo
if (current_page == "processes") {
proctable_freeze (app);
} else if (current_page == "resources") {
- load_graph_stop (app->cpu_graph);
load_graph_stop (app->mem_graph);
load_graph_stop (app->net_graph);
} else if (current_page == "disks") {
@@ -651,7 +644,6 @@ cb_main_window_state_changed (GtkWidget *window, GdkEventWindowState *event, gpo
proctable_update (app);
proctable_thaw (app);
} else if (current_page == "resources") {
- load_graph_start (app->cpu_graph);
load_graph_start (app->mem_graph);
load_graph_start (app->net_graph);
} else if (current_page == "disks") {
diff --git a/src/org.gnome.gnome-system-monitor.gschema.xml.in
b/src/org.gnome.gnome-system-monitor.gschema.xml.in
index 8a799ec..0d49eba 100644
--- a/src/org.gnome.gnome-system-monitor.gschema.xml.in
+++ b/src/org.gnome.gnome-system-monitor.gschema.xml.in
@@ -28,22 +28,6 @@
</description>
</key>
- <key type="b" name="cpu-stacked-area-chart">
- <default>false
- </default>
- <summary>Show CPU chart as stacked area chart</summary>
- <description>If TRUE, system-monitor shows the CPU chart as a stacked area chart instead of a line
chart.
- </description>
- </key>
-
- <key type="b" name="cpu-smooth-graph">
- <default>true
- </default>
- <summary>Show CPU chart as smooth graph using Bezier curves</summary>
- <description>If TRUE, system-monitor shows the CPU chart as a smoothed graph, otherwise as a line
chart.
- </description>
- </key>
-
<key name="smooth-refresh" type="b">
<default>true
</default>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]