def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.layout = QtGui.QVBoxLayout() self.layout.setContentsMargins(0, 0, 0, 0) self.splitter = QtGui.QSplitter() self.splitter.setContentsMargins(0, 0, 0, 0) self.layout.addWidget(self.splitter) self.connectionList = QDBConnectionList(self) dbGrid = QtGui.QGridLayout(self) dbGrid.setMargin(0) dbGrid.setSpacing(0) dbGrid.addWidget(self.connectionList, 2, 1, QtCore.Qt.AlignLeft) self.addAct = QtGui.QAction("Add Database", self) self.removeAct = QtGui.QAction("Remove Database", self) self.addButton = QtGui.QToolButton() self.addButton.setToolTip("Create a new database connection") self.addButton.setDefaultAction(self.addAct) self.addButton.setAutoRaise(True) self.removeButton = QtGui.QToolButton() self.removeButton.setToolTip( "Remove the selected connection from list") self.removeButton.setDefaultAction(self.removeAct) self.removeButton.setAutoRaise(True) self.removeButton.setEnabled(False) panelButtonsLayout = QtGui.QHBoxLayout() panelButtonsLayout.setMargin(0) panelButtonsLayout.setSpacing(0) panelButtonsLayout.addWidget(self.addButton) panelButtonsLayout.addWidget(self.removeButton) dbGrid.addLayout(panelButtonsLayout, 1, 1, QtCore.Qt.AlignLeft) dbWidget = QDBWidget(parent, self.connectionList) dbWidget.setLayout(dbGrid) self.splitter.addWidget(dbWidget) self.connect(self.addAct, QtCore.SIGNAL('triggered()'), self.showConnConfig) self.connect(self.removeAct, QtCore.SIGNAL('triggered()'), self.connectionList.removeConnection) self.connect(self.connectionList, QtCore.SIGNAL('itemSelectionChanged()'), self.updateEditButtons) self.connect(self.connectionList, QtCore.SIGNAL('itemSelectionChanged()'), self.checkConnection) self.tabView = QtGui.QTabWidget() self.tabView.setContentsMargins(0, 0, 0, 0) self.splitter.addWidget(self.tabView) # self.workflowSearch = WorkflowSearchWidget(self.connectionList) # self.tabView.addTab(self.workflowSearch, "Search for Workflows") self.executionSearch = ExecutionSearchWidget(self.connectionList) self.tabView.addTab(self.executionSearch, "Search for Workflow Executions") self.setLayout(self.layout) self.setWindowTitle('Provenance Browser') self.resize(QtCore.QSize(800, 600)) # self.workflowSearch.setup_results() self.executionSearch.setup_results()
def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.layout = QtGui.QVBoxLayout() self.layout.setContentsMargins(0, 0, 0, 0) self.splitter = QtGui.QSplitter() self.splitter.setContentsMargins(0, 0, 0, 0) self.layout.addWidget(self.splitter) self.connectionList = QDBConnectionList(self) dbGrid = QtGui.QGridLayout(self) dbGrid.setMargin(0) dbGrid.setSpacing(0) dbGrid.addWidget(self.connectionList, 2, 1, QtCore.Qt.AlignLeft) self.addAct = QtGui.QAction("Add Database", self) self.removeAct = QtGui.QAction("Remove Database", self) self.addButton = QtGui.QToolButton() self.addButton.setToolTip("Create a new database connection") self.addButton.setDefaultAction(self.addAct) self.addButton.setAutoRaise(True) self.removeButton = QtGui.QToolButton() self.removeButton.setToolTip("Remove the selected connection from list") self.removeButton.setDefaultAction(self.removeAct) self.removeButton.setAutoRaise(True) self.removeButton.setEnabled(False) panelButtonsLayout = QtGui.QHBoxLayout() panelButtonsLayout.setMargin(0) panelButtonsLayout.setSpacing(0) panelButtonsLayout.addWidget(self.addButton) panelButtonsLayout.addWidget(self.removeButton) dbGrid.addLayout(panelButtonsLayout, 1, 1, QtCore.Qt.AlignLeft) dbWidget = QDBWidget(parent, self.connectionList) dbWidget.setLayout(dbGrid) self.splitter.addWidget(dbWidget) self.connect(self.addAct, QtCore.SIGNAL('triggered()'), self.showConnConfig) self.connect(self.removeAct, QtCore.SIGNAL('triggered()'), self.connectionList.removeConnection) self.connect(self.connectionList, QtCore.SIGNAL('itemSelectionChanged()'), self.updateEditButtons) self.connect(self.connectionList, QtCore.SIGNAL('itemSelectionChanged()'), self.checkConnection) self.tabView = QtGui.QTabWidget() self.tabView.setContentsMargins(0, 0, 0, 0) self.splitter.addWidget(self.tabView) # self.workflowSearch = WorkflowSearchWidget(self.connectionList) # self.tabView.addTab(self.workflowSearch, "Search for Workflows") self.executionSearch = ExecutionSearchWidget(self.connectionList) self.tabView.addTab(self.executionSearch, "Search for Workflow Executions") self.setLayout(self.layout) self.setWindowTitle('Provenance Browser') self.resize(QtCore.QSize(800, 600)) # self.workflowSearch.setup_results() self.executionSearch.setup_results()
class QExplorerWindow(QtGui.QWidget, QVistrailsPaletteInterface): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.layout = QtGui.QVBoxLayout() self.layout.setContentsMargins(0, 0, 0, 0) self.splitter = QtGui.QSplitter() self.splitter.setContentsMargins(0, 0, 0, 0) self.layout.addWidget(self.splitter) self.connectionList = QDBConnectionList(self) dbGrid = QtGui.QGridLayout(self) dbGrid.setMargin(0) dbGrid.setSpacing(0) dbGrid.addWidget(self.connectionList, 2, 1, QtCore.Qt.AlignLeft) self.addAct = QtGui.QAction("Add Database", self) self.removeAct = QtGui.QAction("Remove Database", self) self.addButton = QtGui.QToolButton() self.addButton.setToolTip("Create a new database connection") self.addButton.setDefaultAction(self.addAct) self.addButton.setAutoRaise(True) self.removeButton = QtGui.QToolButton() self.removeButton.setToolTip("Remove the selected connection from list") self.removeButton.setDefaultAction(self.removeAct) self.removeButton.setAutoRaise(True) self.removeButton.setEnabled(False) panelButtonsLayout = QtGui.QHBoxLayout() panelButtonsLayout.setMargin(0) panelButtonsLayout.setSpacing(0) panelButtonsLayout.addWidget(self.addButton) panelButtonsLayout.addWidget(self.removeButton) dbGrid.addLayout(panelButtonsLayout, 1, 1, QtCore.Qt.AlignLeft) dbWidget = QDBWidget(parent, self.connectionList) dbWidget.setLayout(dbGrid) self.splitter.addWidget(dbWidget) self.connect(self.addAct, QtCore.SIGNAL('triggered()'), self.showConnConfig) self.connect(self.removeAct, QtCore.SIGNAL('triggered()'), self.connectionList.removeConnection) self.connect(self.connectionList, QtCore.SIGNAL('itemSelectionChanged()'), self.updateEditButtons) self.connect(self.connectionList, QtCore.SIGNAL('itemSelectionChanged()'), self.checkConnection) self.tabView = QtGui.QTabWidget() self.tabView.setContentsMargins(0, 0, 0, 0) self.splitter.addWidget(self.tabView) # self.workflowSearch = WorkflowSearchWidget(self.connectionList) # self.tabView.addTab(self.workflowSearch, "Search for Workflows") self.executionSearch = ExecutionSearchWidget(self.connectionList) self.tabView.addTab(self.executionSearch, "Search for Workflow Executions") self.setLayout(self.layout) self.setWindowTitle('Provenance Browser') self.resize(QtCore.QSize(800, 600)) # self.workflowSearch.setup_results() self.executionSearch.setup_results() def showConnConfig(self, *args, **keywords): return showConnConfig(self.connectionList, *args, **keywords) def updateEditButtons(self): """updateEditButtons() -> None It will enable/disable the connections buttons according to the selection """ self.workflowSearch.setup_results() self.executionSearch.setup_results() id = self.connectionList.getCurrentItemId() if id != -1: self.removeButton.setEnabled(True) else: self.removeButton.setEnabled(False) def checkConnection(self): checkConnection(self.connectionList) def getConnectionInfo(self, id): return getConnectionInfo(self.connectionList, id)
class QExplorerWindow(QtGui.QWidget, QVistrailsPaletteInterface): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.layout = QtGui.QVBoxLayout() self.layout.setContentsMargins(0, 0, 0, 0) self.splitter = QtGui.QSplitter() self.splitter.setContentsMargins(0, 0, 0, 0) self.layout.addWidget(self.splitter) self.connectionList = QDBConnectionList(self) dbGrid = QtGui.QGridLayout(self) dbGrid.setMargin(0) dbGrid.setSpacing(0) dbGrid.addWidget(self.connectionList, 2, 1, QtCore.Qt.AlignLeft) self.addAct = QtGui.QAction("Add Database", self) self.removeAct = QtGui.QAction("Remove Database", self) self.addButton = QtGui.QToolButton() self.addButton.setToolTip("Create a new database connection") self.addButton.setDefaultAction(self.addAct) self.addButton.setAutoRaise(True) self.removeButton = QtGui.QToolButton() self.removeButton.setToolTip( "Remove the selected connection from list") self.removeButton.setDefaultAction(self.removeAct) self.removeButton.setAutoRaise(True) self.removeButton.setEnabled(False) panelButtonsLayout = QtGui.QHBoxLayout() panelButtonsLayout.setMargin(0) panelButtonsLayout.setSpacing(0) panelButtonsLayout.addWidget(self.addButton) panelButtonsLayout.addWidget(self.removeButton) dbGrid.addLayout(panelButtonsLayout, 1, 1, QtCore.Qt.AlignLeft) dbWidget = QDBWidget(parent, self.connectionList) dbWidget.setLayout(dbGrid) self.splitter.addWidget(dbWidget) self.connect(self.addAct, QtCore.SIGNAL('triggered()'), self.showConnConfig) self.connect(self.removeAct, QtCore.SIGNAL('triggered()'), self.connectionList.removeConnection) self.connect(self.connectionList, QtCore.SIGNAL('itemSelectionChanged()'), self.updateEditButtons) self.connect(self.connectionList, QtCore.SIGNAL('itemSelectionChanged()'), self.checkConnection) self.tabView = QtGui.QTabWidget() self.tabView.setContentsMargins(0, 0, 0, 0) self.splitter.addWidget(self.tabView) # self.workflowSearch = WorkflowSearchWidget(self.connectionList) # self.tabView.addTab(self.workflowSearch, "Search for Workflows") self.executionSearch = ExecutionSearchWidget(self.connectionList) self.tabView.addTab(self.executionSearch, "Search for Workflow Executions") self.setLayout(self.layout) self.setWindowTitle('Provenance Browser') self.resize(QtCore.QSize(800, 600)) # self.workflowSearch.setup_results() self.executionSearch.setup_results() def showConnConfig(self, *args, **keywords): return showConnConfig(self.connectionList, *args, **keywords) def updateEditButtons(self): """updateEditButtons() -> None It will enable/disable the connections buttons according to the selection """ self.workflowSearch.setup_results() self.executionSearch.setup_results() id = self.connectionList.getCurrentItemId() if id != -1: self.removeButton.setEnabled(True) else: self.removeButton.setEnabled(False) def checkConnection(self): checkConnection(self.connectionList) def getConnectionInfo(self, id): return getConnectionInfo(self.connectionList, id)