diff options
author | deva <deva> | 2005-03-26 10:32:50 +0000 |
---|---|---|
committer | deva <deva> | 2005-03-26 10:32:50 +0000 |
commit | 63ac729b32331438a607ec5b8be046143c7592e6 (patch) | |
tree | 4f4606119fe178024ccd9b27a0e44757a572d3ad /src/mainwindow.cc | |
parent | 13149f3c34de4cad937b1866778030d540674a06 (diff) |
Added an error object for genereic error message handling.
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(); } } |