From b7e4e6bec2572f8fc1628e14a091f3292cf8dc4c Mon Sep 17 00:00:00 2001 From: duplo Date: Thu, 27 May 2010 12:30:38 +0000 Subject: [PATCH] Add a fake validation to load the preset data once when the user press the next button. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3854 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/BProjectPresets.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/wizard/BProjectPresets.py b/wizard/BProjectPresets.py index ee6d0a06..200e6768 100644 --- a/wizard/BProjectPresets.py +++ b/wizard/BProjectPresets.py @@ -108,17 +108,25 @@ class BProjectPresets(BWizardPage): if preset_path: self.setProjectInfo("PROJECT_PRESET", preset_path) self.setProjectInfo("BASE_MODE", not self.advanced) - # TODO: find a better place for preset loading... - try: - QApplication.instance().setOverrideCursor(Qt.WaitCursor) - self.project.loadProjectFromPreset(preset_path) - finally: - QApplication.instance().restoreOverrideCursor() return True else: self.setProjectInfo("PROJECT_PRESET", None) return False + def validatePage(self): + """ + This hack permits to load the preset once, when the user go press the + Next button. + """ + preset_path = self.selected_path + try: + QApplication.instance().setOverrideCursor(Qt.WaitCursor) + self.project.loadProjectFromPreset(preset_path) + finally: + QApplication.instance().restoreOverrideCursor() + # Return always True, this is a fake validation. + return True + def nextId(self): """ Overload of the QWizardPage nextId method. -- 2.25.1