summaryrefslogtreecommitdiff
path: root/client/macrowindow.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/macrowindow.cc')
-rw-r--r--client/macrowindow.cc25
1 files changed, 17 insertions, 8 deletions
diff --git a/client/macrowindow.cc b/client/macrowindow.cc
index 98262fd..d9060b0 100644
--- a/client/macrowindow.cc
+++ b/client/macrowindow.cc
@@ -151,11 +151,26 @@ bool MacroWindow::doCommit()
// If all entries passed validation, continue commit
if(faulty == 0) {
- netcom.send(widgets, templ, macro, version);
+ QDomDocument doc = netcom.send(widgets, templ, macro, version);
+
+ QDomNodeList nl = doc.documentElement().childNodes();
+ QDomNode n = nl.at(0); // There can be only one! (Swush, flomp)
+
+ if(n.toElement().tagName() == "error") {
+ QMessageBox::critical(this, "Server Error", "Server Error: " +
+ n.toElement().text());
+ return false;
+ }
+
emit updateOnCommit();
setCollapsed(true);
return true;
} else {
+ MessageBox::critical(NULL, "Fejl",
+ "Makroen " + macrotitle +
+ " er ikke udfyldt korrekt, prøv igen.\n",
+ MessageBox::Ok);
+
return false;
}
}
@@ -168,13 +183,7 @@ void MacroWindow::close()
void MacroWindow::commit()
{
- if(doCommit()) {
- // close();
- } else {
- MessageBox::critical(NULL, "Fejl",
- "Makroen " + macrotitle + " er ikke udfyldt korrekt, prøv igen.\n",
- MessageBox::Ok);
- }
+ doCommit();
}
void MacroWindow::reset()