summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorsenator <senator>2010-10-12 10:18:28 +0000
committersenator <senator>2010-10-12 10:18:28 +0000
commit9ba471ac654ff18178723ef0a84c46a03fa20b6f (patch)
tree9cdd3fd24f4498e1e4899538f7c5b8c1dd4209ab /client
parentda99c66b024032122bb0ff7bf2084f05a82c3668 (diff)
added launcher if no cpr specified on command line
Diffstat (limited to 'client')
-rw-r--r--client/client.pro2
-rw-r--r--client/launcherwindow.cc6
-rw-r--r--client/launcherwindow.h2
-rw-r--r--client/pracro.cc12
4 files changed, 18 insertions, 4 deletions
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 <QtGui/QDialog>
+#include <QDialog>
#include <QLineEdit>
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*/