def __init__(self, parent=None, designMode=False): TaurusMainWindow.__init__(self, parent, designMode=designMode) self.loadUi() # setting up the device Tree. #@todo: This should be done in the ui file when the TaurusDatabaseTree Designer plugin is available import taurus.qt.qtgui.tree TaurusDbTreeWidget = taurus.qt.qtgui.tree.TaurusDbTreeWidget self.deviceTree = TaurusDbTreeWidget( perspective=TaurusElementType.Device) self.deviceTree.getQModel().setSelectables([TaurusElementType.Member ]) # TODO: Tango-centric # self.deviceTree.insertFilter(filterNonExported) self.setCentralWidget(self.deviceTree) # register subwidgets for configuration purposes # self.registerConfigDelegate(self.taurusAttrForm) # self.registerConfigDelegate(self.deviceTree) self.registerConfigDelegate(self._ui.taurusCommandsForm) self.loadSettings() self.createActions() # self.addToolBar(self.basicTaurusToolbar()) self.deviceTree.currentItemChanged.connect(self.onItemSelectionChanged) self.updatePerspectivesMenu() if not designMode: self.splashScreen().finish(self)
def __init__(self, parent=None, designMode=False): TaurusMainWindow.__init__(self, parent, designMode=designMode) self.loadUi() # setting up the device Tree. #@todo: This should be done in the ui file when the TaurusDatabaseTree Designer plugin is available import taurus.qt.qtgui.tree TaurusDbTreeWidget = taurus.qt.qtgui.tree.TaurusDbTreeWidget self.deviceTree = TaurusDbTreeWidget( perspective=TaurusElementType.Device) self.deviceTree.getQModel().setSelectables([TaurusElementType.Member ]) # TODO: Tango-centric # self.deviceTree.insertFilter(filterNonExported) self.setCentralWidget(self.deviceTree) # needed because of a limitation in when using the useParentModel # property from designer and taurus parents are not the same as Qt # Parents self._ui.taurusAttrForm.recheckTaurusParent() self._ui.taurusCommandsForm.recheckTaurusParent() # Add StateLed to statusBar # self.devStateLed = TaurusLed() # self.statusbar.addPermanentWidget(self.devStateLed) # self.devStateLed.setModel('/state') # self.devStateLed.setUseParentModel(True) # register subwidgets for configuration purposes # self.registerConfigDelegate(self.taurusAttrForm) # self.registerConfigDelegate(self.deviceTree) self.registerConfigDelegate(self._ui.taurusCommandsForm) self.loadSettings() self.createActions() # self.addToolBar(self.basicTaurusToolbar()) self.connect(self.deviceTree, Qt.SIGNAL("currentItemChanged"), self.onItemSelectionChanged) self.updatePerspectivesMenu() if not designMode: self.splashScreen().finish(self)
def __init__(self, parent=None, designMode=False): TaurusMainWindow.__init__(self, parent, designMode=designMode) self.loadUi() # setting up the device Tree. #@todo: This should be done in the ui file when the TaurusDatabaseTree Designer plugin is available import taurus.qt.qtgui.tree TaurusDbTreeWidget = taurus.qt.qtgui.tree.TaurusDbTreeWidget self.deviceTree = TaurusDbTreeWidget( perspective=TaurusElementType.Device) self.deviceTree.getQModel().setSelectables( [TaurusElementType.Member]) # TODO: Tango-centric # self.deviceTree.insertFilter(filterNonExported) self.setCentralWidget(self.deviceTree) # needed because of a limitation in when using the useParentModel # property from designer and taurus parents are not the same as Qt # Parents self._ui.taurusAttrForm.recheckTaurusParent() self._ui.taurusCommandsForm.recheckTaurusParent() # Add StateLed to statusBar # self.devStateLed = TaurusLed() # self.statusbar.addPermanentWidget(self.devStateLed) # self.devStateLed.setModel('/state') # self.devStateLed.setUseParentModel(True) # register subwidgets for configuration purposes # self.registerConfigDelegate(self.taurusAttrForm) # self.registerConfigDelegate(self.deviceTree) self.registerConfigDelegate(self._ui.taurusCommandsForm) self.loadSettings() self.createActions() # self.addToolBar(self.basicTaurusToolbar()) self.deviceTree.currentItemChanged.connect(self.onItemSelectionChanged) self.updatePerspectivesMenu() if not designMode: self.splashScreen().finish(self)
def __init__(self, parent=None, designMode=False): TaurusMainWindow.__init__(self, parent, designMode) self.statusBar().showMessage("") self.setModelInConfig(True) self._doorName = "" self.registerConfigProperty("doorName", "setDoorName", "doorName") self._customMacroEditorPaths = "" self.registerConfigProperty("customMacroEditorPaths", "setCustomMacroEditorPaths", "customMacroEditorPaths") self._qDoor = None self.setWindowIcon(getIcon(":/apps/preferences-system-session.svg")) toolBar = self.basicTaurusToolbar() toolBar.setIconSize(Qt.QSize(24, 24)) self.configureAction = self.createConfigureAction() toolBar.addAction(self.configureAction) self.taurusMenu.addAction(self.configureAction) self.customMacroEditorsPathsAction = self.createCustomMacroEditorPathsAction() self.taurusMenu.addAction(self.customMacroEditorsPathsAction) self.addToolBar(toolBar) self.initComponents() self.splashScreen().finish(self) self.connect(self, Qt.SIGNAL("doorChanged"), self.onDoorChanged)
def __init__(self, parent=None, designMode=False): TaurusMainWindow.__init__(self, parent, designMode) self.statusBar().showMessage("") self.setModelInConfig(True) self._doorName = "" self.registerConfigProperty("doorName", "setDoorName", "doorName") self._customMacroEditorPaths = "" self.registerConfigProperty( "customMacroEditorPaths", "setCustomMacroEditorPaths", "customMacroEditorPaths") self._qDoor = None self.setWindowIcon(getIcon(":/apps/preferences-system-session.svg")) toolBar = self.basicTaurusToolbar() toolBar.setIconSize(Qt.QSize(24, 24)) self.configureAction = self.createConfigureAction() toolBar.addAction(self.configureAction) self.taurusMenu.addAction(self.configureAction) self.customMacroEditorsPathsAction = self.createCustomMacroEditorPathsAction() self.taurusMenu.addAction(self.customMacroEditorsPathsAction) self.addToolBar(toolBar) self.initComponents() self.splashScreen().finish(self) self.doorChanged.connect(self.onDoorChanged)
def closeEvent(self, event): try: self.__macroBroker.removeTemporaryPanels() except: pass TaurusMainWindow.closeEvent(self, event) for n, panel in self._TaurusGui__panels.items(): panel.closeEvent(event) panel.widget().closeEvent(event) if not event.isAccepted(): result = Qt.QMessageBox.question( self, 'Closing error', "Panel '%s' cannot be closed. Proceed closing?" % n, Qt.QMessageBox.Yes | Qt.QMessageBox.No) if result == Qt.QMessageBox.Yes: event.accept() else: break for curve in plot_items.listDataItems(): plot.removeItem(curve) l.removeItem(curve.name()) gui.saveSettings()
def getQtDesignerPluginInfo(cls): ret = TaurusMainWindow.getQtDesignerPluginInfo() ret['module'] = 'taurus.qt.qtgui.panel' return ret
def setTangoHost(self, host): '''extended from :class:setTangoHost''' TaurusMainWindow.setTangoHost(self, host) self.deviceTree.setModel(host)
def setModel(self, model): """Sets new model for application, and change window title witn new macroserver name.""" TaurusMainWindow.setModel(self, model) self.setWindowTitle(Qt.QApplication.applicationName() + ": " + model)
def __init__(self, parent=None): TaurusMainWindow.__init__(self, parent) contextToolBar = ContextToolBar() contextToolBar.setDefaultContextID(85) contextToolBar.setSorter(cmp) self.addToolBar(contextToolBar)
def loadSettings(self): TaurusMainWindow.loadSettings(self) self.doorChanged.emit(self.doorName())
def setModel(self, name): """Reimplemented to delegate model to the commands and attrs forms""" TaurusMainWindow.setModel(self, name) self._ui.taurusAttrForm.setModel(name) self._ui.taurusCommandsForm.setModel(name)
def loadSettings(self): TaurusMainWindow.loadSettings(self) self.emit(Qt.SIGNAL("doorChanged"), self.doorName())