File tree Expand file tree Collapse file tree 8 files changed +154
-2
lines changed Expand file tree Collapse file tree 8 files changed +154
-2
lines changed Original file line number Diff line number Diff line change 31
31
<item row =" 0" column =" 1" >
32
32
<widget class =" QLabel" name =" label_clients" >
33
33
<property name =" text" >
34
- <string >Clients</string >
34
+ <string >Clients (double click client for resource monitoring) </string >
35
35
</property >
36
36
</widget >
37
37
</item >
Original file line number Diff line number Diff line change @@ -27,6 +27,6 @@ void Resources::DeserializeJson(json resourcesJson)
27
27
memoryLoad = resourcesJson[" memoryLoad" ];
28
28
diskFreeSpacePercentage = resourcesJson[" diskFreeSpacePercentage" ];
29
29
cpuLoad = resourcesJson[" cpuLoad" ];
30
- processesMap= resourcesJson[" processesMap" ].get <std::map<int , std::string>>();
30
+ processesMap = resourcesJson[" processesMap" ].get <std::map<int , std::string>>();
31
31
updateLists ();
32
32
}
Original file line number Diff line number Diff line change
1
+ #include " runningprocesses.h"
2
+ #include " ui_runningprocesses.h"
3
+
4
+ RunningProcesses::RunningProcesses (QWidget *parent) :
5
+ QDialog(parent),
6
+ ui(new Ui::RunningProcesses)
7
+ {
8
+ ui->setupUi (this );
9
+ }
10
+
11
+ RunningProcesses::RunningProcesses (std::map<int , std::string> i_processesMap) :
12
+ QDialog(nullptr ),
13
+ ui(new Ui::RunningProcesses)
14
+ {
15
+ ui->setupUi (this );
16
+ processesMap = i_processesMap;
17
+ for (const auto & [key, value] : processesMap) {
18
+ ui->listWidgetProcesses ->addItem (QString::number (key) + " \t " + QString::fromStdString (value));
19
+ }
20
+ }
21
+
22
+ RunningProcesses::~RunningProcesses ()
23
+ {
24
+ delete ui;
25
+ }
Original file line number Diff line number Diff line change
1
+ #ifndef RUNNINGPROCESSES_H
2
+ #define RUNNINGPROCESSES_H
3
+
4
+ #include < QDialog>
5
+
6
+ namespace Ui {
7
+ class RunningProcesses ;
8
+ }
9
+
10
+ class RunningProcesses : public QDialog
11
+ {
12
+ Q_OBJECT
13
+
14
+ public:
15
+ explicit RunningProcesses (QWidget *parent = nullptr );
16
+ RunningProcesses (std::map<int , std::string> i_processesMap);
17
+ ~RunningProcesses ();
18
+
19
+ private:
20
+ Ui::RunningProcesses *ui;
21
+ std::map<int , std::string> processesMap;
22
+ };
23
+
24
+ #endif // RUNNINGPROCESSES_H
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <ui version =" 4.0" >
3
+ <class >RunningProcesses</class >
4
+ <widget class =" QDialog" name =" RunningProcesses" >
5
+ <property name =" geometry" >
6
+ <rect >
7
+ <x >0</x >
8
+ <y >0</y >
9
+ <width >488</width >
10
+ <height >587</height >
11
+ </rect >
12
+ </property >
13
+ <property name =" windowTitle" >
14
+ <string >Dialog</string >
15
+ </property >
16
+ <widget class =" QDialogButtonBox" name =" buttonBox" >
17
+ <property name =" geometry" >
18
+ <rect >
19
+ <x >120</x >
20
+ <y >550</y >
21
+ <width >341</width >
22
+ <height >32</height >
23
+ </rect >
24
+ </property >
25
+ <property name =" orientation" >
26
+ <enum >Qt::Horizontal</enum >
27
+ </property >
28
+ <property name =" standardButtons" >
29
+ <set >QDialogButtonBox::Close</set >
30
+ </property >
31
+ </widget >
32
+ <widget class =" QListWidget" name =" listWidgetProcesses" >
33
+ <property name =" geometry" >
34
+ <rect >
35
+ <x >20</x >
36
+ <y >10</y >
37
+ <width >441</width >
38
+ <height >531</height >
39
+ </rect >
40
+ </property >
41
+ </widget >
42
+ </widget >
43
+ <resources />
44
+ <connections >
45
+ <connection >
46
+ <sender >buttonBox</sender >
47
+ <signal >accepted()</signal >
48
+ <receiver >RunningProcesses</receiver >
49
+ <slot >accept()</slot >
50
+ <hints >
51
+ <hint type =" sourcelabel" >
52
+ <x >248</x >
53
+ <y >254</y >
54
+ </hint >
55
+ <hint type =" destinationlabel" >
56
+ <x >157</x >
57
+ <y >274</y >
58
+ </hint >
59
+ </hints >
60
+ </connection >
61
+ <connection >
62
+ <sender >buttonBox</sender >
63
+ <signal >rejected()</signal >
64
+ <receiver >RunningProcesses</receiver >
65
+ <slot >reject()</slot >
66
+ <hints >
67
+ <hint type =" sourcelabel" >
68
+ <x >316</x >
69
+ <y >260</y >
70
+ </hint >
71
+ <hint type =" destinationlabel" >
72
+ <x >286</x >
73
+ <y >274</y >
74
+ </hint >
75
+ </hints >
76
+ </connection >
77
+ </connections >
78
+ </ui >
Original file line number Diff line number Diff line change @@ -25,3 +25,11 @@ SelectedClient::~SelectedClient()
25
25
{
26
26
delete ui;
27
27
}
28
+
29
+ void SelectedClient::on_pushButtonProcesses_clicked ()
30
+ {
31
+ // <QTcpSocket*,Resources> resourcesSocketMap
32
+ RunningProcesses* p = new RunningProcesses (resources->getProcessesMap ());
33
+ p->show ();
34
+ }
35
+
Original file line number Diff line number Diff line change 3
3
4
4
#include < QDialog>
5
5
#include " resources.h"
6
+ #include " runningprocesses.h"
6
7
7
8
namespace Ui {
8
9
class SelectedClient ;
@@ -17,6 +18,9 @@ class SelectedClient : public QDialog
17
18
SelectedClient (Resources* r);
18
19
~SelectedClient ();
19
20
21
+ private slots:
22
+ void on_pushButtonProcesses_clicked ();
23
+
20
24
private:
21
25
Ui::SelectedClient *ui;
22
26
Resources* resources;
Original file line number Diff line number Diff line change 125
125
</item >
126
126
</layout >
127
127
</widget >
128
+ <widget class =" QPushButton" name =" pushButtonProcesses" >
129
+ <property name =" geometry" >
130
+ <rect >
131
+ <x >10</x >
132
+ <y >180</y >
133
+ <width >161</width >
134
+ <height >41</height >
135
+ </rect >
136
+ </property >
137
+ <property name =" text" >
138
+ <string >Show running processes</string >
139
+ </property >
140
+ </widget >
128
141
</widget >
129
142
<resources />
130
143
<connections >
You can’t perform that action at this time.
0 commit comments