aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/desktop-plugins/systemmonitor/MonitorWidget.h
blob: 618ac8f4592f65cef0977c943604e353cc714a38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//===========================================
//  Lumina-DE source code
//  Copyright (c) 2015, Ken Moore
//  Available under the 3-clause BSD license
//  See the LICENSE file for full details
//===========================================
//  This plugin is a simple hardware status monitor on the desktop
//===========================================
#ifndef _LUMINA_DESKTOP_PLUGIN_HW_MONITOR_WIDGET_H
#define _LUMINA_DESKTOP_PLUGIN_HW_MONITOR_WIDGET_H

#include <QTimer>
#include <QWidget>

#include "../LDPlugin.h"

namespace Ui{
	class MonitorWidget;
};

class MonitorWidget : public QWidget{
	Q_OBJECT
public:
	MonitorWidget(QWidget *parent = 0);
	~MonitorWidget();

public slots:
	void LoadIcons();

private:
	Ui::MonitorWidget *ui;
	QTimer *upTimer;

private slots:
	void UpdateStats();
};

// Wrapper class to put this into a desktop plugin container
class SysMonitorPlugin : public LDPlugin{
	Q_OBJECT
public:
	SysMonitorPlugin(QWidget* parent, QString ID);
	~SysMonitorPlugin();

	virtual QSize defaultPluginSize(){
	  // The returned QSize is in grid points (typically 100 or 200 pixels square)
	  return QSize(3,2);
	}
	
private:
	MonitorWidget *monitor;

public slots:
	void LocaleChange(){
	  QTimer::singleShot(0,monitor, SLOT(LoadIcons()));
	}
	void ThemeChange(){
	  QTimer::singleShot(0,monitor, SLOT(LoadIcons()));
	}
};

#endif
bgstack15