From d9caca8195ffaf4d00993bec35792da36964cc69 Mon Sep 17 00:00:00 2001 From: ubbo Date: Mon, 3 Jan 2011 20:22:07 +0000 Subject: allow exit when no tabs open git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@427 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- gpgwin.cpp | 1 + textedit.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gpgwin.cpp b/gpgwin.cpp index 68251de..3670118 100644 --- a/gpgwin.cpp +++ b/gpgwin.cpp @@ -423,6 +423,7 @@ void GpgWin::createDockWindows() void GpgWin::closeEvent(QCloseEvent *event) { + /** ask to save changes, if text modified */ if (edit->maybeSave()) { diff --git a/textedit.cpp b/textedit.cpp index bc1caf8..7c1d4ce 100644 --- a/textedit.cpp +++ b/textedit.cpp @@ -282,10 +282,15 @@ bool TextEdit::maybeSave() { EditorPage *page = curPage(); - if (page == 0) + if(tabWidget->count() == 0) { + return true; + } + + // whats this supposed to do? it blocks closing program when all tabs closed + /*if (page == 0) { return false; - } + }*/ QTextDocument *document = page->getTextPage()->document(); -- cgit v1.2.3