"....................",
"...................."};
-int LightApp_Application::lastStudyId = 0;
-
// Markers used to parse array with dockable windows and toolbars state.
// For more details please see the qdockarealayout.cpp && qtoolbararealayout.cpp
// in the Qt source code.
}
}
-/*!
- \return last global id of study
-*/
-int LightApp_Application::studyId()
-{
- return LightApp_Application::lastStudyId;
-}
-
/*!Create new instance of LightApp_Application.*/
extern "C" LIGHTAPP_EXPORT SUIT_Application* createApplication()
{
desktop()->statusBar()->showMessage( "" );
LightApp_EventFilter::Init();
+
+ onNewDoc();
}
/*!Closeapplication.*/
*/
void LightApp_Application::onNewDoc()
{
-#ifdef SINGLE_DESKTOP
if ( !checkExistingDoc() )
return;
-#endif
//asl: fix for 0020515
saveDockWindowsState();
{
SUIT_Study* study = activeStudy();
-#ifdef SINGLE_DESKTOP
if ( !checkExistingDoc() )
return;
-#endif
CAM_Application::onOpenDoc();
*/
bool LightApp_Application::onOpenDoc( const QString& aName )
{
-#ifdef SINGLE_DESKTOP
if ( !checkExistingDoc() )
return false;
-#endif
saveDockWindowsState();
/*!
Gets window.
\param flag - key for window
- \param studyId - study id
Flag used how identificator of window in windows list.
*/
-QWidget* LightApp_Application::getWindow( const int flag, const int )
+QWidget* LightApp_Application::getWindow( const int flag)
{
QWidget* wid = dockWindow( flag );
if ( !wid )
*/
SUIT_Study* LightApp_Application::createNewStudy()
{
- LightApp_Application::lastStudyId++;
-
LightApp_Study* aStudy = new LightApp_Study( this );
// Set up processing of major study-related events
pref->addPreference( tr( "PREF_PY_LINE_NUMBS_AREA" ), pyDispGroup,
LightApp_Preferences::Bool, "PyEditor", "LineNumberArea" );
// ... "Display settings" group <<end>>
+
+ // ... "Editor settings" group <<start>>
+ int pyEditGroup = pref->addPreference( tr( "PREF_GROUP_PY_EDITOR" ), pyeditTab );
+ // ... -> navigation mode
+ int pyCompletion = pref->addPreference( tr( "PREF_PY_COMPLETION_MODE" ), pyEditGroup,
+ LightApp_Preferences::Selector, "PyEditor", "CompletionPolicy" );
+ aValuesList.clear();
+ anIndicesList.clear();
+ aValuesList << tr("PREF_PY_NONE") << tr("PREF_PY_AUTO") << tr("PREF_PY_MANUAL") << tr("PREF_PY_ALWAYS");
+ anIndicesList << 0 << 1 << 2 << 3 ;
+ pref->setItemProperty( "strings", aValuesList, pyCompletion );
+ pref->setItemProperty( "indexes", anIndicesList, pyCompletion );
+ // ... "Editor settings" group <<end>>
+
// ... "Tab settings" group <<start>>
int pyTabGroup = pref->addPreference( tr( "PREF_GROUP_PY_TAB" ), pyeditTab );
pref->setItemProperty( "columns", 2, pyTabGroup );
}
if ( sec == "desktop" && param == "opaque_resize" ) {
bool opaqueResize = resMgr->booleanValue( "desktop", "opaque_resize", false );
- QMainWindow::DockOptions dopts = desktop()->dockOptions();
- if ( opaqueResize ) dopts |= QMainWindow::AnimatedDocks;
- else dopts &= ~QMainWindow::AnimatedDocks;
- desktop()->setDockOptions( dopts );
+ // RNV: This code has been commented, because clearing of the QMainWindow::AnimatedDocks option
+ // leads to strange behaviour of the dockable windows (at least at qt-5.6.1):
+ // any dockable window can't be docked to the another area, except initial area.
+ // It is possible to move window to another area, but it always returns to the initial area.
+ //
+ // QMainWindow::DockOptions dopts = desktop()->dockOptions();
+ // if ( opaqueResize ) dopts |= QMainWindow::AnimatedDocks;
+ // else dopts &= ~QMainWindow::AnimatedDocks;
+ // desktop()->setDockOptions( dopts );
desktop()->setOpaqueResize( opaqueResize );
if ( dynamic_cast<STD_TabDesktop*>( desktop() ) )
dynamic_cast<STD_TabDesktop*>( desktop() )->workstack()->setOpaqueResize( opaqueResize );
if ( desktop() ) {
desktop()->retrieveGeometry( aResMgr->stringValue( "desktop", "geometry" ) );
bool opaqueResize = aResMgr->booleanValue( "desktop", "opaque_resize", false );
- QMainWindow::DockOptions dopts = desktop()->dockOptions();
- if ( opaqueResize ) dopts |= QMainWindow::AnimatedDocks;
- else dopts &= ~QMainWindow::AnimatedDocks;
- desktop()->setDockOptions( dopts );
+ // QMainWindow::DockOptions dopts = desktop()->dockOptions();
+ // if ( opaqueResize ) dopts |= QMainWindow::AnimatedDocks;
+ // else dopts &= ~QMainWindow::AnimatedDocks;
+ // desktop()->setDockOptions( dopts );
desktop()->setOpaqueResize( opaqueResize );
if ( dynamic_cast<STD_TabDesktop*>( desktop() ) )
dynamic_cast<STD_TabDesktop*>( desktop() )->workstack()->setOpaqueResize( opaqueResize );
{
bool result = true;
if( activeStudy() ) {
- int answer = SUIT_MessageBox::question( desktop(),
- tr( "APPCLOSE_CAPTION" ),
- tr( "STUDYCLOSE_DESCRIPTION" ),
- tr( "APPCLOSE_SAVE" ),
- tr( "APPCLOSE_CLOSE" ),
- tr( "APPCLOSE_CANCEL" ), 0 );
+ int answer = !activeStudy()->isModified() ? 1 :
+ SUIT_MessageBox::question( desktop(),
+ tr( "APPCLOSE_CAPTION" ),
+ tr( "STUDYCLOSE_DESCRIPTION" ),
+ tr( "APPCLOSE_SAVE" ),
+ tr( "APPCLOSE_CLOSE" ),
+ tr( "APPCLOSE_CANCEL" ), 0 );
if(answer == 0) {
if ( activeStudy()->isSaved() ) {
onSaveDoc();
closeDoc( false );
} else if ( onSaveAsDoc() ) {
- if( !closeDoc( false ) ) {
- result = false;
+ if( !closeDoc( false ) ) {
+ result = false;
}
} else {
result = false;