Commit 2ca4655f authored by Petr Štětka's avatar Petr Štětka
Browse files

Fixed bug with graph timeout interval.

UI graph tweaks.
Updated screenshot.
Updated version 0.0.4
parent 662252a5
......@@ -16,7 +16,7 @@ sudo make install
```
##Version
Actual version is 0.0.3
Actual version is 0.0.4
##License
Code is under GNU GPLv3 license.
......
......@@ -5,7 +5,7 @@ project_name: gnome-usage
vala_binary: src/gnome-usage
*version: 0.0.3
*version: 0.0.4
*vala_vapi: vapis/egg-private.vapi
*vala_vapi: vapis/glibtop.vapi
*vala_vapi: vapis/rg.vapi
......@@ -46,25 +46,25 @@ h_folder: /usr/include/libgtop-2.0
*po: po
*translate: vala src/cpu-graph.vala
*translate: vala src/cpu-graph-table.vala
*translate: vala src/system-monitor.vala
*translate: vala src/memory-sub-view.vala
*translate: vala src/network-sub-view.vala
*translate: vala src/header-bar.vala
*translate: vala src/disk-sub-view.vala
*translate: vala src/graph-stack-switcher.vala
*translate: vala src/graph-switcher-button.vala
*translate: vala src/performance-view.vala
*translate: vala src/cpu-sub-view.vala
*translate: vala src/graph-stack-switcher.vala
*translate: vala src/gnome-usage.vala
*translate: vala src/view.vala
*translate: vala src/graph-switcher-button.vala
*translate: vala src/cpu-sub-view.vala
*translate: vala src/window.vala
*translate: vala src/cpu-graph.vala
*translate: vala src/storage-view.vala
*translate: vala src/power-view.vala
*translate: vala src/process-list.vala
*translate: vala src/application.vala
*translate: vala src/data-view.vala
*translate: vala src/cpu-graph-table.vala
*translate: vala src/window.vala
*translate: vala src/gnome-usage.vala
*data: data/local
......
screenshot.png

88.5 KB | W: | H:

screenshot.png

89.2 KB | W: | H:

screenshot.png
screenshot.png
screenshot.png
screenshot.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -7,13 +7,13 @@ set (GETTEXT_PACKAGE "gnome-usage")
set (RELEASE_NAME "gnome-usage")
set (CMAKE_C_FLAGS "")
set (PREFIX ${CMAKE_INSTALL_PREFIX})
set (VERSION "0.0.3")
set (VERSION "0.0.4")
set (TESTSRCDIR "${CMAKE_SOURCE_DIR}")
set (DOLLAR "$")
configure_file (${CMAKE_SOURCE_DIR}/src/Config.vala.cmake ${CMAKE_BINARY_DIR}/src/Config.vala)
add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\")
set (VERSION "0.0.3")
set (VERSION "0.0.4")
add_definitions (${DEPS_CFLAGS})
link_libraries ( ${DEPS_LIBRARIES} )
link_directories ( ${DEPS_LIBRARY_DIRS} )
......
......@@ -12,7 +12,7 @@ namespace Usage {
var column = new Rg.Column("TOTAL CPU", Type.from_name("gdouble"));
add_column(column);
(GLib.Application.get_default() as Application).monitor.set_update_graph_interval(timespan / (max_samples - 1)); //TODO move to settings!! Here is problem, that this will set all table ant it is problem.
(GLib.Application.get_default() as Application).monitor.set_update_graph_interval(timespan / (max_samples - 1));
Timeout.add(timespan / (max_samples - 1), update_data);
}
......@@ -27,7 +27,7 @@ namespace Usage {
add_column(column);
}
(GLib.Application.get_default() as Application).monitor.set_update_graph_interval(timespan / (max_samples - 1)); //TODO move to settings!! Here is problem, that this will set all table ant it is problem.
(GLib.Application.get_default() as Application).monitor.set_update_graph_interval(timespan / (max_samples - 1));
Timeout.add(timespan / (max_samples - 1), update_data_multi);
}
......
......@@ -6,9 +6,9 @@ namespace Usage {
static string[] colors = {
"#73d216",
"#f57900",
"#3465a4",
"#ef2929",
"#3465a4",
"#f57900",
"#75507b",
"#ce5c00",
"#c17d11",
......@@ -29,7 +29,8 @@ namespace Usage {
set_table(table);
LineRenderer renderer = new LineRenderer();
renderer.stroke_color = colors [0];
renderer.stroke_color = colors [1];
renderer.line_width = 2;
add_renderer(renderer);
}
......@@ -48,6 +49,7 @@ namespace Usage {
LineRenderer renderer = new LineRenderer();
renderer.column = i;
renderer.stroke_color = colors [i % colors.length];
renderer.line_width = 2;
add_renderer(renderer);
}
}
......
// project version=0.0.3
// project version=0.0.4
public static int main (string[] args)
{
......
......@@ -25,8 +25,8 @@ namespace Usage
public double swap_usage { get; private set; }
public double swap_usage_graph { get; private set; }
//TODO update interval setter and getter for non graph
uint update_graph_interval = 0;
uint update_interval = 0;
uint64 cpu_last_used = 0;
uint64 cpu_last_used_graph = 0;
......@@ -38,7 +38,8 @@ namespace Usage
uint64[] x_cpu_last_total;
uint64[] x_cpu_last_total_graph;
bool continue_graph_timeout = true;
bool change_graph_timeout = false;
bool change_timeout = false;
HashTable<uint, Process> process_table;
......@@ -142,10 +143,16 @@ namespace Usage
x_cpu_last_used = x_cpu_used;
x_cpu_last_total = cpu_data.xcpu_total;
if(change_graph_timeout)
{
Timeout.add(update_interval, update_data);
return false;
}
return true;
}
public bool update_graph_data()
private bool update_graph_data()
{
/* CPU */
GTop.Cpu cpu_data;
......@@ -176,16 +183,20 @@ namespace Usage
x_cpu_last_used_graph = x_cpu_used;
x_cpu_last_total_graph = cpu_data.xcpu_total;
if(continue_graph_timeout == false)
if(change_graph_timeout)
{
Timeout.add(update_graph_interval, update_graph_data);
return false;
}
return continue_graph_timeout;
return true;
}
public void set_update_graph_interval(uint miliseconds)
{
change_graph_timeout = true;
update_graph_interval = miliseconds;
Timeout.add(update_graph_interval, update_graph_data);
}
public uint get_update_graph_interval()
......@@ -193,6 +204,17 @@ namespace Usage
return update_graph_interval;
}
public void set_update_interval(uint miliseconds)
{
change_timeout = true;
update_interval = miliseconds;
}
public uint get_update_interval()
{
return update_interval;
}
public List<unowned Process> get_processes()
{
return process_table.get_values();
......@@ -209,7 +231,9 @@ namespace Usage
x_cpu_last_total = new uint64[get_num_processors()];
x_cpu_last_total_graph = new uint64[get_num_processors()];
process_table = new HashTable<uint, Process>(direct_hash, direct_equal);
this.update_interval = update_interval;
Timeout.add(update_interval, update_data);
Timeout.add(100, update_graph_data);
}
}
}
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