From 01ea1cb9ca4547c406ce0ed72b3f5f6ce18d91d9 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 7 Sep 2012 15:02:14 +0200 Subject: Make simple-quit if no sessionid has been assigned. --- client/mainwindow.cc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/client/mainwindow.cc b/client/mainwindow.cc index 7bf4116..9436f41 100644 --- a/client/mainwindow.cc +++ b/client/mainwindow.cc @@ -239,15 +239,17 @@ void MainWindow::closeEvent(QCloseEvent *event) return; } - if(isStored || MessageBox::critical(this, - tr("Discard"), - tr("This session will " - "NOT be stored in " - "the journal.
" - "Are you sure you want to continue?"), - MessageBox::Yes | MessageBox::No) - == MessageBox::Yes) { - if(!isStored) { + if(netcom.sessionid == "" || + isStored || + MessageBox::critical(this, + tr("Discard"), + tr("This session will " + "NOT be stored in " + "the journal.
" + "Are you sure you want to continue?"), + MessageBox::Yes | MessageBox::No) == MessageBox::Yes) + { + if(netcom.sessionid != "" && !isStored) { netcom.discard(); // isStored = true; closing = true; -- cgit v1.2.3