From 2d4215b37786234ada14afcd7c83c776c323ef0d Mon Sep 17 00:00:00 2001 From: sln Date: Fri, 6 Apr 2012 09:58:11 +0000 Subject: [PATCH] Rollback to 1.7.1 source code --- src/LightApp/LightApp_Application.cxx | 94 +---------------------- src/LightApp/LightApp_Application.h | 5 +- src/LightApp/LightApp_Module.cxx | 6 -- src/LightApp/LightApp_Module.h | 3 - src/LightApp/resources/LightApp_msg_en.ts | 28 ------- src/LightApp/resources/LightApp_msg_fr.ts | 28 ------- 6 files changed, 3 insertions(+), 161 deletions(-) diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index dce1076b2..f53fa4f3a 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -585,7 +585,6 @@ void LightApp_Application::createActions() // New window int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, MenuWindowId, 100 ); int newWinMenu = createMenu( tr( "MEN_DESK_NEWWINDOW" ), windowMenu, -1, 0 ); - int restoreWinMenu = createMenu( tr( "MEN_DESK_RESTORE" ), windowMenu, -1, 0 ); createAction( CloseId, tr( "TOT_CLOSE" ), QIcon(), tr( "MEN_DESK_CLOSE" ), tr( "PRP_CLOSE" ), Qt::SHIFT+Qt::Key_C, desk, false, this, SLOT( onCloseWindow() ) ); @@ -618,17 +617,6 @@ void LightApp_Application::createActions() createActionForViewer( NewGraphicsViewId, newWinMenu, QString::number( 5 ), Qt::ALT+Qt::Key_R ); #endif - createAction( RestoreDefaultId, tr( "TOT_RESTORE_DEFAULT" ), QIcon(), - tr( "MEN_DESK_RESTORE_DEFAULT" ), tr( "PRP_RESTORE_DEFAULT" ), - 0, desk, false, this, SLOT( onRestoreDefault() ) ); - - createAction( RestoreFromPrefsId, tr( "TOT_RESTORE_FROM_PREFERENCES" ), QIcon(), - tr( "MEN_DESK_RESTORE_FROM_PREFERENCES" ), tr( "PRP_RESTORE_FROM_PREFERENCES" ), - 0, desk, false, this, SLOT( onRestoreFromPreferences() ) ); - - createMenu( RestoreDefaultId, restoreWinMenu, -1 ); - createMenu( RestoreFromPrefsId, restoreWinMenu, -1 ); - createAction( RenameId, tr( "TOT_RENAME" ), QIcon(), tr( "MEN_DESK_RENAME" ), tr( "PRP_RENAME" ), Qt::SHIFT+Qt::Key_R, desk, false, this, SLOT( onRenameWindow() ) ); createMenu( RenameId, windowMenu, -1 ); @@ -865,14 +853,6 @@ void LightApp_Application::updateCommandsStatus() if( a ) a->setEnabled( activeStudy() ); #endif - - a = action( RestoreDefaultId ); - if( a ) - a->setEnabled( activeStudy() ); - - a = action( RestoreFromPrefsId ); - if( a ) - a->setEnabled( activeStudy() ); } /*! @@ -2720,13 +2700,13 @@ void LightApp_Application::updateViewManagers() /*! Loads windows geometry */ -void LightApp_Application::loadDockWindowsState( const bool theIsForced ) +void LightApp_Application::loadDockWindowsState() { if ( !desktop() ) return; bool store = resourceMgr()->booleanValue( "Study", "store_positions", true ); - if ( !theIsForced && !store ) + if( !store ) return; QString modName; @@ -3069,76 +3049,6 @@ void LightApp_Application::onGroupAllWindow() wgStack->stack(); } -/*! - Restore default state of application windows -*/ -void LightApp_Application::onRestoreDefault() -{ - if ( !activeStudy() || !desktop() ) - return; - - QMap winMap; - bool restored = false; - - if ( activeModule() && activeModule()->inherits( "LightApp_Module" ) ) - { - ((LightApp_Module*)activeModule())->windows( winMap ); - restored = ((LightApp_Module*)activeModule())->defaultWindowsState(); - } - - if ( !restored ) - { - if( winMap.isEmpty() ) - defaultWindows( winMap ); - - QMap::const_iterator winMapIt = winMap.constBegin(); - for ( ; winMapIt != winMap.constEnd(); ++winMapIt ) - { - QWidget* win = dockWindow( winMapIt.key() ); - QDockWidget* dock = ::qobject_cast( win ); - if ( !dock ) - dock = windowDock( win ); - - if ( dock ) - { - if ( !dock->isVisible() ) - dock->setVisible( true ); - - if ( dock->isFloating() ) - dock->setFloating( false ); - - desktop()->addDockWidget( (Qt::DockWidgetArea)winMapIt.value(), dock ); - } - } - - QList tbList = qFindChildren( desktop() ); - for ( QList::iterator tit = tbList.begin(); tit != tbList.end(); ++tit ) - { - QToolBar* tb = *tit; - - QObject* po = Qtx::findParent( tb, "QMainWindow" ); - if ( po != desktop() ) - continue; - - if ( !tb->isVisible() ) - tb->setVisible( true ); - - desktop()->addToolBar( Qt::TopToolBarArea, tb ); - } - } -} - -/*! - Restore application windows state from preferences file -*/ -void LightApp_Application::onRestoreFromPreferences() -{ - if ( !activeStudy() || !desktop() ) - return; - - loadDockWindowsState( true ); -} - /*! \return if the library of module exists \param moduleTitle - title of module diff --git a/src/LightApp/LightApp_Application.h b/src/LightApp/LightApp_Application.h index 3815ec437..3fe5d6ced 100644 --- a/src/LightApp/LightApp_Application.h +++ b/src/LightApp/LightApp_Application.h @@ -76,7 +76,6 @@ public: enum { RenameId = CAM_Application::UserID, CloseId, CloseAllId, GroupAllId, - RestoreDefaultId, RestoreFromPrefsId, PreferencesId, MRUId, ModulesListId, NewGLViewId, NewPlot2dId, NewOCCViewId, NewVTKViewId, NewQxGraphViewId, NewGraphicsViewId, UserID }; @@ -218,15 +217,13 @@ private slots: void onCloseWindow(); void onCloseAllWindow(); void onGroupAllWindow(); - void onRestoreDefault(); - void onRestoreFromPreferences(); protected: void updateWindows(); void updateViewManagers(); void updateModuleActions(); - void loadDockWindowsState( const bool theIsForced = false ); + void loadDockWindowsState(); void saveDockWindowsState(); virtual void studyOpened( SUIT_Study* ); diff --git a/src/LightApp/LightApp_Module.cxx b/src/LightApp/LightApp_Module.cxx index c9ce91928..332e4a70a 100644 --- a/src/LightApp/LightApp_Module.cxx +++ b/src/LightApp/LightApp_Module.cxx @@ -124,12 +124,6 @@ void LightApp_Module::windows( QMap& ) const { } -/*!NOT IMPLEMENTED*/ -bool LightApp_Module::defaultWindowsState() -{ - return false; -} - /*!NOT IMPLEMENTED*/ void LightApp_Module::viewManagers( QStringList& ) const { diff --git a/src/LightApp/LightApp_Module.h b/src/LightApp/LightApp_Module.h index b97547243..95206ec46 100644 --- a/src/LightApp/LightApp_Module.h +++ b/src/LightApp/LightApp_Module.h @@ -93,9 +93,6 @@ public: virtual QString updateDesktopTitle( const QString& ); // Custom update desktop title - virtual bool defaultWindowsState(); - // Custom restore the default windows state - public slots: virtual bool activateModule( SUIT_Study* ); virtual bool deactivateModule( SUIT_Study* ); diff --git a/src/LightApp/resources/LightApp_msg_en.ts b/src/LightApp/resources/LightApp_msg_en.ts index 6cdfcf194..29985e9ea 100644 --- a/src/LightApp/resources/LightApp_msg_en.ts +++ b/src/LightApp/resources/LightApp_msg_en.ts @@ -533,34 +533,6 @@ CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITASPRP_GROUP_ALL Group all windows - - MEN_DESK_RESTORE - Restore windows &state - - - TOT_RESTORE_DEFAULT - By Default - - - MEN_DESK_RESTORE_DEFAULT - &By Default - - - PRP_RESTORE_DEFAULT - Restore windows state by default - - - TOT_RESTORE_FROM_PREFERENCES - From Preferences - - - MEN_DESK_RESTORE_FROM_PREFERENCES - &From Preferences - - - PRP_RESTORE_FROM_PREFERENCES - Restore windows state from preferences file - ERR_DOC_NOT_EXISTS Can not open %1. diff --git a/src/LightApp/resources/LightApp_msg_fr.ts b/src/LightApp/resources/LightApp_msg_fr.ts index e167be16e..b88a546b7 100755 --- a/src/LightApp/resources/LightApp_msg_fr.ts +++ b/src/LightApp/resources/LightApp_msg_fr.ts @@ -533,34 +533,6 @@ CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITASPRP_GROUP_ALL Grouper toutes les fenêtres - - MEN_DESK_RESTORE - Redimensionner les fenêtres - - - TOT_RESTORE_DEFAULT - Par défaut - - - MEN_DESK_RESTORE_DEFAULT - &Défaut - - - PRP_RESTORE_DEFAULT - Redimensionner les fenêtres par défaut. - - - TOT_RESTORE_FROM_PREFERENCES - Selon les préférences - - - MEN_DESK_RESTORE_FROM_PREFERENCES - &Préférences - - - PRP_RESTORE_FROM_PREFERENCES - Redimensionner les fenêtres selon le fichier de préférences. - ERR_DOC_NOT_EXISTS Impossible d'ouvrir %1. -- 2.39.2