-
Notifications
You must be signed in to change notification settings - Fork 28
/
cmduplugin.h
58 lines (45 loc) · 1.61 KB
/
cmduplugin.h
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
#ifndef CMDUPlugin_H
#define CMDUPlugin_H
#include "dde-dock/pluginsiteminterface.h"
#include "cmduwidget.h"
#include <QTimer>
#include <QLabel>
class CMDUPlugin : public QObject, PluginsItemInterface
{
Q_OBJECT
Q_INTERFACES(PluginsItemInterface)
Q_PLUGIN_METADATA(IID "com.deepin.dock.PluginsItemInterface" FILE "cmdu.json")
public:
explicit CMDUPlugin(QObject *parent = 0);
const QString pluginName() const override;
const QString pluginDisplayName() const override;
void init(PluginProxyInterface *proxyInter) override;
void pluginStateSwitched() override;
bool pluginIsAllowDisable() override { return true; }
bool pluginIsDisable() override;
int itemSortKey(const QString &itemKey);
void setSortKey(const QString &itemKey, const int order);
QWidget *itemWidget(const QString &itemKey) override;
QWidget *itemTipsWidget(const QString &itemKey) override;
const QString itemCommand(const QString &itemKey) override;
const QString itemContextMenu(const QString &itemKey) override;
void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked) override;
private slots:
void updateCMDU();
private:
long int i, db, ub, dbt, ubt, dbt1, ubt1, dbt0, ubt0, tt0, idle0;
QPointer<CMDUWidget> m_centralWidget;
QPointer<QLabel> m_tipsLabel;
QTimer *m_refershTimer;
QSettings m_settings;
QString KB(long k);
QString BS(long b);
QString NB(long b);
QString startup;
//QLabel *labelStartupDuration;
void about();
void changelog();
void bootRecord();
void bootAnalyze();
};
#endif // CMDUPlugin_H