Changeset 8ac3551 in sasview


Ignore:
Timestamp:
Mar 21, 2018 8:26:17 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
3790f7f, fca1f50
Parents:
8b480d27
Message:

Analysis menu properly interacting with the perspective combo.
Fixed menu enablement for Fitting.

Location:
src/sas/qtgui/MainWindow
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/MainWindow/DataExplorer.py

    r3b3b40b r8ac3551  
    473473        Notify the gui manager about the new perspective chosen. 
    474474        """ 
    475         self.communicator.perspectiveChangedSignal.emit(self.cbFitting.currentText()) 
     475        self.communicator.perspectiveChangedSignal.emit(self.cbFitting.itemText(index)) 
    476476        self.chkBatch.setEnabled(self.parent.perspective().allowBatch()) 
    477477 
     
    10311031        pass 
    10321032 
     1033    def onAnalysisUpdate(self, new_perspective=""): 
     1034        """ 
     1035        Update the perspective combo index based on passed string 
     1036        """ 
     1037        assert new_perspective in Perspectives.PERSPECTIVES.keys() 
     1038        self.cbFitting.blockSignals(True) 
     1039        self.cbFitting.setCurrentIndex(self.cbFitting.findText(new_perspective)) 
     1040        self.cbFitting.blockSignals(False) 
     1041        pass 
     1042 
    10331043    def loadComplete(self, output): 
    10341044        """ 
  • src/sas/qtgui/MainWindow/GuiManager.py

    r3b3b40b r8ac3551  
    4949    Main SasView window functionality 
    5050    """ 
    51  
    5251    def __init__(self, parent=None): 
    5352        """ 
     
    184183        Respond to change of the perspective signal 
    185184        """ 
    186  
    187         # Save users from themselves... 
    188         #if isinstance(self._current_perspective, Perspectives.PERSPECTIVES[str(perspective_name)]): 
    189         self.setupPerspectiveMenubarOptions(self._current_perspective) 
    190         #    return 
    191  
    192185        # Close the previous perspective 
    193186        self.clearPerspectiveMenubarOptions(self._current_perspective) 
     
    199192        # Default perspective 
    200193        self._current_perspective = Perspectives.PERSPECTIVES[str(perspective_name)](parent=self) 
     194 
     195        self.setupPerspectiveMenubarOptions(self._current_perspective) 
    201196 
    202197        subwindow = self._workspace.workspace.addSubWindow(self._current_perspective) 
     
    422417        self._workspace.actionInversion.triggered.connect(self.actionInversion) 
    423418        self._workspace.actionInvariant.triggered.connect(self.actionInvariant) 
     419        self._workspace.actionCorfunc.triggered.connect(self.actionCorfunc) 
    424420        # Help 
    425421        self._workspace.actionDocumentation.triggered.connect(self.actionDocumentation) 
     
    691687        """ 
    692688        self.perspectiveChanged("Fitting") 
     689        # Notify other widgets 
     690        self.filesWidget.onAnalysisUpdate("Fitting") 
    693691 
    694692    def actionInversion(self): 
     
    696694        Change to the Inversion perspective 
    697695        """ 
    698         # For now we'll just update the analysis menu status but when the inversion is implemented delete from here 
    699         self.checkAnalysisOption(self._workspace.actionInversion) 
    700         # to here and uncomment the following line 
    701696        self.perspectiveChanged("Inversion") 
     697        self.filesWidget.onAnalysisUpdate("Inversion") 
    702698 
    703699    def actionInvariant(self): 
     
    706702        """ 
    707703        self.perspectiveChanged("Invariant") 
     704        self.filesWidget.onAnalysisUpdate("Invariant") 
     705 
     706    def actionCorfunc(self): 
     707        """ 
     708        Change to the Corfunc perspective 
     709        """ 
     710        self.perspectiveChanged("Corfunc") 
     711        self.filesWidget.onAnalysisUpdate("Corfunc") 
    708712 
    709713    #============ WINDOW ================= 
     
    852856        elif isinstance(perspective, Perspectives.PERSPECTIVES["Invariant"]): 
    853857            self.checkAnalysisOption(self._workspace.actionInvariant) 
    854         # elif isinstance(perspective, Perspectives.PERSPECTIVES["Inversion"]): 
    855         #     self.checkAnalysisOption(self._workspace.actionInversion) 
     858        elif isinstance(perspective, Perspectives.PERSPECTIVES["Inversion"]): 
     859            self.checkAnalysisOption(self._workspace.actionInversion) 
     860        elif isinstance(perspective, Perspectives.PERSPECTIVES["Corfunc"]): 
     861            self.checkAnalysisOption(self._workspace.actionCorfunc) 
  • src/sas/qtgui/MainWindow/MainWindow.py

    r8353d90 r8ac3551  
    3030        except Exception as ex: 
    3131            import logging 
    32             logging.error("Application failed with: ", ex) 
     32            logging.error("Application failed with: " + str(ex)) 
    3333            print("Application failed with: ", ex) 
    3434 
  • src/sas/qtgui/MainWindow/UI/MainWindowUI.ui

    r3b3b40b r8ac3551  
    128128     <string>Analysis</string> 
    129129    </property> 
     130    <addaction name="actionCorfunc"/> 
    130131    <addaction name="actionFitting"/> 
     132    <addaction name="actionInvariant"/> 
    131133    <addaction name="actionInversion"/> 
    132     <addaction name="actionInvariant"/> 
    133134   </widget> 
    134135   <widget class="QMenu" name="menuHelp"> 
     
    517518   </property> 
    518519  </action> 
     520  <action name="actionCorfunc"> 
     521   <property name="checkable"> 
     522    <bool>true</bool> 
     523   </property> 
     524   <property name="text"> 
     525    <string>Correlation Function</string> 
     526   </property> 
     527  </action> 
    519528 </widget> 
    520529 <resources/> 
Note: See TracChangeset for help on using the changeset viewer.