From: duplo Date: Mon, 31 May 2010 10:21:35 +0000 (+0000) Subject: Show the previously selected preset, when coming back from the toolchain page. X-Git-Tag: 2.5.0~32 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=8cc308300073d38f6826ea357f4c6221e1f44f03;p=bertos.git Show the previously selected preset, when coming back from the toolchain page. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3885 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/BBoardPage.py b/wizard/BBoardPage.py index f063e774..fdad680b 100644 --- a/wizard/BBoardPage.py +++ b/wizard/BBoardPage.py @@ -68,6 +68,7 @@ class BBoardPage(BWizardPage): preset_path = preset_path["path"] self.setProjectInfo("PROJECT_BOARD", preset_path) self.setProjectInfo("PROJECT_FROM_PRESET", True) + self.setProjectInfo("PRESET_LOADED", False) return True else: return False diff --git a/wizard/BProjectPresets.py b/wizard/BProjectPresets.py index ba4d6d7d..b92eaa3d 100644 --- a/wizard/BProjectPresets.py +++ b/wizard/BProjectPresets.py @@ -122,6 +122,7 @@ class BProjectPresets(BWizardPage): try: QApplication.instance().setOverrideCursor(Qt.WaitCursor) self.project.loadProjectFromPreset(preset_path) + self.setProjectInfo("PRESET_LOADED", True) finally: QApplication.instance().restoreOverrideCursor() # Return always True, this is a fake validation. @@ -163,12 +164,13 @@ class BProjectPresets(BWizardPage): ## Overloaded BWizardPage methods ## def reloadData(self): - preset_path = self.projectInfo("PROJECT_BOARD") - preset_tree = self.projectInfo("PRESET_TREE") - preset_list = preset_tree["children"][preset_path]["children"] - preset_list = sorted(preset_list.values(), _cmp) - self.setTitle(self.tr("Select the project template for %1").arg(preset_tree["children"][preset_path]["info"].get("name", preset_tree["children"][preset_path]["info"]["filename"]))) - self.setupTabs(preset_list) + if not self.projectInfo("PRESET_LOADED"): + preset_path = self.projectInfo("PROJECT_BOARD") + preset_tree = self.projectInfo("PRESET_TREE") + preset_list = preset_tree["children"][preset_path]["children"] + preset_list = sorted(preset_list.values(), _cmp) + self.setTitle(self.tr("Select the project template for %1").arg(preset_tree["children"][preset_path]["info"].get("name", preset_tree["children"][preset_path]["info"]["filename"]))) + self.setupTabs(preset_list) def connectSignals(self): self.connect(self.pageContent.boardTabWidget, SIGNAL("currentChanged(int)"), self, SIGNAL("completeChanged()"))