summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2012-09-07 10:28:47 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2012-09-07 10:28:47 +0200
commitdb3b3fed726527600aa37f3310de13439571f04d (patch)
treec81e33870b86dc9c15539a44bdb03a02346af485
parent6d586584f530035b46dfedf88c30c719c8cc0dbd (diff)
Disable all macro entities when commit/nocommit/discard has been pressed, until an answer has been received.
-rw-r--r--client/mainwindow.cc18
-rw-r--r--client/mainwindow.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/client/mainwindow.cc b/client/mainwindow.cc
index 756f759..7bf4116 100644
--- a/client/mainwindow.cc
+++ b/client/mainwindow.cc
@@ -161,6 +161,14 @@ bool MainWindow::hasOpen(void *me)
return false;
}
+void MainWindow::enableEntities(bool enable)
+{
+ Entities::iterator i = entities.begin();
+ while(i != entities.end()) {
+ i.value()->widget()->setEnabled(enable);
+ i++;
+ }
+}
void MainWindow::closeCommit()
{
@@ -171,6 +179,9 @@ void MainWindow::closeCommit()
tr("Close open macros first."));
return;
}
+
+ enableEntities(false);
+
netcom.commit();
// isStored = true;
closing = true;
@@ -185,6 +196,9 @@ void MainWindow::closeNoCommit()
tr("Close open macros first."));
return;
}
+
+ enableEntities(false);
+
netcom.nocommit();
// isStored = true;
closing = true;
@@ -209,6 +223,8 @@ void MainWindow::closeDiscard()
MessageBox::Yes | MessageBox::No);
if(res == MessageBox::Yes) {
+ enableEntities(false);
+
netcom.discard();
// isStored = true;
closing = true;
@@ -394,6 +410,8 @@ void MainWindow::setTemplate(QString name)
void MainWindow::handle(QDomDocument &doc)
{
+ enableEntities(true);
+
DEBUG(mainwindow, "Handle %s\n",
doc.toString().toStdString().c_str());
diff --git a/client/mainwindow.h b/client/mainwindow.h
index ad96154..70519b3 100644
--- a/client/mainwindow.h
+++ b/client/mainwindow.h
@@ -65,6 +65,7 @@ public slots:
void setTemplate(QString name);
private:
+ void enableEntities(bool enable);
void updateTemplates(QDomNodeList &nodes);
void updateMacros(QDomNodeList &nodes);
void updateTemplateHeaders(QDomNode &templatenode);