Show the previously selected preset, when coming back from the toolchain page.
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 31 May 2010 10:21:35 +0000 (10:21 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 31 May 2010 10:21:35 +0000 (10:21 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3885 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BBoardPage.py
wizard/BProjectPresets.py

index f063e77448402b524cf283b1ef34b3178da2ff55..fdad680ba4ec83e983e46b6765fb7782ba4e855a 100644 (file)
@@ -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
index ba4d6d7d0314c119054d477f485a2f6b772011af..b92eaa3dfb571267f70d5742e947919abd89a123 100644 (file)
@@ -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()"))