From 68a1537b8c7994d51c56ec08282c9f8497b6ced5 Mon Sep 17 00:00:00 2001 From: stv Date: Thu, 15 Mar 2007 10:55:07 +0000 Subject: [PATCH] *** empty log message *** --- src/SUIT/SUIT_Application.h | 5 ---- src/SUIT/SUIT_ViewManager.cxx | 43 +++++++++++++++++++++-------------- src/SUIT/SUIT_ViewManager.h | 41 ++++++++++++++++++--------------- 3 files changed, 49 insertions(+), 40 deletions(-) diff --git a/src/SUIT/SUIT_Application.h b/src/SUIT/SUIT_Application.h index 472c5d27b..6a0c5e978 100755 --- a/src/SUIT/SUIT_Application.h +++ b/src/SUIT/SUIT_Application.h @@ -30,7 +30,6 @@ class QLabel; class QString; class QAction; class SUIT_Desktop; -class SUIT_Convertor; class SUIT_ViewModel; class SUIT_ResourceMgr; @@ -95,10 +94,6 @@ public: SUIT_ResourceMgr* resourceMgr() const; - /*! Returns instance of data object Convertor class according to given Viewer. - If convertation is not supported returns 0. */ - virtual SUIT_Convertor* getConvertor(const SUIT_ViewModel* theViewer) { return 0; } - //! Puts the message to the status bar void putInfo ( const QString&, const int = 0 ); diff --git a/src/SUIT/SUIT_ViewManager.cxx b/src/SUIT/SUIT_ViewManager.cxx index 2302e245f..cfcac20ba 100755 --- a/src/SUIT/SUIT_ViewManager.cxx +++ b/src/SUIT/SUIT_ViewManager.cxx @@ -1,17 +1,17 @@ // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D -// +// // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -53,7 +54,7 @@ myStudy( NULL ) myId = useNewId( getType() ); - connect( theDesktop, SIGNAL( windowActivated( SUIT_ViewWindow* ) ), + connect( theDesktop, SIGNAL( windowActivated( SUIT_ViewWindow* ) ), this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) ); myStudy = theStudy; @@ -91,8 +92,15 @@ void SUIT_ViewManager::setTitle( const QString& theTitle ) setViewName( myViews[i] ); } +void SUIT_ViewManager::setIcon( const QPixmap& theIcon ) +{ + myIcon = theIcon; + for ( int i = 0; i < (int)myViews.count(); i++ ) + myViews[i]->setWindowIcon( QIcon( myIcon ) ); +} + /*!Sets view model \a theViewModel to view manager.*/ -void SUIT_ViewManager::setViewModel(SUIT_ViewModel* theViewModel) +void SUIT_ViewManager::setViewModel(SUIT_ViewModel* theViewModel) { if (myViewModel && myViewModel != theViewModel) { myViewModel->setViewManager(0); @@ -140,14 +148,15 @@ SUIT_ViewWindow* SUIT_ViewManager::createViewWindow() delete aView; return 0; } - + setViewName( aView ); + aView->setWindowIcon( QIcon( myIcon ) ); + //myDesktop->addViewWindow( aView ); //it is done automatically during creation of view - aView->setViewManager(this); - - emit viewCreated(aView); + aView->setViewManager( this ); + emit viewCreated( aView ); // Special treatment for the case when is the first one in this view manager // -> call onWindowActivated() directly, because somebody may always want @@ -188,7 +197,7 @@ bool SUIT_ViewManager::insertView(SUIT_ViewWindow* theView) myViews.resize( aNbItems ); aSize = myViews.size(); } - + connect(theView, SIGNAL(closing(SUIT_ViewWindow*)), this, SLOT(onClosingView(SUIT_ViewWindow*))); @@ -333,8 +342,8 @@ void SUIT_ViewManager::closeAllViews() *\retval QString - type of view model. */ QString SUIT_ViewManager::getType() const -{ - return (!myViewModel)? "": myViewModel->getType(); +{ + return (!myViewModel)? "": myViewModel->getType(); } /*! diff --git a/src/SUIT/SUIT_ViewManager.h b/src/SUIT/SUIT_ViewManager.h index 0baeb780e..0cb1c05a2 100755 --- a/src/SUIT/SUIT_ViewManager.h +++ b/src/SUIT/SUIT_ViewManager.h @@ -1,17 +1,17 @@ // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D -// +// // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either +// License as published by the Free Software Foundation; either // version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com @@ -23,6 +23,7 @@ #include "SUIT_ViewWindow.h" #include "SUIT_PopupClient.h" +#include #include #include #include @@ -48,21 +49,24 @@ public: virtual QString popupClientType() const { return getType(); } virtual void contextMenuPopup( QMenu* ); - + void setViewModel(SUIT_ViewModel* theViewModel); SUIT_ViewModel* getViewModel() { return myViewModel; } - + SUIT_Study* study() const; - QString getType() const; + QString getType() const; SUIT_ViewWindow* getActiveView() { return myActiveView; } - + int getViewsCount() { return myViews.count(); } QVector getViews() const; QString getTitle() const { return myTitle; } virtual void setTitle( const QString& ); + QPixmap getIcon() const { return myIcon; } + virtual void setIcon( const QPixmap& ); + SUIT_ViewWindow* createViewWindow(); bool isVisible() const; @@ -72,7 +76,7 @@ public: public slots: void createView(); void closeAllViews(); - + signals: void lastViewClosed(SUIT_ViewManager*); void deleteView(SUIT_ViewWindow*); @@ -85,7 +89,7 @@ signals: void keyPress(SUIT_ViewWindow*, QKeyEvent*); void keyRelease(SUIT_ViewWindow*, QKeyEvent*); void activated(SUIT_ViewManager*); - + protected slots: void onWindowActivated(SUIT_ViewWindow*); void onClosingView( SUIT_ViewWindow* ); @@ -94,19 +98,19 @@ protected slots: private slots: void onContextMenuRequested( QContextMenuEvent* e ); - + protected: /*! Inserts the View into internal Views Vector.\n * Returns true if view has been added successfully */ virtual bool insertView(SUIT_ViewWindow* theView); - + /*! Removes the View from internal Views Vector.*/ virtual void removeView(SUIT_ViewWindow* theView); - + /*! Close the specified View.*/ virtual void closeView(SUIT_ViewWindow* theView); - + /*! Used to set unique name for the view.*/ virtual void setViewName(SUIT_ViewWindow* theView ); QString prepareTitle( const QString&, const int, const int ); @@ -123,6 +127,7 @@ protected: SUIT_ViewWindow* myActiveView; int myId; + QPixmap myIcon; QString myTitle; SUIT_Study* myStudy; -- 2.39.2