diff options
Diffstat (limited to 'client/mainwindow.cc')
-rw-r--r-- | client/mainwindow.cc | 52 |
1 files changed, 4 insertions, 48 deletions
diff --git a/client/mainwindow.cc b/client/mainwindow.cc index a158c09..88eae63 100644 --- a/client/mainwindow.cc +++ b/client/mainwindow.cc @@ -131,25 +131,10 @@ MainWindow::MainWindow(Decoder *d) layout->addWidget(history, 0,4, 3,1); // Create statusbar - statusbar = new QStatusBar(this); + statusbar = new StatusBar(this, decoder); outerlayout->addWidget(statusbar, 1,0, 1,1); - 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); + statusbar->message("Ready"); show(); // setWindowState(Qt::WindowFullScreen); @@ -167,37 +152,6 @@ MainWindow::~MainWindow() MIaV::info->log("MIaV is shut down."); } -void MainWindow::timerEvent(QTimerEvent *event) -{ - Status s = decoder->status(); - QString statusmsg; - - for(int cnt = 0; cnt < s.queue_sizes.size(); cnt++) { - QString next; - next.sprintf("(%d)", s.queue_sizes[cnt]); - statusmsg.prepend(next); - } - - 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); - } -} void MainWindow::about_clicked() @@ -220,9 +174,11 @@ void MainWindow::record_clicked() if(MIaV::control.isRecording()) { MIaV::control.stop(); btn_record->setIcon(*Icons::record); + statusbar->message("Stopped"); } else { MIaV::control.record(); btn_record->setIcon(*Icons::stop); + statusbar->message("Recording"); } } |