summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2012-09-07 11:08:05 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2012-09-07 11:08:05 +0200
commita105650f7520d4762c83ff6af52e80581fd1ab3d (patch)
tree4c1886292ca1bfbd891ba1e5a0481a58b9ca966c
parent813b50f0c91805b22941bfb28758b49f8e00cb22 (diff)
parent39777a9f5ea2b0761028f6db6dbc071ea2ad7c60 (diff)
Merge branch 'master' of http://git.aasimon.org/public/pracro
-rw-r--r--client/client.pro2
-rw-r--r--client/mainwindow.cc24
-rw-r--r--client/mainwindow.h1
3 files changed, 26 insertions, 1 deletions
diff --git a/client/client.pro b/client/client.pro
index 375818f..893d25d 100644
--- a/client/client.pro
+++ b/client/client.pro
@@ -16,7 +16,7 @@ debug {
DEFINES+=USE_DEBUG
}
-DEFINES+=VERSION=\\\"2.2.2\\\"
+DEFINES+=VERSION=\\\"2.2.4\\\"
win32 {
QMAKE_LIBDIR += lua/lib
diff --git a/client/mainwindow.cc b/client/mainwindow.cc
index 2345644..7bf4116 100644
--- a/client/mainwindow.cc
+++ b/client/mainwindow.cc
@@ -161,14 +161,27 @@ 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()
{
+ if(closing) return;
+
if(hasOpen(NULL)) {
MessageBox::warning(this, tr("Close first."),
tr("Close open macros first."));
return;
}
+
+ enableEntities(false);
+
netcom.commit();
// isStored = true;
closing = true;
@@ -176,11 +189,16 @@ void MainWindow::closeCommit()
void MainWindow::closeNoCommit()
{
+ if(closing) return;
+
if(hasOpen(NULL)) {
MessageBox::warning(this, tr("Close first."),
tr("Close open macros first."));
return;
}
+
+ enableEntities(false);
+
netcom.nocommit();
// isStored = true;
closing = true;
@@ -188,6 +206,8 @@ void MainWindow::closeNoCommit()
void MainWindow::closeDiscard()
{
+ if(closing) return;
+
if(hasOpen(NULL)) {
MessageBox::warning(this, tr("Close first."),
tr("Close open macros first."));
@@ -203,6 +223,8 @@ void MainWindow::closeDiscard()
MessageBox::Yes | MessageBox::No);
if(res == MessageBox::Yes) {
+ enableEntities(false);
+
netcom.discard();
// isStored = true;
closing = true;
@@ -388,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);