Remove _ from method names
[bertos.git] / wizard / BWizard.py
index 7c2b0f4bc6c73c0302c3db77d8b74f61307a6aaa..3ea2dac67a195fa68fecd88bfeb8192a153a6816 100644 (file)
@@ -24,17 +24,21 @@ import BCreationPage
 import BFinalPage
 
 class BWizard(QWizard):
+    """
+    Main class of the wizard. It adds the pages automatically.
+    """
     
     def __init__(self):
         QWizard.__init__(self)
-        # TODO: choose the right minimum size
-        self.setMinimumSize(1000, 500)
         self.setWindowTitle(self.tr("Create a BeRTOS project"))
         self.setOption(QWizard.DisabledBackButtonOnLastPage, True)
-        self._addPages()
-        self._connectSignals()
+        self.addPages()
+        self.connectSignals()
     
-    def _addPages(self):
+    def addPages(self):
+        """
+        Method used by the constructor in order to add the pages in the wizard.
+        """
         self.addPage(BFolderPage.BFolderPage())
         self.addPage(BVersionPage.BVersionPage())
         self.addPage(BCpuPage.BCpuPage())
@@ -44,16 +48,23 @@ class BWizard(QWizard):
         self.addPage(BCreationPage.BCreationPage())
         self.addPage(BFinalPage.BFinalPage())
     
-    def _connectSignals(self):
-        self.connect(self, SIGNAL("currentIdChanged(int)"), self._pageChanged)
+    def connectSignals(self):
+        """
+        Connects the signals with the related slots.
+        """
+        self.connect(self, SIGNAL("currentIdChanged(int)"), self.pageChanged)
     
-    def _pageChanged(self, pageId):
-        prev_page = self.page(pageId - 1)
-        if prev_page is not None:
-            prev_page.saveData()
+    def pageChanged(self, pageId):
+        """
+        Slot called when the user change the current page. It calls the reloadData
+        method of the next page.
+        """
         page = self.page(pageId)
         if page is not None:
             page.reloadData()
     
     def project(self):
+        """
+        Returns the BProject associated with the wizard.
+        """
         return copy.deepcopy(QApplication.instance().project)