From b596d748b398242b556cb5a6271dff014d5e638d Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 30 Jul 2009 08:55:53 +0000 Subject: Changed illogically named 'window' tag into the more descriptive 'widgets' tag. --- client/macrowindow.cc | 2 +- server/src/macroheaderparser.cc | 2 +- server/src/macroparser.cc | 22 +++++++++++----------- server/src/macroparser.h | 2 +- server/src/macrotool_dump.cc | 2 +- server/src/macrotool_fieldnames.cc | 2 +- server/src/macrotool_filehandler.cc | 2 +- server/src/server.cc | 8 ++++---- server/src/template.h | 2 +- server/src/templateheaderparser.cc | 2 +- server/src/templateparser.cc | 2 +- server/src/widgetgenerator.cc | 4 ++-- server/xml/macros/5steps-1.0.xml | 4 ++-- server/xml/macros/90Dlens-1.0.xml | 4 ++-- server/xml/macros/amdconsent-1.0.xml | 4 ++-- server/xml/macros/amdindication-1.0.xml | 4 ++-- server/xml/macros/amdinformation-1.0.xml | 4 ++-- server/xml/macros/amdinjektionindikation-1.0.xml | 4 ++-- server/xml/macros/amdpreopconclusion-1.0.xml | 4 ++-- server/xml/macros/amdprocedure-1.0.xml | 4 ++-- server/xml/macros/amdtreatmentindication-1.0.xml | 4 ++-- server/xml/macros/autoref-1.0.xml | 4 ++-- server/xml/macros/cave-1.0.xml | 4 ++-- server/xml/macros/current-1.0.xml | 4 ++-- server/xml/macros/example.xml | 4 ++-- server/xml/macros/fluoresceinconclusion-1.0.xml | 4 ++-- server/xml/macros/fluoresceininj-1.0.xml | 4 ++-- server/xml/macros/fluoresceinphases-1.0.xml | 4 ++-- server/xml/macros/fundus-1.0.xml | 4 ++-- server/xml/macros/header-1.0.xml | 4 ++-- server/xml/macros/lensmeter-1.0.xml | 4 ++-- server/xml/macros/medicine-1.0.xml | 4 ++-- server/xml/macros/ocgtt-1.0.xml | 4 ++-- server/xml/macros/octevaluation-1.0.xml | 4 ++-- server/xml/macros/octmeasurement-1.0.xml | 4 ++-- server/xml/macros/pressure-1.0.xml | 4 ++-- server/xml/macros/preveyediseases-1.0.xml | 4 ++-- server/xml/macros/previouscommon-1.0.xml | 4 ++-- server/xml/macros/referral-1.0.xml | 4 ++-- server/xml/macros/slitlamp-1.0.xml | 4 ++-- server/xml/macros/subjeval-1.0.xml | 4 ++-- server/xml/macros/test_altcombobox.xml | 4 ++-- server/xml/macros/test_button.xml | 4 ++-- server/xml/macros/test_checkbox.xml | 4 ++-- server/xml/macros/test_combobox.xml | 4 ++-- server/xml/macros/test_dbwidget.xml | 4 ++-- server/xml/macros/test_lineedit.xml | 4 ++-- server/xml/macros/test_listbox.xml | 4 ++-- server/xml/macros/test_meta.xml | 4 ++-- server/xml/macros/test_metawidget.xml | 4 ++-- server/xml/macros/test_multilist.xml | 4 ++-- server/xml/macros/test_radiobuttons.xml | 4 ++-- server/xml/macros/test_resume.xml | 4 ++-- server/xml/macros/tobacco-1.0.xml | 4 ++-- server/xml/macros/visus-1.0.xml | 4 ++-- 55 files changed, 112 insertions(+), 112 deletions(-) diff --git a/client/macrowindow.cc b/client/macrowindow.cc index 7173e2a..16ccf53 100644 --- a/client/macrowindow.cc +++ b/client/macrowindow.cc @@ -105,7 +105,7 @@ void MacroWindow::initMacro(QDomNode &node) printf("Unknown script type %s\n", xml_elem.attribute("language").toStdString().c_str()); } - } else if(xml_elem.tagName() == "window") { + } else if(xml_elem.tagName() == "widgets") { Window *window = new Window(xml_elem, this); macrotitle = xml_elem.attribute("caption"); mainwidget = window; diff --git a/server/src/macroheaderparser.cc b/server/src/macroheaderparser.cc index e9748b1..d6ba0bb 100644 --- a/server/src/macroheaderparser.cc +++ b/server/src/macroheaderparser.cc @@ -94,7 +94,7 @@ MacroHeaderParser::~MacroHeaderParser() void MacroHeaderParser::startTag(std::string name, std::map< std::string, std::string> attributes) { - // Create macro and enable parsing of queries, maps and window + // Create macro and enable parsing of queries, maps and widgets if(name == "macro") { assert(!m); // A Macro has already been allocated, cannot create macro! m = new Macro(); diff --git a/server/src/macroparser.cc b/server/src/macroparser.cc index fac39b6..b91462a 100644 --- a/server/src/macroparser.cc +++ b/server/src/macroparser.cc @@ -119,7 +119,7 @@ void MacroParser::characterData(std::string &data) void MacroParser::startTag(std::string name, std::map< std::string, std::string> attributes) { - // Create macro and enable parsing of queries, maps and window + // Create macro and enable parsing of queries, maps and widgets if(name == "macro") { if(state != UNDEFINED) error("macro found not root tag."); state = MACRO; @@ -219,17 +219,17 @@ void MacroParser::startTag(std::string name, std::map< std::string, std::string> } // Enable widget parsing - if(name == "window") { + if(name == "widgets") { - if(state != MACRO) error("window found outside macro."); - state = WINDOW; + if(state != MACRO) error("widgets found outside macro."); + state = WIDGETS; - assert(m); // No macro is currently available, cannot create window! + assert(m); // No macro is currently available, cannot create widgets! - m->window.attributes = attributes; - m->window.attributes["tagname"] = name; + m->widgets.attributes = attributes; + m->widgets.attributes["tagname"] = name; - Widget *current = &(m->window); + Widget *current = &(m->widgets); widgetstack.push_back(current); return; @@ -237,7 +237,7 @@ void MacroParser::startTag(std::string name, std::map< std::string, std::string> // TODO: We need to parse some (maybe even all) widgets in order to // make db lookup of the previous values. - if(state == WINDOW) { + if(state == WIDGETS) { assert(widgetstack.size()); // Widget stack is empty, cannot create! @@ -281,9 +281,9 @@ void MacroParser::endTag(std::string name) current_script = NULL; state = SCRIPTS; } - if(name == "window") state = MACRO; + if(name == "widgets") state = MACRO; - if(state == WINDOW) { + if(state == WIDGETS) { assert(widgetstack.size()); // Widget stack is empty, cannot pop! widgetstack.pop_back(); if(widgetstack.size() == 0) state = MACRO; diff --git a/server/src/macroparser.h b/server/src/macroparser.h index 9d90ff1..a283d26 100644 --- a/server/src/macroparser.h +++ b/server/src/macroparser.h @@ -39,7 +39,7 @@ class MacroParser : public SAXParser { QUERY, MAPS, MAP, - WINDOW, + WIDGETS, SCRIPTS, SCRIPT } ParserState; diff --git a/server/src/macrotool_dump.cc b/server/src/macrotool_dump.cc index 71bc690..990d247 100644 --- a/server/src/macrotool_dump.cc +++ b/server/src/macrotool_dump.cc @@ -80,7 +80,7 @@ static std::map macroList() std::string key = macro->attributes["name"];// + "-" + macro->attributes["version"]; macros[key].name = macro->attributes["name"]; macros[key].file = *mfs; - macros[key].title = macro->window.attributes["caption"]; + macros[key].title = macro->widgets.attributes["caption"]; macros[key].version = macro->attributes["version"]; mfs++; diff --git a/server/src/macrotool_fieldnames.cc b/server/src/macrotool_fieldnames.cc index 4c18de5..1d92df8 100644 --- a/server/src/macrotool_fieldnames.cc +++ b/server/src/macrotool_fieldnames.cc @@ -85,7 +85,7 @@ static std::map > getMacroRefsList() Macro *macro = parser.getMacro(); std::string key = name; - reflist[key] = getWidgetNames(macro->window); + reflist[key] = getWidgetNames(macro->widgets); mfs++; } diff --git a/server/src/macrotool_filehandler.cc b/server/src/macrotool_filehandler.cc index 2d9ea4e..d0245ba 100644 --- a/server/src/macrotool_filehandler.cc +++ b/server/src/macrotool_filehandler.cc @@ -55,7 +55,7 @@ public: std::vector< Query > queries; std::vector< Map > maps; std::vector< Script > scripts; - Widget window; + Widget widgets; std::map< std::string, std::string > attributes; Resume resume; }; diff --git a/server/src/server.cc b/server/src/server.cc index f75aeab..0eeec43 100644 --- a/server/src/server.cc +++ b/server/src/server.cc @@ -65,9 +65,9 @@ static std::string error_box(std::string message) "\n" " \n" "\n"; @@ -173,7 +173,7 @@ static std::string handleRequest(Transaction *transaction, MacroParser mp(macrolist.getLatestVersion(macro.attributes["name"])); mp.parse(); Macro *m = mp.getMacro(); - answer += " caption=\"" + m->window.attributes["caption"] + "\""; + answer += " caption=\"" + m->widgets.attributes["caption"] + "\""; answer += ">\n"; LUAQueryMapper lqm; @@ -225,7 +225,7 @@ static std::string handleRequest(Transaction *transaction, MacroParser mp(macrolist.getLatestVersion(macro.attributes["name"])); mp.parse(); Macro *m = mp.getMacro(); - answer += " caption=\"" + m->window.attributes["caption"] + "\""; + answer += " caption=\"" + m->widgets.attributes["caption"] + "\""; answer += ">\n"; } diff --git a/server/src/template.h b/server/src/template.h index c14577e..031f068 100644 --- a/server/src/template.h +++ b/server/src/template.h @@ -62,7 +62,7 @@ public: std::vector< Query > queries; std::vector< Map > maps; std::vector< Script > scripts; - Widget window; + Widget widgets; std::map< std::string, std::string > attributes; Resume resume; bool isHeader; diff --git a/server/src/templateheaderparser.cc b/server/src/templateheaderparser.cc index 8b0f162..8698e05 100644 --- a/server/src/templateheaderparser.cc +++ b/server/src/templateheaderparser.cc @@ -94,7 +94,7 @@ TemplateHeaderParser::~TemplateHeaderParser() void TemplateHeaderParser::startTag(std::string name, std::map< std::string, std::string> attributes) { - // Create template and enable parsing of queries, maps and window + // Create template and enable parsing of queries, maps and widgets if(name == "template") { assert(!t); // A Template has already been allocated, cannot create template! t = new Template(); diff --git a/server/src/templateparser.cc b/server/src/templateparser.cc index 62be9c7..3a1e17b 100644 --- a/server/src/templateparser.cc +++ b/server/src/templateparser.cc @@ -95,7 +95,7 @@ void TemplateParser::startTag(std::string name, std::map< std::string, std::stri return; } - // Create macro and enable parsing of queries, maps and window + // Create macro and enable parsing of queries, maps and widgets if(name == "macro" || name == "header") { if(state != TEMPLATE) error("macro found outside template."); state = MACRO; diff --git a/server/src/widgetgenerator.cc b/server/src/widgetgenerator.cc index b7d6ac3..f8f3790 100644 --- a/server/src/widgetgenerator.cc +++ b/server/src/widgetgenerator.cc @@ -192,9 +192,9 @@ static void get_fields(Widget &widget, Fieldnames &fields) std::string widgetgenerator(std::string cpr, Macro ¯o, LUAQueryMapper &mapper, Database &db) { Fieldnames fields; - get_fields(macro.window, fields); + get_fields(macro.widgets, fields); Values values = db.getValues(cpr, fields); - return send_macro_widget(macro, macro.window, " ", mapper, values); + return send_macro_widget(macro, macro.widgets, " ", mapper, values); } diff --git a/server/xml/macros/5steps-1.0.xml b/server/xml/macros/5steps-1.0.xml index d655b23..1369b82 100644 --- a/server/xml/macros/5steps-1.0.xml +++ b/server/xml/macros/5steps-1.0.xml @@ -14,7 +14,7 @@ end - + @@ -23,5 +23,5 @@