aboutsummaryrefslogtreecommitdiffstats
path: root/app/taskmanager.cpp
diff options
context:
space:
mode:
authorVitaly Wool <vitaly.wool@konsulko.com>2019-03-03 23:00:06 +0100
committerVitaly Wool <vitaly.wool@konsulko.com>2019-03-03 23:00:06 +0100
commit122bcc295d054a733585996e859dea870ba5ca88 (patch)
tree0fdd2137bc73be984e0e182a81cebfa7fc2b2ae4 /app/taskmanager.cpp
parente5c3f28f53eeef478d19a39b32dc7405efa46ef9 (diff)
Add extraInfo processing
Implement processing of user request for extra info for a selected process and show a pop-up with the information returned by the back-end. Change-Id: Ief4e18d561e83877d57f984d8db3163c1cd314ac Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.com>
Diffstat (limited to 'app/taskmanager.cpp')
-rw-r--r--app/taskmanager.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/app/taskmanager.cpp b/app/taskmanager.cpp
index 3b0d1e7..ece6d83 100644
--- a/app/taskmanager.cpp
+++ b/app/taskmanager.cpp
@@ -33,6 +33,10 @@ void TaskManager::kill(int tid) {
callService("kill_process", QJsonValue(tid));
}
+void TaskManager::getExtraInfo(int tid) {
+ callService("get_extra_info", QJsonValue(tid));
+}
+
void TaskManager::query() {
callService("get_process_list",
QJsonValue(QJsonObject({{"processes", QJsonValue()}})));
@@ -63,6 +67,10 @@ void TaskManager::ProcessResponse(Message *message)
QJsonArray processes = message->replyData()["processes"].toArray();
ProcessResponseTasklist(processes);
}
+ if (QString::compare(msgType, "extraInfo") == 0) {
+ QJsonObject info = message->replyData()["info"].toObject();
+ ProcessResponseExtraInfo(info);
+ }
// more response types to follow
}
@@ -119,3 +127,20 @@ void TaskManager::ProcessResponseTasklist(QJsonArray& processes)
}
m_procinfos = procs;
}
+
+void TaskManager::ProcessResponseExtraInfo(QJsonObject &info)
+{
+ QString infoString;
+
+ if (info.size() == 0) {
+ // this is not a valid process list response
+ QTextStream(&infoString) << "procces is not available";
+ } else {
+ infoString = "Task : " + info["cmd"].toString() + "\n"
+ + "Exec start : " + info["exec_start"].toString() + "\n"
+ + "Exec runtime : " + info["vruntime"].toString() + "\n"
+ + "Prio : " + info["prio"].toString();
+ }
+
+ emit showProcessInfo(infoString);
+}