diff options
author | senator <senator> | 2010-10-13 12:17:16 +0000 |
---|---|---|
committer | senator <senator> | 2010-10-13 12:17:16 +0000 |
commit | 5f5f01c0e3825ff4dd2a5b7b51c08172c93674c3 (patch) | |
tree | 22da029ede156efa29a2daaa957ba0d7b3ce1e51 /client/launcherwindow.cc | |
parent | f3c83817a311c23df40f172b8561beede3d2d5e9 (diff) |
working on template ini file integration. not entirely done but compiles just fine
Diffstat (limited to 'client/launcherwindow.cc')
-rw-r--r-- | client/launcherwindow.cc | 21 |
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")); |