diff --git a/Code/Mantid/Framework/DataHandling/src/Load.cpp b/Code/Mantid/Framework/DataHandling/src/Load.cpp index e29e91c5e6bd81d964f2177655e9c240c08f03c0..5f5b9a685284dff845015081c16503de968f330e 100644 --- a/Code/Mantid/Framework/DataHandling/src/Load.cpp +++ b/Code/Mantid/Framework/DataHandling/src/Load.cpp @@ -178,7 +178,9 @@ namespace Mantid if( loadProp->name() == filePropName ) continue; try { - declareProperty(loadProp->clone(), loadProp->documentation()); + Property * propClone = loadProp->clone(); + propClone->deleteSettings(); //Get rid of special settings because it does not work in custom GUI. + declareProperty(propClone, loadProp->documentation()); } catch(Exception::ExistsError&) { diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/Property.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/Property.h index 91ad516d98183000c39369fbf438aecdc319bb58..d3a3a5c44b0607b438b3fbf71ea0f35670250093 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/Property.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/Property.h @@ -113,6 +113,15 @@ public: void setSettings(IPropertySettings * settings) { m_settings = settings; } + /** @return the PropertySettings for this property */ + IPropertySettings * getSettings() + { return m_settings; } + + /** Deletes the PropertySettings object contained */ + void deleteSettings() + { delete m_settings; m_settings = NULL; } + + ///Overriden function that returns if property has the same value that it was initialised with, if applicable virtual bool isDefault() const = 0; ///Whether to save input values diff --git a/Code/Mantid/Framework/Kernel/src/Property.cpp b/Code/Mantid/Framework/Kernel/src/Property.cpp index e19a22864ecf9d24ae94bd79fd3f25ab77908146..76497cddc8b584c035cc5610dceaa87ed794e0c8 100644 --- a/Code/Mantid/Framework/Kernel/src/Property.cpp +++ b/Code/Mantid/Framework/Kernel/src/Property.cpp @@ -20,7 +20,8 @@ Property::Property( const std::string &name, const std::type_info &type, const u m_typeinfo( &type ), m_direction( direction ), m_units(""), - m_settings(NULL) + m_settings(NULL), + m_group("") { // Make sure a random int hasn't been passed in for the direction // Property & PropertyWithValue destructors will be called in this case @@ -34,7 +35,8 @@ Property::Property( const Property& right ) : m_typeinfo( right.m_typeinfo ), m_direction( right.m_direction ), m_units( right.m_units), - m_settings(NULL) + m_settings(NULL), + m_group( right.m_group) { if (right.m_settings) m_settings = right.m_settings->clone(); diff --git a/Code/Mantid/Framework/Kernel/src/PropertyManager.cpp b/Code/Mantid/Framework/Kernel/src/PropertyManager.cpp index 733bd53c110727a4a7810c3ca4bb9f50c2e71945..0c043881b8ff3c1836cf04c59150acbe60c9a382 100644 --- a/Code/Mantid/Framework/Kernel/src/PropertyManager.cpp +++ b/Code/Mantid/Framework/Kernel/src/PropertyManager.cpp @@ -34,6 +34,8 @@ namespace Mantid for (unsigned int i = 0; i < m_orderedProperties.size(); ++i) { Property * p = other.m_orderedProperties[i]->clone(); + if (p->getSettings()) + p->getSettings()->setPropertyManager(this); this->m_orderedProperties[i] = p; std::string key = p->name(); std::transform(key.begin(), key.end(), key.begin(), toupper); @@ -59,6 +61,8 @@ namespace Mantid for (unsigned int i = 0; i < m_orderedProperties.size(); ++i) { Property * p = other.m_orderedProperties[i]->clone(); + if (p->getSettings()) + p->getSettings()->setPropertyManager(this); this->m_orderedProperties[i] = p; std::string key = p->name(); std::transform(key.begin(), key.end(), key.begin(), toupper); @@ -188,6 +192,9 @@ namespace Mantid delete p; throw std::invalid_argument("An empty property name is not permitted"); } + // Make sure the settings has the right property manager attached + if (p->getSettings()) + p->getSettings()->setPropertyManager(this); std::transform(key.begin(), key.end(), key.begin(), toupper); if ( m_properties.insert(PropertyMap::value_type(key, p)).second)