Пример #1
0
    def on_fileOpenAction_triggered(self):
        fileName = "%s" % QFileDialog.getOpenFileName(self.parent(), "Tabbed Feedbacks -- Open File")
        config = ConfigParser.ConfigParser()
        config.read(fileName)
        for section in config.sections():
            if re.match("^(.*)/(LOneVariableFeedbackComposite)/(.*)$", section):
                match = re.match("^(.*)/(LOneVariableFeedbackComposite)/(.*)$", section)
                item = LMyItem()
                item.setName(match.group(1))
                item.setCompositeClassName(match.group(2))
                item.setVersion(match.group(3))
                debug(self, "Found section %s" % match.group(0), 3)
                item.setConfigurationFile(fileName)
                item.buildComposite()
                item.loadCompositeConfiguration()
                self.dataContainer.feedbacks.append(item)
            if re.match("^(.*)/(LXVariableFeedbackComposite)/(.*)$", section):
                match = re.match("^(.*)/(LXVariableFeedbackComposite)/(.*)$", section)
                item = LMyItem()
                item.setName(match.group(1))
                item.setCompositeClassName(match.group(2))
                item.setVersion(match.group(3))
                debug(self, "Found section %s" % match.group(0), 3)
                item.setConfigurationFile(fileName)
                item.buildComposite()
                item.loadCompositeConfiguration()
                self.dataContainer.feedbacks.append(item)
        self.parent().updateUi()

        tabWidget = self.parent().tabWidget
        numberOfTabs = tabWidget.count()
        lastTabIndex = numberOfTabs - 1
        tabWidget.setCurrentIndex(lastTabIndex)
        debug(self, "Jump to tab %d" % lastTabIndex, 5)
Пример #2
0
    def on_fileNewOvfAction_triggered(self):
        item = LMyItem()
        item.setName("OVFeedback_X")
        fileName = tempfile.mkstemp(suffix=".conf", prefix="ovf_", dir="/tmp", text=True)[1]
        item.setConfigurationFile(fileName)
        item.setCompositeClassName("LOneVariableFeedbackComposite")
        item.buildComposite()
        item.saveCompositeConfiguration()
        self.dataContainer.feedbacks.append(item)
        self.parent().updateUi()

        tabWidget = self.parent().tabWidget
        numberOfTabs = tabWidget.count()
        lastTabIndex = numberOfTabs - 1
        tabWidget.setCurrentIndex(lastTabIndex)
        debug(self, "Jump to tab %d" % lastTabIndex, 5)