X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2FBBoardPage.py;h=28130c9e4f5cb69cdde79c1662f439df3e247bee;hb=c05941e41ee333ab29af6bb62ecc08862c7321fd;hp=80631b598f2c7cbd51b3b53348886661251da28e;hpb=bb9ed2f778c62e37fe8dab83fcb6dc9a6928619f;p=bertos.git diff --git a/wizard/BBoardPage.py b/wizard/BBoardPage.py index 80631b59..28130c9e 100644 --- a/wizard/BBoardPage.py +++ b/wizard/BBoardPage.py @@ -38,6 +38,9 @@ from PyQt4.QtGui import * from BWizardPage import BWizardPage +from BCpuPage import BCpuPage +from BOutputPage import BOutputPage + import const import qvariant_converter from bertos_utils import presetList @@ -59,7 +62,24 @@ class BBoardPage(BWizardPage): """ Overload of the QWizardPage isComplete method. """ - return False + return self.pageContent.boardList.currentItem() is not None + + def nextId(self): + """ + Overload of the QWizardPage nextId method. + """ + # Stub of nextId logic + if self.advanced: + self.setProjectInfo("PRESET_ADVANCED_CONFIG", True) + return self.wizard().pageIndex(BCpuPage) + # Search for suitable toolchains. If there isn't one return + # BToolchainPage id (BToolchainPage should then route to BOutputPage + # instead of BModulePage). + + # If a suitable toolchain is found the user has to be prompted + # directly to the BOutputPage + else: + return self.wizard().pageIndex(BOutputPage) #### @@ -86,10 +106,11 @@ class BBoardPage(BWizardPage): self.populatePresetList() def populatePresetList(self): + self.pageContent.boardList.clear() presets = self.projectInfo("PRESETS") for preset, info in presets.items(): board_list = self.pageContent.boardList - item = QListWidgetItem(info["name"], board_list) + item = QListWidgetItem(info["PRESET_NAME"], board_list) item.setData(Qt.UserRole, qvariant_converter.convertString(preset)) if self._last_selected == preset: self.pageContent.boardList.setCurrentItem(item) @@ -104,7 +125,19 @@ class BBoardPage(BWizardPage): preset_path = qvariant_converter.getString(self.pageContent.boardList.currentItem().data(Qt.UserRole)) presets = self.projectInfo("PRESETS") selected_preset = presets[preset_path] - self.pageContent.descriptionLabel.setText(selected_preset['description']) + text_components = [ + "Board: %s" %selected_preset["PRESET_NAME"], + "CPU: %s" %selected_preset["CPU_NAME"], + ] + if selected_preset["PRESET_DESCRIPTION"]: + text_components.append("Description: %s" %selected_preset["PRESET_DESCRIPTION"]) + text = "\n".join(text_components) + self.pageContent.descriptionLabel.setText(text) self._last_selected = preset_path + self.emit(SIGNAL("completeChanged()")) #### + + @property + def advanced(self): + return self.pageContent.advancedCheckBox.isChecked() \ No newline at end of file