From efd6dc8a0c05c929fb98dff7e4bf07d3eba992c9 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Fri, 20 Jun 2008 06:35:42 +0000 Subject: [PATCH] One view/doc: more fixes and cosmetics. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25329 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiView.cpp | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 94a05797dc..74d589ca24 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -682,23 +682,26 @@ void GuiView::on_lastWorkAreaRemoved() // We have a splitter so don't close anything. return; - if (lyxrc.open_buffers_in_tabs) { - d.toc_models_.reset(0); - // The document settings needs to be reinitialised. - updateDialog("document", ""); - updateDialogs(); + // Reset and updates the dialogs. + d.toc_models_.reset(0); + updateDialog("document", ""); + updateDialogs(); + + if (lyxrc.open_buffers_in_tabs) + // Nothing more to do, the window should stay open. + return; + + if (guiApp->viewIds().size() > 1) { + close(); return; } - if (guiApp->viewIds().size() == 1) { -#ifndef Q_WS_MACX - // On Mac close the view in any case because the application stay - // resident in memory. On other platforms we don't close the last - // window because this would quit the application. - return; -#endif - } +#ifdef Q_WS_MACX + // On Mac we also close the last window because the application stay + // resident in memory. On other platforms we don't close the last + // window because this would quit the application. close(); +#endif }