From 5f5f01c0e3825ff4dd2a5b7b51c08172c93674c3 Mon Sep 17 00:00:00 2001 From: senator Date: Wed, 13 Oct 2010 12:17:16 +0000 Subject: working on template ini file integration. not entirely done but compiles just fine --- client/launcherwindow.cc | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'client') 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 #include #include +#include +#include #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")); -- cgit v1.2.3