Commit 27b2dd51 authored by Robert Roth's avatar Robert Roth

Cleanup of deprecated options and old cpu graph

parent 6c00e3a8
......@@ -24,28 +24,12 @@ 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)
{
......@@ -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);
......
......@@ -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") {
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment