From 3f4f5c8e919bd38f754bb13e4b097de349635c47 Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 2 May 2005 18:47:21 +0000 Subject: Cpr now sent to decoder. And saved prioer to editing, in order to be able to disable editing session and revert to old cpr. --- src/mainwindow.cc | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/src/mainwindow.cc b/src/mainwindow.cc index 1fd7b4a..f7ba33d 100644 --- a/src/mainwindow.cc +++ b/src/mainwindow.cc @@ -27,6 +27,11 @@ */ /* * $Log$ + * Revision 1.21 2005/05/02 18:47:21 deva + * + * Cpr now sent to decoder. And saved prioer to editing, in order to be able + * to disable editing session and revert to old cpr. + * * Revision 1.20 2005/05/01 12:17:41 deva * *** empty log message *** * @@ -56,6 +61,8 @@ #include #include #include +#include + #include #include @@ -172,8 +179,17 @@ void MainWindow::createGui() QGridLayout *g0 = new QGridLayout(this, 2, 2, 0, -1); QGridLayout *g1 = new QGridLayout(3, 4, -1); g0->addLayout(g1, 0, 0); - QGridLayout *g2 = new QGridLayout(1, NUM_HISTORY, -1); - g0->addLayout(g2, 0, 1); + + QGroupBox *gb = new QGroupBox(this); + // gb->setRows(NUM_HISTORY); + gb->setColumns(1); + // gb->setTitle("fisk"); + // QGridLayout *g2 = new QGridLayout(1, NUM_HISTORY, -1); + // QVBoxLayout *g2 = new QVBoxLayout(this); + // g0->addLayout(g2, 0, 1); + gb->setInsideMargin(25); + gb->setFlat(true); + g0->addWidget(gb, 0, 1); img_recedge = new QLabel(this); img_recedge->setBackgroundColor(QColor(160,160,160)); @@ -217,10 +233,11 @@ void MainWindow::createGui() // History widgets for(int i = 0; i < NUM_HISTORY; i++) { - img_history[i] = new QLabel(this); + img_history[i] = new QLabel(gb); img_history[i]->setPixmap(*pix_dummy); img_history[i]->setFixedSize(240,192); - g2->addWidget(img_history[i], i, 0, Qt::AlignHCenter); + // g2->addWidget(img_history[i], i, 0, Qt::AlignHCenter & Qt::AlignVCenter); + // g2->addWidget(img_history[i]); } // Statusbar @@ -270,18 +287,23 @@ void MainWindow::message(char *msg) void MainWindow::cpr_clicked() { - { - // TODO: Save CPR and name, from the labels. - } + char oldcpr[256]; + char oldname[256]; + + // Save CPR and name, from the labels. + strcpy(oldname, lbl_name->text().ascii()); + strcpy(oldcpr, lbl_cpr->text().ascii()); // Create and call the CPRQueryDialog. CPRQueryDialog dlg(lbl_cpr, lbl_name, this, TXT_CPRDLG_TITLE, status); if(dlg.exec() == 0) { - // TODO: Restore old CPR and name, in the labels. + // Restore old CPR and name, in the labels. + lbl_name->setText(oldname); + lbl_cpr->setText(oldcpr); } else { - // TODO: Change CPR camera. - camera->setCpr("fisk"); + // Change CPR camera. + camera->setCpr((char*)lbl_cpr->text().ascii()); } } -- cgit v1.2.3