From: duplo Date: Thu, 19 Feb 2009 17:17:35 +0000 (+0000) Subject: Add the automaticFix checkbox (default checked) X-Git-Tag: 2.1.0~318 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=15754f71192e0a4333a243ca9fd4facdefa75341;p=bertos.git Add the automaticFix checkbox (default checked) git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2364 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/BModulePage.py b/wizard/BModulePage.py index 17812cd9..b8b52226 100644 --- a/wizard/BModulePage.py +++ b/wizard/BModulePage.py @@ -232,24 +232,24 @@ class BModulePage(BWizardPage): modules[selectedModule]["enabled"] = True self._projectInfoStore("MODULES", modules) depends = self._projectInfoRetrieve("MODULES")[selectedModule]["depends"] - unsatisfied = self.selectDependencyCheck(selectedModule) + unsatisfied = [] + if self.pageContent.automaticFix.isChecked(): + unsatisfied = self.selectDependencyCheck(selectedModule) if len(unsatisfied) > 0: - message = self.tr("The module %1 needs the following modules:\n%2.\n\nDo you want to resolve automatically the problem?") - message = message.arg(selectedModule).arg(", ".join(unsatisfied)) - choice = QMessageBox.warning(self, self.tr("Dependency error"), message, QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes) - if choice == QMessageBox.Yes: - for module in unsatisfied: - modules = self._projectInfoRetrieve("MODULES") - modules[module]["enabled"] = True - for index in range(self.pageContent.moduleTable.rowCount()): - if unicode(self.pageContent.moduleTable.item(index, 1).text()) in unsatisfied: - self._buttonGroup.button(index).setChecked(True) + for module in unsatisfied: + modules = self._projectInfoRetrieve("MODULES") + modules[module]["enabled"] = True + for index in range(self.pageContent.moduleTable.rowCount()): + if unicode(self.pageContent.moduleTable.item(index, 1).text()) in unsatisfied: + self._buttonGroup.button(index).setChecked(True) def _moduleUnselected(self, unselectedModule): modules = self._projectInfoRetrieve("MODULES") modules[unselectedModule]["enabled"] = False self._projectInfoStore("MODULES", modules) - unsatisfied = self.unselectDependencyCheck(unselectedModule) + unsatisfied = [] + if self.pageContent.automaticFix.isChecked(): + unsatisfied = self.unselectDependencyCheck(unselectedModule) if len(unsatisfied) > 0: message = self.tr("The module %1 is needed by the following modules:\n%2.\n\nDo you want to resolve automatically the problem?") message = message.arg(unselectedModule).arg(", ".join(unsatisfied)) diff --git a/wizard/ui/module_select.ui b/wizard/ui/module_select.ui index 370e3212..b2d3faa6 100644 --- a/wizard/ui/module_select.ui +++ b/wizard/ui/module_select.ui @@ -5,8 +5,8 @@ 0 0 - 621 - 428 + 466 + 366 @@ -20,26 +20,59 @@ - - - - 150 - 16777215 - - - - QAbstractItemView::NoEditTriggers - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - false - - + + + + + + 150 + 0 + + + + + 150 + 16777215 + + + + Correct conflicts +automatically + + + true + + + + + + + + 150 + 0 + + + + + 150 + 16777215 + + + + QAbstractItemView::NoEditTriggers + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + false + + + +