summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2012-01-19 13:52:58 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2012-01-19 13:52:58 +0100
commit3488ab9a9526b1d999beb354b5318fb28cf917de (patch)
tree38194b2e11185ccd3551d487863021103e82d24c
parent6c211941aa46058750869799f7f0a83d7a1da3bc (diff)
Make client block on error response from server. Both on macro commits and on template commit.
-rw-r--r--client/mainwindow.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/client/mainwindow.cc b/client/mainwindow.cc
index 4cb721f..2345644 100644
--- a/client/mainwindow.cc
+++ b/client/mainwindow.cc
@@ -170,7 +170,7 @@ void MainWindow::closeCommit()
return;
}
netcom.commit();
- isStored = true;
+ // isStored = true;
closing = true;
}
@@ -182,7 +182,7 @@ void MainWindow::closeNoCommit()
return;
}
netcom.nocommit();
- isStored = true;
+ // isStored = true;
closing = true;
}
@@ -204,7 +204,7 @@ void MainWindow::closeDiscard()
if(res == MessageBox::Yes) {
netcom.discard();
- isStored = true;
+ // isStored = true;
closing = true;
}
}
@@ -227,7 +227,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
== MessageBox::Yes) {
if(!isStored) {
netcom.discard();
- isStored = true;
+ // isStored = true;
closing = true;
event->ignore();
return;
@@ -388,8 +388,6 @@ void MainWindow::setTemplate(QString name)
void MainWindow::handle(QDomDocument &doc)
{
- if(closing) close();
-
DEBUG(mainwindow, "Handle %s\n",
doc.toString().toStdString().c_str());
@@ -400,6 +398,7 @@ void MainWindow::handle(QDomDocument &doc)
if(element.tagName() == "error") {
showError("Pracro Server Error", element.text());
+ closing = false;
continue;
}
@@ -430,4 +429,9 @@ void MainWindow::handle(QDomDocument &doc)
}
}
+
+ if(closing) {
+ isStored = true;
+ close();
+ }
}