diff options
Diffstat (limited to 'src/mainwindow.cc')
-rw-r--r-- | src/mainwindow.cc | 53 |
1 files changed, 41 insertions, 12 deletions
diff --git a/src/mainwindow.cc b/src/mainwindow.cc index 1493506..0b1343e 100644 --- a/src/mainwindow.cc +++ b/src/mainwindow.cc @@ -31,6 +31,11 @@ /* * $Log$ + * Revision 1.33 2005/06/16 21:28:57 deva + * Rewrote thread object + * Fixed bug in mov_encoder (pushed read_sem too many times, whihc lead to + * growing server queue) + * * Revision 1.32 2005/06/15 08:41:49 deva * *** empty log message *** * @@ -119,7 +124,7 @@ MainWindow::MainWindow(QApplication *qApp, QWidget* parent, const char* name ) { info = new InfoGui(qApp, this, config); - info->log("Starting MIaV."); + info->log("Starting MIaV v. %s.", VERSION); video_width = config->readInt("video_width"); video_height = config->readInt("video_height"); @@ -254,17 +259,17 @@ void MainWindow::createGui() btn_cpr->setPixmap(*pix_cpr); QObject::connect( btn_cpr, SIGNAL(clicked()), this, SLOT(cpr_clicked()) ); // Will also be connected in the MGUI code - g1->addWidget(btn_cpr, 1, 1); + g1->addWidget(btn_cpr, 1, 2); lbl_name = createLabel("", 18, 2); g1->addMultiCellWidget ( lbl_name, 2, 2, 0, 2); - +/* btn_clear = createButton("Clear", 8, 3); // btn_clear->setPixmap(*pix_clear); QObject::connect( btn_clear, SIGNAL(clicked()), this, SLOT(clear_clicked()) ); // Will also be connected in the MGUI code g1->addWidget(btn_clear, 1, 2); - +*/ // Rec + Shot + Freeze buttons btn_rec = createButton("", 8, 3); btn_rec->setPixmap(*pix_record); @@ -292,6 +297,16 @@ void MainWindow::createGui() // g2->addWidget(img_history[i]); } + // FIXME: Create button like the other buttons + btn_clear = new QPushButton("Clear", gb); + btn_clear->setFont( QFont( "Arial", (int)(unit * 3 / 2), QFont::Bold ) ); + btn_clear->setFixedHeight((int)(unit * 3)); + + // btn_clear->setPixmap(*pix_clear); + QObject::connect( btn_clear, SIGNAL(clicked()), this, SLOT(clear_clicked()) ); + // Will also be connected in the MGUI code + + // Statusbar status = new QStatusBar(this); status->setSizeGripEnabled(FALSE); @@ -378,21 +393,28 @@ void MainWindow::message(char *msg) info->log("Message: %s", msg); } -void MainWindow::clear_clicked() +void MainWindow::clear() { info->log("Clearing screen."); + // History widgets + QImage dummy_resized = pix_dummy->smoothScale(240, 192); + + for(int i = 0; i < NUM_HISTORY; i++) { + img_history[i]->setPixmap(dummy_resized); + } + + lbl_name->setText(""); + lbl_cpr->setText(""); +} + +void MainWindow::clear_clicked() +{ if(MessageBox(this, TXT_ASK_CLEAR_SCREEN_TITLE, TXT_ASK_CLEAR_SCREEN, TYPE_YES_NO, ICON_QUESTION).exec() == MSG_YES) { - - // History widgets - QImage dummy_resized = pix_dummy->smoothScale(240, 192); - - for(int i = 0; i < NUM_HISTORY; i++) { - img_history[i]->setPixmap(dummy_resized); - } + clear(); } } @@ -416,6 +438,8 @@ void MainWindow::cpr_clicked() strcpy(oldname, lbl_name->text().ascii()); strcpy(oldcpr, lbl_cpr->text().ascii()); + clear(); + // Create and call the CPRQueryDialog. CPRQueryDialog dlg(lbl_cpr, lbl_name, this, TXT_CPRDLG_TITLE, status); @@ -427,6 +451,11 @@ void MainWindow::cpr_clicked() } else { // Change CPR camera. info->log("New CPR %s (old %s).", (char*)lbl_cpr->text().ascii(), oldcpr); + strcpy(oldname, lbl_name->text().ascii()); + strcpy(oldcpr, lbl_cpr->text().ascii()); + clear(); + lbl_name->setText(oldname); + lbl_cpr->setText(oldcpr); camera->setCpr((char*)lbl_cpr->text().ascii()); } } |