Ticket #9650: parameter_update_fix.patch

File parameter_update_fix.patch, 3.5 KB (added by Roman Tolchenov, 6 years ago)
  • Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/FitPropertyBrowser.h

    diff --git a/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/FitPropertyBrowser.h b/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/FitPropertyBrowser.h
    index eff7bd9..9a3ed52 100644
    a b public: 
    208208  /// Returns true if the fit should be done against binned (bunched) data.      
    209209  bool rawData()const; 
    210210 
     211  void setADSObserveEnabled(bool enabled); 
     212 
    211213  void postDeleteHandle(const std::string& wsName); 
    212214  void addHandle(const std::string& wsName,const boost::shared_ptr<Mantid::API::Workspace> ws); 
    213215 
  • Code/Mantid/MantidQt/MantidWidgets/src/FitPropertyBrowser.cpp

    diff --git a/Code/Mantid/MantidQt/MantidWidgets/src/FitPropertyBrowser.cpp b/Code/Mantid/MantidQt/MantidWidgets/src/FitPropertyBrowser.cpp
    index bb232ae..951dd72 100644
    a b void FitPropertyBrowser::showEvent(QShowEvent* e) 
    16661666  (void)e; 
    16671667  // Observe what workspaces are added and deleted unless it's a custom fitting, all workspaces for custom fitting (eg muon analysis)  
    16681668  // should be manually added. 
    1669   observeAdd(); 
    1670   observePostDelete(); 
     1669  setADSObserveEnabled(true); 
    16711670  populateWorkspaceNames(); 
    16721671} 
    16731672 
    void FitPropertyBrowser::showEvent(QShowEvent* e) 
    16771676void FitPropertyBrowser::hideEvent(QHideEvent* e) 
    16781677{ 
    16791678  (void)e; 
    1680   observeAdd(false); 
    1681   observePostDelete(false); 
     1679  setADSObserveEnabled(false); 
     1680} 
     1681 
     1682void FitPropertyBrowser::setADSObserveEnabled(bool enabled) 
     1683{ 
     1684  observeAdd(enabled); 
     1685  observePostDelete(enabled); 
    16821686} 
    16831687 
    16841688/// workspace was added 
    void FitPropertyBrowser::addHandle(const std::string& wsName,const boost::shared 
    16881692  QStringList oldWorkspaces = m_workspaceNames; 
    16891693  QString oldName = QString::fromStdString(workspaceName()); 
    16901694  int i = m_workspaceNames.indexOf(QString(wsName.c_str())); 
     1695 
     1696  bool initialSignalsBlocked = m_enumManager->signalsBlocked(); 
     1697 
    16911698  // if new workspace append this workspace name 
    16921699  if (i < 0) 
    16931700  { 
     1701    if (!m_workspaceNames.isEmpty()) 
     1702    { 
     1703      m_enumManager->blockSignals(true); 
     1704    } 
     1705 
    16941706    m_workspaceNames.append(QString(wsName.c_str())); 
    16951707    m_workspaceNames.sort(); 
    16961708    m_enumManager->setEnumNames(m_workspace, m_workspaceNames); 
    void FitPropertyBrowser::addHandle(const std::string& wsName,const boost::shared 
    17011713  { 
    17021714    m_enumManager->setValue(m_workspace,i); 
    17031715  } 
     1716 
     1717  m_enumManager->blockSignals(initialSignalsBlocked); 
     1718  /* 
    17041719  if (m_workspaceNames.size() == 1) 
    17051720  { 
    17061721    setWorkspaceName(QString::fromStdString(wsName)); 
    17071722  } 
    1708   getHandler()->updateWorkspaces(oldWorkspaces); 
     1723  */ 
    17091724} 
    17101725 
    17111726/// workspace was removed 
    void FitPropertyBrowser::postDeleteHandle(const std::string& wsName) 
    17181733  { 
    17191734    m_workspaceNames.removeAt(i); 
    17201735  } 
     1736 
     1737  bool initialSignalsBlocked = m_enumManager->signalsBlocked(); 
     1738 
     1739  if (QString::fromStdString(wsName) != oldName) 
     1740  { 
     1741    m_enumManager->blockSignals(true); 
     1742  } 
     1743 
    17211744  m_enumManager->setEnumNames(m_workspace, m_workspaceNames); 
     1745 
    17221746  i = m_workspaceNames.indexOf(oldName); 
    17231747  if (i >= 0) 
    17241748  { 
    17251749    m_enumManager->setValue(m_workspace,i); 
    17261750  }  
    1727   getHandler()->updateWorkspaces(oldWorkspaces); 
     1751 
     1752  m_enumManager->blockSignals(initialSignalsBlocked); 
    17281753} 
    17291754 
    17301755