示例#1
0
    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)
示例#2
0
    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)
示例#3
0
    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)
示例#4
0
文件: common.py 项目: cmft/sardana
 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)
示例#5
0
 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)
示例#6
0
    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()
示例#7
0
 def getQtDesignerPluginInfo(cls):
     ret = TaurusMainWindow.getQtDesignerPluginInfo()
     ret['module'] = 'taurus.qt.qtgui.panel'
     return ret
示例#8
0
 def setTangoHost(self, host):
     '''extended from :class:setTangoHost'''
     TaurusMainWindow.setTangoHost(self, host)
     self.deviceTree.setModel(host)
示例#9
0
文件: common.py 项目: cmft/sardana
 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)
示例#10
0
 def __init__(self, parent=None):
     TaurusMainWindow.__init__(self, parent)
     contextToolBar = ContextToolBar()
     contextToolBar.setDefaultContextID(85)
     contextToolBar.setSorter(cmp)
     self.addToolBar(contextToolBar)
示例#11
0
 def loadSettings(self):
     TaurusMainWindow.loadSettings(self)
     self.doorChanged.emit(self.doorName())
示例#12
0
 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)
示例#13
0
 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 __init__(self, parent=None):
     TaurusMainWindow.__init__(self, parent)
     contextToolBar = ContextToolBar()
     contextToolBar.setDefaultContextID(85)
     contextToolBar.setSorter(cmp)
     self.addToolBar(contextToolBar)
示例#15
0
 def setTangoHost(self, host):
     '''extended from :class:setTangoHost'''
     TaurusMainWindow.setTangoHost(self, host)
     self.deviceTree.setModel(host)
示例#16
0
 def getQtDesignerPluginInfo(cls):
     ret = TaurusMainWindow.getQtDesignerPluginInfo()
     ret['module'] = 'taurus.qt.qtgui.panel'
     return ret
示例#17
0
 def loadSettings(self):
     TaurusMainWindow.loadSettings(self)
     self.doorChanged.emit(self.doorName())
示例#18
0
 def loadSettings(self):
     TaurusMainWindow.loadSettings(self)
     self.emit(Qt.SIGNAL("doorChanged"), self.doorName())
示例#19
0
 def loadSettings(self):
     TaurusMainWindow.loadSettings(self)
     self.emit(Qt.SIGNAL("doorChanged"), self.doorName())