mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-11-11 16:19:17 +05:00
Automatic update of Dependency tree after object renaming.
This commit is contained in:
parent
66d16d30f7
commit
f084f3e3cd
@ -716,6 +716,18 @@ void DependencyTree_View::changeWidgetState( bool theIsCompute )
|
||||
updateButton->setEnabled( !theIsCompute );
|
||||
}
|
||||
|
||||
bool DependencyTree_View::updateObjectName( const std::string &theEntry )
|
||||
{
|
||||
bool res = false;
|
||||
for( initSelected(); moreSelected(); nextSelected() ) {
|
||||
if( DependencyTree_Object* aDepObject = dynamic_cast<DependencyTree_Object*>( selectedObject() ) ) {
|
||||
aDepObject->updateName();
|
||||
res = true;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
DependencyTree_ComputeDlg_QThread::DependencyTree_ComputeDlg_QThread( DependencyTree_View* theView )
|
||||
{
|
||||
myView = theView;
|
||||
|
@ -94,6 +94,7 @@ public:
|
||||
void setIsCompute( bool );
|
||||
bool getIsCompute();
|
||||
|
||||
bool updateObjectName( const std::string &theEntry );
|
||||
|
||||
QMutex myMutex;
|
||||
|
||||
|
@ -3343,6 +3343,11 @@ bool GeometryGUI::renameObject( const QString& entry, const QString& name)
|
||||
GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(obj));
|
||||
if (!CORBA::is_nil(anObj)) {
|
||||
anObj->SetName( name.toLatin1().data() ); // Rename the corresponding GEOM_Object
|
||||
// rename the given object in the dependency tree
|
||||
if ( SUIT_ViewManager *svm = app->getViewManager( GraphicsView_Viewer::Type(), false ) )
|
||||
if ( DependencyTree_ViewModel* viewModel = dynamic_cast<DependencyTree_ViewModel*>( svm->getViewModel() ) )
|
||||
if ( DependencyTree_View* view = dynamic_cast<DependencyTree_View*>( viewModel->getActiveViewPort() ) )
|
||||
view->updateObjectName( anObj->GetEntry() );
|
||||
}
|
||||
result = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user