From: duplo Date: Tue, 27 Jan 2009 15:37:19 +0000 (+0000) Subject: Automatic data save when changing wizard page X-Git-Tag: 2.1.0~453 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=b04beb3ec4c8e96e584387b715e470cf60599dee;p=bertos.git Automatic data save when changing wizard page git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2229 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/BModulePage.py b/wizard/BModulePage.py index 7fca118b..19d0c3a5 100644 --- a/wizard/BModulePage.py +++ b/wizard/BModulePage.py @@ -100,7 +100,7 @@ class BModulePage(BWizardPage): spinBox.setSuffix("L") spinBox.setValue(int(configurations[property]["value"].replace("L", ""))) - def _savePage(self, previousRow, previousColumn): + def _saveData(self, previousRow, previousColumn): module = self._module(previousRow) moduleConfigurations = self._configurations(module) for index in range(self.pageContent.propertyTable.rowCount()): @@ -117,7 +117,7 @@ class BModulePage(BWizardPage): def _pageChanged(self, row, column, previousRow, previousColumn): if previousRow != -1 and previousColumn != -1: - self._savePage(previousRow, previousColumn) + self._saveData(previousRow, previousColumn) self._fillPropertyTable() def _currentModule(self): diff --git a/wizard/BWizard.py b/wizard/BWizard.py index 9a035b96..9e227fa6 100644 --- a/wizard/BWizard.py +++ b/wizard/BWizard.py @@ -39,6 +39,9 @@ class BWizard(QWizard): self.connect(self, SIGNAL("currentIdChanged(int)"), self._pageChanged) def _pageChanged(self, pageId): + prevPage = self.page(pageId - 1) + if prevPage is not None: + prevPage.saveData() page = self.page(pageId) if page is not None: page.reloadData() \ No newline at end of file diff --git a/wizard/BWizardPage.py b/wizard/BWizardPage.py index b4fc6217..7f7039af 100644 --- a/wizard/BWizardPage.py +++ b/wizard/BWizardPage.py @@ -61,4 +61,7 @@ class BWizardPage(QWizardPage): self._settingsStore("toolchains", qvariant_converter.convertBoolDict(toolchains)) def reloadData(self): + pass + + def saveData(self): pass \ No newline at end of file