diff options
author | Vitaly Wool <vitaly.wool@konsulko.com> | 2018-11-27 08:49:32 +0100 |
---|---|---|
committer | Vitaly Wool <vitaly.wool@konsulko.com> | 2018-11-28 16:51:21 +0100 |
commit | f52f93fa42ffc213653e4772acedfcf849707ce8 (patch) | |
tree | 409bb47397fd5fb104cc53d2df868898f0eef714 /app/taskmanager.h | |
parent | 49364e7ea0df798a48c7b671821f63401b6c7798 (diff) |
Initial commit
Add Task Manager GUI.
Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.com>
Change-Id: I56d9a34df38fb441b598d150e88c905db95346aa
Diffstat (limited to 'app/taskmanager.h')
-rw-r--r-- | app/taskmanager.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/app/taskmanager.h b/app/taskmanager.h new file mode 100644 index 0000000..08d0027 --- /dev/null +++ b/app/taskmanager.h @@ -0,0 +1,40 @@ +#include <QObject> +#include <QString> +#include <QSharedPointer> +#include <QStringList> +#include <QVector> +#include <QtCore> +#include <QWebSocket> +#include "procinfo.h" + +#ifndef TASKMANAGER_H +#define TASKMANAGER_H + +class TaskManager : public QObject +{ + Q_OBJECT + +public: + explicit TaskManager(QObject* parent = nullptr); + + Q_INVOKABLE void open(const QUrl& url); + QTimer *timer; + +signals: + void updateProcess(const QString& cmd_, int tid_, int euid_, double scpu_, double ucpu_, double resident_memory_, const QString& state_); + void addProcess(const QString& cmd_, int tid_, int euid_, double scpu_, double ucpu_, double resident_memory_, const QString& state_); + void removeProcess(int tid_); + +private slots: + void callService(); + void onSocketTextReceived(QString msg); + +private: + QWebSocket m_socket; + int m_nextCallId; + std::vector<ProcInfo> m_procinfos; + + void ProcessResponse(bool r, const QJsonValue &val); +}; + +#endif // TASKMANAGER_H |