Commit 15f399d1 authored by Petr Štětka's avatar Petr Štětka
Browse files

version 0.0.8

Fixed colors of processes.
parent c33ecafa
......@@ -18,7 +18,7 @@ sudo make install
In terminal run ```gnome-usage``` command or run GNOME Usage application from app launcher.
##Version
Actual version is 0.0.7
Actual version is 0.0.8
##License
Code is under GNU GPLv3 license.
......
No preview for this file type
.processListBoxRow-opened { background: #9c9c9c; }
.processListBoxRow { background: #ffffff; }
.processListBoxRow-hover { background: #e2e2e2; }
.processListBoxRow-max { background: #fabbbb; }
.processListBoxRow-max-opened { background: #faa5a2; }
.processListBoxRow-max-hover { background: #faa5a2; }
.processDetailListBoxRow { background: #f2f2f2; }
.processDetailListBoxRow:hover { background: #e2e2e2; }
row { padding: 0 }
.processRow-opened { background: #9c9c9c; border: 1px solid #898989;}
.processRow { background: #ffffff; }
.processRow-hover { background: #e2e2e2; }
.processRow-max { background: #fabbbb; border: 1px solid #faa5a2; }
.processRow-max-hover { background: #faa5a2; border: 1px solid #faa5a2; }
.subProcessSubRow { background: #f2f2f2; }
.subProcessSubRow-hover { background: #e2e2e2; }
.subProcessSubRow-max { background: #fabbbb; border: 1px solid #faa5a2; }
.subProcessSubRow-max-hover { background: #faa5a2; border: 1px solid #faa5a2; }
.sidebar-buttons {
border-style: none;
......
......@@ -5,7 +5,7 @@ project_name: gnome-usage
vala_binary: src/gnome-usage
*version: 0.0.7
*version: 0.0.8
*vala_vapi: vapis/better.vapi
*vala_vapi: vapis/egg-private.vapi
*vala_vapi: vapis/glibtop.vapi
......@@ -59,14 +59,15 @@ h_folder: /usr/include/libgtop-2.0
translate: c src/better-box.c
*translate: vala src/cpu-graph-table.vala
*translate: vala src/sub-process-list-box.vala
*translate: vala src/process-row.vala
*translate: vala src/application.vala
*translate: vala src/gnome-usage.vala
*translate: vala src/header-bar.vala
*translate: vala src/network-sub-view.vala
*translate: vala src/cpu-graph.vala
*translate: vala src/performance-view.vala
*translate: vala src/memory-graph-table.vala
*translate: vala src/sub-process-sub-row.vala
*translate: vala src/cpu-sub-view.vala
*translate: vala src/view.vala
*translate: vala src/graph-switcher-button.vala
*translate: vala src/disk-sub-view.vala
......@@ -74,13 +75,12 @@ translate: c src/better-box.c
*translate: vala src/graph-stack-switcher.vala
*translate: vala src/system-monitor.vala
*translate: vala src/window.vala
*translate: vala src/process-row.vala
*translate: vala src/sub-process-list-box.vala
*translate: vala src/memory-graph.vala
*translate: vala src/cpu-sub-view.vala
*translate: vala src/process-list-box.vala
*translate: vala src/sub-process-sub-row.vala
*translate: vala src/settings.vala
*translate: vala src/storage-view.vala
*translate: vala src/gnome-usage.vala
*translate: vala src/power-view.vala
*translate: vala src/data-view.vala
......
screenshot.png

79.6 KB | W: | H:

screenshot.png

52.1 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.7")
set (VERSION "0.0.8")
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.7")
set (VERSION "0.0.8")
add_definitions (${DEPS_CFLAGS})
link_libraries ( ${DEPS_LIBRARIES} )
link_directories ( ${DEPS_LIBRARY_DIRS} )
......
// project version=0.0.7
// project version=0.0.8
public static int main (string[] args)
{
......
......@@ -64,7 +64,7 @@ namespace Usage
if((int) process.cpu_load > 0)
{
unowned ProcessRow row = process_rows_table[process.cmdline];
row.update_row(process.pid, (int) process.cpu_load);
row.set_value(process.pid, (int) process.cpu_load);
duplicates.add(process.cmdline);
}
}
......@@ -78,7 +78,7 @@ namespace Usage
foreach(unowned ProcessRow row in process_rows_table.get_values())
{
row.post_update();
if(row.alive == false)
if(row.get_alive() == false)
{
process_rows_table.remove(row.get_name());
rows.remove(row);
......@@ -86,7 +86,7 @@ namespace Usage
}
for(int i = 0; i < rows.size; i++)
if(rows[i].alive)
if(rows[i].get_alive())
this.add(rows[i]);
}
......
......@@ -9,12 +9,11 @@ namespace Usage
Gtk.EventBox event_box;
SubProcessListBox sub_process_list_box;
bool in_box = false;
private uint pid;
private int value;
uint pid;
int value;
string name;
public bool alive = true;
public bool group = false;
bool alive = true;
bool group = false;
//public bool is_headline { get; private set; }
public bool showing_details { get; private set; }
......@@ -71,7 +70,7 @@ namespace Usage
this.pack_end(revealer, false, true, 0);
this.pack_end(separator, false, true, 0); //TODO Fix for last element
update_row(pid, value);
set_value(pid, value);
show_all();
}
......@@ -91,7 +90,7 @@ namespace Usage
group = false;
name = sub_process_list_box.get_first_name();
pid = sub_process_list_box.get_first_pid();
update_row(pid, sub_process_list_box.get_first_value());
set_value(pid, sub_process_list_box.get_first_value());
sub_process_list_box.remove_all();
if(showing_details)
hide_details();
......@@ -128,6 +127,11 @@ namespace Usage
return name;
}
public bool get_alive()
{
return alive;
}
public uint get_pid()
{
return pid;
......@@ -138,13 +142,11 @@ namespace Usage
return value;
}
public void update_row(uint pid, int value)
public void set_value(uint pid, int value)//TODO rename to set_value?
{
alive = true;
if(!group)
{
this.value = int.min(value, 100);
}
else
{
if(sub_process_list_box.is_in_table(pid))
......@@ -184,56 +186,29 @@ namespace Usage
private void style()
{
if(max_usage)
{
event_box.get_style_context().remove_class("processListBoxRow");
event_box.get_style_context().remove_class("processListBoxRow-hover");
event_box.get_style_context().remove_class("processListBoxRow-opened");
event_box.get_style_context().remove_class("processRow-max");
event_box.get_style_context().remove_class("processRow-max-hover");
event_box.get_style_context().remove_class("processRow");
event_box.get_style_context().remove_class("processRow-hover");
event_box.get_style_context().remove_class("processRow-opened");
if(showing_details)
{
event_box.get_style_context().remove_class("processListBoxRow-max");
event_box.get_style_context().remove_class("processListBoxRow-max-hover");
event_box.get_style_context().add_class("processListBoxRow-max-opened");
}
else
{
if(in_box)
{
event_box.get_style_context().remove_class("processListBoxRow-max-opened");
event_box.get_style_context().add_class("processListBoxRow-max-hover");
}
else
{
event_box.get_style_context().remove_class("processListBoxRow-max-hover");
event_box.get_style_context().add_class("processListBoxRow-max");
}
}
}
if(showing_details)
event_box.get_style_context().add_class("processRow-opened");
else
{
event_box.get_style_context().remove_class("processListBoxRow-max");
event_box.get_style_context().remove_class("processListBoxRow-max-hover");
event_box.get_style_context().remove_class("processListBoxRow-max-opened");
if(showing_details)
if(max_usage)
{
event_box.get_style_context().remove_class("processListBoxRow");
event_box.get_style_context().remove_class("processListBoxRow-hover");
event_box.get_style_context().add_class("processListBoxRow-opened");
if(in_box)
event_box.get_style_context().add_class("processRow-max-hover");
else
event_box.get_style_context().add_class("processRow-max");
}
else
{
if(in_box)
{
event_box.get_style_context().remove_class("processListBoxRow-opened");
event_box.get_style_context().add_class("processListBoxRow-hover");
}
event_box.get_style_context().add_class("processRow-hover");
else
{
event_box.get_style_context().remove_class("processListBoxRow-hover");
event_box.get_style_context().add_class("processListBoxRow");
}
event_box.get_style_context().add_class("processRow");
}
}
}
......
......@@ -52,6 +52,7 @@ namespace Usage
foreach(unowned SubProcessSubRow sub_row in process_sub_rows_table.get_values())
{
sub_row.update();
if(sub_row.get_alive() == false)
{
process_sub_rows_table.remove(sub_row.get_pid());
......
namespace Usage
{
//TODO rewrite as Row
public class SubProcessSubRow : Gtk.ListBoxRow
/*public class subProcessSubRow : Gtk.ListBoxRow
{
Gtk.Image icon;
Gtk.Label title_label;
......@@ -13,7 +12,7 @@ namespace Usage
private bool alive = true;
public bool max_usage { get; private set; }
public SubProcessSubRow(uint pid, int value, string name)
public subProcessSubRow(uint pid, int value, string name)
{
this.name = name;
this.pid = pid;
......@@ -76,5 +75,130 @@ namespace Usage
load_label.set_label(value.to_string() + "%");
}
}*/
public class SubProcessSubRow : Gtk.Box
{
Gtk.Image icon;
Gtk.Label title_label;
Gtk.Label load_label;
Gtk.EventBox event_box;
bool in_box = false;
uint pid;
int value;
string name;
bool alive = true;
//public bool is_headline { get; private set; }
public bool max_usage { get; private set; }
public SubProcessSubRow(uint pid, int value, string name)
{
this.margin = 0;
this.orientation = Gtk.Orientation.VERTICAL;
var main_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0);
main_box.margin = 12;
title_label = new Gtk.Label(name);
load_label = new Gtk.Label(null);
//load_label.ellipsize = Pango.EllipsizeMode.END;
icon = new Gtk.Image.from_icon_name("system-run-symbolic", Gtk.IconSize.BUTTON);
main_box.pack_start(icon, false, false, 10);
main_box.pack_start(title_label, false, true, 5);
main_box.pack_end(load_label, false, true, 10);
event_box = new Gtk.EventBox();
event_box.add(main_box);
event_box.button_press_event.connect ((event) => {
return false;
});
event_box.enter_notify_event.connect ((event) => {
in_box = true;
style();
return false;
});
event_box.leave_notify_event.connect ((event) => {
in_box = false;
style();
return false;
});
var separator = new Gtk.Separator(Gtk.Orientation.VERTICAL);
this.pack_start(event_box, false, true, 0);
this.pack_end(separator, false, true, 0); //TODO Fix for last element
set_value(value);
show_all();
}
public string get_name()
{
return name;
}
public uint get_pid()
{
return pid;
}
public int get_value()
{
return value;
}
public bool get_alive()
{
return alive;
}
public bool set_alive(bool alive)
{
return this.alive = alive;
}
public void set_value(int value)
{
this.value = int.min(value, 100);
alive = true;
}
public void update()
{
if(value >= 90)
max_usage = true;
else
max_usage = false;
load_label.set_label(value.to_string() + "%");
style();
}
private void style()
{
event_box.get_style_context().remove_class("subProcessSubRow-max");
event_box.get_style_context().remove_class("subProcessSubRow-max-hover");
event_box.get_style_context().remove_class("subProcessSubRow");
event_box.get_style_context().remove_class("subProcessSubRow-hover");
if(max_usage)
{
if(in_box)
event_box.get_style_context().add_class("subProcessSubRow-max-hover");
else
event_box.get_style_context().add_class("subProcessSubRow-max");
}
else
{
if(in_box)
event_box.get_style_context().add_class("subProcessSubRow-hover");
else
event_box.get_style_context().add_class("subProcessSubRow");
}
}
}
}
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