summaryrefslogtreecommitdiffstats
path: root/kcontrol/hwmanager/devicepropsdlg.h
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-04-12 21:27:22 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-04-12 21:27:22 -0500
commita6b8435d467eae3cde0e55de2a5820e7c3b64b46 (patch)
treed52bd8ca30d4cb559e6b03ce116d274137649c3e /kcontrol/hwmanager/devicepropsdlg.h
parent20088876e262f10d8928e48cdbcfabe36d272c29 (diff)
downloadtdebase-a6b8435d467eae3cde0e55de2a5820e7c3b64b46.tar.gz
tdebase-a6b8435d467eae3cde0e55de2a5820e7c3b64b46.zip
Add monitor tab
Update sensors tab
Diffstat (limited to 'kcontrol/hwmanager/devicepropsdlg.h')
-rw-r--r--kcontrol/hwmanager/devicepropsdlg.h103
1 files changed, 99 insertions, 4 deletions
diff --git a/kcontrol/hwmanager/devicepropsdlg.h b/kcontrol/hwmanager/devicepropsdlg.h
index 0e8a46b2c..ce445bf84 100644
--- a/kcontrol/hwmanager/devicepropsdlg.h
+++ b/kcontrol/hwmanager/devicepropsdlg.h
@@ -19,6 +19,8 @@
#ifndef __devicepropsdlg_h__
#define __devicepropsdlg_h__
+#include <tqprogressbar.h>
+
#include <kdialogbase.h>
#include <tdehardwaredevices.h>
@@ -27,13 +29,13 @@
/**
*
- * Simple sensor name and value display widget
+ * Simple sensor name and text label value display widget
*
* @version 0.1
* @author Timothy Pearson <kb9vqf@pearsoncomputing.net>
*/
-class TDEUI_EXPORT SensorDisplayWidget : public TQWidget
+class TDEUI_EXPORT SensorDisplayLabelsWidget : public TQWidget
{
Q_OBJECT
public:
@@ -41,8 +43,8 @@ public:
* Create a simple sensor name and value display widget
* @param parent Parent widget for the display widget
*/
- SensorDisplayWidget(TQWidget* parent);
- virtual ~SensorDisplayWidget();
+ SensorDisplayLabelsWidget(TQWidget* parent);
+ virtual ~SensorDisplayLabelsWidget();
/**
* Set sensor name
@@ -61,6 +63,97 @@ private:
TQLabel* m_valueLabel;
};
+class TDEUI_EXPORT SensorBar : public TQProgressBar
+{
+ Q_OBJECT
+public:
+ SensorBar(TQWidget* parent=0, const char* name=0, WFlags f=0) : TQProgressBar(parent, name, f) {}
+ SensorBar(int totalSteps, TQWidget* parent=0, const char* name=0, WFlags f=0): TQProgressBar(totalSteps, parent, name, f) {}
+
+protected:
+ virtual bool setIndicator(TQString & progress_str, int progress, int totalSteps);
+ virtual void drawContents(TQPainter *p);
+
+public:
+ TQString m_currentValueString;
+ TQString m_maximumValueString;
+ TQString m_minimumValueString;
+ int m_currentLocation;
+ int m_warningLocation;
+ int m_criticalLocation;
+};
+
+/**
+ *
+ * Simple sensor information display widget
+ *
+ * @version 0.1
+ * @author Timothy Pearson <kb9vqf@pearsoncomputing.net>
+ */
+
+class TDEUI_EXPORT SensorDisplayWidget : public TQWidget
+{
+ Q_OBJECT
+public:
+ /**
+ * Simple sensor information display widget
+ * @param parent Parent widget for the display widget
+ */
+ SensorDisplayWidget(TQWidget* parent);
+ virtual ~SensorDisplayWidget();
+
+ /**
+ * Set sensor name
+ * @param name A TQString with the name of the sensor
+ */
+ void setSensorName(TQString name);
+
+ /**
+ * Set current sensor value
+ * @param value A double with the current value of the sensor
+ */
+ void setSensorCurrentValue(double value);
+
+ /**
+ * Set minimum sensor value
+ * @param value A double with the minimum value of the sensor, < 0 if not supported
+ */
+ void setSensorMinimumValue(double value);
+
+ /**
+ * Set maximum sensor value
+ * @param value A double with the maximum value of the sensor, < 0 if not supported
+ */
+ void setSensorMaximumValue(double value);
+
+ /**
+ * Set warning sensor value
+ * @param value A double with the warning value of the sensor, < 0 if not supported
+ */
+ void setSensorWarningValue(double value);
+
+ /**
+ * Set critical sensor value
+ * @param value A double with the critical value of the sensor, < 0 if not supported
+ */
+ void setSensorCriticalValue(double value);
+
+ /**
+ * Updates the sensor value display
+ */
+ void updateDisplay();
+
+private:
+ TQLabel* m_nameLabel;
+ SensorBar* m_progressBar;
+
+ double m_current;
+ double m_minimum;
+ double m_maximum;
+ double m_warning;
+ double m_critical;
+};
+
typedef TQPtrList<SensorDisplayWidget> SensorDisplayWidgetList;
/**
@@ -90,6 +183,8 @@ private slots:
void processHardwareUpdated(TDEGenericDevice*);
void populateDeviceInformation();
+ void setBacklightBrightness(int);
+
private:
TDEGenericDevice* m_device;
DevicePropertiesDialogBase* base;