]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Forbid renaming of the objects "in place" by default.
authorrnv <rnv@opencascade.com>
Wed, 7 Mar 2012 11:37:46 +0000 (11:37 +0000)
committerrnv <rnv@opencascade.com>
Wed, 7 Mar 2012 11:37:46 +0000 (11:37 +0000)
src/SalomeApp/SalomeApp_Module.cxx
src/SalomeApp/SalomeApp_Module.h

index 59efa951b4765009b3379de7e420ab9d1d0a92c3..39245c79bd180e183854a2dbed6ba22f5cad5259 100644 (file)
@@ -229,44 +229,6 @@ void SalomeApp_Application::onStudyClosed( SUIT_Study* theStudy){
              this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ) );
 }
 
-/*!
-  \brief Check if this object is can't be renamed in place
-
-  This method can be re-implemented in the subclasses.
-  Return true in case if object isn't reference or component (module root).
-
-  \param id column id
-  \return \c true if the item can be renamed by the user in place (e.g. in the Object browser)
-*/
-bool SalomeApp_Module::renameAllowed( const QString& entry) const {
-
-  SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
-
-  SalomeApp_Study* appStudy = app ? dynamic_cast<SalomeApp_Study*>( app->activeStudy() ) : 0; 
-
-  SalomeApp_DataObject* obj = appStudy ? dynamic_cast<SalomeApp_DataObject*>(appStudy->findObjectByEntry(entry)) : 0;
-
-  return (app && appStudy && obj && !appStudy->isComponent(entry) && !obj->isReference());
-}
-
-/*!
-  \brief Show warning message box and return c\ false in case if current study locked,
-         \c true otherwise.
-*/
-bool SalomeApp_Module::renameObject( const QString& /*entry*/, const QString& /*name*/) {
-
-  SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
-  SalomeApp_Study* appStudy = app ? dynamic_cast<SalomeApp_Study*>(app->activeStudy()) : 0;
-  
-  if ( appStudy && appStudy->studyDS()) {    
-    bool aLocked = (_PTR(AttributeStudyProperties)(appStudy->studyDS()->GetProperties()))->IsLocked();
-    if ( aLocked ) {
-      SUIT_MessageBox::warning ( app->desktop(), QObject::tr("WRN_WARNING"), QObject::tr("WRN_STUDY_LOCKED") );
-      return false;
-    }
-  }
-  return true;
-}
 
 void SalomeApp_Module::updateModuleVisibilityState() {
 
index 307bf04c12db92f3d5ca1482dfa32f69af8552ad..428c1e43766004a3d5f7cea9bdf57b17ec4271a1 100644 (file)
@@ -62,9 +62,6 @@ public:
   virtual void                        storeVisualParameters(int savePoint);
   virtual void                        restoreVisualParameters(int savePoint);
   virtual LightApp_Selection*         createSelection() const;
-
-  virtual bool                        renameAllowed( const QString& ) const;
-  virtual bool                        renameObject( const QString&, const QString& );
   
   public slots:
   virtual bool                        activateModule( SUIT_Study* );