From 789ed99ffdeae638e9191ca99272e536f36f6934 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 29 Mar 2005 20:07:22 +0000 Subject: Added a lot of error detection stuff to the camera, player, encoder and decoder objects. --- src/mainwindow.cc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/mainwindow.cc') 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; } } -- cgit v1.2.3