[Xfce4-commits] [panel-plugins/xfce4-hardware-monitor-plugin] 09/29: Implement fixed/unfixed maxes in visualisation
noreply at xfce.org
noreply at xfce.org
Mon Dec 18 12:45:40 CET 2017
This is an automated email from the git hooks/post-receive script.
o m e g a p h i l p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository panel-plugins/xfce4-hardware-monitor-plugin.
commit 91ae0ba1def372b1d9a625be9ef4ae024c4b1b6c
Author: OmegaPhil <OmegaPhil at startmail.com>
Date: Fri Nov 24 16:35:43 2017 +0000
Implement fixed/unfixed maxes in visualisation
As requested in https://bugzilla.xfce.org/show_bug.cgi?id=13803 ,
allow user to specify whether a visualisation has a fixed max or
not, and when there is sufficiently variable output, allow the user
to specify the max
---
src/choose-monitor-window.cpp | 459 ++++++++++++++++++++---------------
src/choose-monitor-window.hpp | 22 +-
src/monitor-impls.cpp | 322 ++++++++++++++++--------
src/monitor-impls.hpp | 101 +++++---
src/monitor.hpp | 1 +
src/ui.glade | 551 ++++++++++++++++++++++++++++++++++++------
6 files changed, 1053 insertions(+), 403 deletions(-)
diff --git a/src/choose-monitor-window.cpp b/src/choose-monitor-window.cpp
index 2e97e02..94112bb 100644
--- a/src/choose-monitor-window.cpp
+++ b/src/choose-monitor-window.cpp
@@ -39,19 +39,29 @@ ChooseMonitorWindow::ChooseMonitorWindow(XfcePanelPlugin* xfce_plugin,
: xfce_plugin(xfce_plugin)
{
// Now we are forced to use top-level widgets this is much more over the top...
- std::vector<Glib::ustring> objects(12);
+ std::vector<Glib::ustring> objects(22);
objects[0] = "choose_monitor_window";
objects[1] = "cpu_no_adjustment";
objects[2] = "cpu_usage_refresh_delay_adjustment";
- objects[3] = "disk_stats_refresh_delay_adjustment";
- objects[4] = "disk_usage_refresh_delay_adjustment";
- objects[5] = "fan_delay_adjustment";
- objects[6] = "generic_delay_adjustment";
- objects[7] = "load_average_refresh_delay_adjustment";
- objects[8] = "memory_refresh_delay_adjustment";
- objects[9] = "network_load_delay_adjustment";
+ objects[3] = "cpu_usage_max_adjustment";
+ objects[4] = "load_average_refresh_delay_adjustment";
+ objects[5] = "load_average_max_adjustment";
+ objects[6] = "disk_usage_refresh_delay_adjustment";
+ objects[7] = "disk_usage_max_adjustment";
+ objects[8] = "disk_stats_refresh_delay_adjustment";
+ objects[9] = "disk_stats_max_adjustment";
objects[10] = "swap_refresh_delay_adjustment";
- objects[11] = "temperature_delay_adjustment";
+ objects[11] = "swap_max_adjustment";
+ objects[12] = "memory_refresh_delay_adjustment";
+ objects[13] = "memory_max_adjustment";
+ objects[14] = "network_load_delay_adjustment";
+ objects[15] = "network_load_max_spinbutton";
+ objects[16] = "temperature_delay_adjustment";
+ objects[17] = "temperature_max_spinbutton";
+ objects[18] = "fan_delay_adjustment";
+ objects[19] = "fan_max_spinbutton";
+ objects[20] = "generic_delay_adjustment";
+ objects[21] = "generic_max_adjustment";
ui = get_builder_xml(objects);
ui->get_widget("choose_monitor_window", window);
@@ -70,71 +80,87 @@ ChooseMonitorWindow::ChooseMonitorWindow(XfcePanelPlugin* xfce_plugin,
cpu_usage_incl_low_checkbutton);
ui->get_widget("cpu_usage_incl_iowait_checkbutton",
cpu_usage_incl_iowait_checkbutton);
- ui->get_widget("cpu_usage_tag_entry", cpu_tag);
ui->get_widget("cpu_usage_refresh_delay_spinbutton",
cpu_usage_refresh_delay_spinbutton);
ui->get_widget("cpu_usage_refresh_delay_default_button",
cpu_usage_refresh_delay_default_button);
+ ui->get_widget("cpu_usage_fixed_max_checkbutton",
+ cpu_usage_fixed_max_checkbutton);
+ ui->get_widget("cpu_usage_tag_entry", cpu_tag);
ui->get_widget("load_average_radiobutton", load_average_radiobutton);
ui->get_widget("load_average_options", load_average_options);
- ui->get_widget("load_average_tag_entry", load_average_tag);
ui->get_widget("load_average_refresh_delay_spinbutton",
load_average_refresh_delay_spinbutton);
ui->get_widget("load_average_refresh_delay_default_button",
load_average_refresh_delay_default_button);
+ ui->get_widget("load_average_fixed_max_checkbutton",
+ load_average_fixed_max_checkbutton);
+ ui->get_widget("load_average_max_spinbutton", load_average_max_spinbutton);
+ ui->get_widget("load_average_tag_entry", load_average_tag);
ui->get_widget("disk_usage_radiobutton", disk_usage_radiobutton);
ui->get_widget("disk_usage_options", disk_usage_options);
ui->get_widget("mount_dir_entry", mount_dir_entry);
ui->get_widget("show_free_checkbutton", show_free_checkbutton);
- ui->get_widget("disk_usage_tag_entry", disk_usage_tag);
ui->get_widget("disk_usage_refresh_delay_spinbutton",
disk_usage_refresh_delay_spinbutton);
ui->get_widget("disk_usage_refresh_delay_default_button",
disk_usage_refresh_delay_default_button);
+ ui->get_widget("disk_usage_fixed_max_checkbutton",
+ disk_usage_fixed_max_checkbutton);
+ ui->get_widget("disk_usage_tag_entry", disk_usage_tag);
ui->get_widget("disk_stats_radiobutton", disk_stats_radiobutton);
ui->get_widget("disk_stats_options", disk_stats_options);
ui->get_widget("disk_stats_device_combobox", disk_stats_device_combobox);
ui->get_widget("disk_stats_stat_combobox", disk_stats_stat_combobox);
- ui->get_widget("disk_stats_tag_entry", disk_stats_tag);
ui->get_widget("disk_stats_refresh_delay_spinbutton",
disk_stats_refresh_delay_spinbutton);
ui->get_widget("disk_stats_refresh_delay_default_button",
disk_stats_refresh_delay_default_button);
+ ui->get_widget("disk_stats_fixed_max_checkbutton",
+ disk_stats_fixed_max_checkbutton);
+ ui->get_widget("disk_stats_max_spinbutton",
+ disk_stats_max_spinbutton);
+ ui->get_widget("disk_stats_tag_entry", disk_stats_tag);
ui->get_widget("swap_usage_radiobutton", swap_usage_radiobutton);
ui->get_widget("swap_usage_options", swap_usage_options);
- ui->get_widget("swap_tag_entry", swap_usage_tag);
ui->get_widget("swap_refresh_delay_spinbutton", swap_refresh_delay_spinbutton);
ui->get_widget("swap_refresh_delay_default_button",
swap_refresh_delay_default_button);
+ ui->get_widget("swap_fixed_max_checkbutton", swap_fixed_max_checkbutton);
+ ui->get_widget("swap_tag_entry", swap_usage_tag);
ui->get_widget("memory_usage_radiobutton", memory_usage_radiobutton);
ui->get_widget("memory_usage_options", memory_usage_options);
- ui->get_widget("memory_tag_entry", memory_usage_tag);
ui->get_widget("memory_refresh_delay_spinbutton",
memory_refresh_delay_spinbutton);
ui->get_widget("memory_refresh_delay_default_button",
memory_refresh_delay_default_button);
+ ui->get_widget("memory_fixed_max_checkbutton", memory_fixed_max_checkbutton);
+ ui->get_widget("memory_tag_entry", memory_usage_tag);
ui->get_widget("network_load_radiobutton", network_load_radiobutton);
ui->get_widget("network_load_options", network_load_options);
ui->get_widget("network_type_combobox", network_type_combobox);
ui->get_widget("network_direction_combobox", network_direction_combobox);
ui->get_widget("network_interfaces_treeview", network_interfaces_treeview);
- ui->get_widget("network_load_tag_entry", network_load_tag);
ui->get_widget("network_load_refresh_delay_spinbutton",
network_load_refresh_delay_spinbutton);
ui->get_widget("network_load_refresh_delay_default_button",
network_load_refresh_delay_default_button);
+ ui->get_widget("network_load_fixed_max_checkbutton",
+ network_load_fixed_max_checkbutton);
+ ui->get_widget("network_load_max_spinbutton", network_load_max_spinbutton);
+ ui->get_widget("network_load_tag_entry", network_load_tag);
/* Need special code here to set the desired stock icon as GTK Builder doesn't
* support setting a stock icon but custom text, and as soon as you change the
* label on a stock button the icon is removed! Attaching a custom image widget
* requires extra hacking in the code, don't see why it is superior to just
- * this*/
+ * this */
ui->get_widget("network_interfaces_restore_defaults_button",
network_interfaces_restore_defaults_button);
Gtk::Image *stock_image = Gtk::manage(new Gtk::Image(
@@ -146,21 +172,26 @@ ChooseMonitorWindow::ChooseMonitorWindow(XfcePanelPlugin* xfce_plugin,
ui->get_widget("temperature_box", temperature_box);
ui->get_widget("temperature_options", temperature_options);
ui->get_widget("temperature_combobox", temperature_combobox);
- ui->get_widget("temperature_tag_entry", temperature_tag);
ui->get_widget("temperature_refresh_delay_spinbutton",
temperature_refresh_delay_spinbutton);
ui->get_widget("temperature_refresh_delay_default_button",
temperature_refresh_delay_default_button);
+ ui->get_widget("temperature_fixed_max_checkbutton",
+ temperature_fixed_max_checkbutton);
+ ui->get_widget("temperature_max_spinbutton", temperature_max_spinbutton);
+ ui->get_widget("temperature_tag_entry", temperature_tag);
ui->get_widget("fan_speed_radiobutton", fan_speed_radiobutton);
ui->get_widget("fan_speed_box", fan_speed_box);
ui->get_widget("fan_speed_options", fan_speed_options);
ui->get_widget("fan_speed_combobox", fan_speed_combobox);
- ui->get_widget("fan_speed_tag_entry", fan_speed_tag);
ui->get_widget("fan_speed_refresh_delay_spinbutton",
fan_speed_refresh_delay_spinbutton);
ui->get_widget("fan_speed_refresh_delay_default_button",
fan_speed_refresh_delay_default_button);
+ ui->get_widget("fan_fixed_max_checkbutton", fan_fixed_max_checkbutton);
+ ui->get_widget("fan_max_spinbutton", fan_max_spinbutton);
+ ui->get_widget("fan_speed_tag_entry", fan_speed_tag);
ui->get_widget("generic_radiobutton", generic_radiobutton);
ui->get_widget("generic_box", generic_box);
@@ -187,11 +218,13 @@ ChooseMonitorWindow::ChooseMonitorWindow(XfcePanelPlugin* xfce_plugin,
generic_data_source_name_short_entry);
ui->get_widget("generic_units_long_entry", generic_units_long_entry);
ui->get_widget("generic_units_short_entry", generic_units_short_entry);
- ui->get_widget("generic_tag_entry", generic_tag);
ui->get_widget("generic_refresh_delay_spinbutton",
generic_refresh_delay_spinbutton);
ui->get_widget("generic_refresh_delay_default_button",
generic_refresh_delay_default_button);
+ ui->get_widget("generic_fixed_max_checkbutton", generic_fixed_max_checkbutton);
+ ui->get_widget("generic_max_spinbutton", generic_max_spinbutton);
+ ui->get_widget("generic_tag_entry", generic_tag);
cpu_usage_radiobutton->signal_toggled()
.connect(sigc::mem_fun(*this, &ChooseMonitorWindow::
@@ -282,12 +315,16 @@ ChooseMonitorWindow::ChooseMonitorWindow(XfcePanelPlugin* xfce_plugin,
* maintain it here */
cpu_usage_refresh_delay_spinbutton->set_value(
CpuUsageMonitor::update_interval_default / 1000);
+ cpu_usage_fixed_max_checkbutton->set_active(true);
load_average_refresh_delay_spinbutton->set_value(
LoadAverageMonitor::update_interval_default / 1000);
+ load_average_fixed_max_checkbutton->set_active(false);
+ load_average_max_spinbutton->set_value(0);
disk_usage_refresh_delay_spinbutton->set_value(
DiskUsageMonitor::update_interval_default / 1000);
+ disk_usage_fixed_max_checkbutton->set_active(true);
/* Setup disk statistics device name combobox - no column packing needed here
* since this seems to be done automatically when a text entry is included */
@@ -320,12 +357,16 @@ ChooseMonitorWindow::ChooseMonitorWindow(XfcePanelPlugin* xfce_plugin,
disk_stats_refresh_delay_spinbutton->set_value(
DiskStatsMonitor::update_interval_default / 1000);
+ disk_stats_fixed_max_checkbutton->set_active(false);
+ disk_stats_max_spinbutton->set_value(0);
swap_refresh_delay_spinbutton->set_value(
SwapUsageMonitor::update_interval_default / 1000);
+ swap_fixed_max_checkbutton->set_active(true);
memory_refresh_delay_spinbutton->set_value(
MemoryUsageMonitor::update_interval_default / 1000);
+ memory_fixed_max_checkbutton->set_active(true);
// Setup network interface type combobox
static NetworkInterfaceTypeCols nitc;
@@ -358,6 +399,8 @@ ChooseMonitorWindow::ChooseMonitorWindow(XfcePanelPlugin* xfce_plugin,
network_load_refresh_delay_spinbutton->set_value(
NetworkLoadMonitor::update_interval_default / 1000);
+ network_load_fixed_max_checkbutton->set_active(false);
+ network_load_max_spinbutton->set_value(0);
#if !HAVE_LIBSENSORS // No sensors support, no options for it
device_notebook->get_nth_page(3)->hide();
@@ -397,6 +440,8 @@ ChooseMonitorWindow::ChooseMonitorWindow(XfcePanelPlugin* xfce_plugin,
temperature_refresh_delay_spinbutton->set_value(
TemperatureMonitor::update_interval_default / 1000);
+ temperature_fixed_max_checkbutton->set_active(false);
+ temperature_max_spinbutton->set_value(0);
// Setup fan combobox
static SensorsCols fsc;
@@ -431,9 +476,13 @@ ChooseMonitorWindow::ChooseMonitorWindow(XfcePanelPlugin* xfce_plugin,
fan_speed_refresh_delay_spinbutton->set_value(
FanSpeedMonitor::update_interval_default / 1000);
+ fan_fixed_max_checkbutton->set_active(false);
+ fan_max_spinbutton->set_value(0);
generic_refresh_delay_spinbutton->set_value(
GenericMonitor::update_interval_default / 1000);
+ generic_fixed_max_checkbutton->set_active(false);
+ generic_max_spinbutton->set_value(0);
/* Fix border on help linkbutton - border is specified in the glade config, yet
* it is ignored?? */
@@ -472,6 +521,15 @@ Monitor *ChooseMonitorWindow::run(const Glib::ustring &mon_dir)
int update_interval = xfce_rc_read_int_entry(settings_ro,
"update_interval", -1);
+ /* Floats are not supported by XFCE configuration code, so need to
+ * unserialise the double */
+ double max;
+ std::stringstream s(xfce_rc_read_entry(settings_ro, "max", "0"));
+ s >> max;
+
+ /* Have moved fixed_max to individual monitors to default the value as
+ * appropriate */
+
if (type == "memory_usage")
{
device_notebook->set_current_page(1);
@@ -482,6 +540,9 @@ Monitor *ChooseMonitorWindow::run(const Glib::ustring &mon_dir)
if (update_interval == -1)
update_interval = MemoryUsageMonitor::update_interval_default;
memory_refresh_delay_spinbutton->set_value(update_interval / 1000);
+
+ bool fixed_max = xfce_rc_read_bool_entry(settings_ro, "fixed_max", true);
+ memory_fixed_max_checkbutton->set_active(fixed_max);
}
else if (type == "load_average")
{
@@ -493,125 +554,37 @@ Monitor *ChooseMonitorWindow::run(const Glib::ustring &mon_dir)
if (update_interval == -1)
update_interval = LoadAverageMonitor::update_interval_default;
load_average_refresh_delay_spinbutton->set_value(update_interval / 1000);
+
+ bool fixed_max = xfce_rc_read_bool_entry(settings_ro, "fixed_max", false);
+ load_average_fixed_max_checkbutton->set_active(fixed_max);
+ load_average_max_spinbutton->set_value(max);
}
else if (type == "disk_usage")
{
device_notebook->set_current_page(1);
disk_usage_radiobutton->set_active();
+
+ Glib::ustring mount_dir = xfce_rc_read_entry(settings_ro,
+ "mount_dir", "");
+ mount_dir_entry->set_text(mount_dir);
+ bool show_free = xfce_rc_read_bool_entry(settings_ro,
+ "show_free", false);
+ show_free_checkbutton->set_active(show_free);
disk_usage_tag->set_text(tag);
// Enforcing default update interval when it isn't present
if (update_interval == -1)
update_interval = DiskUsageMonitor::update_interval_default;
disk_usage_refresh_delay_spinbutton->set_value(update_interval / 1000);
+
+ bool fixed_max = xfce_rc_read_bool_entry(settings_ro, "fixed_max", true);
+ disk_usage_fixed_max_checkbutton->set_active(fixed_max);
}
else if (type == "disk_statistics")
{
device_notebook->set_current_page(1);
disk_stats_radiobutton->set_active();
- disk_stats_tag->set_text(tag);
-
- // Enforcing default update interval when it isn't present
- if (update_interval == -1)
- update_interval = DiskStatsMonitor::update_interval_default;
- disk_stats_refresh_delay_spinbutton->set_value(update_interval / 1000);
- }
- else if (type == "swap_usage")
- {
- device_notebook->set_current_page(1);
- swap_usage_radiobutton->set_active();
- swap_usage_tag->set_text(tag);
-
- // Enforcing default update interval when it isn't present
- if (update_interval == -1)
- update_interval = SwapUsageMonitor::update_interval_default;
- swap_refresh_delay_spinbutton->set_value(update_interval / 1000);
- }
- else if (type == "network_load")
- {
- device_notebook->set_current_page(2);
- network_load_radiobutton->set_active();
- network_load_tag->set_text(tag);
-
- // Enforcing default update interval when it isn't present
- if (update_interval == -1)
- update_interval = NetworkLoadMonitor::update_interval_default;
- network_load_refresh_delay_spinbutton->set_value(update_interval / 1000);
- }
- else if (type == "temperature")
- {
- device_notebook->set_current_page(3);
- temperature_radiobutton->set_active();
- temperature_tag->set_text(tag);
-
- // Enforcing default update interval when it isn't present
- if (update_interval == -1)
- update_interval = TemperatureMonitor::update_interval_default;
- temperature_refresh_delay_spinbutton->set_value(update_interval / 1000);
- }
-
- // TODO: When I start supporting it, why no fan stuff here?
-
- else if (type == "generic")
- {
- device_notebook->set_current_page(4);
- generic_radiobutton->set_active();
- generic_tag->set_text(tag);
-
- // Enforcing default update interval when it isn't present
- if (update_interval == -1)
- update_interval = GenericMonitor::update_interval_default;
- generic_refresh_delay_spinbutton->set_value(update_interval / 1000);
- }
- else
- {
- device_notebook->set_current_page(0);
- cpu_usage_radiobutton->set_active();
- cpu_tag->set_text(tag);
-
- // Enforcing default update interval when it isn't present
- if (update_interval == -1)
- update_interval = CpuUsageMonitor::update_interval_default;
- cpu_usage_refresh_delay_spinbutton->set_value(update_interval / 1000);
- }
-
- // Fill in cpu info
- if (xfce_rc_has_entry(settings_ro, "cpu_no"))
- {
- int no = xfce_rc_read_int_entry(settings_ro, "cpu_no", -1);
- if (no >= 0 && no < CpuUsageMonitor::max_no_cpus) {
- one_cpu_radiobutton->set_active();
- cpu_no_spinbutton->set_value(no + 1);
- }
- else {
- all_cpus_radiobutton->set_active();
- }
-
- bool incl_low_prio = xfce_rc_read_bool_entry(settings_ro,
- "include_low_priority", false);
- cpu_usage_incl_low_checkbutton->set_active(incl_low_prio);
- bool incl_iowait = xfce_rc_read_bool_entry(settings_ro,
- "include_iowait", false);
- cpu_usage_incl_iowait_checkbutton->set_active(incl_iowait);
- }
-
- // Fill in disk usage info
- if (xfce_rc_has_entry(settings_ro, "mount_dir"))
- {
- Glib::ustring mount_dir = xfce_rc_read_entry(settings_ro,
- "mount_dir", "");
- mount_dir_entry->set_text(mount_dir);
- }
- if (xfce_rc_has_entry(settings_ro, "show_free"))
- {
- bool show_free = xfce_rc_read_bool_entry(settings_ro,
- "show_free", false);
- show_free_checkbutton->set_active(show_free);
- }
- // Fill in disk stats info
- if (xfce_rc_has_entry(settings_ro, "disk_stats_device"))
- {
Glib::ustring device_name = xfce_rc_read_entry(settings_ro,
"disk_stats_device", "");
@@ -648,18 +621,38 @@ Monitor *ChooseMonitorWindow::run(const Glib::ustring &mon_dir)
// Selecting the correct statistic
disk_stats_stat_combobox->set_active(stat);
- }
- if (xfce_rc_has_entry(settings_ro, "show_free"))
- {
- bool show_free = xfce_rc_read_bool_entry(settings_ro,
- "show_free", false);
- show_free_checkbutton->set_active(show_free);
+ disk_stats_tag->set_text(tag);
+
+ // Enforcing default update interval when it isn't present
+ if (update_interval == -1)
+ update_interval = DiskStatsMonitor::update_interval_default;
+ disk_stats_refresh_delay_spinbutton->set_value(update_interval / 1000);
+
+ bool fixed_max = xfce_rc_read_bool_entry(settings_ro, "fixed_max", false);
+ disk_stats_fixed_max_checkbutton->set_active(fixed_max);
+ disk_stats_max_spinbutton->set_value(max);
}
+ else if (type == "swap_usage")
+ {
+ device_notebook->set_current_page(1);
+ swap_usage_radiobutton->set_active();
+ swap_usage_tag->set_text(tag);
+
+ // Enforcing default update interval when it isn't present
+ if (update_interval == -1)
+ update_interval = SwapUsageMonitor::update_interval_default;
+ swap_refresh_delay_spinbutton->set_value(update_interval / 1000);
- // Fill in network load info
- if (xfce_rc_has_entry(settings_ro, "interface_type"))
+ // WIP: Why is this not max by default?
+ bool fixed_max = xfce_rc_read_bool_entry(settings_ro, "fixed_max", true);
+ swap_fixed_max_checkbutton->set_active(fixed_max);
+ }
+ else if (type == "network_load")
{
+ device_notebook->set_current_page(2);
+ network_load_radiobutton->set_active();
+
/* By the time this code is reached, deprecated configuration will be
* updated so no need to convert stuff etc */
NetworkLoadMonitor::InterfaceType interface_type =
@@ -749,19 +742,78 @@ Monitor *ChooseMonitorWindow::run(const Glib::ustring &mon_dir)
network_direction_combobox->set_active(2);
break;
}
- }
- // Fill in temperature info
- if (xfce_rc_has_entry(settings_ro, "temperature_no"))
+ /* Populate interface type interface names advanced settings - interface
+ * name column needs to be editable + trigger validation on entry - note
+ * that append_column returns the number of columns present rather than
+ * the genuine ordinal to the last column, hence -1
+ * This is here as it is independent of monitors but dependent on a settings
+ * file being available, and needs to run both when a monitor does and doesn't
+ * exist */
+ network_interfaces_names_store = Gtk::ListStore::create(nc);
+ network_interfaces_treeview->set_model(network_interfaces_names_store);
+ network_interfaces_treeview->append_column(_("Interface Type"),
+ nc.interface_type);
+ int column_num = network_interfaces_treeview
+ ->append_column(_("Interface Name"), nc.interface_name) - 1;
+
+ // Documentation asks for dynamic_cast here
+ Gtk::CellRendererText *cell_renderer = dynamic_cast<Gtk::CellRendererText*>(network_interfaces_treeview
+ ->get_column_cell_renderer(column_num));
+ cell_renderer->property_editable() = true;
+ cell_renderer->signal_edited().connect(
+ sigc::mem_fun(*this, &ChooseMonitorWindow::
+ on_network_interface_name_edited));
+
+ for (int i = 0; i < NetworkLoadMonitor::NUM_INTERFACE_TYPES; ++i)
+ {
+ NetworkLoadMonitor::InterfaceType interface_type =
+ static_cast<NetworkLoadMonitor::InterfaceType>(i);
+ store_iter iter = network_interfaces_names_store->append();
+ (*iter)[nc.interface_type] = NetworkLoadMonitor::
+ interface_type_to_string(interface_type, false);
+ (*iter)[nc.interface_name] = NetworkLoadMonitor::
+ get_interface_name(interface_type, xfce_plugin);
+ }
+
+ network_load_tag->set_text(tag);
+
+ // Enforcing default update interval when it isn't present
+ if (update_interval == -1)
+ update_interval = NetworkLoadMonitor::update_interval_default;
+ network_load_refresh_delay_spinbutton->set_value(update_interval / 1000);
+
+ bool fixed_max = xfce_rc_read_bool_entry(settings_ro, "fixed_max", false);
+ network_load_fixed_max_checkbutton->set_active(fixed_max);
+ network_load_max_spinbutton->set_value(max);
+ }
+ else if (type == "temperature")
{
+ device_notebook->set_current_page(3);
+ temperature_radiobutton->set_active();
+
int temperature_no = xfce_rc_read_int_entry(settings_ro,
"temperature_no", 0);
temperature_combobox->set_active(temperature_no);
+ temperature_tag->set_text(tag);
+
+ // Enforcing default update interval when it isn't present
+ if (update_interval == -1)
+ update_interval = TemperatureMonitor::update_interval_default;
+ temperature_refresh_delay_spinbutton->set_value(update_interval / 1000);
+
+ bool fixed_max = xfce_rc_read_bool_entry(settings_ro, "fixed_max", false);
+ temperature_fixed_max_checkbutton->set_active(fixed_max);
+ temperature_max_spinbutton->set_value(max);
}
- // Fill in generic info
- if (xfce_rc_has_entry(settings_ro, "file_path"))
+ // TODO: When I start supporting it, why no fan stuff here?
+
+ else if (type == "generic")
{
+ device_notebook->set_current_page(4);
+ generic_radiobutton->set_active();
+
Glib::ustring file_path = xfce_rc_read_entry(settings_ro, "file_path",
""),
regex_string = xfce_rc_read_entry(settings_ro, "regex", ""),
@@ -805,6 +857,49 @@ Monitor *ChooseMonitorWindow::run(const Glib::ustring &mon_dir)
generic_data_source_name_short_entry->set_text(data_source_name_short);
generic_units_long_entry->set_text(units_long);
generic_units_short_entry->set_text(units_short);
+
+ generic_tag->set_text(tag);
+
+ // Enforcing default update interval when it isn't present
+ if (update_interval == -1)
+ update_interval = GenericMonitor::update_interval_default;
+ generic_refresh_delay_spinbutton->set_value(update_interval / 1000);
+
+ bool fixed_max = xfce_rc_read_bool_entry(settings_ro, "fixed_max", false);
+ generic_fixed_max_checkbutton->set_active(fixed_max);
+ generic_max_spinbutton->set_value(max);
+ }
+ else
+ {
+ // CPU usage monitor
+ device_notebook->set_current_page(0);
+ cpu_usage_radiobutton->set_active();
+
+ int no = xfce_rc_read_int_entry(settings_ro, "cpu_no", -1);
+ if (no >= 0 && no < CpuUsageMonitor::max_no_cpus) {
+ one_cpu_radiobutton->set_active();
+ cpu_no_spinbutton->set_value(no + 1);
+ }
+ else {
+ all_cpus_radiobutton->set_active();
+ }
+
+ bool incl_low_prio = xfce_rc_read_bool_entry(settings_ro,
+ "include_low_priority", false);
+ cpu_usage_incl_low_checkbutton->set_active(incl_low_prio);
+ bool incl_iowait = xfce_rc_read_bool_entry(settings_ro,
+ "include_iowait", false);
+ cpu_usage_incl_iowait_checkbutton->set_active(incl_iowait);
+
+ // Enforcing default update interval when it isn't present
+ if (update_interval == -1)
+ update_interval = CpuUsageMonitor::update_interval_default;
+ cpu_usage_refresh_delay_spinbutton->set_value(update_interval / 1000);
+
+ bool fixed_max = xfce_rc_read_bool_entry(settings_ro, "fixed_max", true);
+ cpu_usage_fixed_max_checkbutton->set_active(fixed_max);
+
+ cpu_tag->set_text(tag);
}
xfce_rc_close(settings_ro);
@@ -815,39 +910,6 @@ Monitor *ChooseMonitorWindow::run(const Glib::ustring &mon_dir)
device_notebook->set_current_page(0);
cpu_usage_radiobutton->set_active();
}
-
- /* Populate interface type interface names advanced settings - interface
- * name column needs to be editable + trigger validation on entry - note
- * that append_column returns the number of columns present rather than
- * the genuine ordinal to the last column, hence -1
- * This is here as it is independent of monitors but dependent on a settings
- * file being available, and needs to run both when a monitor does and doesn't
- * exist */
- network_interfaces_names_store = Gtk::ListStore::create(nc);
- network_interfaces_treeview->set_model(network_interfaces_names_store);
- network_interfaces_treeview->append_column(_("Interface Type"),
- nc.interface_type);
- int column_num = network_interfaces_treeview
- ->append_column(_("Interface Name"), nc.interface_name) - 1;
-
- // Documentation asks for dynamic_cast here
- Gtk::CellRendererText *cell_renderer = dynamic_cast<Gtk::CellRendererText*>(network_interfaces_treeview
- ->get_column_cell_renderer(column_num));
- cell_renderer->property_editable() = true;
- cell_renderer->signal_edited().connect(
- sigc::mem_fun(*this, &ChooseMonitorWindow::
- on_network_interface_name_edited));
-
- for (int i = 0; i < NetworkLoadMonitor::NUM_INTERFACE_TYPES; ++i)
- {
- NetworkLoadMonitor::InterfaceType interface_type =
- static_cast<NetworkLoadMonitor::InterfaceType>(i);
- store_iter iter = network_interfaces_names_store->append();
- (*iter)[nc.interface_type] = NetworkLoadMonitor::
- interface_type_to_string(interface_type, false);
- (*iter)[nc.interface_name] = NetworkLoadMonitor::
- get_interface_name(interface_type, xfce_plugin);
- }
}
if (cpu_usage_radiobutton->get_active())
@@ -866,34 +928,41 @@ Monitor *ChooseMonitorWindow::run(const Glib::ustring &mon_dir)
{
if (one_cpu_radiobutton->get_active())
mon = new CpuUsageMonitor(
- int(cpu_no_spinbutton->get_value()) - 1, cpu_tag->get_text(),
+ int(cpu_no_spinbutton->get_value()) - 1,
+ cpu_usage_fixed_max_checkbutton->get_active(),
int(cpu_usage_refresh_delay_spinbutton->get_value() * 1000),
cpu_usage_incl_low_checkbutton->get_active(),
- cpu_usage_incl_iowait_checkbutton->get_active());
+ cpu_usage_incl_iowait_checkbutton->get_active(),
+ cpu_tag->get_text());
else
mon = new CpuUsageMonitor(
- cpu_tag->get_text(),
+ cpu_usage_fixed_max_checkbutton->get_active(),
int(cpu_usage_refresh_delay_spinbutton->get_value() * 1000),
cpu_usage_incl_low_checkbutton->get_active(),
- cpu_usage_incl_iowait_checkbutton->get_active());
+ cpu_usage_incl_iowait_checkbutton->get_active(),
+ cpu_tag->get_text());
}
else if (memory_usage_radiobutton->get_active())
{
mon = new MemoryUsageMonitor(
- memory_usage_tag->get_text(),
- int(memory_refresh_delay_spinbutton->get_value() * 1000));
+ int(memory_refresh_delay_spinbutton->get_value() * 1000),
+ memory_fixed_max_checkbutton->get_active(),
+ memory_usage_tag->get_text());
}
else if (swap_usage_radiobutton->get_active())
{
mon = new SwapUsageMonitor(
- swap_usage_tag->get_text(),
- int(swap_refresh_delay_spinbutton->get_value() * 1000));
+ int(swap_refresh_delay_spinbutton->get_value() * 1000),
+ swap_fixed_max_checkbutton->get_active(),
+ swap_usage_tag->get_text());
}
else if (load_average_radiobutton->get_active())
{
mon = new LoadAverageMonitor(
- load_average_tag->get_text(),
- int(load_average_refresh_delay_spinbutton->get_value() * 1000));
+ int(load_average_refresh_delay_spinbutton->get_value() * 1000),
+ load_average_fixed_max_checkbutton->get_active(),
+ load_average_max_spinbutton->get_value(),
+ load_average_tag->get_text());
}
else if (disk_usage_radiobutton->get_active())
{
@@ -925,8 +994,9 @@ Monitor *ChooseMonitorWindow::run(const Glib::ustring &mon_dir)
}
mon = new DiskUsageMonitor(mount_dir, show_free,
- disk_usage_tag->get_text(),
- int(disk_usage_refresh_delay_spinbutton->get_value() * 1000));
+ int(disk_usage_refresh_delay_spinbutton->get_value() * 1000),
+ disk_usage_fixed_max_checkbutton->get_active(),
+ disk_usage_tag->get_text());
}
else if (disk_stats_radiobutton->get_active())
{
@@ -966,8 +1036,10 @@ Monitor *ChooseMonitorWindow::run(const Glib::ustring &mon_dir)
}
mon = new DiskStatsMonitor(device_name, stat,
- disk_stats_tag->get_text(),
- int(disk_stats_refresh_delay_spinbutton->get_value() * 1000));
+ int(disk_stats_refresh_delay_spinbutton->get_value() * 1000),
+ disk_stats_fixed_max_checkbutton->get_active(),
+ disk_stats_max_spinbutton->get_value(),
+ disk_stats_tag->get_text());
}
else if (network_load_radiobutton->get_active())
{
@@ -1010,21 +1082,26 @@ Monitor *ChooseMonitorWindow::run(const Glib::ustring &mon_dir)
}
mon = new NetworkLoadMonitor(interface_type, dir,
- network_load_tag->get_text(),
int(network_load_refresh_delay_spinbutton->get_value() * 1000),
- xfce_plugin);
+ network_load_fixed_max_checkbutton->get_active(),
+ network_load_max_spinbutton->get_value(),
+ network_load_tag->get_text(), xfce_plugin);
}
else if (temperature_radiobutton->get_active())
{
mon = new TemperatureMonitor(temperature_combobox->get_active_row_number(),
- temperature_tag->get_text(),
- int(temperature_refresh_delay_spinbutton->get_value() * 1000));
+ int(temperature_refresh_delay_spinbutton->get_value() * 1000),
+ temperature_fixed_max_checkbutton->get_active(),
+ temperature_max_spinbutton->get_value(),
+ temperature_tag->get_text());
}
else if (fan_speed_radiobutton->get_active())
{
mon = new FanSpeedMonitor(fan_speed_combobox->get_active_row_number(),
- fan_speed_tag->get_text(),
- int(fan_speed_refresh_delay_spinbutton->get_value() * 1000));
+ int(fan_speed_refresh_delay_spinbutton->get_value() * 1000),
+ fan_fixed_max_checkbutton->get_active(),
+ fan_max_spinbutton->get_value(),
+ fan_speed_tag->get_text());
}
else if (generic_radiobutton->get_active())
{
@@ -1159,8 +1236,10 @@ Monitor *ChooseMonitorWindow::run(const Glib::ustring &mon_dir)
mon = new GenericMonitor(file_path, value_from_contents, regex_string,
follow_change, dir, data_source_name_long,
data_source_name_short, units_long, units_short,
- generic_tag->get_text(),
- int(generic_refresh_delay_spinbutton->get_value() * 1000));
+ int(generic_refresh_delay_spinbutton->get_value() * 1000),
+ generic_fixed_max_checkbutton->get_active(),
+ generic_max_spinbutton->get_value(),
+ generic_tag->get_text());
}
return mon;
diff --git a/src/choose-monitor-window.hpp b/src/choose-monitor-window.hpp
index ec5b39f..2f0ab97 100644
--- a/src/choose-monitor-window.hpp
+++ b/src/choose-monitor-window.hpp
@@ -72,11 +72,14 @@ private:
Gtk::Box *cpu_usage_options, *load_average_options;
Gtk::RadioButton *all_cpus_radiobutton, *one_cpu_radiobutton;
Gtk::SpinButton *cpu_no_spinbutton, *cpu_usage_refresh_delay_spinbutton,
- *load_average_refresh_delay_spinbutton, *disk_usage_refresh_delay_spinbutton,
- *disk_stats_refresh_delay_spinbutton, *swap_refresh_delay_spinbutton,
- *memory_refresh_delay_spinbutton, *network_load_refresh_delay_spinbutton,
- *temperature_refresh_delay_spinbutton, *fan_speed_refresh_delay_spinbutton,
- *generic_refresh_delay_spinbutton;
+ *load_average_refresh_delay_spinbutton, *load_average_max_spinbutton,
+ *disk_usage_refresh_delay_spinbutton, *disk_stats_refresh_delay_spinbutton,
+ *disk_stats_max_spinbutton, *swap_refresh_delay_spinbutton,
+ *memory_refresh_delay_spinbutton,
+ *network_load_refresh_delay_spinbutton, *network_load_max_spinbutton,
+ *temperature_refresh_delay_spinbutton, *temperature_max_spinbutton,
+ *fan_speed_refresh_delay_spinbutton, *fan_max_spinbutton,
+ *generic_refresh_delay_spinbutton, *generic_max_spinbutton;
Gtk::Entry *cpu_tag, *load_average_tag;
Gtk::Button *cpu_usage_refresh_delay_default_button,
*load_average_refresh_delay_default_button,
@@ -92,8 +95,13 @@ private:
*swap_usage_options;
Gtk::Entry *mount_dir_entry, *disk_usage_tag, *disk_stats_tag, *memory_usage_tag,
*swap_usage_tag;
- Gtk::CheckButton *show_free_checkbutton, *cpu_usage_incl_low_checkbutton,
- *cpu_usage_incl_iowait_checkbutton;
+ Gtk::CheckButton *cpu_usage_incl_low_checkbutton,
+ *cpu_usage_incl_iowait_checkbutton, *cpu_usage_fixed_max_checkbutton,
+ *load_average_fixed_max_checkbutton, *show_free_checkbutton,
+ *disk_usage_fixed_max_checkbutton, *disk_stats_fixed_max_checkbutton,
+ *swap_fixed_max_checkbutton, *memory_fixed_max_checkbutton,
+ *network_load_fixed_max_checkbutton, *temperature_fixed_max_checkbutton,
+ *fan_fixed_max_checkbutton, *generic_fixed_max_checkbutton;
Gtk::ComboBox *disk_stats_device_combobox, *disk_stats_stat_combobox;
diff --git a/src/monitor-impls.cpp b/src/monitor-impls.cpp
index db8d897..bbc2c0f 100644
--- a/src/monitor-impls.cpp
+++ b/src/monitor-impls.cpp
@@ -22,6 +22,7 @@
#include <iomanip> // Needed for Precision helper
#include <iostream>
#include <limits> // Used for sentinel value in Generic Monitor
+#include <sstream> // Used for string to number conversion
#include <string>
#include <vector>
@@ -78,10 +79,17 @@ load_monitors(XfceRc *settings_ro, XfcePanelPlugin *panel_plugin)
// Obtaining general monitor details
Glib::ustring type = xfce_rc_read_entry(settings_ro, "type", ""),
tag = xfce_rc_read_entry(settings_ro, "tag", "");
-
int update_interval = xfce_rc_read_int_entry(settings_ro,
"update_interval", -1);
+ /* Floats are not supported by XFCE configuration code, so need to
+ * unstringify the double */
+ double max;
+ std::stringstream s(xfce_rc_read_entry(settings_ro, "max", "0"));
+ s >> max;
+
+ bool fixed_max = xfce_rc_read_bool_entry(settings_ro, "fixed_max", false);
+
if (type == "cpu_usage")
{
// Obtaining cpu_no
@@ -99,13 +107,15 @@ load_monitors(XfceRc *settings_ro, XfcePanelPlugin *panel_plugin)
// Creating CPU usage monitor with provided number if valid
if (cpu_no == -1)
{
- monitors.push_back(new CpuUsageMonitor(tag, update_interval,
- incl_low_prio, incl_iowait));
+ monitors.push_back(new CpuUsageMonitor(fixed_max, incl_low_prio,
+ incl_iowait, update_interval,
+ tag));
}
else
{
- monitors.push_back(new CpuUsageMonitor(cpu_no, tag, update_interval,
- incl_low_prio, incl_iowait));
+ monitors.push_back(new CpuUsageMonitor(cpu_no, fixed_max,
+ incl_low_prio, incl_iowait,
+ update_interval, tag));
}
}
else if (type == "memory_usage")
@@ -114,7 +124,8 @@ load_monitors(XfceRc *settings_ro, XfcePanelPlugin *panel_plugin)
if (update_interval == -1)
update_interval = MemoryUsageMonitor::update_interval_default;
- monitors.push_back(new MemoryUsageMonitor(tag, update_interval));
+ monitors.push_back(new MemoryUsageMonitor(update_interval, fixed_max,
+ tag));
}
else if (type == "swap_usage")
{
@@ -122,7 +133,7 @@ load_monitors(XfceRc *settings_ro, XfcePanelPlugin *panel_plugin)
if (update_interval == -1)
update_interval = SwapUsageMonitor::update_interval_default;
- monitors.push_back(new SwapUsageMonitor(tag, update_interval));
+ monitors.push_back(new SwapUsageMonitor(update_interval, fixed_max, tag));
}
else if (type == "load_average")
{
@@ -130,7 +141,8 @@ load_monitors(XfceRc *settings_ro, XfcePanelPlugin *panel_plugin)
if (update_interval == -1)
update_interval = LoadAverageMonitor::update_interval_default;
- monitors.push_back(new LoadAverageMonitor(tag, update_interval));
+ monitors.push_back(new LoadAverageMonitor(update_interval, fixed_max,
+ max, tag));
}
else if (type == "disk_usage")
{
@@ -147,8 +159,8 @@ load_monitors(XfceRc *settings_ro, XfcePanelPlugin *panel_plugin)
update_interval = DiskUsageMonitor::update_interval_default;
// Creating disk usage monitor
- monitors.push_back(new DiskUsageMonitor(mount_dir, show_free, tag,
- update_interval));
+ monitors.push_back(new DiskUsageMonitor(mount_dir, show_free,
+ update_interval, fixed_max, tag));
}
else if (type == "disk_statistics")
{
@@ -165,8 +177,9 @@ load_monitors(XfceRc *settings_ro, XfcePanelPlugin *panel_plugin)
update_interval = DiskStatsMonitor::update_interval_default;
// Creating disk statistics monitor
- monitors.push_back(new DiskStatsMonitor(device_name, stat, tag,
- update_interval));
+ monitors.push_back(new DiskStatsMonitor(device_name, stat,
+ update_interval, fixed_max, max,
+ tag));
}
else if (type == "network_load")
{
@@ -255,8 +268,8 @@ load_monitors(XfceRc *settings_ro, XfcePanelPlugin *panel_plugin)
// Creating network load monitor
monitors.push_back(new NetworkLoadMonitor(inter_type, inter_direction,
- tag, update_interval,
- panel_plugin));
+ update_interval, fixed_max,
+ max, tag, panel_plugin));
}
else if (type == "temperature")
{
@@ -269,8 +282,9 @@ load_monitors(XfceRc *settings_ro, XfcePanelPlugin *panel_plugin)
update_interval = TemperatureMonitor::update_interval_default;
// Creating temperature monitor
- monitors.push_back(new TemperatureMonitor(temperature_no, tag,
- update_interval));
+ monitors.push_back(new TemperatureMonitor(temperature_no,
+ update_interval, fixed_max,
+ max, tag));
}
else if (type == "fan_speed")
{
@@ -282,7 +296,8 @@ load_monitors(XfceRc *settings_ro, XfcePanelPlugin *panel_plugin)
update_interval = FanSpeedMonitor::update_interval_default;
// Creating fan monitor
- monitors.push_back(new FanSpeedMonitor(fan_no, tag, update_interval));
+ monitors.push_back(new FanSpeedMonitor(fan_no, update_interval,
+ fixed_max, max, tag));
}
else if (type == "generic")
@@ -328,7 +343,8 @@ load_monitors(XfceRc *settings_ro, XfcePanelPlugin *panel_plugin)
regex_string, follow_change, dir,
data_source_name_long,
data_source_name_short, units_long,
- units_short, tag, update_interval));
+ units_short, update_interval,
+ fixed_max, max, tag));
}
// Saving the monitor's settings root
@@ -341,7 +357,7 @@ load_monitors(XfceRc *settings_ro, XfcePanelPlugin *panel_plugin)
// Always start with a CpuUsageMonitor
if (monitors.empty())
- monitors.push_back(new CpuUsageMonitor("", 1000, false, false));
+ monitors.push_back(new CpuUsageMonitor(true, false, false, 1000, ""));
return monitors;
}
@@ -403,17 +419,18 @@ int const CpuUsageMonitor::max_no_cpus = GLIBTOP_NCPU;
int const CpuUsageMonitor::update_interval_default = 1000;
-CpuUsageMonitor::CpuUsageMonitor(const Glib::ustring &tag_string, int interval,
- bool incl_low_prio, bool incl_iowait)
- : Monitor(tag_string, interval), cpu_no(all_cpus),
+CpuUsageMonitor::CpuUsageMonitor(bool fixed_max, bool incl_low_prio,
+ bool incl_iowait, int interval,
+ const Glib::ustring &tag_string)
+ : Monitor(tag_string, interval), cpu_no(all_cpus), fixed_max_priv(fixed_max),
incl_low_prio_priv(incl_low_prio), incl_iowait_priv(incl_iowait),
total_time(0), nice_time(0), idle_time(0), iowait_time(0)
{}
-CpuUsageMonitor::CpuUsageMonitor(int cpu, const Glib::ustring &tag_string,
- int interval, bool incl_low_prio,
- bool incl_iowait)
- : Monitor(tag_string, interval), cpu_no(cpu),
+CpuUsageMonitor::CpuUsageMonitor(int cpu, bool fixed_max, bool incl_low_prio,
+ bool incl_iowait, int interval,
+ const Glib::ustring &tag_string)
+ : Monitor(tag_string, interval), cpu_no(cpu), fixed_max_priv(fixed_max),
incl_low_prio_priv(incl_low_prio), incl_iowait_priv(incl_iowait),
total_time(0), nice_time(0), idle_time(0), iowait_time(0)
{
@@ -469,14 +486,9 @@ double CpuUsageMonitor::do_measure()
return 0;
}
-double CpuUsageMonitor::max()
-{
- return 1;
-}
-
bool CpuUsageMonitor::fixed_max()
{
- return true;
+ return fixed_max_priv;
}
Glib::ustring CpuUsageMonitor::format_value(double val, bool compact)
@@ -502,6 +514,11 @@ Glib::ustring CpuUsageMonitor::get_short_name()
return String::ucompose(_("CPU %1"), cpu_no + 1);
}
+double CpuUsageMonitor::max()
+{
+ return 1;
+}
+
void CpuUsageMonitor::save(XfceRc *settings_w)
{
// Fetching assigned settings group
@@ -515,8 +532,14 @@ void CpuUsageMonitor::save(XfceRc *settings_w)
incl_low_prio_priv);
xfce_rc_write_bool_entry(settings_w, "include_iowait",
incl_iowait_priv);
- xfce_rc_write_entry(settings_w, "tag", tag.c_str());
xfce_rc_write_int_entry(settings_w, "update_interval", update_interval());
+ xfce_rc_write_bool_entry(settings_w, "fixed_max", fixed_max());
+ xfce_rc_write_entry(settings_w, "tag", tag.c_str());
+}
+
+void CpuUsageMonitor::set_fixed_max(bool fixed_max)
+{
+ fixed_max_priv = fixed_max;
}
void CpuUsageMonitor::set_update_interval(int interval)
@@ -535,8 +558,9 @@ int CpuUsageMonitor::update_interval()
// Static initialisation
int const SwapUsageMonitor::update_interval_default = 10 * 1000;
-SwapUsageMonitor::SwapUsageMonitor(const Glib::ustring &tag_string, int interval)
- : Monitor(tag_string, interval), max_value(0)
+SwapUsageMonitor::SwapUsageMonitor(int interval, bool fixed_max,
+ const Glib::ustring &tag_string)
+ : Monitor(tag_string, interval), max_value(0), fixed_max_priv(fixed_max)
{
}
@@ -554,14 +578,9 @@ double SwapUsageMonitor::do_measure()
return 0;
}
-double SwapUsageMonitor::max()
-{
- return max_value;
-}
-
bool SwapUsageMonitor::fixed_max()
{
- return false;
+ return fixed_max_priv;
}
Glib::ustring SwapUsageMonitor::format_value(double val, bool compact)
@@ -584,6 +603,11 @@ Glib::ustring SwapUsageMonitor::get_short_name()
return _("Swap");
}
+double SwapUsageMonitor::max()
+{
+ return max_value;
+}
+
void SwapUsageMonitor::save(XfceRc *settings_w)
{
// Fetching assigned settings group
@@ -592,8 +616,19 @@ void SwapUsageMonitor::save(XfceRc *settings_w)
// Saving settings
xfce_rc_set_group(settings_w, dir.c_str());
xfce_rc_write_entry(settings_w, "type", "swap_usage");
- xfce_rc_write_entry(settings_w, "tag", tag.c_str());
xfce_rc_write_int_entry(settings_w, "update_interval", update_interval());
+ xfce_rc_write_bool_entry(settings_w, "fixed_max", fixed_max());
+
+ // No support for floats - stringifying
+ Glib::ustring setting = String::ucompose("%1", max_value);
+ xfce_rc_write_entry(settings_w, "max", setting.c_str());
+
+ xfce_rc_write_entry(settings_w, "tag", tag.c_str());
+}
+
+void SwapUsageMonitor::set_fixed_max(bool fixed_max)
+{
+ fixed_max_priv = fixed_max;
}
void SwapUsageMonitor::set_update_interval(int interval)
@@ -612,8 +647,9 @@ int SwapUsageMonitor::update_interval()
// Static initialisation
int const LoadAverageMonitor::update_interval_default = 30 * 1000;
-LoadAverageMonitor::LoadAverageMonitor(const Glib::ustring &tag_string, int interval)
- : Monitor(tag_string, interval), max_value(1.0)
+LoadAverageMonitor::LoadAverageMonitor(int interval, bool fixed_max, double max,
+ const Glib::ustring &tag_string)
+ : Monitor(tag_string, interval), max_value(max), fixed_max_priv(fixed_max)
{
}
@@ -639,14 +675,9 @@ double LoadAverageMonitor::do_measure()
return 0;
}
-double LoadAverageMonitor::max()
-{
- return max_value;
-}
-
bool LoadAverageMonitor::fixed_max()
{
- return false;
+ return fixed_max_priv;
}
Glib::ustring LoadAverageMonitor::format_value(double val, bool compact)
@@ -666,6 +697,11 @@ Glib::ustring LoadAverageMonitor::get_short_name()
return _("Load");
}
+double LoadAverageMonitor::max()
+{
+ return max_value;
+}
+
void LoadAverageMonitor::save(XfceRc *settings_w)
{
// Fetching assigned settings group
@@ -674,12 +710,24 @@ void LoadAverageMonitor::save(XfceRc *settings_w)
// Saving settings
xfce_rc_set_group(settings_w, dir.c_str());
xfce_rc_write_entry(settings_w, "type", "load_average");
- xfce_rc_write_entry(settings_w, "tag", tag.c_str());
xfce_rc_write_int_entry(settings_w, "update_interval", update_interval());
+ xfce_rc_write_bool_entry(settings_w, "fixed_max", fixed_max());
// No support for floats - stringifying
Glib::ustring setting = String::ucompose("%1", max_value);
xfce_rc_write_entry(settings_w, "max", setting.c_str());
+
+ xfce_rc_write_entry(settings_w, "tag", tag.c_str());
+}
+
+void LoadAverageMonitor::set_fixed_max(bool fixed_max)
+{
+ fixed_max_priv = fixed_max;
+}
+
+void LoadAverageMonitor::set_max(double max)
+{
+ max_value = max;
}
void LoadAverageMonitor::set_update_interval(int interval)
@@ -698,8 +746,9 @@ int LoadAverageMonitor::update_interval()
// Static initialisation
int const MemoryUsageMonitor::update_interval_default = 10 * 1000;
-MemoryUsageMonitor::MemoryUsageMonitor(const Glib::ustring &tag_string, int interval)
- : Monitor(tag_string, interval), max_value(0)
+MemoryUsageMonitor::MemoryUsageMonitor(int interval, bool fixed_max,
+ const Glib::ustring &tag_string)
+ : Monitor(tag_string, interval), max_value(0), fixed_max_priv(fixed_max)
{
}
@@ -717,14 +766,9 @@ double MemoryUsageMonitor::do_measure()
return 0;
}
-double MemoryUsageMonitor::max()
-{
- return max_value;
-}
-
bool MemoryUsageMonitor::fixed_max()
{
- return false;
+ return fixed_max_priv;
}
Glib::ustring MemoryUsageMonitor::format_value(double val, bool compact)
@@ -747,6 +791,11 @@ Glib::ustring MemoryUsageMonitor::get_short_name()
return _("Mem.");
}
+double MemoryUsageMonitor::max()
+{
+ return max_value;
+}
+
void MemoryUsageMonitor::save(XfceRc *settings_w)
{
// Fetching assigned settings group
@@ -755,8 +804,14 @@ void MemoryUsageMonitor::save(XfceRc *settings_w)
// Saving settings
xfce_rc_set_group(settings_w, dir.c_str());
xfce_rc_write_entry(settings_w, "type", "memory_usage");
- xfce_rc_write_entry(settings_w, "tag", tag.c_str());
xfce_rc_write_int_entry(settings_w, "update_interval", update_interval());
+ xfce_rc_write_bool_entry(settings_w, "fixed_max", fixed_max());
+ xfce_rc_write_entry(settings_w, "tag", tag.c_str());
+}
+
+void MemoryUsageMonitor::set_fixed_max(bool fixed_max)
+{
+ fixed_max_priv = fixed_max;
}
void MemoryUsageMonitor::set_update_interval(int interval)
@@ -776,8 +831,10 @@ int MemoryUsageMonitor::update_interval()
int const DiskUsageMonitor::update_interval_default = 60 * 1000;
DiskUsageMonitor::DiskUsageMonitor(const std::string &dir, bool free,
- const Glib::ustring &tag_string, int interval)
- : Monitor(tag_string, interval), max_value(0), mount_dir(dir), show_free(free)
+ int interval, bool fixed_max,
+ const Glib::ustring &tag_string)
+ : Monitor(tag_string, interval), max_value(0), fixed_max_priv(fixed_max),
+ mount_dir(dir), show_free(free)
{
}
@@ -787,6 +844,7 @@ double DiskUsageMonitor::do_measure()
glibtop_get_fsusage(&fsusage, mount_dir.c_str());
+ // Keeping max_value available whether the monitor has a fixed max or not
max_value = fsusage.blocks * fsusage.block_size;
double v = 0;
@@ -803,14 +861,9 @@ double DiskUsageMonitor::do_measure()
return v;
}
-double DiskUsageMonitor::max()
-{
- return max_value;
-}
-
bool DiskUsageMonitor::fixed_max()
{
- return false;
+ return fixed_max_priv;
}
Glib::ustring DiskUsageMonitor::format_value(double val, bool compact)
@@ -848,6 +901,11 @@ Glib::ustring DiskUsageMonitor::get_short_name()
return String::ucompose("%1", mount_dir);
}
+double DiskUsageMonitor::max()
+{
+ return max_value;
+}
+
void DiskUsageMonitor::save(XfceRc *settings_w)
{
// Fetching assigned settings group
@@ -858,8 +916,14 @@ void DiskUsageMonitor::save(XfceRc *settings_w)
xfce_rc_write_entry(settings_w, "type", "disk_usage");
xfce_rc_write_entry(settings_w, "mount_dir", mount_dir.c_str());
xfce_rc_write_bool_entry(settings_w, "show_free", show_free);
- xfce_rc_write_entry(settings_w, "tag", tag.c_str());
xfce_rc_write_int_entry(settings_w, "update_interval", update_interval());
+ xfce_rc_write_bool_entry(settings_w, "fixed_max", fixed_max());
+ xfce_rc_write_entry(settings_w, "tag", tag.c_str());
+}
+
+void DiskUsageMonitor::set_fixed_max(bool fixed_max)
+{
+ fixed_max_priv = fixed_max;
}
void DiskUsageMonitor::set_update_interval(int interval)
@@ -882,10 +946,11 @@ int const DiskStatsMonitor::update_interval_default = 1000;
// No stats allow for negative values, so using that to detect no previous value
DiskStatsMonitor::DiskStatsMonitor(const Glib::ustring &device_name,
const Stat &stat_to_monitor,
- const Glib::ustring &tag_string,
- int interval)
+ int interval, bool fixed_max, double max,
+ const Glib::ustring &tag_string)
: Monitor(tag_string, interval), device_name(device_name),
- stat_to_monitor(stat_to_monitor), previous_value(-1), max_value(1)
+ stat_to_monitor(stat_to_monitor), previous_value(-1), max_value(max),
+ fixed_max_priv(fixed_max)
{
}
@@ -992,7 +1057,7 @@ double DiskStatsMonitor::do_measure()
bool DiskStatsMonitor::fixed_max()
{
- return false;
+ return fixed_max_priv;
}
Glib::ustring DiskStatsMonitor::format_value(double val, bool compact)
@@ -1116,9 +1181,20 @@ void DiskStatsMonitor::save(XfceRc *settings_w)
xfce_rc_write_entry(settings_w, "type", "disk_statistics");
xfce_rc_write_entry(settings_w, "disk_stats_device", device_name.c_str());
xfce_rc_write_int_entry(settings_w, "disk_stats_stat", int(stat_to_monitor));
+ xfce_rc_write_bool_entry(settings_w, "fixed_max", fixed_max());
xfce_rc_write_int_entry(settings_w, "max", int(max_value));
- xfce_rc_write_entry(settings_w, "tag", tag.c_str());
xfce_rc_write_int_entry(settings_w, "update_interval", update_interval());
+ xfce_rc_write_entry(settings_w, "tag", tag.c_str());
+}
+
+void DiskStatsMonitor::set_fixed_max(bool fixed_max)
+{
+ fixed_max_priv = fixed_max;
+}
+
+void DiskStatsMonitor::set_max(double max)
+{
+ max_value = max;
}
void DiskStatsMonitor::set_update_interval(int interval)
@@ -1234,11 +1310,12 @@ std::vector<Glib::ustring> NetworkLoadMonitor::interface_type_names_default = in
bool NetworkLoadMonitor::interface_names_configured = false;
NetworkLoadMonitor::NetworkLoadMonitor(InterfaceType &inter_type, Direction dir,
+ int interval, bool fixed_max, double max,
const Glib::ustring &tag_string,
- int interval, XfcePanelPlugin* xfce_plugin)
- : Monitor(tag_string, interval), max_value(1), byte_count(0),
- time_stamp_secs(0), time_stamp_usecs(0),interface_type(inter_type),
- direction(dir), xfce_plugin(xfce_plugin)
+ XfcePanelPlugin* xfce_plugin)
+ : Monitor(tag_string, interval), max_value(max), fixed_max_priv(fixed_max),
+ byte_count(0), time_stamp_secs(0), time_stamp_usecs(0),
+ interface_type(inter_type), direction(dir), xfce_plugin(xfce_plugin)
{
}
@@ -1552,7 +1629,7 @@ double NetworkLoadMonitor::do_measure()
bool NetworkLoadMonitor::fixed_max()
{
- return false;
+ return fixed_max_priv;
}
Glib::ustring NetworkLoadMonitor::format_value(double val, bool compact)
@@ -1782,9 +1859,10 @@ void NetworkLoadMonitor::save(XfceRc *settings_w)
xfce_rc_write_int_entry(settings_w, "interface_type", int(interface_type));
xfce_rc_write_int_entry(settings_w, "interface_direction",
int(direction));
+ xfce_rc_write_bool_entry(settings_w, "fixed_max", fixed_max());
xfce_rc_write_int_entry(settings_w, "max", int(max_value));
- xfce_rc_write_entry(settings_w, "tag", tag.c_str());
xfce_rc_write_int_entry(settings_w, "update_interval", update_interval());
+ xfce_rc_write_entry(settings_w, "tag", tag.c_str());
}
void NetworkLoadMonitor::save_interfaces(XfceRc *settings_w)
@@ -1827,11 +1905,21 @@ void NetworkLoadMonitor::save_interfaces(XfceRc *settings_w)
interface_type_names[wireless_third].c_str());
}
+void NetworkLoadMonitor::set_fixed_max(bool fixed_max)
+{
+ fixed_max_priv = fixed_max;
+}
+
void NetworkLoadMonitor::set_interface_name(InterfaceType type, const Glib::ustring interface_name)
{
interface_type_names[type] = interface_name;
}
+void NetworkLoadMonitor::set_max(double max)
+{
+ max_value = max;
+}
+
void NetworkLoadMonitor::set_update_interval(int interval)
{
update_interval_priv = interval;
@@ -1964,9 +2052,11 @@ double const Sensors::invalid_max = -1000000;
int const TemperatureMonitor::update_interval_default = 20 * 1000;
-TemperatureMonitor::TemperatureMonitor(int no, const Glib::ustring &tag_string,
- int interval)
- : Monitor(tag_string, interval), sensors_no(no)
+TemperatureMonitor::TemperatureMonitor(int no, int interval, bool fixed_max,
+ double max,
+ const Glib::ustring &tag_string)
+ : Monitor(tag_string, interval), sensors_no(no), max_value(max),
+ fixed_max_priv(fixed_max)
{
Sensors::FeatureInfo info
= Sensors::instance().get_temperature_features()[sensors_no];
@@ -1992,7 +2082,7 @@ double TemperatureMonitor::do_measure()
bool TemperatureMonitor::fixed_max()
{
- return false;
+ return fixed_max_priv;
}
@@ -2032,12 +2122,24 @@ void TemperatureMonitor::save(XfceRc *settings_w)
xfce_rc_set_group(settings_w, dir.c_str());
xfce_rc_write_entry(settings_w, "type", "temperature");
xfce_rc_write_int_entry(settings_w, "temperature_no", sensors_no);
- xfce_rc_write_entry(settings_w, "tag", tag.c_str());
xfce_rc_write_int_entry(settings_w, "update_interval", update_interval());
+ xfce_rc_write_bool_entry(settings_w, "fixed_max", fixed_max());
// No support for floats - stringifying
Glib::ustring setting = String::ucompose("%1", max_value);
xfce_rc_write_entry(settings_w, "max", setting.c_str());
+
+ xfce_rc_write_entry(settings_w, "tag", tag.c_str());
+}
+
+void TemperatureMonitor::set_fixed_max(bool fixed_max)
+{
+ fixed_max_priv = fixed_max;
+}
+
+void TemperatureMonitor::set_max(double max)
+{
+ max_value = max;
}
void TemperatureMonitor::set_update_interval(int interval)
@@ -2056,9 +2158,11 @@ int TemperatureMonitor::update_interval()
// Static initialisation
int const FanSpeedMonitor::update_interval_default = 20 * 1000;
-FanSpeedMonitor::FanSpeedMonitor(int no, const Glib::ustring &tag_string,
- int interval)
- : Monitor(tag_string, interval), sensors_no(no)
+FanSpeedMonitor::FanSpeedMonitor(int no, int interval, bool fixed_max,
+ double max,
+ const Glib::ustring &tag_string)
+ : Monitor(tag_string, interval), sensors_no(no), max_value(max),
+ fixed_max_priv(fixed_max)
{
Sensors::FeatureInfo info
= Sensors::instance().get_fan_features()[sensors_no];
@@ -2084,7 +2188,7 @@ double FanSpeedMonitor::do_measure()
bool FanSpeedMonitor::fixed_max()
{
- return false;
+ return fixed_max_priv;
}
Glib::ustring FanSpeedMonitor::format_value(double val, bool compact)
@@ -2113,6 +2217,16 @@ double FanSpeedMonitor::max()
return max_value;
}
+void FanSpeedMonitor::set_fixed_max(bool fixed_max)
+{
+ fixed_max_priv = fixed_max;
+}
+
+void FanSpeedMonitor::set_max(double max)
+{
+ max_value = max;
+}
+
void FanSpeedMonitor::save(XfceRc *settings_w)
{
// Fetching assigned settings group
@@ -2122,12 +2236,14 @@ void FanSpeedMonitor::save(XfceRc *settings_w)
xfce_rc_set_group(settings_w, dir.c_str());
xfce_rc_write_entry(settings_w, "type", "fan_speed");
xfce_rc_write_int_entry(settings_w, "fan_no", sensors_no);
- xfce_rc_write_entry(settings_w, "tag", tag.c_str());
xfce_rc_write_int_entry(settings_w, "update_interval", update_interval());
+ xfce_rc_write_bool_entry(settings_w, "fixed_max", fixed_max());
// No support for floats - stringifying
Glib::ustring setting = String::ucompose("%1", max_value);
xfce_rc_write_entry(settings_w, "max", setting.c_str());
+
+ xfce_rc_write_entry(settings_w, "tag", tag.c_str());
}
void FanSpeedMonitor::set_update_interval(int interval)
@@ -2155,9 +2271,9 @@ GenericMonitor::GenericMonitor(const Glib::ustring &file_path,
const Glib::ustring &data_source_name_short,
const Glib::ustring &units_long,
const Glib::ustring &units_short,
- const Glib::ustring &tag_string,
- int interval)
- : Monitor(tag_string, interval), max_value(0),
+ int interval, bool fixed_max, double max,
+ const Glib::ustring &tag_string)
+ : Monitor(tag_string, interval), max_value(max), fixed_max_priv(fixed_max),
previous_value(std::numeric_limits<double>::min()),
file_path(file_path), value_from_contents(value_from_contents),
follow_change(follow_change), dir(dir),
@@ -2303,7 +2419,7 @@ double GenericMonitor::do_measure()
bool GenericMonitor::fixed_max()
{
- return false;
+ return fixed_max_priv;
}
Glib::ustring GenericMonitor::format_value(double val, bool compact)
@@ -2347,8 +2463,24 @@ void GenericMonitor::save(XfceRc *settings_w)
data_source_name_short.c_str());
xfce_rc_write_entry(settings_w, "units_long", units_long.c_str());
xfce_rc_write_entry(settings_w, "units_short", units_short.c_str());
- xfce_rc_write_entry(settings_w, "tag", tag.c_str());
xfce_rc_write_int_entry(settings_w, "update_interval", update_interval());
+ xfce_rc_write_bool_entry(settings_w, "fixed_max", fixed_max());
+
+ // No support for floats - stringifying
+ Glib::ustring setting = String::ucompose("%1", max_value);
+ xfce_rc_write_entry(settings_w, "max", setting.c_str());
+
+ xfce_rc_write_entry(settings_w, "tag", tag.c_str());
+}
+
+void GenericMonitor::set_fixed_max(bool fixed_max)
+{
+ fixed_max_priv = fixed_max;
+}
+
+void GenericMonitor::set_max(double max)
+{
+ max_value = max;
}
void GenericMonitor::set_update_interval(int interval)
diff --git a/src/monitor-impls.hpp b/src/monitor-impls.hpp
index 8e1ea38..e357805 100644
--- a/src/monitor-impls.hpp
+++ b/src/monitor-impls.hpp
@@ -50,19 +50,21 @@ class CpuUsageMonitor: public Monitor
public:
// Monitor all CPUs
- CpuUsageMonitor(const Glib::ustring &tag_string, int interval,
- bool incl_low_prio, bool incl_iowait);
+ CpuUsageMonitor(bool fixed_max, bool incl_low_prio, bool incl_iowait,
+ int interval, const Glib::ustring &tag_string);
// Monitor only CPU no.
- CpuUsageMonitor(int cpu_no, const Glib::ustring &tag_string, int interval,
- bool incl_low_prio, bool incl_iowait);
+ CpuUsageMonitor(int cpu_no, bool fixed_max, bool incl_low_prio,
+ bool incl_iowait, int interval,
+ const Glib::ustring &tag_string);
- virtual double max();
virtual bool fixed_max();
virtual Glib::ustring format_value(double val, bool compact = false);
virtual Glib::ustring get_name();
virtual Glib::ustring get_short_name();
+ virtual double max();
virtual void save(XfceRc *settings_w);
+ virtual void set_fixed_max(bool fixed_max);
virtual void set_update_interval(int interval);
virtual int update_interval();
@@ -80,6 +82,7 @@ private:
static int const all_cpus = -1;
int cpu_no;
+ bool fixed_max_priv;
// Define whether these are included in CPU time or not
bool incl_low_prio_priv, incl_iowait_priv;
@@ -93,14 +96,15 @@ private:
class SwapUsageMonitor: public Monitor
{
public:
- SwapUsageMonitor(const Glib::ustring &tag_string, int interval);
+ SwapUsageMonitor(int interval, bool fixed_max, const Glib::ustring &tag_string);
- virtual double max();
virtual bool fixed_max();
virtual Glib::ustring format_value(double val, bool compact = false);
virtual Glib::ustring get_name();
virtual Glib::ustring get_short_name();
+ virtual double max();
virtual void save(XfceRc *settings_w);
+ virtual void set_fixed_max(bool fixed_max);
virtual void set_update_interval(int interval);
virtual int update_interval();
@@ -112,6 +116,7 @@ public:
private:
virtual double do_measure();
+ bool fixed_max_priv;
guint64 max_value; // maximum available swap
};
@@ -119,14 +124,17 @@ private:
class LoadAverageMonitor: public Monitor
{
public:
- LoadAverageMonitor(const Glib::ustring &tag_string, int interval);
+ LoadAverageMonitor(int interval, bool fixed_max, double max,
+ const Glib::ustring &tag_string);
- virtual double max();
virtual bool fixed_max();
virtual Glib::ustring format_value(double val, bool compact = false);
virtual Glib::ustring get_name();
virtual Glib::ustring get_short_name();
+ virtual double max();
virtual void save(XfceRc *settings_w);
+ virtual void set_fixed_max(bool fixed_max);
+ virtual void set_max(double max);
virtual void set_update_interval(int interval);
virtual int update_interval();
@@ -138,21 +146,27 @@ public:
private:
virtual double do_measure();
- double max_value; // currently monitored max number of processes
+ bool fixed_max_priv;
+
+ /* Recent max load average, i.e. processes running or waiting to run on all
+ * cores */
+ double max_value;
};
class MemoryUsageMonitor: public Monitor
{
public:
- MemoryUsageMonitor(const Glib::ustring &tag_string, int interval);
+ MemoryUsageMonitor(int interval, bool fixed_max,
+ const Glib::ustring &tag_string);
- virtual double max();
virtual bool fixed_max();
virtual Glib::ustring format_value(double val, bool compact = false);
virtual Glib::ustring get_name();
virtual Glib::ustring get_short_name();
+ virtual double max();
virtual void save(XfceRc *settings_w);
+ virtual void set_fixed_max(bool fixed_max);
virtual void set_update_interval(int interval);
virtual int update_interval();
@@ -164,22 +178,24 @@ public:
private:
virtual double do_measure();
- guint64 max_value; // maximum available physical RAM
+ bool fixed_max_priv;
+ guint64 max_value; // Maximum available physical RAM
};
class DiskUsageMonitor: public Monitor
{
public:
- DiskUsageMonitor(const std::string &mount_dir, bool show_free,
- const Glib::ustring &tag_string, int interval);
+ DiskUsageMonitor(const std::string &mount_dir, bool show_free, int interval,
+ bool fixed_max, const Glib::ustring &tag_string);
- virtual double max();
virtual bool fixed_max();
virtual Glib::ustring format_value(double val, bool compact= false);
virtual Glib::ustring get_name();
virtual Glib::ustring get_short_name();
+ virtual double max(); // Fixed at size of the relevant volume
virtual void save(XfceRc *settings_w);
+ virtual void set_fixed_max(bool fixed_max);
virtual void set_update_interval(int interval);
virtual int update_interval();
@@ -191,10 +207,10 @@ public:
private:
virtual double do_measure();
- guint64 max_value; // maximum available disk blocks
+ guint64 max_value; // Maximum available bytes in relevant volume
std::string mount_dir;
- bool show_free;
+ bool fixed_max_priv, show_free;
};
class DiskStatsMonitor: public Monitor
@@ -219,14 +235,17 @@ public:
};
DiskStatsMonitor(const Glib::ustring &device_name, const Stat &stat_to_monitor,
- const Glib::ustring &tag_string, int interval);
+ int interval, bool fixed_max, double max,
+ const Glib::ustring &tag_string);
- virtual double max();
virtual bool fixed_max();
virtual Glib::ustring format_value(double val, bool compact=false);
virtual Glib::ustring get_name();
virtual Glib::ustring get_short_name();
+ virtual double max();
virtual void save(XfceRc *settings_w);
+ virtual void set_fixed_max(bool fixed_max);
+ virtual void set_max(double max);
virtual void set_update_interval(int interval);
virtual int update_interval();
@@ -253,11 +272,11 @@ private:
* vector of reported stats. Note that unordered_map is C++11 */
static std::map<Glib::ustring, std::vector<unsigned long int> > parse_disk_stats();
- guint64 max_value;
-
+ bool fixed_max_priv;
Glib::ustring device_name;
- Stat stat_to_monitor;
+ guint64 max_value;
double previous_value;
+ Stat stat_to_monitor;
};
class NetworkLoadMonitor: public Monitor
@@ -288,17 +307,20 @@ public:
};
NetworkLoadMonitor(InterfaceType &interface_type,
- Direction direction, const Glib::ustring &tag_string,
- int interval, XfcePanelPlugin *xfce_plugin);
+ Direction dir, int interval, bool fixed_max, double max,
+ const Glib::ustring &tag_string,
+ XfcePanelPlugin *xfce_plugin);
- virtual double max();
virtual bool fixed_max();
virtual Glib::ustring format_value(double val, bool compact = false);
virtual Glib::ustring get_name();
virtual Glib::ustring get_short_name();
+ virtual double max();
virtual void possibly_add_sync_with(Monitor *other);
virtual void remove_sync_with(Monitor *other);
virtual void save(XfceRc *settings_w);
+ virtual void set_fixed_max(bool fixed_max);
+ virtual void set_max(double max);
virtual void set_update_interval(int interval);
virtual int update_interval();
@@ -338,6 +360,7 @@ private:
XfcePanelPlugin *xfce_plugin; // Needed to allow do_measure to call
// get_interface_name(xfce_plugin)
+ bool fixed_max_priv;
guint64 max_value; // maximum measured capacity of line
long int time_difference; // no. of msecs. between the last two calls
@@ -364,14 +387,17 @@ class TemperatureMonitor: public Monitor
public:
// no. in the temperature features
- TemperatureMonitor(int no, const Glib::ustring &tag_string, int interval);
+ TemperatureMonitor(int no, int interval, bool fixed_max, double max,
+ const Glib::ustring &tag_string);
- virtual double max();
virtual bool fixed_max();
virtual Glib::ustring format_value(double val, bool compact = false);
virtual Glib::ustring get_name();
virtual Glib::ustring get_short_name();
+ virtual double max();
virtual void save(XfceRc *settings_w);
+ virtual void set_fixed_max(bool fixed_max);
+ virtual void set_max(double max);
virtual void set_update_interval(int interval);
virtual int update_interval();
@@ -384,6 +410,7 @@ private:
virtual double do_measure();
double max_value;
+ bool fixed_max_priv;
int chip_no, feature_no, sensors_no;
std::string description;
};
@@ -394,14 +421,17 @@ class FanSpeedMonitor: public Monitor
public:
// no. in the fan features
- FanSpeedMonitor(int no, const Glib::ustring &tag_string, int interval);
+ FanSpeedMonitor(int no, int interval, bool fixed_max, double max,
+ const Glib::ustring &tag_string);
- virtual double max();
virtual bool fixed_max();
virtual Glib::ustring format_value(double val, bool compact = false);
virtual Glib::ustring get_name();
virtual Glib::ustring get_short_name();
+ virtual double max();
virtual void save(XfceRc *settings_w);
+ virtual void set_fixed_max(bool fixed_max);
+ virtual void set_max(double max);
virtual void set_update_interval(int interval);
virtual int update_interval();
@@ -414,6 +444,7 @@ private:
virtual double do_measure();
double max_value;
+ bool fixed_max_priv;
int chip_no, feature_no, sensors_no;
std::string description;
};
@@ -440,15 +471,17 @@ public:
const Glib::ustring &data_source_name_short,
const Glib::ustring &units_long,
const Glib::ustring &units_short,
- const Glib::ustring &tag_string,
- int interval);
+ int interval, bool fixed_max, double max,
+ const Glib::ustring &tag_string);
- virtual double max();
virtual bool fixed_max();
virtual Glib::ustring format_value(double val, bool compact=false);
virtual Glib::ustring get_name();
virtual Glib::ustring get_short_name();
+ virtual double max();
virtual void save(XfceRc *settings_w);
+ virtual void set_fixed_max(bool fixed_max);
+ virtual void set_max(double max);
virtual void set_update_interval(int interval);
virtual int update_interval();
@@ -464,7 +497,7 @@ private:
Glib::ustring file_path, data_source_name_long,
data_source_name_short, units_long, units_short, tag;
- bool value_from_contents, follow_change;
+ bool fixed_max_priv, follow_change, value_from_contents;
ValueChangeDirection dir;
Glib::RefPtr<Glib::Regex> regex;
};
diff --git a/src/monitor.hpp b/src/monitor.hpp
index 84935ee..b98d235 100644
--- a/src/monitor.hpp
+++ b/src/monitor.hpp
@@ -96,6 +96,7 @@ public:
// Save information about the monitor
virtual void save(XfceRc *settings_w) = 0;
+ virtual void set_fixed_max(bool fixed_max) = 0;
virtual void set_update_interval(int interval) = 0;
/* If other is watching the same thing as this monitor, it might be
diff --git a/src/ui.glade b/src/ui.glade
index 1fd925c..3a4f46e 100644
--- a/src/ui.glade
+++ b/src/ui.glade
@@ -9,6 +9,12 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
+ <object class="GtkAdjustment" id="cpu_usage_max_adjustment">
+ <property name="upper">100</property>
+ <property name="value">100</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
<object class="GtkAdjustment" id="cpu_usage_refresh_delay_adjustment">
<property name="lower">1</property>
<property name="upper">9999</property>
@@ -16,6 +22,11 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
+ <object class="GtkAdjustment" id="disk_stats_max_adjustment">
+ <property name="upper">999999999999</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
<object class="GtkAdjustment" id="disk_stats_refresh_delay_adjustment">
<property name="lower">1</property>
<property name="upper">9999</property>
@@ -23,6 +34,11 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
+ <object class="GtkAdjustment" id="disk_usage_max_adjustment">
+ <property name="upper">9999999999999</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
<object class="GtkAdjustment" id="disk_usage_refresh_delay_adjustment">
<property name="lower">1</property>
<property name="upper">9999</property>
@@ -37,6 +53,11 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
+ <object class="GtkAdjustment" id="fan_max_adjustment">
+ <property name="upper">999999999999</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
<object class="GtkAdjustment" id="generic_delay_adjustment">
<property name="lower">1</property>
<property name="upper">9999</property>
@@ -44,6 +65,17 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
+ <object class="GtkAdjustment" id="generic_max_adjustment">
+ <property name="upper">999999999999</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkAdjustment" id="load_average_max_adjustment">
+ <property name="upper">1000</property>
+ <property name="value">1</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
<object class="GtkAdjustment" id="load_average_refresh_delay_adjustment">
<property name="lower">1</property>
<property name="upper">9999</property>
@@ -51,6 +83,11 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
+ <object class="GtkAdjustment" id="memory_max_adjustment">
+ <property name="upper">999999999999</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
<object class="GtkAdjustment" id="memory_refresh_delay_adjustment">
<property name="lower">1</property>
<property name="upper">9999</property>
@@ -65,6 +102,16 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
+ <object class="GtkAdjustment" id="network_load_max_adjustment">
+ <property name="upper">999999999999</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkAdjustment" id="swap_max_adjustment">
+ <property name="upper">999999999999</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
<object class="GtkAdjustment" id="swap_refresh_delay_adjustment">
<property name="lower">1</property>
<property name="upper">9999</property>
@@ -79,6 +126,11 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
+ <object class="GtkAdjustment" id="temperature_max_adjustment">
+ <property name="upper">999999999999</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
<object class="GtkDialog" id="choose_monitor_window">
<property name="can_focus">False</property>
<property name="border_width">12</property>
@@ -309,7 +361,7 @@ less than default priority</property>
<object class="GtkTable" id="table1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="n_rows">2</property>
+ <property name="n_rows">3</property>
<property name="n_columns">4</property>
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
@@ -321,8 +373,8 @@ less than default priority</property>
<property name="label" translatable="yes">Tag: </property>
</object>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
@@ -343,14 +395,15 @@ view</property>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="cpu_usage_refresh_delay_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="xalign">0</property>
<property name="label" translatable="yes">Refresh every</property>
</object>
</child>
@@ -402,6 +455,30 @@ taken by the monitor</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="cpu_usage_fixed_max_checkbutton">
+ <property name="label" translatable="yes">Fixed max (100%)</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Resulting visualisation is fixed
+to a maximum value of 100%</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</object>
<packing>
<property name="expand">True</property>
@@ -484,7 +561,7 @@ taken by the monitor</property>
<object class="GtkTable" id="table2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="n_rows">2</property>
+ <property name="n_rows">3</property>
<property name="n_columns">4</property>
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
@@ -496,8 +573,8 @@ taken by the monitor</property>
<property name="label" translatable="yes">Tag:</property>
</object>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
@@ -518,8 +595,8 @@ view</property>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
@@ -578,6 +655,45 @@ taken by the monitor</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="load_average_fixed_max_checkbutton">
+ <property name="label" translatable="yes">Fixed max at</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Resulting visualisation is fixed to a
+user-specified maximum value</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="load_average_max_spinbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">load_average_max_adjustment</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
</object>
</child>
<child type="label">
@@ -724,7 +840,7 @@ taken by the monitor</property>
<object class="GtkTable" id="table3">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="n_rows">2</property>
+ <property name="n_rows">3</property>
<property name="n_columns">4</property>
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
@@ -739,8 +855,8 @@ view</property>
<property name="label" translatable="yes">Tag: </property>
</object>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
@@ -761,8 +877,8 @@ view</property>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
@@ -821,6 +937,33 @@ taken by the monitor</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="disk_usage_fixed_max_checkbutton">
+ <property name="label" translatable="yes">Fixed max
+(size of volume)</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Resulting visualisation is fixed
+to a maximum value based on
+the size of the volume</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</object>
</child>
<child type="label">
@@ -973,7 +1116,7 @@ taken by the monitor</property>
<object class="GtkTable" id="table4">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="n_rows">2</property>
+ <property name="n_rows">3</property>
<property name="n_columns">4</property>
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
@@ -988,8 +1131,8 @@ view</property>
<property name="label" translatable="yes">Tag: </property>
</object>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
@@ -1010,8 +1153,8 @@ view</property>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
@@ -1070,6 +1213,45 @@ taken by the monitor</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="disk_stats_fixed_max_checkbutton">
+ <property name="label" translatable="yes">Fixed max at</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Resulting visualisation is fixed
+to a user-specified maximum value</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="disk_stats_max_spinbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">disk_stats_max_adjustment</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
</object>
</child>
<child type="label">
@@ -1148,7 +1330,7 @@ taken by the monitor</property>
<object class="GtkTable" id="table5">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="n_rows">2</property>
+ <property name="n_rows">3</property>
<property name="n_columns">4</property>
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
@@ -1160,8 +1342,8 @@ taken by the monitor</property>
<property name="label" translatable="yes">Tag: </property>
</object>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
@@ -1182,8 +1364,8 @@ view</property>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
@@ -1242,6 +1424,33 @@ taken by the monitor</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="swap_fixed_max_checkbutton">
+ <property name="label" translatable="yes">Fixed max
+(available swap)</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Resulting visualisation is fixed
+to a maximum value based on
+the amount of swap available</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</object>
</child>
<child type="label">
@@ -1320,7 +1529,7 @@ taken by the monitor</property>
<object class="GtkTable" id="table6">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="n_rows">2</property>
+ <property name="n_rows">3</property>
<property name="n_columns">4</property>
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
@@ -1332,8 +1541,8 @@ taken by the monitor</property>
<property name="label" translatable="yes">Tag: </property>
</object>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
@@ -1354,8 +1563,8 @@ view</property>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
@@ -1414,6 +1623,33 @@ taken by the monitor</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="memory_fixed_max_checkbutton">
+ <property name="label" translatable="yes">Fixed max
+(installed memory)</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Resulting visualisation is fixed
+to a maximum value based on
+the amount of RAM available</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</object>
</child>
<child type="label">
@@ -1587,7 +1823,7 @@ taken by the monitor</property>
<object class="GtkTable" id="table7">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="n_rows">2</property>
+ <property name="n_rows">3</property>
<property name="n_columns">4</property>
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
@@ -1599,8 +1835,8 @@ taken by the monitor</property>
<property name="label" translatable="yes">Tag: </property>
</object>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
@@ -1621,8 +1857,8 @@ view</property>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
@@ -1681,6 +1917,45 @@ taken by the monitor</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="network_load_fixed_max_checkbutton">
+ <property name="label" translatable="yes">Fixed max at</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Resulting visualisation is fixed
+to a user-specified maximum value</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="network_load_max_spinbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">network_load_max_adjustment</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">True</property>
@@ -1846,7 +2121,7 @@ taken by the monitor</property>
<object class="GtkTable" id="table8">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="n_rows">2</property>
+ <property name="n_rows">3</property>
<property name="n_columns">4</property>
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
@@ -1858,8 +2133,8 @@ taken by the monitor</property>
<property name="label" translatable="yes">Tag: </property>
</object>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
@@ -1880,8 +2155,8 @@ view</property>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
@@ -1940,6 +2215,45 @@ taken by the monitor</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="temperature_fixed_max_checkbutton">
+ <property name="label" translatable="yes">Fixed max at</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Resulting visualisation is fixed
+to a user-specified maximum value</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="temperature_max_spinbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">temperature_max_adjustment</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
</object>
</child>
<child type="label">
@@ -2031,7 +2345,7 @@ taken by the monitor</property>
<object class="GtkTable" id="table9">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="n_rows">2</property>
+ <property name="n_rows">3</property>
<property name="n_columns">4</property>
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
@@ -2043,8 +2357,8 @@ taken by the monitor</property>
<property name="label" translatable="yes">Tag: </property>
</object>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
@@ -2065,8 +2379,8 @@ view</property>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
@@ -2125,6 +2439,45 @@ taken by the monitor</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="fan_fixed_max_checkbutton">
+ <property name="label" translatable="yes">Fixed max at</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Resulting visualisation is fixed
+to a user-specified maximum value</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="fan_max_spinbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">fan_max_adjustment</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
</object>
</child>
<child type="label">
@@ -2590,42 +2943,67 @@ taken by the monitor</property>
</packing>
</child>
<child>
- <object class="GtkHBox" id="generic_tag_hbox">
+ <object class="GtkHBox" id="generic_refresh_delay_hbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkLabel" id="generic_tag_label">
+ <object class="GtkLabel" id="generic_refresh_delay_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">Tag: </property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Refresh every</property>
</object>
<packing>
- <property name="expand">False</property>
+ <property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkEntry" id="generic_tag_entry">
- <property name="width_request">80</property>
+ <object class="GtkSpinButton" id="generic_refresh_delay_spinbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip_text" translatable="yes">Tag to display along with monitor data
-in the optional text overlay in a curve
-view</property>
+ <property name="tooltip_text" translatable="yes">Seconds delay between measurements
+taken by the monitor</property>
<property name="invisible_char">●</property>
- <property name="invisible_char_set">True</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">generic_delay_adjustment</property>
+ <property name="climb_rate">1</property>
</object>
<packing>
- <property name="expand">False</property>
+ <property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="label19">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes"> seconds</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="generic_refresh_delay_default_button">
+ <property name="label" translatable="yes">Reset</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">True</property>
@@ -2634,35 +3012,35 @@ view</property>
</packing>
</child>
<child>
- <object class="GtkHBox" id="generic_refresh_delay_hbox">
+ <object class="GtkHBox" id="hbox2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkLabel" id="generic_refresh_delay_label">
+ <object class="GtkCheckButton" id="generic_fixed_max_checkbutton">
+ <property name="label" translatable="yes">Fixed max at </property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Refresh every</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Resulting visualisation is fixed
+to a user-specified maximum value</property>
+ <property name="draw_indicator">True</property>
</object>
<packing>
- <property name="expand">True</property>
+ <property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="generic_refresh_delay_spinbutton">
+ <object class="GtkSpinButton" id="generic_max_spinbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip_text" translatable="yes">Seconds delay between measurements
-taken by the monitor</property>
<property name="invisible_char">●</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
- <property name="adjustment">generic_delay_adjustment</property>
- <property name="climb_rate">1</property>
+ <property name="adjustment">generic_max_adjustment</property>
</object>
<packing>
<property name="expand">True</property>
@@ -2670,36 +3048,55 @@ taken by the monitor</property>
<property name="position">1</property>
</packing>
</child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">10</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="generic_tag_hbox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
<child>
- <object class="GtkLabel" id="label19">
+ <object class="GtkLabel" id="generic_tag_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes"> seconds</property>
+ <property name="label" translatable="yes">Tag: </property>
</object>
<packing>
- <property name="expand">True</property>
+ <property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">2</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkButton" id="generic_refresh_delay_default_button">
- <property name="label" translatable="yes">Reset</property>
+ <object class="GtkEntry" id="generic_tag_entry">
+ <property name="width_request">80</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <property name="tooltip_text" translatable="yes">Tag to display along with monitor data
+in the optional text overlay in a curve
+view</property>
+ <property name="invisible_char">●</property>
+ <property name="invisible_char_set">True</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
</object>
<packing>
- <property name="expand">True</property>
+ <property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">3</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">10</property>
+ <property name="position">11</property>
</packing>
</child>
</object>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list