...
 
Commits (7)
...@@ -47,6 +47,7 @@ gtkmm = dependency('gtkmm-3.0', version: '>=3.3.18') ...@@ -47,6 +47,7 @@ gtkmm = dependency('gtkmm-3.0', version: '>=3.3.18')
libgtop = dependency('libgtop-2.0', version: '>=2.37.0') libgtop = dependency('libgtop-2.0', version: '>=2.37.0')
librsvg = dependency('librsvg-2.0', version: '>=2.35') librsvg = dependency('librsvg-2.0', version: '>=2.35')
libxml = dependency('libxml-2.0', version: '>=2.0') libxml = dependency('libxml-2.0', version: '>=2.0')
libdazzle = dependency('libdazzle-1.0', version: '>=3.26.3')
if get_option('wnck') if get_option('wnck')
...@@ -83,6 +84,7 @@ extra_cflags = [ ...@@ -83,6 +84,7 @@ extra_cflags = [
extra_cxxflags = [ extra_cxxflags = [
# '-fvisibility=hidden', # '-fvisibility=hidden',
# '-fvisibility-inlines-hidden', # '-fvisibility-inlines-hidden',
'-fpermissive',
] ]
add_project_arguments(cc.get_supported_arguments(extra_flags + extra_cflags), add_project_arguments(cc.get_supported_arguments(extra_flags + extra_cflags),
......
...@@ -24,28 +24,12 @@ static void ...@@ -24,28 +24,12 @@ static void
cb_solaris_mode_changed (Gio::Settings& settings, Glib::ustring key, GsmApplication* app) cb_solaris_mode_changed (Gio::Settings& settings, Glib::ustring key, GsmApplication* app)
{ {
app->config.solaris_mode = settings.get_boolean(key); app->config.solaris_mode = settings.get_boolean(key);
app->cpu_graph->clear_background(); // app->cpu_graph->clear_background();
if (app->timeout) { if (app->timeout) {
proctable_update (app); 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 static void
cb_network_in_bits_changed (Gio::Settings& settings, Glib::ustring key, GsmApplication* app) 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 ...@@ -123,10 +107,10 @@ cb_color_changed (Gio::Settings& settings, Glib::ustring key, GsmApplication* ap
if (key == GSM_SETTING_CPU_COLORS) { if (key == GSM_SETTING_CPU_COLORS) {
apply_cpu_color_settings(settings, app); apply_cpu_color_settings(settings, app);
for (int i = 0; i < app->config.num_cpus; i++) { for (int i = 0; i < app->config.num_cpus; i++) {
if(!gdk_rgba_equal(&app->cpu_graph->colors[i], &app->config.cpu_color[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]; //app->cpu_graph->colors[i] = app->config.cpu_color[i];
break; // break;
} // }
} }
return; return;
} }
...@@ -159,16 +143,6 @@ GsmApplication::load_settings() ...@@ -159,16 +143,6 @@ GsmApplication::load_settings()
cb_solaris_mode_changed (*this->settings.operator->(), key, this); 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); 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) { 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); cb_network_in_bits_changed (*this->settings.operator->(), key, this);
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <signal.h> #include <signal.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#include <math.h> #include <math.h>
#include <dazzle.h>
#include "interface.h" #include "interface.h"
#include "proctable.h" #include "proctable.h"
...@@ -51,6 +52,17 @@ static const char* LOAD_GRAPH_CSS = "\ ...@@ -51,6 +52,17 @@ static const char* LOAD_GRAPH_CSS = "\
);\ );\
color: mix (@theme_fg_color, @theme_bg_color, 0.5);\ color: mix (@theme_fg_color, @theme_bg_color, 0.5);\
}\ }\
dzlgraphview.view { \
background-color: @theme_bg_color; \
background-size:100% 100%; \
background: linear-gradient(180deg, alpha(@theme_fg_color,0.3) 1px, transparent 0%),\
linear-gradient(90deg, alpha(@theme_fg_color,0.3) 1px, transparent 0% ),\
linear-gradient(-90deg, alpha(@theme_fg_color,0.3) 1px, transparent 0% ),\
linear-gradient(0deg, alpha(@theme_fg_color,0.3) 1px, transparent 0% ),\
repeating-linear-gradient(0deg, alpha(@theme_fg_color,0.15), alpha(@theme_fg_color,0.15) 1px, transparent 1px, transparent 20%), \
repeating-linear-gradient(-90deg, alpha(@theme_fg_color,0.15), alpha(@theme_fg_color,0.15) 1px, transparent 1px, transparent 20%), \
linear-gradient(to bottom, @theme_bg_color, @theme_base_color);\
}\
"; ";
static gboolean static gboolean
...@@ -180,14 +192,16 @@ static void ...@@ -180,14 +192,16 @@ static void
create_sys_view (GsmApplication *app, GtkBuilder * builder) create_sys_view (GsmApplication *app, GtkBuilder * builder)
{ {
GtkBox *cpu_graph_box, *mem_graph_box, *net_graph_box; GtkBox *cpu_graph_box, *mem_graph_box, *net_graph_box;
GtkLabel *label,*cpu_label; GtkLabel *label, *cpu_label;
GtkGrid *table; GtkGrid *table;
GsmColorButton *color_picker; GsmColorButton *color_picker;
GtkCssProvider *provider; GtkCssProvider *provider;
LoadGraph *cpu_graph, *mem_graph, *net_graph; LoadGraph *mem_graph, *net_graph;
//LoadGraph *cpu_graph;
GtkWidget *dzl_graph;
gint i; int i;
gchar *title_text; gchar *title_text;
gchar *label_text; gchar *label_text;
gchar *title_template; gchar *title_template;
...@@ -202,10 +216,12 @@ create_sys_view (GsmApplication *app, GtkBuilder * builder) ...@@ -202,10 +216,12 @@ create_sys_view (GsmApplication *app, GtkBuilder * builder)
cpu_graph_box = GTK_BOX (gtk_builder_get_object (builder, "cpu_graph_box")); 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,
gtk_widget_set_size_request (GTK_WIDGET(load_graph_get_widget(cpu_graph)), -1, 70); "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, gtk_box_pack_start (cpu_graph_box,
GTK_WIDGET (load_graph_get_widget(cpu_graph)), GTK_WIDGET (dzl_graph),
TRUE, TRUE,
TRUE, TRUE,
0); 0);
...@@ -224,7 +240,7 @@ create_sys_view (GsmApplication *app, GtkBuilder * builder) ...@@ -224,7 +240,7 @@ create_sys_view (GsmApplication *app, GtkBuilder * builder)
gtk_grid_insert_row(cpu_table, (i+1)/cols); gtk_grid_insert_row(cpu_table, (i+1)/cols);
} }
gtk_grid_attach(cpu_table, GTK_WIDGET (temp_hbox), i%cols, i/cols, 1, 1); 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_signal_connect (G_OBJECT (color_picker), "color-set",
G_CALLBACK (cb_cpu_color_changed), GINT_TO_POINTER (i)); G_CALLBACK (cb_cpu_color_changed), GINT_TO_POINTER (i));
gtk_box_pack_start (temp_hbox, GTK_WIDGET (color_picker), FALSE, TRUE, 0); gtk_box_pack_start (temp_hbox, GTK_WIDGET (color_picker), FALSE, TRUE, 0);
...@@ -248,14 +264,11 @@ create_sys_view (GsmApplication *app, GtkBuilder * builder) ...@@ -248,14 +264,11 @@ create_sys_view (GsmApplication *app, GtkBuilder * builder)
gtk_widget_set_halign (GTK_WIDGET (cpu_label), GTK_ALIGN_START); 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_box_pack_start (temp_hbox, GTK_WIDGET (cpu_label), FALSE, FALSE, 0);
gtk_widget_show (GTK_WIDGET (cpu_label)); 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 */ /** The memory box */
mem_graph_box = GTK_BOX (gtk_builder_get_object (builder, "mem_graph_box")); mem_graph_box = GTK_BOX (gtk_builder_get_object (builder, "mem_graph_box"));
mem_graph = new LoadGraph(LOAD_GRAPH_MEM); mem_graph = new LoadGraph(LOAD_GRAPH_MEM);
...@@ -578,11 +591,9 @@ update_page_activities (GsmApplication *app) ...@@ -578,11 +591,9 @@ update_page_activities (GsmApplication *app)
} }
if (strcmp (current_page, "resources") == 0) { if (strcmp (current_page, "resources") == 0) {
load_graph_start (app->cpu_graph);
load_graph_start (app->mem_graph); load_graph_start (app->mem_graph);
load_graph_start (app->net_graph); load_graph_start (app->net_graph);
} else { } else {
load_graph_stop (app->cpu_graph);
load_graph_stop (app->mem_graph); load_graph_stop (app->mem_graph);
load_graph_stop (app->net_graph); load_graph_stop (app->net_graph);
} }
...@@ -623,7 +634,6 @@ cb_main_window_state_changed (GtkWidget *window, GdkEventWindowState *event, gpo ...@@ -623,7 +634,6 @@ cb_main_window_state_changed (GtkWidget *window, GdkEventWindowState *event, gpo
if (current_page == "processes") { if (current_page == "processes") {
proctable_freeze (app); proctable_freeze (app);
} else if (current_page == "resources") { } else if (current_page == "resources") {
load_graph_stop (app->cpu_graph);
load_graph_stop (app->mem_graph); load_graph_stop (app->mem_graph);
load_graph_stop (app->net_graph); load_graph_stop (app->net_graph);
} else if (current_page == "disks") { } else if (current_page == "disks") {
...@@ -634,7 +644,6 @@ cb_main_window_state_changed (GtkWidget *window, GdkEventWindowState *event, gpo ...@@ -634,7 +644,6 @@ cb_main_window_state_changed (GtkWidget *window, GdkEventWindowState *event, gpo
proctable_update (app); proctable_update (app);
proctable_thaw (app); proctable_thaw (app);
} else if (current_page == "resources") { } else if (current_page == "resources") {
load_graph_start (app->cpu_graph);
load_graph_start (app->mem_graph); load_graph_start (app->mem_graph);
load_graph_start (app->net_graph); load_graph_start (app->net_graph);
} else if (current_page == "disks") { } else if (current_page == "disks") {
......
...@@ -96,6 +96,7 @@ executable(meson.project_name(), ...@@ -96,6 +96,7 @@ executable(meson.project_name(),
libgtop, libgtop,
libsystemd, libsystemd,
libwnck, libwnck,
libdazzle,
], ],
link_with: libgsm_legacy, link_with: libgsm_legacy,
cpp_args: [ cpp_args: [
......
...@@ -28,22 +28,6 @@ ...@@ -28,22 +28,6 @@
</description> </description>
</key> </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"> <key name="smooth-refresh" type="b">
<default>true <default>true
</default> </default>
......