From e89d236efdf9c24cd2f98b9c1f6312691433b560 Mon Sep 17 00:00:00 2001 From: Herwig Birke Date: Wed, 16 May 2018 10:33:56 +0200 Subject: [PATCH] . --- cmainwindow.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/cmainwindow.cpp b/cmainwindow.cpp index cb78597..90608d9 100644 --- a/cmainwindow.cpp +++ b/cmainwindow.cpp @@ -1193,14 +1193,6 @@ void cMainWindow::onRechercheContextMenu(const QPoint& pos) void cMainWindow::onFileNew() { -// QString szPath = QDir::homePath() + QDir::separator() + "OneDrive - WINDESIGN" + QDir::separator() + "__BOOKS__" + QDir::separator() + "qtStoryWriter" + QDir::separator() + "rückwärts.storyWriter" ; -// m_lpStoryBook = new cStoryBook(szPath); -// m_lpStoryBook->fillOutlineList(ui->m_lpOutlineList); -// m_lpStoryBook->fillCharacterList(ui->m_lpCharacterList); -// m_lpStoryBook->fillPlaceList(ui->m_lpPlaceList); -// m_lpStoryBook->fillObjectList(ui->m_lpObjectList); -// m_lpStoryBook->fillRechercheList(ui->m_lpRechercheList); - if(m_bSomethingChanged) { switch(QMessageBox::question(this, tr("Save"), m_lpStoryBook->title() + tr(" has been changed.\nDo you want to save?"), QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel)) @@ -1218,6 +1210,8 @@ void cMainWindow::onFileNew() } } + ui->m_lpMdiArea->closeAllSubWindows(); + if(m_lpStoryBook) delete m_lpStoryBook; @@ -1258,7 +1252,10 @@ void cMainWindow::onFileOpen() if(szProjectName.isEmpty()) return; - delete m_lpStoryBook; + ui->m_lpMdiArea->closeAllSubWindows(); + + if(m_lpStoryBook) + delete m_lpStoryBook; m_lpStoryBook = new cStoryBook(szProjectName);