summaryrefslogtreecommitdiff
path: root/src/mainwindow.cc
diff options
context:
space:
mode:
authordeva <deva>2005-03-29 21:02:39 +0000
committerdeva <deva>2005-03-29 21:02:39 +0000
commit5023167ffc89c413eede025a1984edf12d3784bb (patch)
tree5f1c4ff4ac443c69942745786c9f2006deea2005 /src/mainwindow.cc
parent0e00efae89cd5a9bde70088b3ca51cbfba94d234 (diff)
Added text defines and pixmap defines.
Added new icons.
Diffstat (limited to 'src/mainwindow.cc')
-rw-r--r--src/mainwindow.cc54
1 files changed, 34 insertions, 20 deletions
diff --git a/src/mainwindow.cc b/src/mainwindow.cc
index 212dfe7..5da340b 100644
--- a/src/mainwindow.cc
+++ b/src/mainwindow.cc
@@ -59,8 +59,6 @@ MainWindow::MainWindow( QWidget* parent, const char* name )
resize(resolution_w, resolution_h);
// Load images
- pix_record = new QPixmap();
- pix_record->load( PIXMAPS"/record.png" );
/*
QPainter *paint = new QPainter();
QPicture *pic = new QPicture();
@@ -71,17 +69,29 @@ MainWindow::MainWindow( QWidget* parent, const char* name )
paint->end();
*/
+ pix_record = new QPixmap();
+ pix_record->load( PIXMAP_RECORD );
+
pix_stop = new QPixmap();
- pix_stop->load( PIXMAPS"/stop.png" );
+ pix_stop->load( PIXMAP_STOP );
+
+ pix_freeze = new QPixmap();
+ pix_freeze->load( PIXMAP_FREEZE );
- pix_camera = new QPixmap();
- pix_camera->load( PIXMAPS"/camera.png" );
+ pix_unfreeze = new QPixmap();
+ pix_unfreeze->load( PIXMAP_UNFREEZE );
+
+ pix_cpr = new QPixmap();
+ pix_cpr->load( PIXMAP_CPR );
+
+ pix_snapshot = new QPixmap();
+ pix_snapshot->load( PIXMAP_SNAPSHOT );
pix_dummy = new QPixmap();
- pix_dummy->load( PIXMAPS"/dummy.png" );
+ pix_dummy->load( PIXMAP_DUMMY );
pix_logo = new QPixmap();
- pix_logo->load( PIXMAPS"/miav-logo-64x64.png" );
+ pix_logo->load( PIXMAP_LOGO_SMALL );
createGui();
show();
@@ -92,7 +102,7 @@ MainWindow::MainWindow( QWidget* parent, const char* name )
cam_error = camera->errorObject();
while(cam_error->hasError()) {
- MessageBox(this, "", cam_error->popErrorString().c_str(),
+ MessageBox(this, TXT_ERROR_TITLE, cam_error->popErrorString().c_str(),
TYPE_OK, ICON_ERROR).exec();
}
@@ -134,10 +144,10 @@ void MainWindow::createGui()
* |______________________________|__________________|
*/
- QGridLayout *g0 = new QGridLayout(this, 2, 2, 0, -1, "g0");
- QGridLayout *g1 = new QGridLayout(3, 4, -1, "g1");
+ 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, "g2");
+ QGridLayout *g2 = new QGridLayout(1, NUM_HISTORY, -1);
g0->addLayout(g2, 0, 1);
img_recedge = new QLabel(this);
@@ -154,8 +164,9 @@ void MainWindow::createGui()
lbl_cpr = createLabel("", 18, 3);
g1->addMultiCellWidget ( lbl_cpr, 1, 1, 0, 1);
- btn_cpr = createButton("NYT CPR", 8, 3);
+ btn_cpr = createButton("", 8, 3);
btn_cpr->setFocus();
+ 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, 2);
@@ -170,12 +181,12 @@ void MainWindow::createGui()
g1->addWidget(btn_rec, 3, 0);
btn_shoot = createButton("", 8, 3);
- btn_shoot->setPixmap(*pix_camera);
+ btn_shoot->setPixmap(*pix_snapshot);
QObject::connect( btn_shoot, SIGNAL(clicked()), this, SLOT(shoot_clicked()) );
g1->addWidget(btn_shoot, 3, 1);
- btn_freeze = createButton("FREEZE", 8, 3);
- // btn_freeze->setPixmap(*pix_logo);
+ btn_freeze = createButton("", 8, 3);
+ btn_freeze->setPixmap(*pix_freeze);
QObject::connect( btn_freeze, SIGNAL(clicked()), this, SLOT(freeze_clicked()) );
g1->addWidget(btn_freeze, 3, 2);
@@ -196,7 +207,7 @@ void MainWindow::createGui()
lbl_version->setFixedWidth(300);
status->addWidget(lbl_version, 0, TRUE);
- status->message("Klar...");
+ status->message( TXT_READY );
}
QPushButton *MainWindow::createButton(char *caption, int width, int height)
@@ -228,13 +239,11 @@ void MainWindow::cpr_clicked()
}
// Create and call the CPRQueryDialog.
- CPRQueryDialog dlg(lbl_cpr, lbl_name, this, "CPRQueryDialog", status);
+ CPRQueryDialog dlg(lbl_cpr, lbl_name, this, TXT_CPRDLG_TITLE, status);
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.
}
}
@@ -242,7 +251,7 @@ void MainWindow::cpr_clicked()
void MainWindow::checkErrors()
{
while(cam_error->hasError()) {
- MessageBox(this, "", cam_error->popErrorString().c_str(),
+ MessageBox(this, TXT_ERROR_TITLE, cam_error->popErrorString().c_str(),
TYPE_OK, ICON_ERROR).exec();
}
}
@@ -282,6 +291,7 @@ void MainWindow::shoot_clicked()
if(frozen) {
camera->unfreeze();
+ btn_freeze->setPixmap(*pix_freeze);
checkErrors();
btn_freeze->setOn(false);
frozen = false;
@@ -292,11 +302,15 @@ void MainWindow::freeze_clicked()
{
if(frozen) {
camera->unfreeze();
+ btn_freeze->setPixmap(*pix_freeze);
checkErrors();
+ btn_freeze->setOn(false);
frozen = false;
} else {
camera->freeze();
+ btn_freeze->setPixmap(*pix_unfreeze);
checkErrors();
+ btn_freeze->setOn(true);
frozen = true;
}
}