def __init__(self, controller=None, parent=None): """ QAliasListPanel(controller: MashupController, parent: QWidget) -> QAliasListPanel """ QtGui.QWidget.__init__(self, parent) self.controller = None self.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) layout = QtGui.QVBoxLayout() self.aliases = QAliasList(controller, self) self.inspector = QAliasInspector(self.aliases) self.updateController(controller) self.setLayout(layout) #self.layout().setMargin(0) #self.layout().setSpacing(1) self.splitter = QtGui.QSplitter() layout.addWidget(self.splitter) self.splitter.setOrientation(QtCore.Qt.Vertical) self.splitter.addWidget(self.aliases) self.splitter.addWidget(self.inspector) self.splitter.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) self.splitter.setStretchFactor(0, 0) self.splitter.setStretchFactor(1, 1) #connecting signals self.aliases.itemSelectionChanged.connect(self.updateInspector) self.aliases.highlightModule.connect(self.highlightModule) self.aliases.aliasUpdated.connect(self.updateAlias) self.aliases.aliasRemoved.connect(self.aliasRemoved) self.inspector.aliasChanged.connect(self.updateAlias)
def __init__(self, controller=None, parent=None): """ QAliasListPanel(controller: MashupController, parent: QWidget) -> QAliasListPanel """ QtGui.QWidget.__init__(self, parent) self.controller = None self.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) layout = QtGui.QVBoxLayout() self.aliases = QAliasList(controller, self) self.inspector = QAliasInspector(self.aliases) self.updateController(controller) self.setLayout(layout) #self.layout().setMargin(0) #self.layout().setSpacing(1) self.splitter = QtGui.QSplitter() layout.addWidget(self.splitter) self.splitter.setOrientation(QtCore.Qt.Vertical) self.splitter.addWidget(self.aliases) self.splitter.addWidget(self.inspector) self.splitter.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) self.splitter.setStretchFactor(0,0) self.splitter.setStretchFactor(1,1) #connecting signals self.aliases.itemSelectionChanged.connect(self.updateInspector) self.aliases.highlightModule.connect(self.highlightModule) self.aliases.aliasUpdated.connect(self.updateAlias) self.aliases.aliasRemoved.connect(self.aliasRemoved) self.inspector.aliasChanged.connect(self.updateAlias)
class QAliasListPanel(QtGui.QWidget, BaseView): """ QAliasListPanel shows list of aliases in pipeline. """ #signals highlightModule = pyqtSignal(int) aliasesChanged = pyqtSignal() aliasChanged = pyqtSignal(Alias) aliasRemoved = pyqtSignal(str) def __init__(self, controller=None, parent=None): """ QAliasListPanel(controller: MashupController, parent: QWidget) -> QAliasListPanel """ QtGui.QWidget.__init__(self, parent) self.controller = None self.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) layout = QtGui.QVBoxLayout() self.aliases = QAliasList(controller, self) self.inspector = QAliasInspector(self.aliases) self.updateController(controller) self.setLayout(layout) #self.layout().setMargin(0) #self.layout().setSpacing(1) self.splitter = QtGui.QSplitter() layout.addWidget(self.splitter) self.splitter.setOrientation(QtCore.Qt.Vertical) self.splitter.addWidget(self.aliases) self.splitter.addWidget(self.inspector) self.splitter.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) self.splitter.setStretchFactor(0, 0) self.splitter.setStretchFactor(1, 1) #connecting signals self.aliases.itemSelectionChanged.connect(self.updateInspector) self.aliases.highlightModule.connect(self.highlightModule) self.aliases.aliasUpdated.connect(self.updateAlias) self.aliases.aliasRemoved.connect(self.aliasRemoved) self.inspector.aliasChanged.connect(self.updateAlias) def updateController(self, controller, other_dict=None): if self.controller: self.aliasRemoved.disconnect(self.controller.removeAlias) self.aliasChanged.disconnect(self.controller.updateAlias) self.controller = controller if self.controller: self.aliases.controller = self.controller if (self.controller.currentMashup.alias_list and len(self.controller.currentMashup.alias_list) > 0): self.aliases.populateFromMashup(self.controller) else: self.aliases.clear() self.aliasRemoved.connect(self.controller.removeAlias) self.aliasChanged.connect(self.controller.updateAlias) def updateVersion(self, versionId): #print "AliasPanel.updateVersion " if self.controller: if (self.controller.currentMashup.alias_list and len(self.controller.currentMashup.alias_list) > 0): self.aliases.populateFromMashup(self.controller) else: self.aliases.clear() @pyqtSlot() def updateInspector(self): if len(self.aliases.selectedItems()) == 1: item = self.aliases.selectedItems()[0] self.inspector.updateContents(item.alias, self.controller) else: self.inspector.updateContents() @pyqtSlot(Alias) def updateAlias(self, alias): #make sure the module is highlighted in the pipeline view # or method_drop box is empty self.aliasChanged.emit(alias) self.aliasesChanged.emit() def set_default_layout(self): from vistrails.gui.mashups.mashups_inspector import QMashupsInspector from vistrails.gui.mashups.alias_parameter_view import QAliasParameterView self.set_palette_layout({ QtCore.Qt.LeftDockWidgetArea: QMashupsInspector, QtCore.Qt.RightDockWidgetArea: QAliasParameterView, }) def set_action_links(self): self.action_links = \ { }
class QAliasListPanel(QtGui.QWidget, BaseView): """ QAliasListPanel shows list of aliases in pipeline. """ #signals highlightModule = pyqtSignal(int) aliasesChanged = pyqtSignal() aliasChanged = pyqtSignal(Alias) aliasRemoved = pyqtSignal(str) def __init__(self, controller=None, parent=None): """ QAliasListPanel(controller: MashupController, parent: QWidget) -> QAliasListPanel """ QtGui.QWidget.__init__(self, parent) self.controller = None self.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) layout = QtGui.QVBoxLayout() self.aliases = QAliasList(controller, self) self.inspector = QAliasInspector(self.aliases) self.updateController(controller) self.setLayout(layout) #self.layout().setMargin(0) #self.layout().setSpacing(1) self.splitter = QtGui.QSplitter() layout.addWidget(self.splitter) self.splitter.setOrientation(QtCore.Qt.Vertical) self.splitter.addWidget(self.aliases) self.splitter.addWidget(self.inspector) self.splitter.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) self.splitter.setStretchFactor(0,0) self.splitter.setStretchFactor(1,1) #connecting signals self.aliases.itemSelectionChanged.connect(self.updateInspector) self.aliases.highlightModule.connect(self.highlightModule) self.aliases.aliasUpdated.connect(self.updateAlias) self.aliases.aliasRemoved.connect(self.aliasRemoved) self.inspector.aliasChanged.connect(self.updateAlias) def updateController(self, controller, other_dict=None): if self.controller: self.aliasRemoved.disconnect(self.controller.removeAlias) self.aliasChanged.disconnect(self.controller.updateAlias) self.controller = controller if self.controller: self.aliases.controller = self.controller if (self.controller.currentMashup.alias_list and len(self.controller.currentMashup.alias_list) > 0): self.aliases.populateFromMashup(self.controller) else: self.aliases.clear() self.aliasRemoved.connect(self.controller.removeAlias) self.aliasChanged.connect(self.controller.updateAlias) def updateVersion(self, versionId): #print "AliasPanel.updateVersion " if self.controller: if (self.controller.currentMashup.alias_list and len(self.controller.currentMashup.alias_list) > 0): self.aliases.populateFromMashup(self.controller) else: self.aliases.clear() @pyqtSlot() def updateInspector(self): if len(self.aliases.selectedItems()) == 1: item = self.aliases.selectedItems()[0] self.inspector.updateContents(item.alias, self.controller) else: self.inspector.updateContents() @pyqtSlot(Alias) def updateAlias(self, alias): #make sure the module is highlighted in the pipeline view # or method_drop box is empty self.aliasChanged.emit(alias) self.aliasesChanged.emit() def set_default_layout(self): from vistrails.gui.mashups.mashups_inspector import QMashupsInspector from vistrails.gui.mashups.alias_parameter_view import QAliasParameterView self.set_palette_layout( {QtCore.Qt.LeftDockWidgetArea: QMashupsInspector, QtCore.Qt.RightDockWidgetArea: QAliasParameterView, }) def set_action_links(self): self.action_links = \ { }