From 9ba471ac654ff18178723ef0a84c46a03fa20b6f Mon Sep 17 00:00:00 2001 From: senator Date: Tue, 12 Oct 2010 10:18:28 +0000 Subject: added launcher if no cpr specified on command line --- client/client.pro | 2 ++ client/launcherwindow.cc | 6 +++--- client/launcherwindow.h | 2 +- client/pracro.cc | 12 ++++++++++++ 4 files changed, 18 insertions(+), 4 deletions(-) (limited to 'client') diff --git a/client/client.pro b/client/client.pro index 46d0a03..7b9704d 100644 --- a/client/client.pro +++ b/client/client.pro @@ -35,6 +35,7 @@ unix { HEADERS += \ collapser.h \ debug.h \ + launcherwindow.h \ lua.h \ luadb.h \ luawidget.h \ @@ -71,6 +72,7 @@ SOURCES += \ pracro.cc \ collapser.cc \ debug.cc \ + launcherwindow.cc \ lua.cc \ luadb.cc \ luawidget.cc \ diff --git a/client/launcherwindow.cc b/client/launcherwindow.cc index 1a18602..d2d5436 100644 --- a/client/launcherwindow.cc +++ b/client/launcherwindow.cc @@ -49,8 +49,8 @@ LauncherWindow::LauncherWindow(QWidget *parent) } */ QLabel *cprLabel = new QLabel("Patient CPR:"); - cpr = new QLineEdit(); - cpr->setValidator(new QRegExpValidator(QRegExp("^[0-9]{10,10}$"), this)); + cprLineEdit = new QLineEdit(); + cprLineEdit->setValidator(new QRegExpValidator(QRegExp("^[0-9]{10,10}$"), this)); QPushButton *ok = new QPushButton("Ok"); connect(ok, SIGNAL(clicked()), this, SLOT(accept())); @@ -63,7 +63,7 @@ LauncherWindow::LauncherWindow(QWidget *parent) layout->addWidget(user, 1, 2, 1, 2); */ layout->addWidget(cprLabel, 2, 1); - layout->addWidget(cpr, 2, 2, 1, 2); + layout->addWidget(cprLineEdit, 2, 2, 1, 2); layout->addWidget(ok, 3, 2); layout->addWidget(cancel, 3, 3); diff --git a/client/launcherwindow.h b/client/launcherwindow.h index 9f18aa0..0bb9d88 100644 --- a/client/launcherwindow.h +++ b/client/launcherwindow.h @@ -28,7 +28,7 @@ #ifndef __PRACRO_LAUNCHERWINDOW_H__ #define __PRACRO_LAUNCHERWINDOW_H__ -#include +#include #include class LauncherWindow : public QDialog diff --git a/client/pracro.cc b/client/pracro.cc index a3c56ff..c02af93 100644 --- a/client/pracro.cc +++ b/client/pracro.cc @@ -37,6 +37,7 @@ #include "netcom.h" #include "mainwindow.h" +#include "launcherwindow.h" #include "viewer.h" #include "debug.h" @@ -177,6 +178,15 @@ int main(int argc, char *argv[]) QFont f = fontdb.font("Bitstream Vera Sans Mono", "", 8); fixedfont = &f; + if(cpr == CPR_DEFAULT) { + LauncherWindow lwnd; + if(lwnd.exec() == QDialog::Accepted) { + cpr = lwnd.cpr(); + } else { + return 1; + } + } + if(show_editor && show_viewer) { MainWindow mainwindow(cpr, templ, host, port, user); mainwindow.show(); @@ -204,4 +214,6 @@ int main(int argc, char *argv[]) return 1; } + + #endif/*TESTING*/ -- cgit v1.2.3