[Xfce4-commits] [panel-plugins/xfce4-hardware-monitor-plugin] 06/13: Property sensitise tag widgets different "devices" are selected

noreply at xfce.org noreply at xfce.org
Wed Aug 12 18:39:10 CEST 2015


This is an automated email from the git hooks/post-receive script.

omegaphil pushed a commit to branch master
in repository panel-plugins/xfce4-hardware-monitor-plugin.

commit 2cce8a1af78cefa1e471013493f78214e920bd99
Author: OmegaPhil <OmegaPhil at startmail.com>
Date:   Wed Aug 5 18:53:59 2015 +0100

    Property sensitise tag widgets different "devices" are selected
---
 src/choose-monitor-window.cpp |   35 ++++++++++++++++++++++++++++++++++-
 src/choose-monitor-window.hpp |   20 +++++++++-----------
 src/ui.glade                  |    4 ++--
 3 files changed, 45 insertions(+), 14 deletions(-)

diff --git a/src/choose-monitor-window.cpp b/src/choose-monitor-window.cpp
index 3600828..f6113fb 100644
--- a/src/choose-monitor-window.cpp
+++ b/src/choose-monitor-window.cpp
@@ -59,7 +59,10 @@ ChooseMonitorWindow::ChooseMonitorWindow(XfcePanelPlugin* panel_applet_local,
   ui->get_widget("fan_speed_radiobutton", fan_speed_radiobutton);
 
   ui->get_widget("cpu_usage_options", cpu_usage_options);
+  ui->get_widget("load_average_options", load_average_options);
   ui->get_widget("disk_usage_options", disk_usage_options);
+  ui->get_widget("memory_usage_options", memory_usage_options);
+  ui->get_widget("swap_usage_options", swap_usage_options);
   ui->get_widget("network_load_options", network_load_options);
 
   ui->get_widget("all_cpus_radiobutton", all_cpus_radiobutton);
@@ -103,17 +106,29 @@ ChooseMonitorWindow::ChooseMonitorWindow(XfcePanelPlugin* panel_applet_local,
     .connect(sigc::mem_fun(*this, &ChooseMonitorWindow::
                         on_cpu_usage_radiobutton_toggled));
 
+  load_average_radiobutton->signal_toggled()
+    .connect(sigc::mem_fun(*this, &ChooseMonitorWindow::
+                        on_load_average_radiobutton_toggled));
+
   disk_usage_radiobutton->signal_toggled()
     .connect(sigc::mem_fun(*this, &ChooseMonitorWindow::
                         on_disk_usage_radiobutton_toggled));
 
+  memory_usage_radiobutton->signal_toggled()
+    .connect(sigc::mem_fun(*this, &ChooseMonitorWindow::
+                        on_memory_usage_radiobutton_toggled));
+
+  swap_usage_radiobutton->signal_toggled()
+    .connect(sigc::mem_fun(*this, &ChooseMonitorWindow::
+                        on_swap_usage_radiobutton_toggled));
+
   network_load_radiobutton->signal_toggled()
     .connect(sigc::mem_fun(*this, &ChooseMonitorWindow::
                         on_network_load_radiobutton_toggled));
 
   network_interfaces_restore_defaults_button->signal_clicked()
       .connect(sigc::mem_fun(*this, &ChooseMonitorWindow::
-                             on_network_interfaces_restore_defaults_button_clicked));
+                        on_network_interfaces_restore_defaults_button_clicked));
 
   temperature_radiobutton->signal_toggled()
     .connect(sigc::mem_fun(*this, &ChooseMonitorWindow::
@@ -470,12 +485,30 @@ void ChooseMonitorWindow::on_cpu_usage_radiobutton_toggled()
     = cpu_usage_radiobutton->get_active();
 }
 
+void ChooseMonitorWindow::on_load_average_radiobutton_toggled()
+{
+  load_average_options->property_sensitive()
+    = load_average_radiobutton->get_active();
+}
+
 void ChooseMonitorWindow::on_disk_usage_radiobutton_toggled()
 {
   disk_usage_options->property_sensitive()
     = disk_usage_radiobutton->get_active();
 }
 
+void ChooseMonitorWindow::on_memory_usage_radiobutton_toggled()
+{
+  memory_usage_options->property_sensitive()
+    = memory_usage_radiobutton->get_active();
+}
+
+void ChooseMonitorWindow::on_swap_usage_radiobutton_toggled()
+{
+  swap_usage_options->property_sensitive()
+    = swap_usage_radiobutton->get_active();
+}
+
 void ChooseMonitorWindow::on_fan_speed_radiobutton_toggled()
 {
   fan_speed_options->property_sensitive()
diff --git a/src/choose-monitor-window.hpp b/src/choose-monitor-window.hpp
index 5c402b1..e266fa5 100644
--- a/src/choose-monitor-window.hpp
+++ b/src/choose-monitor-window.hpp
@@ -66,21 +66,16 @@ private:
   Gtk::Dialog *window;
   Gtk::Notebook *device_notebook;
   
-  Gtk::RadioButton *cpu_usage_radiobutton,
-    *memory_usage_radiobutton,
-    *swap_usage_radiobutton,
-    *load_average_radiobutton,
-    *disk_usage_radiobutton,
-    *network_load_radiobutton,
-    *temperature_radiobutton,
-    *fan_speed_radiobutton;
-
-  Gtk::Box *cpu_usage_options;
+  Gtk::RadioButton *cpu_usage_radiobutton, *memory_usage_radiobutton,
+    *swap_usage_radiobutton, *load_average_radiobutton, *disk_usage_radiobutton,
+    *network_load_radiobutton, *temperature_radiobutton, *fan_speed_radiobutton;
+
+  Gtk::Box *cpu_usage_options, *load_average_options;
   Gtk::RadioButton *all_cpus_radiobutton, *one_cpu_radiobutton;
   Gtk::SpinButton *cpu_no_spinbutton;
   Gtk::Entry *cpu_tag, *load_average_tag;
 
-  Gtk::Box *disk_usage_options;
+  Gtk::Box *disk_usage_options, *memory_usage_options, *swap_usage_options;
   Gtk::Entry *mount_dir_entry, *disk_usage_tag, *memory_usage_tag,
              *swap_usage_tag;
   Gtk::CheckButton *show_free_checkbutton;
@@ -118,7 +113,10 @@ private:
 
   // GUI
   void on_cpu_usage_radiobutton_toggled();
+  void on_load_average_radiobutton_toggled();
   void on_disk_usage_radiobutton_toggled();
+  void on_memory_usage_radiobutton_toggled();
+  void on_swap_usage_radiobutton_toggled();
   void on_fan_speed_radiobutton_toggled();
   void on_network_load_radiobutton_toggled();
   void on_network_interfaces_restore_defaults_button_clicked();
diff --git a/src/ui.glade b/src/ui.glade
index 4f33adb..6d1c38a 100644
--- a/src/ui.glade
+++ b/src/ui.glade
@@ -536,7 +536,7 @@ view</property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkHBox" id="memory_options">
+                      <widget class="GtkHBox" id="memory_usage_options">
                         <property name="visible">True</property>
                         <property name="sensitive">False</property>
                         <property name="can_focus">False</property>
@@ -635,7 +635,7 @@ view</property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkHBox" id="swap_options">
+                      <widget class="GtkHBox" id="swap_usage_options">
                         <property name="visible">True</property>
                         <property name="sensitive">False</property>
                         <property name="can_focus">False</property>

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list