From d761b7166a84700866a71aba505237c2215dcd91 Mon Sep 17 00:00:00 2001 From: duplo Date: Fri, 17 Apr 2009 10:21:40 +0000 Subject: [PATCH] Show in evidence when the module is not totally supported by the selected cpu git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2532 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/BModulePage.py | 30 ++++++++++------ wizard/ui/module_select.ui | 73 ++++++++++++++++++++++---------------- 2 files changed, 62 insertions(+), 41 deletions(-) diff --git a/wizard/BModulePage.py b/wizard/BModulePage.py index f95b8e7a..2191ce60 100644 --- a/wizard/BModulePage.py +++ b/wizard/BModulePage.py @@ -46,6 +46,7 @@ class BModulePage(BWizardPage): self.pageContent.propertyTable.setColumnCount(2) self.pageContent.propertyTable.setRowCount(0) self.pageContent.moduleLabel.setVisible(False) + self.pageContent.warningLabel.setVisible(False) def connectSignals(self): """ @@ -77,11 +78,23 @@ class BModulePage(BWizardPage): """ module = self.currentModule() if module is not None: + try: + supported = bertos_utils.isSupported(module, self.project()) + except SupportedException, e: + self.exceptionOccurred(self.tr("Error evaluating \"%1\" for module %2").arg(e.support_string).arg(selectedModule)) + supported = True self._control_group.clear() configuration = self.projectInfo("MODULES")[module]["configuration"] module_description = self.projectInfo("MODULES")[module]["description"] self.pageContent.moduleLabel.setText(module_description) self.pageContent.moduleLabel.setVisible(True) + if not supported: + self.pageContent.warningLabel.setVisible(True) + selected_cpu = self.projectInfo("CPU_NAME") + self.pageContent.warningLabel.setText(self.tr("Warning: the selected module, \ + is not completely supported by the %1.").arg(selected_cpu)) + else: + self.pageContent.warningLabel.setVisible(False) self.pageContent.propertyTable.clear() self.pageContent.propertyTable.setRowCount(0) if configuration != "": @@ -191,6 +204,13 @@ class BModulePage(BWizardPage): for module in module_list: enabled = modules[module]["enabled"] module_item = QTreeWidgetItem(item, QStringList([module])) + try: + supported = bertos_utils.isSupported(module, self.project()) + except SupportedException, e: + self.exceptionOccurred(self.tr("Error evaluating \"%1\" for module %2").arg(e.support_string).arg(selectedModule)) + supported = True + if not supported: + module_item.setForeground(0, QBrush(QColor(Qt.red))) if enabled: module_item.setCheckState(0, Qt.Checked) else: @@ -322,16 +342,6 @@ class BModulePage(BWizardPage): Resolves the selection dependencies. """ modules = self.projectInfo("MODULES") - try: - supported = bertos_utils.isSupported(selectedModule, self.project()) - except SupportedException, e: - self.exceptionOccurred(self.tr("Error evaluating \"%1\" for module %2").arg(e.support_string).arg(selectedModule)) - supported = True - # Temporary feedback - if supported: - print "%s is supported" %selectedModule - else: - print "%s is not supported" %selectedModule modules[selectedModule]["enabled"] = True self.setProjectInfo("MODULES", modules) depends = self.projectInfo("MODULES")[selectedModule]["depends"] diff --git a/wizard/ui/module_select.ui b/wizard/ui/module_select.ui index c8b8e4a3..6efa7741 100644 --- a/wizard/ui/module_select.ui +++ b/wizard/ui/module_select.ui @@ -1,7 +1,8 @@ - + + Form - - + + 0 0 @@ -9,58 +10,58 @@ 409 - - + + 0 0 - + Form - + - + - - + + 175 0 - + 175 16777215 - + 1 - - + + 175 0 - + 175 16777215 - + Automatically fix dependecies - + true @@ -68,10 +69,10 @@ dependecies - + - - + + Qt::Vertical @@ -79,39 +80,49 @@ dependecies - + - - + + - - + + QAbstractItemView::NoEditTriggers - + true - + QAbstractItemView::SingleSelection - + QAbstractItemView::SelectRows - + false - + true - + false + + + + + + + true + + + -- 2.25.1