~feng-kylin/youker-assistant/youker-assistant

« back to all changes in this revision

Viewing changes to plugins/systemmonitor/systemmonitor.h

  • Committer: lixiang
  • Date: 2018-03-06 03:13:06 UTC
  • Revision ID: lixiang@kylinos.cn-20180306031306-fd7qnru3vm4a1xjd
Rewrite with Qt5, and add system monitor

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2013 ~ 2018 National University of Defense Technology(NUDT) & Tianjin Kylin Ltd.
 
3
 *
 
4
 * Authors:
 
5
 *  Kobe Lee    xiangli@ubuntukylin.com/kobe24_lixiang@126.com
 
6
 *
 
7
 * This program is free software; you can redistribute it and/or modify
 
8
 * it under the terms of the GNU General Public License as published by
 
9
 * the Free Software Foundation; version 3.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
 */
 
19
 
 
20
#ifndef SYSTEMMONITOR_H
 
21
#define SYSTEMMONITOR_H
 
22
 
 
23
#include "monitortitlewidget.h"
 
24
#include "processdialog.h"
 
25
#include "resourcesdialog.h"
 
26
#include "filesystemdialog.h"
 
27
 
 
28
#include <QFrame>
 
29
#include <QStackedWidget>
 
30
#include <QLabel>
 
31
#include <QSettings>
 
32
 
 
33
class SystemMonitor : public QFrame
 
34
{
 
35
    Q_OBJECT
 
36
 
 
37
public:
 
38
    SystemMonitor(QWidget *parent = 0);
 
39
    ~SystemMonitor();
 
40
 
 
41
    void initTitleWidget();
 
42
    void initPanelStack();
 
43
    void initConnections();
 
44
 
 
45
    QList<bool> getReadyDisplayProcessColumns();
 
46
    bool isSortOrNot();
 
47
    int getCurrentSortColumnIndex();
 
48
 
 
49
    QList<bool> getReadyDisplayFileSysColumns();
 
50
 
 
51
    void moveCenter();
 
52
 
 
53
public slots:
 
54
    void recordProcessVisibleColumn(int, bool, QList<bool> columnVisible);
 
55
    void recordSortStatus(int index, bool isSort);
 
56
    void recordFileSysVisibleColumn(int, bool, QList<bool> columnVisible);
 
57
    void onChangePage(int index);
 
58
 
 
59
protected:
 
60
    void resizeEvent(QResizeEvent *e) override;
 
61
//    void paintEvent(QPaintEvent *);
 
62
    void closeEvent(QCloseEvent *event);
 
63
    void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
 
64
    void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
 
65
    void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
 
66
 
 
67
private:
 
68
    QStackedWidget  *m_sysMonitorStack = nullptr;
 
69
    MonitorTitleWidget  *m_titleWidget = nullptr;
 
70
//    ToolBar *m_toolBar = nullptr;
 
71
    ProcessDialog *process_dialog = nullptr;
 
72
    ResouresDialog *resources_dialog = nullptr;
 
73
    FileSystemDialog *filesystem_dialog = nullptr;
 
74
    QSettings *proSettings;
 
75
 
 
76
    QPoint dragPosition;
 
77
    bool mousePressed;
 
78
};
 
79
 
 
80
#endif // SYSTEMMONITOR_H