Changeset 83d6249 in sasview for src/sas/qtgui/DataExplorer.py


Ignore:
Timestamp:
Feb 16, 2017 8:06: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:
2bb20a5, fca1f50
Parents:
4c7dd9f
Message:

Perspectives are now switchable and can be added "dynamically"

File:
1 edited

Legend:

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

    r965fbd8 r83d6249  
    6565        self._helpView = QtWebKit.QWebView() 
    6666 
     67        # Fill in the perspectives combo 
     68        self.initPerspectives() 
     69 
    6770        # Custom context menu 
    6871        self.treeView.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) 
     
    125128        self.cbgraph.setEnabled(len(PlotHelper.currentPlots()) > 0) 
    126129        self.cmdAppend.setEnabled(len(PlotHelper.currentPlots()) > 0) 
     130 
     131    def initPerspectives(self): 
     132        """ 
     133        Populate the Perspective combobox and define callbacks 
     134        """ 
     135        self.cbFitting.currentIndexChanged.connect(self.updatePerspectiveCombo) 
     136        # Set the index so we see the default (Fitting) 
     137        self.updatePerspectiveCombo(0) 
    127138 
    128139    def loadFromURL(self, url): 
     
    389400            self.cbgraph.setCurrentIndex(ind) 
    390401 
     402    def updatePerspectiveCombo(self, index): 
     403        """ 
     404        Notify the gui manager about the new perspective chosen. 
     405        """ 
     406        self.communicator.perspectiveChangedSignal.emit(self.cbFitting.currentText()) 
     407 
    391408    def newPlot(self): 
    392409        """ 
Note: See TracChangeset for help on using the changeset viewer.