From c09fb0787c3af4d282ae3fac53c706665a91b0a7 Mon Sep 17 00:00:00 2001 From: senator Date: Wed, 23 Nov 2011 15:06:33 +0100 Subject: Removed console and changed LIBPATH to QMAKE_LIBDIR. LIBPATH is obsolete --- client/client.pro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/client.pro b/client/client.pro index 61a6e06..831b570 100644 --- a/client/client.pro +++ b/client/client.pro @@ -20,12 +20,12 @@ include(../VERSION) DEFINES+=VERSION=\\\"$$VERSION\\\" win32 { - LIBPATH += lua/lib + QMAKE_LIBDIR += lua/lib INCLUDEPATH += lua/include LIBS += -llua51 DEFINES += HOST_WIN32 # debug { - CONFIG += console + CONFIG += # } } -- cgit v1.2.3 From 728e74df239bac0f61faea062bb5a45340ee6d24 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 1 Dec 2011 10:40:27 +0100 Subject: Force focus on combobox in altcombobox in order to avoid the inner widget gaining focus even though it is hidden. --- client/widgets/altcombobox.cc | 6 ++++++ client/widgets/altcombobox.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/client/widgets/altcombobox.cc b/client/widgets/altcombobox.cc index 9956fff..082601a 100644 --- a/client/widgets/altcombobox.cc +++ b/client/widgets/altcombobox.cc @@ -107,6 +107,12 @@ AltComboBox::~AltComboBox() { } +bool AltComboBox::setKeyboardFocus() +{ + combobox->setFocus(); + return true; +} + QComboBox *AltComboBox::qcombobox() { return combobox; diff --git a/client/widgets/altcombobox.h b/client/widgets/altcombobox.h index e6a21d7..b0fb61c 100644 --- a/client/widgets/altcombobox.h +++ b/client/widgets/altcombobox.h @@ -94,6 +94,8 @@ public: QComboBox *qcombobox(); + bool setKeyboardFocus(); + public slots: void comboChanged(); void onChildChange(); -- cgit v1.2.3 From 8dbc6ee0fbc1dd4485ec0ff1cf4a48e24b0b41a8 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 1 Dec 2011 11:26:49 +0100 Subject: Make combobox selection list popup on spacebar or mousedown. --- client/widgets/combobox.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/client/widgets/combobox.cc b/client/widgets/combobox.cc index eed2d10..935f620 100644 --- a/client/widgets/combobox.cc +++ b/client/widgets/combobox.cc @@ -93,6 +93,8 @@ ComboBox::ComboBox(QDomNode &node, MacroWindow *macrowindow) // Make empty default selection. combobox->setCurrentIndex(-1); + combobox->installEventFilter(this); + QDomElement elem = node.toElement(); combotype = SELECT; @@ -213,15 +215,26 @@ void ComboBox::changed() emit eventOnChange(); } +#include bool ComboBox::eventFilter(QObject *obj, QEvent *event) { if(ignoreChangeEvents == true) return false; + if(combotype == SELECT) { if(event->type() == QEvent::MouseButtonRelease) { if(enabled()) combobox->showPopup(); } } + if(event->type() == QEvent::KeyPress) { + QKeyEvent *ke = (QKeyEvent*)event; + // printf("KEY: %d\n", ke->key()); + // if(ke->key() == Qt::Key_Up || ke->key() == Qt::Key_Down) { + if(ke->key() == Qt::Key_Space) { + if(enabled()) combobox->showPopup(); + } + } + return QObject::eventFilter(obj, event); } -- cgit v1.2.3 From ef111490bf0fef23f338910c0a54c142aa61d938 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 1 Dec 2011 11:27:07 +0100 Subject: Set window title and icon. --- client/pcpviewer/pcpviewer.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/pcpviewer/pcpviewer.cc b/client/pcpviewer/pcpviewer.cc index 5853e0a..ea59edb 100644 --- a/client/pcpviewer/pcpviewer.cc +++ b/client/pcpviewer/pcpviewer.cc @@ -42,6 +42,9 @@ PCPViewer::PCPViewer(QString patientid) : praxisd("sarge", 10000) { + setWindowTitle(tr("Pracro Patient View")); + setWindowIcon(QIcon(":/icons/icon.png")); + this->patientid = patientid; setLayout(new QVBoxLayout()); -- cgit v1.2.3 From e0107f150cefec8a8f90c5c7ebfd13e875c02e85 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 1 Dec 2011 14:06:35 +0100 Subject: Restore sane animationtime value. --- client/collapser.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/collapser.cc b/client/collapser.cc index 2057a0e..abbe295 100644 --- a/client/collapser.cc +++ b/client/collapser.cc @@ -32,7 +32,7 @@ #include "debug.h" -#define ANIM_TIME 100 // ms +#define ANIM_TIME 200 // ms #define ANIM_INTERVAL 50 // ms Collapser::Collapser(QWidget *current, QScrollArea *scroll) -- cgit v1.2.3 From 1dc78c2b5875697a926776befc33cb7161bc6eb1 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 1 Dec 2011 14:22:09 +0100 Subject: Make sure space is added in the bottom (stretch) if the window is taller than the macros. --- client/mainwindow.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/mainwindow.cc b/client/mainwindow.cc index 121412e..4cb721f 100644 --- a/client/mainwindow.cc +++ b/client/mainwindow.cc @@ -337,6 +337,9 @@ void MainWindow::updateMacros(QDomNodeList &nodes) break; } } + + QVBoxLayout *l = (QVBoxLayout*)central->layout(); + l->addStretch(1); } } -- cgit v1.2.3 From 5ed7a801b4194e72cc3898de57fb1d9ea0e8caa4 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 1 Dec 2011 14:53:08 +0100 Subject: Added missing strings. --- client/pracro_dk.ts | 83 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 62 insertions(+), 21 deletions(-) diff --git a/client/pracro_dk.ts b/client/pracro_dk.ts index 9c7fd40..72cda12 100644 --- a/client/pracro_dk.ts +++ b/client/pracro_dk.ts @@ -1,6 +1,19 @@ + + AboutBox + + + About Pracro + Om Pracro + + + + <h1>Pracro Client</h1><h2>v. + <h1>Pracro Klient</h1><h2>v. + + DBWidget @@ -53,43 +66,43 @@ et CPR nummer på 10 cifre. MacroWindow - + Error Der er sket en fejl - + The macro Makroen - + was not filled out correctly, please try again. er ikke.udfyldt korrekt. Prøv igen. - + Save the macro changes? Gem makro ændringer? - + you have choosen to close the macro Du har valgt at lukke makroen - + do you want to save before closing? ønsker du at gemme dine ændringer først? - + Close first Luk først - + Close other one first. Luk den åbne makro først. @@ -97,26 +110,26 @@ et CPR nummer på 10 cifre. MainWindow - + Close and commit Gem i journal - + Close no commit Gem som kladde - - - + + + Close first. Luk først. - - - + + + Close open macros first. Luk åbne makroer først. @@ -133,14 +146,14 @@ et CPR nummer på 10 cifre. Denne session bliver husket på denne specifikke maskine. For at genåbne på et senere tidspunkt, skal du blot genåbne på samme patient. - - + + Discard Kassér - - + + This session will <strong>NOT</strong> be stored in the journal.<br/>Are you sure you want to continue? Dette vil slette alle indtastede data. Denne session vil <strong>IKKE</strong> blive gemt i journalen hvis du fortsætter. Fortsætter du kan dataene <strong>IKKE</strong> gendannes.<br/>Er du sikker på du vil fortsætte? @@ -158,6 +171,26 @@ et CPR nummer på 10 cifre. Remove form list Fjern fra listen + + + Inner widget changed. + Indre widget er ændret. + + + + The inner widget changed, and you didn't add it to the list. +Do you want to continue and discard the change? + Den indre widget har ændret sig men er ikke tilføjet til listen. +Vil du fortsætte og smide ændringerne væk? + + + + PCPViewer + + + Pracro Patient View + Pracro Patient Visning + QObject @@ -252,9 +285,17 @@ et CPR nummer på 10 cifre. Ignorér - + Depends on: Afhænger af: + + Template + + + Open + Åbn + + -- cgit v1.2.3 From 93884eadc122a3a025e731a4d7d34b28caad5fb0 Mon Sep 17 00:00:00 2001 From: senator Date: Fri, 2 Dec 2011 13:50:52 +0100 Subject: Updated the language file --- client/pracro_dk.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/client/pracro_dk.ts b/client/pracro_dk.ts index 72cda12..2582280 100644 --- a/client/pracro_dk.ts +++ b/client/pracro_dk.ts @@ -11,7 +11,7 @@ <h1>Pracro Client</h1><h2>v. - <h1>Pracro Klient</h1><h2>v. + <h1>Pracro Client</h1><h2>v. @@ -174,14 +174,13 @@ et CPR nummer på 10 cifre. Inner widget changed. - Indre widget er ændret. + Data er ændret The inner widget changed, and you didn't add it to the list. Do you want to continue and discard the change? - Den indre widget har ændret sig men er ikke tilføjet til listen. -Vil du fortsætte og smide ændringerne væk? + Der er indtastet data, som ikke er tilføjet til listen. Ønsker du at fortsætte og glemme disse data? @@ -189,7 +188,7 @@ Vil du fortsætte og smide ændringerne væk? Pracro Patient View - Pracro Patient Visning + Pracro Patient Oversigt -- cgit v1.2.3 From f4fcce1fc35bc0f4d88462b4c9c29de8fedb7cdf Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 2 Dec 2011 14:03:34 +0100 Subject: Bump version. --- client/client.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/client.pro b/client/client.pro index 46f4ae3..5e16942 100644 --- a/client/client.pro +++ b/client/client.pro @@ -16,7 +16,7 @@ debug { DEFINES+=USE_DEBUG } -DEFINES+=VERSION=\\\"2.2.1\\\" +DEFINES+=VERSION=\\\"2.2.2\\\" win32 { QMAKE_LIBDIR += lua/lib -- cgit v1.2.3 From 97c6a5d184b8e8c14689ddb99951ad4d71204002 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Mon, 5 Dec 2011 10:50:07 +0100 Subject: Change how script code is stored to the Script objects. The std::string code member is there for a reason you know... --- server/src/macroparser.cc | 2 +- server/src/transactionhandler.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/macroparser.cc b/server/src/macroparser.cc index d1604b2..7d3f367 100644 --- a/server/src/macroparser.cc +++ b/server/src/macroparser.cc @@ -114,7 +114,7 @@ void MacroParser::characterData(std::string &data) if(state == SCRIPT) { assert(current_script); // No script present! - current_script->attributes["code"].append(data); + current_script->code.append(data); } } diff --git a/server/src/transactionhandler.cc b/server/src/transactionhandler.cc index 5203ee2..ef112ee 100644 --- a/server/src/transactionhandler.cc +++ b/server/src/transactionhandler.cc @@ -244,7 +244,7 @@ static std::string handleRequest(Request &request, Environment &env, answer +="\n-- END INCLUDE: '"+spi->attributes["src"]+"'\n"; } } else { - answer += xml_encode(spi->attributes["code"]); + answer += xml_encode(spi->code); } answer += "\n"; spi++; -- cgit v1.2.3 From 5e0afb2c9239fd8695ff338f92fe113d593b2bf0 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Mon, 5 Dec 2011 15:46:44 +0100 Subject: Prepare for template scripts. --- server/src/template.h | 2 ++ server/src/templateparser.cc | 49 ++++++++++++++++++++++++++++++++++++++++++++ server/src/templateparser.h | 3 +++ 3 files changed, 54 insertions(+) diff --git a/server/src/template.h b/server/src/template.h index a069cff..e549ef3 100644 --- a/server/src/template.h +++ b/server/src/template.h @@ -84,6 +84,8 @@ public: class Template { public: + std::vector< Script > scripts; + std::vector< Macro > macros; std::string name; diff --git a/server/src/templateparser.cc b/server/src/templateparser.cc index b9c65f5..704b215 100644 --- a/server/src/templateparser.cc +++ b/server/src/templateparser.cc @@ -81,6 +81,10 @@ TemplateParser::~TemplateParser() void TemplateParser::characterData(std::string &data) { + if(state == SCRIPT) { + assert(current_script); // No script present! + current_script->code.append(data); + } } void TemplateParser::startTag(std::string name, attributes_t &attr) @@ -127,6 +131,39 @@ void TemplateParser::startTag(std::string name, attributes_t &attr) return; } + // Enable script parsing + if(name == "scripts") { + if(state != MACRO) error("scripts found outside macro."); + state = SCRIPTS; + + assert(t); // No template is currently available, cannot create maps! + + return; + } + + // Create script + if(name == "script") { + + assert(t); // No template is currently available, cannot create script! + + switch(state) { + case SCRIPTS: + { + state = SCRIPT; + + Script s; + s.attributes = attr; + t->scripts.push_back(s); + current_script = &(t->scripts.back()); + } + break; + default: + error("\n"; + si++; + } + xml += " \n"; + + xml += " \n"; + } xml += " \n"; i++; diff --git a/server/src/template.h b/server/src/template.h index e549ef3..853db3d 100644 --- a/server/src/template.h +++ b/server/src/template.h @@ -67,6 +67,7 @@ public: maps_t maps; std::vector< Script > scripts; std::vector< Script > resume_scripts; + std::vector< Script > commit_scripts; Widget widgets; Resume resume; diff --git a/server/src/templateparser.cc b/server/src/templateparser.cc index 704b215..8fc3eff 100644 --- a/server/src/templateparser.cc +++ b/server/src/templateparser.cc @@ -133,7 +133,7 @@ void TemplateParser::startTag(std::string name, attributes_t &attr) // Enable script parsing if(name == "scripts") { - if(state != MACRO) error("scripts found outside macro."); + if(state != TEMPLATE) error("scripts found outside template."); state = SCRIPTS; assert(t); // No template is currently available, cannot create maps! @@ -158,7 +158,7 @@ void TemplateParser::startTag(std::string name, attributes_t &attr) } break; default: - error("