From 97e015d173f8e7fa8c8e4dfc77ef338d4317e768 Mon Sep 17 00:00:00 2001 From: rnv Date: Mon, 21 Jan 2019 18:06:12 +0300 Subject: [PATCH] 23641: [CEA] FIELDS Window not locked to panel. --- src/LightApp/LightApp_Application.cxx | 25 ++++++++++++++++++------- src/LightApp/LightApp_Application.h | 2 +- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 6fbc2c7a8..21cc6176f 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -1020,10 +1020,15 @@ void LightApp_Application::onOpenDoc() { SUIT_Study* study = activeStudy(); - if ( !checkExistingDoc() ) + if ( !checkExistingDoc( false ) ) + return; + + QString aName = getFileName( true, QString(), getFileFilter( true ), QString(), 0 ); + if ( aName.isNull() ) //Cancel return; - CAM_Application::onOpenDoc(); + closeDoc(false); + onOpenDoc( aName ); if ( !study ) // new study will be create in THIS application { @@ -5157,7 +5162,7 @@ void LightApp_Application::onViewManagerRemoved( SUIT_ViewManager* ) /*! Check existing document. */ -bool LightApp_Application::checkExistingDoc() +bool LightApp_Application::checkExistingDoc( bool closeExistingDoc ) { bool result = true; if( activeStudy() ) { @@ -5171,17 +5176,23 @@ bool LightApp_Application::checkExistingDoc() if(answer == 0) { if ( activeStudy()->isSaved() ) { onSaveDoc(); - closeDoc( false ); + if (closeExistingDoc) { + closeDoc(false); + } } else if ( onSaveAsDoc() ) { - if( !closeDoc( false ) ) { - result = false; + if (closeExistingDoc) { + if( !closeDoc( false ) ) { + result = false; + } } } else { result = false; } } else if( answer == 1 ) { - closeDoc( false ); + if (closeExistingDoc) { + closeDoc( false ); + } } else if( answer == 2 ) { result = false; } diff --git a/src/LightApp/LightApp_Application.h b/src/LightApp/LightApp_Application.h index f32fd38a4..c4ec54ef7 100644 --- a/src/LightApp/LightApp_Application.h +++ b/src/LightApp/LightApp_Application.h @@ -180,7 +180,7 @@ public: void updateVisibilityState( DataObjectList& theList, SUIT_ViewModel* theViewModel ); - virtual bool checkExistingDoc(); + virtual bool checkExistingDoc( bool = true ); #ifndef DISABLE_PYCONSOLE PyConsole_Interp* getPyInterp(); -- 2.39.2