diff options
Diffstat (limited to 'app/taskmanager.cpp')
-rw-r--r-- | app/taskmanager.cpp | 25 |
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); +} |