summaryrefslogtreecommitdiff
path: root/client/mainwindow.cc
diff options
context:
space:
mode:
authordeva <deva>2010-06-10 07:03:06 +0000
committerdeva <deva>2010-06-10 07:03:06 +0000
commit198b0d886817f2c5bc97cfd11857d4b314dffae3 (patch)
tree4fc2d51de46ab69b9e67149abf0ab6a332032f27 /client/mainwindow.cc
parent730eb796bbce6f124be9194f1565b7dda1daddf1 (diff)
Add transaction support on database pr. pracro session. Makes it possible to discard all edited macros.
Diffstat (limited to 'client/mainwindow.cc')
-rw-r--r--client/mainwindow.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/client/mainwindow.cc b/client/mainwindow.cc
index 3d49752..40daad8 100644
--- a/client/mainwindow.cc
+++ b/client/mainwindow.cc
@@ -142,6 +142,8 @@ void MainWindow::showSessions()
sessions.show();
}
+extern QWidget *viewer;
+//#include <QApplication>
void MainWindow::closeEvent(QCloseEvent *event)
{
if(isStored || QMessageBox::question(this,
@@ -150,6 +152,11 @@ void MainWindow::closeEvent(QCloseEvent *event)
"Are you sure you want to continue?",
QMessageBox::Yes | QMessageBox::No)
== QMessageBox::Yes) {
+ if(!isStored) {
+ netcom.discard();
+ sessions.remove(cpr);
+ }
+
QSettings settings("Aasimon.org", "Pracro");
settings.beginGroup("MainWindow");
@@ -159,6 +166,8 @@ void MainWindow::closeEvent(QCloseEvent *event)
settings.endGroup();
event->accept();
+ if(viewer) viewer->close();
+ // qApp->quit();
} else {
event->ignore();
}