-// Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
void STD_Application::start()
{
createActions();
+ customize();
updateDesktopTitle();
updateCommandsStatus();
study->closeDocument();
emit appClosed();
setActiveStudy( 0 );
- delete study;
+ //delete study;
afterCloseDoc();
}
createTool( EditPasteId, stdTBar );
}
+/*!
+ Customize actions.
+*/
+void STD_Application::customize()
+{
+}
+
/*!Opens new application*/
void STD_Application::onNewDoc()
{
return true;
}
-int STD_Application::closeChoice( const QString& docName )
+int STD_Application::closeChoice( const QString& /*docName*/ )
{
int answer = SUIT_MessageBox::question( desktop(), tr( "CLOSE_STUDY" ), tr( "CLOSE_QUESTION" ),
SUIT_MessageBox::Save | SUIT_MessageBox::Discard | SUIT_MessageBox::Cancel,
return res;
}
-bool STD_Application::closeAction( const int choice, bool& closePermanently )
+bool STD_Application::closeAction( const int choice, bool& /*closePermanently*/ )
{
bool res = true;
switch( choice )
}
/*!Save document if all ok, else error message.*/
-void STD_Application::onSaveDoc()
+bool STD_Application::onSaveDoc()
{
if ( !activeStudy() )
- return;
+ return false;
if ( !abortAllOperations() )
- return;
+ return false;
bool isOk = false;
if ( activeStudy()->isSaved() )
if ( isOk )
studySaved( activeStudy() );
else
- onSaveAsDoc();
+ isOk = onSaveAsDoc();
+ return isOk;
}
/*! \retval \c true, if document saved successfully, else \c false.*/
SUIT_ViewManager* vm = 0;
for ( QList<SUIT_ViewManager*>::const_iterator it = myViewMgrs.begin(); it != myViewMgrs.end() && !vm; ++it )
{
- if ( (*it)->getType() == vmType && !(*it)->getDetached())
+ bool keepDetached = property("keep_detached").toBool();
+ if ( (*it)->getType() == vmType && (!(*it)->getDetached() || keepDetached))
vm = *it;
}
return vm;