X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_DataBrowser.cxx;h=f4cc73c2b0ad64f157d411c65e972e741280dd89;hb=5cae7e874afd2fc1b6f61023e8ebd33a933db3c7;hp=b6cdedb224516b134715593cbfc522844e113e1a;hpb=abe63c42525c9299302649cdb5dcff4f83368c26;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_DataBrowser.cxx b/src/HYDROGUI/HYDROGUI_DataBrowser.cxx index b6cdedb2..f4cc73c2 100644 --- a/src/HYDROGUI/HYDROGUI_DataBrowser.cxx +++ b/src/HYDROGUI/HYDROGUI_DataBrowser.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #define VISIBILITY_COLUMN_WIDTH 25 @@ -50,22 +51,26 @@ HYDROGUI_DataBrowser::HYDROGUI_DataBrowser( HYDROGUI_Module* theModule, SUIT_Dat setWindowTitle( tr( "OBJECT_BROWSER" ) ); connect( this, SIGNAL( requestUpdate() ), theModule->getApp(), SLOT( onRefresh() ) ); + QString EntryCol = QObject::tr( "ENTRY_COLUMN" ); QString RefObjCol = tr( "REF_OBJECT_COLUMN" ); QString BathymetryCol = tr( "BATHYMETRY_COLUMN" ); SUIT_AbstractModel* treeModel = dynamic_cast( model() ); - treeModel->setSearcher( theModule->getApp() ); + //RKV: treeModel->setSearcher( theModule->getApp() ); + treeModel->setSearcher( this ); //RKV + treeModel->registerColumn( 0, EntryCol, LightApp_DataObject::EntryId ); + treeModel->setAppropriate( EntryCol, Qtx::Toggled ); treeModel->registerColumn( 0, RefObjCol, HYDROGUI_DataObject::RefObjectId ); treeModel->setAppropriate( RefObjCol, Qtx::Toggled ); treeModel->registerColumn( 0, BathymetryCol, HYDROGUI_DataObject::BathymetryId ); treeModel->setAppropriate( BathymetryCol, Qtx::Toggled ); // Mantis issue 0020136: Drag&Drop in OB - //RKV: TODO: Uncomment for drag and drop - //RKV: SUIT_ProxyModel* proxyModel = dynamic_cast(treeModel); - //RKV: if ( proxyModel ) { - //RKV: connect( proxyModel, SIGNAL( dropped( const QList&, SUIT_DataObject*, int, Qt::DropAction ) ), - //RKV: theModule->getApp(), SLOT( onDropped( const QList&, SUIT_DataObject*, int, Qt::DropAction ) ) ); - //RKV: } + SUIT_ProxyModel* proxyModel = dynamic_cast(treeModel); + if ( proxyModel ) { + connect( proxyModel, + SIGNAL( dropped( const QList&, SUIT_DataObject*, int, Qt::DropAction ) ), + SIGNAL( dropped( const QList&, SUIT_DataObject*, int, Qt::DropAction ) ) ); + } // temporary commented /* @@ -82,9 +87,22 @@ HYDROGUI_DataBrowser::HYDROGUI_DataBrowser( HYDROGUI_Module* theModule, SUIT_Dat treeView()->header()->setResizeMode(SUIT_DataObject::VisibilityId, QHeaderView::Fixed); treeView()->header()->moveSection(SUIT_DataObject::NameId,SUIT_DataObject::VisibilityId); treeView()->setColumnWidth(SUIT_DataObject::VisibilityId, VISIBILITY_COLUMN_WIDTH); + treeView()->hideColumn( SUIT_DataObject::VisibilityId ); + treeView()->hideColumn( LightApp_DataObject::EntryId ); //RKV: connectPopupRequest( theModule->getApp(), SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) ); } HYDROGUI_DataBrowser::~HYDROGUI_DataBrowser() { } + +SUIT_DataObject* HYDROGUI_DataBrowser::findObject( const QString& theEntry ) const +{ + LightApp_DataObject* aCurObj; + for ( SUIT_DataObjectIterator it( root(), SUIT_DataObjectIterator::DepthLeft ); it.current(); ++it ) { + aCurObj = dynamic_cast( it.current() ); + if ( aCurObj && aCurObj->entry() == theEntry ) + return aCurObj; + } + return NULL; +}