summaryrefslogtreecommitdiff
path: root/client/macrowindow.cc
diff options
context:
space:
mode:
authordeva <deva>2010-06-01 12:58:32 +0000
committerdeva <deva>2010-06-01 12:58:32 +0000
commit74a28aa7125be6a603128ad600c98c4882f3b5c2 (patch)
tree1a9e4ab74f29d5ff10f2701e4e112f4525c0dcec /client/macrowindow.cc
parent9b9c1e2dd3e5807ff7714b378b03b9ba31f42df7 (diff)
From new_protocol branch.
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()