summaryrefslogtreecommitdiff
path: root/client/mainwindow.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/mainwindow.cc')
-rw-r--r--client/mainwindow.cc37
1 files changed, 35 insertions, 2 deletions
diff --git a/client/mainwindow.cc b/client/mainwindow.cc
index 0e7270d..a158c09 100644
--- a/client/mainwindow.cc
+++ b/client/mainwindow.cc
@@ -133,7 +133,22 @@ MainWindow::MainWindow(Decoder *d)
// Create statusbar
statusbar = new QStatusBar(this);
outerlayout->addWidget(statusbar, 1,0, 1,1);
- statusbar->showMessage("Ready!");
+
+ server_diskspace = new QProgressBar(statusbar);
+ server_diskspace->setRange(0, 100);
+ server_diskspace->setValue(0);
+
+ server_load = new QProgressBar(statusbar);
+ server_load->setRange(0, 100);
+ server_load->setValue(0);
+
+ messagefield = new QLabel(statusbar);
+
+ statusbar->addWidget(messagefield, 80);
+ statusbar->addWidget(server_diskspace, 10);
+ statusbar->addWidget(server_load, 10);
+
+ // statusbar->showMessage("Ready!");
startTimer(100);
show();
@@ -163,7 +178,25 @@ void MainWindow::timerEvent(QTimerEvent *event)
statusmsg.prepend(next);
}
- statusbar->showMessage(statusmsg);
+ messagefield->setText(statusmsg);
+
+ if(s.server_diskspace_max != 0xffffffff) {
+ server_diskspace->setRange(0, s.server_diskspace_max);
+ server_diskspace->setValue(s.server_diskspace);
+ server_diskspace->setEnabled(true);
+ } else {
+ server_diskspace->setRange(0, 0);
+ server_diskspace->setEnabled(false);
+ }
+
+ if(s.server_load_max != 0xffffffff) {
+ server_load->setRange(0, s.server_load_max);
+ server_load->setValue(s.server_load);
+ server_load->setEnabled(true);
+ } else {
+ server_load->setRange(0, 0);
+ server_load->setEnabled(false);
+ }
}