diff options
Diffstat (limited to 'src/mainwindow.cc')
-rw-r--r-- | src/mainwindow.cc | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/mainwindow.cc b/src/mainwindow.cc index b26d6ce..869d5c3 100644 --- a/src/mainwindow.cc +++ b/src/mainwindow.cc @@ -90,7 +90,13 @@ MainWindow::MainWindow( QWidget* parent, const char* name ) createGui(); show(); - camera = new Camera(cfg.readString("server_addr")->c_str(), cfg.readInt("server_port")); + camera = new Camera(); + camera->connect(cfg.readString("server_addr")->c_str(), + cfg.readInt("server_port")); + + if(camera->hasError()) { + MessageBox(this, "", camera->getErrorString().c_str(), TYPE_OK, ICON_ERROR).exec(); + } recording = false; frozen = false; @@ -242,8 +248,20 @@ void MainWindow::logo_clicked() void MainWindow::cpr_clicked() { + { + // TODO: Save CPR and name, from the labels. + } + + // Create and call the CPRQueryDialog. CPRQueryDialog dlg(lbl_cpr, lbl_name, this, "CPRQueryDialog"); - printf("Cpr Dialog returned: %d\n", dlg.exec()); + + if(dlg.exec() == 0) { + printf("Cancel!\n"); + // TODO: Restore old CPR and name, in the labels. + } else { + printf("CPR changed\n"); + // TODO: Change CPR camera. + } } void MainWindow::rec_clicked() @@ -252,11 +270,11 @@ void MainWindow::rec_clicked() if(recording) { img_recedge->setBackgroundColor(red); btn_rec->setPixmap(*pix_stop); - camera->stop(); + camera->start(); } else { img_recedge->setBackgroundColor(QColor(160,160,160)); btn_rec->setPixmap(*pix_record); - camera->start(); + camera->stop(); } } |