From: vsr Date: Thu, 26 Jan 2017 16:58:59 +0000 (+0300) Subject: Enable back CAF package. X-Git-Tag: SHAPER_2.7.0~3^2~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d3f84a2bd6b64ebe64b8bd639d28dd0e8c033133;p=modules%2Fgui.git Enable back CAF package. --- diff --git a/src/CAF/CAF_Application.cxx b/src/CAF/CAF_Application.cxx index 477dca391..ef3e2fec0 100755 --- a/src/CAF/CAF_Application.cxx +++ b/src/CAF/CAF_Application.cxx @@ -36,7 +36,7 @@ #include #include -#include +#include /*! \brief Create new instance of CAF_Application. @@ -106,13 +106,16 @@ Handle( TDocStd_Application ) CAF_Application::stdApp() const \return file filters for open/save document dialog box */ -QString CAF_Application::getFileFilter() const +QString CAF_Application::getFileFilter( bool open ) const { if ( stdApp().IsNull() ) return QString(); - TColStd_SequenceOfExtendedString formats; - stdApp()->Formats( formats ); + TColStd_SequenceOfAsciiString formats; + if ( open ) + stdApp()->ReadingFormats( formats ); + else + stdApp()->WritingFormats( formats ); QStringList allWC; QMap wildCards; diff --git a/src/CAF/CAF_Application.h b/src/CAF/CAF_Application.h index 5ee1b60be..1ec1aa90e 100755 --- a/src/CAF/CAF_Application.h +++ b/src/CAF/CAF_Application.h @@ -48,7 +48,7 @@ public: Handle(TDocStd_Application) stdApp() const; - virtual QString getFileFilter() const; + virtual QString getFileFilter( bool ) const; public slots: virtual void onHelpAbout(); diff --git a/src/CAF/CAF_Study.cxx b/src/CAF/CAF_Study.cxx index 15f6185ee..f4f4cf957 100755 --- a/src/CAF/CAF_Study.cxx +++ b/src/CAF/CAF_Study.cxx @@ -33,7 +33,7 @@ #include #include - +#include #include #include @@ -106,8 +106,10 @@ bool CAF_Study::createDocument( const QString& doc ) { try { OCC_CATCH_SIGNALS; - TColStd_SequenceOfExtendedString formats; - app->stdApp()->Formats( formats ); + TColStd_SequenceOfAsciiString formats; + app->stdApp()->WritingFormats( formats ); + if ( formats.IsEmpty() ) + app->stdApp()->ReadingFormats( formats ); if ( !formats.IsEmpty() ) app->stdApp()->NewDocument( formats.First(), myStdDoc ); } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f4b1b7fed..907798d2e 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -32,10 +32,7 @@ ADD_SUBDIRECTORY(ObjBrowser) ADD_SUBDIRECTORY(SUIT) ADD_SUBDIRECTORY(SUITApp) ADD_SUBDIRECTORY(STD) -# CAF package (not compilable while TDocStd_Application::Formats is removed) -IF(CAS_VERSION_STR VERSION_LESS "7.0.1") - ADD_SUBDIRECTORY(CAF) -ENDIF() +ADD_SUBDIRECTORY(CAF) ADD_SUBDIRECTORY(CAM) ADD_SUBDIRECTORY(LogWindow) ADD_SUBDIRECTORY(Prs) diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 4b336bd65..1824defd3 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -1836,12 +1836,10 @@ void LightApp_Application::studyCreated( SUIT_Study* s ) } /*!Gets file filter. - *\retval QString "(*.bin)" + *\retval QString "(*.hdf)" */ -QString LightApp_Application::getFileFilter() const +QString LightApp_Application::getFileFilter( bool /*open*/) const { - //return "(*.bin)"; - // HDF persistence return "(*.hdf)"; } diff --git a/src/LightApp/LightApp_Application.h b/src/LightApp/LightApp_Application.h index 926546228..5f98a8794 100644 --- a/src/LightApp/LightApp_Application.h +++ b/src/LightApp/LightApp_Application.h @@ -118,7 +118,7 @@ public: LightApp_Preferences* preferences() const; - virtual QString getFileFilter() const; + virtual QString getFileFilter( bool ) const; virtual QString getFileName( bool open, const QString& initial, const QString& filters, const QString& caption, QWidget* parent ); diff --git a/src/STD/STD_Application.cxx b/src/STD/STD_Application.cxx index ff308b7d7..d252e1491 100755 --- a/src/STD/STD_Application.cxx +++ b/src/STD/STD_Application.cxx @@ -314,7 +314,7 @@ bool STD_Application::onNewDoc( const QString& name ) void STD_Application::onOpenDoc() { // It is preferrable to use OS-specific file dialog box here !!! - QString aName = getFileName( true, QString(), getFileFilter(), QString(), 0 ); + QString aName = getFileName( true, QString(), getFileFilter( true ), QString(), 0 ); if ( aName.isNull() ) return; @@ -611,7 +611,7 @@ bool STD_Application::onSaveAsDoc() bool isOk = false; while ( !isOk ) { - QString aName = getFileName( false, study->studyName(), getFileFilter(), QString(), 0 ); + QString aName = getFileName( false, study->studyName(), getFileFilter( false ), QString(), 0 ); if ( aName.isNull() ) return false; @@ -884,6 +884,12 @@ void STD_Application::onConnectPopupRequest( SUIT_PopupClient* client, QContextM delete popup; } +/*!\retval QString - return file extension(s).*/ +QString STD_Application::getFileFilter( bool /*open*/ ) const +{ + return QString(); +} + /*!\retval QString - return file name from dialog.*/ QString STD_Application::getFileName( bool open, const QString& initial, const QString& filters, const QString& caption, QWidget* parent ) diff --git a/src/STD/STD_Application.h b/src/STD/STD_Application.h index 06ad40df9..c709c95cd 100755 --- a/src/STD/STD_Application.h +++ b/src/STD/STD_Application.h @@ -60,7 +60,7 @@ public: UserID }; - public: +public: STD_Application(); virtual ~STD_Application(); @@ -88,9 +88,9 @@ public: void viewManagers( const QString&, ViewManagerList& ) const; virtual int viewManagerId (const SUIT_ViewManager* ) const; - virtual QString getFileFilter() const { return QString(); } + virtual QString getFileFilter( bool open ) const; virtual QString getFileName( bool open, const QString& initial, const QString& filters, - const QString& caption, QWidget* parent ); + const QString& caption, QWidget* parent ); QString getDirectory( const QString& initial, const QString& caption, QWidget* parent ); virtual void start(); diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index e16d11d53..12a733584 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -969,14 +969,6 @@ void SalomeApp_Application::onDockWindowVisibilityChanged( bool theIsVisible ) objectBrowserColumnsVisibility(); } -/*!Gets file filter. - *\retval QString "(*.hdf)" - */ -QString SalomeApp_Application::getFileFilter() const -{ - return "(*.hdf)"; -} - /*!Create window.*/ QWidget* SalomeApp_Application::createWindow( const int flag ) { diff --git a/src/SalomeApp/SalomeApp_Application.h b/src/SalomeApp/SalomeApp_Application.h index c2b62929d..ae6775ea7 100644 --- a/src/SalomeApp/SalomeApp_Application.h +++ b/src/SalomeApp/SalomeApp_Application.h @@ -87,8 +87,6 @@ public: virtual void updateObjectBrowser( const bool = true ); - virtual QString getFileFilter() const; - virtual void start(); virtual void contextMenuPopup( const QString&, QMenu*, QString& );