summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/launcherwindow.cc21
1 files changed, 19 insertions, 2 deletions
diff --git a/client/launcherwindow.cc b/client/launcherwindow.cc
index f6657f7..a97a1b7 100644
--- a/client/launcherwindow.cc
+++ b/client/launcherwindow.cc
@@ -29,27 +29,44 @@
#include <QGridLayout>
#include <QRegExpValidator>
#include <QPushButton>
+#include <QFileInfo>
+#include <QSettings>
#include "launcherwindow.h"
-LauncherWindow::LauncherWindow(QString cpr, QString templ, QWidget *parent)
+LauncherWindow::LauncherWindow(QString arg, QString cpr, QString templ, QWidget *parent)
: QDialog(parent)
{
setWindowTitle(tr("Pracro Launcher"));
resize(250,80);
+ QSettings templateConfig(QFileInfo(arg).absolutePath() + "/templates.ini", QSettings::IniFormat);
+
QLabel *cprLabel = new QLabel(tr("Patient ID:"));
cprLineEdit = new QLineEdit();
cprLineEdit->setValidator(new QRegExpValidator(QRegExp("^[0-9]{10,10}$"), this));
QLabel *templatesLabel = new QLabel(tr("Template:"));
templates = new QComboBox();
+ QStringList groups = templateConfig.childGroups();
+ QStringList::iterator i = groups.begin();
+ while(i != groups.end()) {
+ if(i->left(8) == "Template") {
+ templateConfig.beginGroup(*i);
+ QString name = templateConfig.value("name").toString();
+ QString value = templateConfig.value("value").toString();
+ templates->addItem(name, value);
+ templateConfig.endGroup();
+ }
+ i++;
+ }
+ /*
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(tr("Accept"));
connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
QPushButton *cancel = new QPushButton(tr("Cancel"));