Correct a bug of the stored value
[bertos.git] / wizard / BWizard.py
index 004fdf3e534c450796719f663670e522d8c7da1a..1966d932e10d908ac74f5bbd2ec0329ff9209c87 100644 (file)
@@ -28,33 +28,28 @@ class BWizard(QWizard):
     Main class of the wizard. It adds the pages automatically.
     """
     
     Main class of the wizard. It adds the pages automatically.
     """
     
-    def __init__(self):
+    def __init__(self, page_list):
         QWizard.__init__(self)
         self.setWindowTitle(self.tr("Create a BeRTOS project"))
         QWizard.__init__(self)
         self.setWindowTitle(self.tr("Create a BeRTOS project"))
+        self.setWindowIcon(QIcon(":/images/appicon.png"))
         self.setOption(QWizard.DisabledBackButtonOnLastPage, True)
         self.setOption(QWizard.DisabledBackButtonOnLastPage, True)
-        self._addPages()
-        self._connectSignals()
+        self.addPages(page_list)
+        self.connectSignals()
     
     
-    def _addPages(self):
+    def addPages(self, page_list):
         """
         """
-        Method used by the constructor in order to add the pages in the wizard.
+        Adds the pages in the wizard.
         """
         """
-        self.addPage(BFolderPage.BFolderPage())
-        self.addPage(BVersionPage.BVersionPage())
-        self.addPage(BCpuPage.BCpuPage())
-        self.addPage(BToolchainPage.BToolchainPage())
-        self.addPage(BModulePage.BModulePage())
-        self.addPage(BOutputPage.BOutputPage())
-        self.addPage(BCreationPage.BCreationPage())
-        self.addPage(BFinalPage.BFinalPage())
-    
-    def _connectSignals(self):
+        for page in page_list:
+            self.addPage(page())
+
+    def connectSignals(self):
         """
         Connects the signals with the related slots.
         """
         """
         Connects the signals with the related slots.
         """
-        self.connect(self, SIGNAL("currentIdChanged(int)"), self._pageChanged)
+        self.connect(self, SIGNAL("currentIdChanged(int)"), self.pageChanged)
     
     
-    def _pageChanged(self, pageId):
+    def pageChanged(self, pageId):
         """
         Slot called when the user change the current page. It calls the reloadData
         method of the next page.
         """
         Slot called when the user change the current page. It calls the reloadData
         method of the next page.