summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorsenator <senator>2010-10-12 12:18:26 +0000
committersenator <senator>2010-10-12 12:18:26 +0000
commit159d4a25168090718d30965f8ab3d9eadb701c46 (patch)
tree8da6c8bc0f0f3e3e91fddaa201770f8ca72e1115 /client
parent9ba471ac654ff18178723ef0a84c46a03fa20b6f (diff)
added template functionality, not done but i need to continue work on a windows pc so i will commit anyways
Diffstat (limited to 'client')
-rw-r--r--client/launcherwindow.cc24
-rw-r--r--client/launcherwindow.h7
-rw-r--r--client/pracro.cc9
3 files changed, 28 insertions, 12 deletions
diff --git a/client/launcherwindow.cc b/client/launcherwindow.cc
index d2d5436..cea9b72 100644
--- a/client/launcherwindow.cc
+++ b/client/launcherwindow.cc
@@ -31,7 +31,7 @@
#include <QPushButton>
#include "launcherwindow.h"
-LauncherWindow::LauncherWindow(QWidget *parent)
+LauncherWindow::LauncherWindow(QString cpr, QString templ, QWidget *parent)
: QDialog(parent)
{
setWindowTitle("Pracro Starter");
@@ -52,16 +52,23 @@ LauncherWindow::LauncherWindow(QWidget *parent)
cprLineEdit = new QLineEdit();
cprLineEdit->setValidator(new QRegExpValidator(QRegExp("^[0-9]{10,10}$"), this));
+ QLabel *templatesLabel = new QLabel("Template:");
+ templates = new QComboBox();
+ templates->addItem("Refraktiv kirurgi: Forundersøgelse",
+ "ref_forunders");
+ templates->addItem("Refraktiv kirurgi: Førstedagskontrol",
+ "ref_foerstedagskontrol");
+ templates->addItem("Refraktiv kirurgi: Efterkontrol",
+ "ref_efterkontrol");
+
QPushButton *ok = new QPushButton("Ok");
connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
QPushButton *cancel = new QPushButton("Annuller");
connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
QGridLayout *layout = new QGridLayout();
- /*
- layout->addWidget(userLabel, 1, 1);
- layout->addWidget(user, 1, 2, 1, 2);
- */
+ layout->addWidget(templatesLabel, 1, 1);
+ layout->addWidget(templates, 1, 2, 1, 2);
layout->addWidget(cprLabel, 2, 1);
layout->addWidget(cprLineEdit, 2, 2, 1, 2);
layout->addWidget(ok, 3, 2);
@@ -74,7 +81,12 @@ LauncherWindow::~LauncherWindow()
{
}
-QString LauncherWindow::cpr()
+QString LauncherWindow::getCpr()
{
return cprLineEdit->text();
}
+
+QString LauncherWindow::getTemplate()
+{
+ return templates->itemData(currentIndex());
+}
diff --git a/client/launcherwindow.h b/client/launcherwindow.h
index 0bb9d88..038bb20 100644
--- a/client/launcherwindow.h
+++ b/client/launcherwindow.h
@@ -30,18 +30,21 @@
#include <QDialog>
#include <QLineEdit>
+#include <QComboBox>
class LauncherWindow : public QDialog
{
Q_OBJECT
public:
- LauncherWindow(QWidget *parent = 0);
+ LauncherWindow(QString, QString, QWidget *parent = 0);
~LauncherWindow();
- QString cpr();
+ QString getCpr();
+ QString getTemplate();
private:
QLineEdit *cprLineEdit;
+ QComboBox *templates;
};
diff --git a/client/pracro.cc b/client/pracro.cc
index c02af93..3867507 100644
--- a/client/pracro.cc
+++ b/client/pracro.cc
@@ -178,10 +178,11 @@ 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();
+ if(cpr == CPR_DEFAULT || templ = TEMPLATE_DEFAULT) {
+ LauncherWindow lwnd(cpr, templ);
+ if(lwnd.exec() == QDialog::Accepted && lwnd.getCpr() != "") {
+ cpr = lwnd.getCpr();
+ templ = lwnd.getTemplate();
} else {
return 1;
}