From: duplo Date: Tue, 20 Apr 2010 12:27:16 +0000 (+0000) Subject: Add stub of project loading from preset. X-Git-Tag: 2.5.0~431 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=87014709b232b8bbb25c4336639538d2757b13db;p=bertos.git Add stub of project loading from preset. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3477 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/BProject.py b/wizard/BProject.py index 7d866197..cc17ad0b 100644 --- a/wizard/BProject.py +++ b/wizard/BProject.py @@ -116,6 +116,12 @@ class BProject(object): self.loadModuleData(True) setEnabledModules(self, project_data["ENABLED_MODULES"]) + def loadProjectFromPreset(self, preset): + """ + Load a project from a preset. + """ + self.loadBertosProject(os.path.join(preset, 'project.bertos'), {}) + def loadProjectPresets(self): """ Load the default presets (into the const.PREDEFINED_BOARDS_DIR). diff --git a/wizard/BRoutePage.py b/wizard/BRoutePage.py index 633fac4a..d5e27b5a 100644 --- a/wizard/BRoutePage.py +++ b/wizard/BRoutePage.py @@ -61,7 +61,8 @@ class BRoutePage(BWizardPage): """ Overload of the QWizardPage isComplete method. """ - return False + self.setProjectInfo("EMPTY_MAIN", self.empty_main) + return True def nextId(self): """ @@ -88,13 +89,14 @@ class BRoutePage(BWizardPage): """ Overload of the BWizardPage connectSignals method. """ - pass + self.connect(self.pageContent.emptyCheckBox, SIGNAL("stateChanged(int)"), self, SIGNAL("completeChanged()")) def reloadData(self): """ Overload of the BWizardPage reloadData method. """ - pass + preset = self.projectInfo('PROJECT_PRESET') + self.project.loadProjectFromPreset(preset) #### @@ -106,3 +108,10 @@ class BRoutePage(BWizardPage): @property def advanced(self): return self.pageContent.advancedButton.isChecked() + + @property + def empty_main(self): + if self.advanced: + return self.pageContent.emptyCheckBox.isChecked() + else: + return False