summaryrefslogtreecommitdiff
path: root/src/mainwindow.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow.cc')
-rw-r--r--src/mainwindow.cc59
1 files changed, 16 insertions, 43 deletions
diff --git a/src/mainwindow.cc b/src/mainwindow.cc
index 8164981..dc5b5e2 100644
--- a/src/mainwindow.cc
+++ b/src/mainwindow.cc
@@ -50,10 +50,6 @@
MainWindow::MainWindow( QWidget* parent, const char* name )
: QWidget( parent, name, WStyle_Customize | WStyle_NoBorder )
{
- // statusBar();
- // statusBar()->message("fisk");
- // statusBar()->setSizeGripEnabled(false);
-
MiavConfig cfg("miav.conf");
int resolution_w = cfg.readInt("pixel_width");
int resolution_h = cfg.readInt("pixel_height");
@@ -64,7 +60,7 @@ MainWindow::MainWindow( QWidget* parent, const char* name )
// Load images
pix_record = new QPixmap();
- pix_record->load( "record.png" );
+ pix_record->load( PIXMAPS"/record.png" );
/*
QPainter *paint = new QPainter();
QPicture *pic = new QPicture();
@@ -76,16 +72,16 @@ MainWindow::MainWindow( QWidget* parent, const char* name )
*/
pix_stop = new QPixmap();
- pix_stop->load( "stop.png" );
+ pix_stop->load( PIXMAPS"/stop.png" );
pix_camera = new QPixmap();
- pix_camera->load( "camera.png" );
+ pix_camera->load( PIXMAPS"/camera.png" );
pix_dummy = new QPixmap();
- pix_dummy->load( "dummy.png" );
+ pix_dummy->load( PIXMAPS"/dummy.png" );
pix_logo = new QPixmap();
- pix_logo->load( "miav-logo-64x64.png" );
+ pix_logo->load( PIXMAPS"/miav-logo-64x64.png" );
createGui();
show();
@@ -102,8 +98,6 @@ MainWindow::MainWindow( QWidget* parent, const char* name )
recording = false;
frozen = false;
- aboutwindow = NULL;
-
// Open the CPR Dialog
cpr_clicked();
}
@@ -112,7 +106,6 @@ MainWindow::~MainWindow()
{
if(camera) delete camera;
delete btn_cpr;
- if(aboutwindow) delete aboutwindow;
}
void MainWindow::createGui()
@@ -157,7 +150,7 @@ void MainWindow::createGui()
g1->addMultiCellWidget ( img_recedge, 0, 0, 0, 2, Qt::AlignHCenter);
// CPR/NAME LABEL + CPR button
- lbl_cpr = createLabel("200379-1613", 18, 3);
+ lbl_cpr = createLabel("", 18, 3);
g1->addMultiCellWidget ( lbl_cpr, 1, 1, 0, 1);
btn_cpr = createButton("NYT CPR", 8, 3);
@@ -166,7 +159,7 @@ void MainWindow::createGui()
// Will also be connected in the MGUI code
g1->addWidget(btn_cpr, 1, 2);
- lbl_name = createLabel("Bent Bisballe Kjær Nyeng Jensen", 18, 2);
+ lbl_name = createLabel("", 18, 2);
g1->addMultiCellWidget ( lbl_name, 2, 2, 0, 2);
// Rec + Shot + Freeze buttons
@@ -194,29 +187,15 @@ void MainWindow::createGui()
}
// Statusbar
- lbl_status = createLabel("STATUS", 18, 1);
- lbl_status->setFrameStyle(QFrame::TabWidgetPanel | QFrame::Sunken);
- lbl_status->setLineWidth(1);
- g0->addWidget(lbl_status, 4, 0);
+ status = new QStatusBar(this);
+ status->setSizeGripEnabled(FALSE);
+ g0->addMultiCellWidget(status, 4, 4, 0, 1);
lbl_version = createLabel("MIaV-Grab v" VERSION, 18, 1);
- lbl_version->setFrameStyle(QFrame::TabWidgetPanel | QFrame::Sunken);
- lbl_version->setLineWidth(1);
- lbl_version->setFixedHeight((int)unit);
- g0->addWidget(lbl_version, 4, 1);
-
- /* // About icon
- btn_logo = new QPushButton("", this);
- btn_logo->setPixmap(*pix_logo);
- btn_logo->setFixedSize(74,74);
- btn_logo->move(940,10);
- btn_logo->setFlat(true);
- QObject::connect( btn_logo, SIGNAL(clicked()), this, SLOT(logo_clicked()) );
- */
- //lbl_version->setFont( QFont( "Arial", 8, QFont::Light ) );
- //lbl_version->setFixedSize(90,10);
- //lbl_version->move(928,81);
+ lbl_version->setFixedWidth(300);
+ status->addWidget(lbl_version, 0, TRUE);
+ status->message("Klar...");
}
QPushButton *MainWindow::createButton(char *caption, int width, int height)
@@ -237,14 +216,8 @@ QLabel *MainWindow::createLabel(char *caption, int width, int height)
void MainWindow::message(char *msg)
{
- lbl_status->setText(msg);
-}
-
-void MainWindow::logo_clicked()
-{
- if(aboutwindow)
- delete aboutwindow;
- aboutwindow = new AboutWindow(0, "About MIAV-Grab");
+ // lbl_status->setText(msg);
+ status->message(msg);
}
void MainWindow::cpr_clicked()
@@ -254,7 +227,7 @@ void MainWindow::cpr_clicked()
}
// Create and call the CPRQueryDialog.
- CPRQueryDialog dlg(lbl_cpr, lbl_name, this, "CPRQueryDialog");
+ CPRQueryDialog dlg(lbl_cpr, lbl_name, this, "CPRQueryDialog", status);
if(dlg.exec() == 0) {
printf("Cancel!\n");