1 //===========================================
2 //  Lumina-DE source code
3 //  Copyright (c) 2015, Ken Moore
4 //  Available under the 3-clause BSD license
5 //  See the LICENSE file for full details
6 //===========================================
7 //  This plugin is a simple hardware status monitor on the desktop
8 //===========================================
9 #ifndef _LUMINA_DESKTOP_PLUGIN_HW_MONITOR_WIDGET_H
10 #define _LUMINA_DESKTOP_PLUGIN_HW_MONITOR_WIDGET_H
11 
12 #include <QTimer>
13 #include <QWidget>
14 
15 #include "../LDPlugin.h"
16 
17 namespace Ui{
18 	class MonitorWidget;
19 };
20 
21 class MonitorWidget : public QWidget{
22 	Q_OBJECT
23 public:
24 	MonitorWidget(QWidget *parent = 0);
25 	~MonitorWidget();
26 
27 public slots:
28 	void LoadIcons();
29 
30 private:
31 	Ui::MonitorWidget *ui;
32 	QTimer *upTimer;
33 
34 private slots:
35 	void UpdateStats();
36 };
37 
38 // Wrapper class to put this into a desktop plugin container
39 class SysMonitorPlugin : public LDPlugin{
40 	Q_OBJECT
41 public:
42 	SysMonitorPlugin(QWidget* parent, QString ID);
43 	~SysMonitorPlugin();
44 
defaultPluginSize()45 	virtual QSize defaultPluginSize(){
46 	  // The returned QSize is in grid points (typically 100 or 200 pixels square)
47 	  return QSize(3,2);
48 	}
49 
50 private:
51 	MonitorWidget *monitor;
52 
53 public slots:
LocaleChange()54 	void LocaleChange(){
55 	  QTimer::singleShot(0,monitor, SLOT(LoadIcons()));
56 	}
ThemeChange()57 	void ThemeChange(){
58 	  QTimer::singleShot(0,monitor, SLOT(LoadIcons()));
59 	}
60 };
61 
62 #endif
63