Add new parameter to reloadData method (an integer containing the id of the previous...
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 8 Jun 2010 13:59:55 +0000 (13:59 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 8 Jun 2010 13:59:55 +0000 (13:59 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3903 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BBoardPage.py
wizard/BCpuPage.py
wizard/BCreationPage.py
wizard/BFinalPage.py
wizard/BModulePage.py
wizard/BOpenPage.py
wizard/BProjectPresets.py
wizard/BToolchainPage.py
wizard/BVersionPage.py
wizard/BWizard.py
wizard/BWizardPage.py

index fdad680ba4ec83e983e46b6765fb7782ba4e855a..843562a7b72b139da864adea6c417f3767b77c5d 100644 (file)
@@ -98,7 +98,7 @@ class BBoardPage(BWizardPage):
         self.connect(self.pageContent.boardList, SIGNAL("currentItemChanged(QListWidgetItem*,QListWidgetItem*)"), self, SIGNAL("completeChanged()"))
         self.connect(self.pageContent.customButton, SIGNAL("clicked()"), self.customButtonClicked)
 
-    def reloadData(self):
+    def reloadData(self, previous_id=None):
         """
         Overload of the BWizardPage reloadData method.
         """
index 17b7341a4c82db19019e5e01a476fead1aff4c0e..b0e9bd394328becb3d3ed9eb8337b8bd0edaeab6 100644 (file)
@@ -106,7 +106,7 @@ class BCpuPage(BWizardPage):
         self.connect(self.pageContent.cpuList, SIGNAL("currentItemChanged(QListWidgetItem *, QListWidgetItem*)"), self.rowChanged)
         self.connect(self.pageContent.frequencySpinBox, SIGNAL("editingFinished()"), self.freqChanged)
 
-    def reloadData(self):
+    def reloadData(self, previous_id=None):
         """
         Overload of the BWizardPage reloadData method.
         """
@@ -134,18 +134,17 @@ class BCpuPage(BWizardPage):
         """
         Slot called when the user select an entry from the cpu list.
         """
-        if self.pageContent.cpuList.currentItem():
-            description = qvariant_converter.getDict(self.pageContent.cpuList.currentItem().data(Qt.UserRole))["CPU_DESC"]
-            description = qvariant_converter.getStringList(description)
-            if not self.freq_modified:
-                # Retrieve the default cpu frequency when the value isn't already modified
-                current_freq = qvariant_converter.getDict(self.pageContent.cpuList.currentItem().data(Qt.UserRole))["CPU_DEFAULT_FREQ"]
-                current_freq = qvariant_converter.getString(current_freq)
-                current_freq = long(current_freq.replace("U", "").replace("L", ""))
-                self.pageContent.frequencySpinBox.setValue(long(current_freq))
-            self.pageContent.descriptionLabel.setText("<br>".join(description))
-            self.pageContent.descriptionLabel.setVisible(True)
-            self.emit(SIGNAL("completeChanged()"))
+        description = qvariant_converter.getDict(self.pageContent.cpuList.currentItem().data(Qt.UserRole))["CPU_DESC"]
+        description = qvariant_converter.getStringList(description)
+        if not self.freq_modified:
+            # Retrieve the default cpu frequency when the value isn't already modified
+            current_freq = qvariant_converter.getDict(self.pageContent.cpuList.currentItem().data(Qt.UserRole))["CPU_DEFAULT_FREQ"]
+            current_freq = qvariant_converter.getString(current_freq)
+            current_freq = long(current_freq.replace("U", "").replace("L", ""))
+            self.pageContent.frequencySpinBox.setValue(long(current_freq))
+        self.pageContent.descriptionLabel.setText("<br>".join(description))
+        self.pageContent.descriptionLabel.setVisible(True)
+        self.emit(SIGNAL("completeChanged()"))
     
     def freqChanged(self):
         """
index d8172155dca5fb9a2a2e62fa304aafdad803e313..d91fbc61c649777cf4432803ec18628c569c02e4 100644 (file)
@@ -63,7 +63,7 @@ class BCreationPage(BWizardPage):
         self.codelitePluginChanged()
         self.setButtonText(QWizard.NextButton, self.tr("Create"))
     
-    def reloadData(self):
+    def reloadData(self, previous_id=None):
         self.setupUi()
         self.pageContent.summaryTree.clear()
         top_level = []
index 2306b8630d8adec21b6c9a54ad0e2b751bc6a2dc..66a300fafb52e86da7e2ac37a09ee5a65f7fd1ca 100644 (file)
@@ -53,7 +53,7 @@ class BFinalPage(BWizardPage):
     
     ## Overloaded BWizardPage methods ##
         
-    def reloadData(self):
+    def reloadData(self, previous_id=None):
         self.setVisible(False)
         """
         Overload of the BWizardPage reloadData method.
index ad6fee500fa3111deb5cfcb95f6fc5289f708970..6e40c7f128d69831c1242fed721374b43ab708c3 100644 (file)
@@ -81,17 +81,20 @@ class BModulePage(BWizardPage):
         self.connect(self.pageContent.moduleTree, SIGNAL("itemPressed(QTreeWidgetItem*, int)"), self.moduleClicked)
         self.connect(self.pageContent.moduleTree, SIGNAL("itemChanged(QTreeWidgetItem*, int)"), self.dependencyCheck)
 
-    def reloadData(self):
+    def reloadData(self, previous_id=None):
         """
         Overload of the BWizardPage reloadData method.
         """
-        try:
-            QApplication.instance().setOverrideCursor(Qt.WaitCursor)
-            self.setupUi()
-            self.loadModuleData()
-            self.fillModuleTree()
-        finally:
-            QApplication.instance().restoreOverrideCursor()
+        # Check if the user are approaching this page from the previous or the
+        # next one.
+        if previous_id is None or previous_id < self.wizard().currentId():
+            try:
+                QApplication.instance().setOverrideCursor(Qt.WaitCursor)
+                self.setupUi()
+                self.loadModuleData()
+                self.fillModuleTree()
+            finally:
+                QApplication.instance().restoreOverrideCursor()
     
     ####
     
index bf2b5ea618c6e2705890a27d42cb599e518e6ddf..50063c987cc5e1ee45d900ab1796bd174b6ed5b9 100644 (file)
@@ -56,7 +56,7 @@ class BOpenPage(BWizardPage):
     
     ## Overloaded BWizardPage methods ##
     
-    def reloadData(self):
+    def reloadData(self, previous_id=None):
         """
         Overload of the BWizardPage reloadData method.
         """
index 5b5fa7a1d5524c0da049f5fd9114583748f3f9fb..9afed4f4328ea37ccefb71f2c6a967ba45623f45 100644 (file)
@@ -163,7 +163,7 @@ class BProjectPresets(BWizardPage):
     
     ## Overloaded BWizardPage methods ##
     
-    def reloadData(self):
+    def reloadData(self, previous_id=None):
         if not self.projectInfo("PRESET_LOADED"):
             preset_path = self.projectInfo("PROJECT_BOARD")
             preset_tree = self.projectInfo("PRESET_TREE")
index ff1891ff70edb15244effd52a3d38069b37f3c3f..785db3889aaab1cd0bc40d24dfa7fd2f8f6c626b 100644 (file)
@@ -103,7 +103,7 @@ class BToolchainPage(BWizardPage):
         self.connect(self.pageContent.searchButton, SIGNAL("clicked()"), self.searchToolchain)
         self.connect(self.pageContent.checkButton, SIGNAL("clicked()"), self.validateAllToolchains)
 
-    def reloadData(self):
+    def reloadData(self, previous_id=None):
         """
         Overload of the BWizard reloadData method.
         """
index c65d34d026b631576ae7c54c0997a85f32520df0..addc2960bc340e71b3a84cfdead92ba7d21b674d 100644 (file)
@@ -84,7 +84,7 @@ class BVersionPage(BWizardPage):
         # Fake signal connection for the update button
         self.connect(self.pageContent.updateButton, SIGNAL("clicked()"), self.updateClicked)
     
-    def reloadData(self):
+    def reloadData(self, previous_id=None):
         """
         Overload of the BWizardPage reloadData method.
         """
index a22e603c4037e1c46d462fbd9e357b552cf49aef..7e96ee497aea252726324bac8c761d57cc02c158 100644 (file)
@@ -49,6 +49,7 @@ class BWizard(QWizard):
     """
 
     def __init__(self, page_list):
+        self._current = None
         QWizard.__init__(self)
         geometry = QApplication.instance().settings.value("geometry", QVariant()).toRect()
         self.setGeometry(geometry)
@@ -83,7 +84,8 @@ class BWizard(QWizard):
         """
         page = self.page(pageId)
         if page:
-            page.reloadData()
+            page.reloadData(previous_id= self._current)
+        self._current = pageId
 
     def project(self):
         """
index b7ffe1f51e96a2fb76e431935cc806973c20a8b2..f86e09c4e717164105cfebfde4ded4e52ccb9c08 100644 (file)
@@ -185,7 +185,7 @@ class BWizardPage(QWizardPage):
     
     ## Methodo to be implemented in child classes when needed ##
     
-    def reloadData(self):
+    def reloadData(self, previous_id=None):
         """
         Method called before the page is loaded. The pages that need to use this
         method have to implement it.