diff options
author | deva <deva> | 2005-03-29 20:07:22 +0000 |
---|---|---|
committer | deva <deva> | 2005-03-29 20:07:22 +0000 |
commit | 789ed99ffdeae638e9191ca99272e536f36f6934 (patch) | |
tree | 29c884d1a6838cbdfc46feb6fb81da7a003f5eec /src/mainwindow.cc | |
parent | 8baab8060621a4d219b84b14677990047ff0bf26 (diff) |
Added a lot of error detection stuff to the camera, player, encoder and decoder objects.
Diffstat (limited to 'src/mainwindow.cc')
-rw-r--r-- | src/mainwindow.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mainwindow.cc b/src/mainwindow.cc index dc5b5e2..212dfe7 100644 --- a/src/mainwindow.cc +++ b/src/mainwindow.cc @@ -92,7 +92,8 @@ MainWindow::MainWindow( QWidget* parent, const char* name ) cam_error = camera->errorObject(); while(cam_error->hasError()) { - MessageBox(this, "", cam_error->popErrorString().c_str(), TYPE_OK, ICON_ERROR).exec(); + MessageBox(this, "", cam_error->popErrorString().c_str(), + TYPE_OK, ICON_ERROR).exec(); } recording = false; @@ -238,6 +239,14 @@ void MainWindow::cpr_clicked() } } +void MainWindow::checkErrors() +{ + while(cam_error->hasError()) { + MessageBox(this, "", cam_error->popErrorString().c_str(), + TYPE_OK, ICON_ERROR).exec(); + } +} + void MainWindow::rec_clicked() { recording = 1 - recording; @@ -245,10 +254,12 @@ void MainWindow::rec_clicked() img_recedge->setBackgroundColor(red); btn_rec->setPixmap(*pix_stop); camera->start(); + checkErrors(); } else { img_recedge->setBackgroundColor(QColor(160,160,160)); btn_rec->setPixmap(*pix_record); camera->stop(); + checkErrors(); } } @@ -257,6 +268,7 @@ void MainWindow::shoot_clicked() QImage image; camera->snapshot(); + checkErrors(); image = img_live->getScreenshot(); image = image.smoothScale(img_history[0]->width(), img_history[0]->height()); @@ -270,6 +282,7 @@ void MainWindow::shoot_clicked() if(frozen) { camera->unfreeze(); + checkErrors(); btn_freeze->setOn(false); frozen = false; } @@ -279,9 +292,11 @@ void MainWindow::freeze_clicked() { if(frozen) { camera->unfreeze(); + checkErrors(); frozen = false; } else { camera->freeze(); + checkErrors(); frozen = true; } } |