X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2FBWizard.py;h=004fdf3e534c450796719f663670e522d8c7da1a;hb=ca1a17d62748010cd95a0012f67a9e80c6565d73;hp=23f05a096bcbd32eb40f3d9eb888fa46fffee84e;hpb=5bd6e143423ef44be2b203f7480b821b0a920dba;p=bertos.git diff --git a/wizard/BWizard.py b/wizard/BWizard.py index 23f05a09..004fdf3e 100644 --- a/wizard/BWizard.py +++ b/wizard/BWizard.py @@ -20,35 +20,51 @@ import BCpuPage import BToolchainPage import BModulePage import BOutputPage +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() 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()) self.addPage(BToolchainPage.BToolchainPage()) self.addPage(BModulePage.BModulePage()) self.addPage(BOutputPage.BOutputPage()) + self.addPage(BCreationPage.BCreationPage()) + self.addPage(BFinalPage.BFinalPage()) def _connectSignals(self): + """ + Connects the signals with the related slots. + """ self.connect(self, SIGNAL("currentIdChanged(int)"), self._pageChanged) def _pageChanged(self, pageId): - prevPage = self.page(pageId - 1) - if prevPage is not None: - prevPage.saveData() + """ + 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): - return copy.deepcopy(QApplication.instance().project) \ No newline at end of file + """ + Returns the BProject associated with the wizard. + """ + return copy.deepcopy(QApplication.instance().project)