X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2FBCreationPage.py;h=e865a2cc2d89c757a7b41185f15c33a679a7dc5c;hb=ba2ba183c492049aface3e3d4e1d5f945b43f3d6;hp=892f9e8241573d866923754292e7c99a3894fe07;hpb=cb9bbecad29402c1c53b8c87f61a81147f6d9dad;p=bertos.git diff --git a/wizard/BCreationPage.py b/wizard/BCreationPage.py index 892f9e82..e865a2cc 100644 --- a/wizard/BCreationPage.py +++ b/wizard/BCreationPage.py @@ -23,38 +23,33 @@ class BCreationPage(BWizardPage): def __init__(self): BWizardPage.__init__(self, UI_LOCATION + "/project_creation.ui") self.setTitle(self.tr("Create the BeRTOS project")) - self._setupUi() - self._connectSignals() self._completed = False + + ## Overloaded BWizardPage methods ## - def _setupUi(self): - self._confirm_group = QWidgetGroup(self.pageContent.summaryTree, - self.pageContent.createButton) - self._final_group = QWidgetGroup(self.pageContent.iconLabel, - self.pageContent.textLabel) - self._final_group.setVisible(False) + def setupUi(self): summary = self.pageContent.summaryTree summary.setHeaderHidden(True) summary.setColumnCount(1) + self.setButtonText(QWizard.NextButton, self.tr("Create")) def reloadData(self): - self._completed = False - self._setupUi() + self.setupUi() self.pageContent.summaryTree.clear() top_level = [] folder_title = QTreeWidgetItem(QStringList([self.tr("Project folder")])) - folder_item = QTreeWidgetItem(folder_title, QStringList([os.path.normpath(self._projectInfoRetrieve("PROJECT_PATH"))])) + folder_item = QTreeWidgetItem(folder_title, QStringList([os.path.normpath(self.projectInfo("PROJECT_PATH"))])) top_level.append(folder_title) version_title = QTreeWidgetItem(QStringList([self.tr("BeRTOS version")])) - sources_path = self._projectInfoRetrieve("SOURCES_PATH") + sources_path = self.projectInfo("SOURCES_PATH") version = QTreeWidgetItem(version_title, QStringList([self.tr("version: ") + bertos_utils.bertosVersion(sources_path)])) source_path = QTreeWidgetItem(version_title, QStringList([self.tr("path: ") + os.path.normpath(sources_path)])) top_level.append(version_title) cpu_title = QTreeWidgetItem(QStringList([self.tr("CPU")])) - cpu_name = QTreeWidgetItem(cpu_title, QStringList([self.tr("cpu name: ") + self._projectInfoRetrieve("CPU_NAME")])) + cpu_name = QTreeWidgetItem(cpu_title, QStringList([self.tr("cpu name: ") + self.projectInfo("CPU_NAME")])) top_level.append(cpu_title) toolchain_title = QTreeWidgetItem(QStringList([self.tr("Toolchain")])) - toolchain_info = self._projectInfoRetrieve("TOOLCHAIN") + toolchain_info = self.projectInfo("TOOLCHAIN") if "target" in toolchain_info.keys(): toolchain_target = QTreeWidgetItem(toolchain_title, QStringList([self.tr("target: " + toolchain_info["target"])])) if "version" in toolchain_info.keys(): @@ -62,9 +57,9 @@ class BCreationPage(BWizardPage): toolchain_path = QTreeWidgetItem(toolchain_title, QStringList([self.tr("path: " + os.path.normpath(toolchain_info["path"]))])) top_level.append(toolchain_title) module_title = QTreeWidgetItem(QStringList([self.tr("Modules")])) - configurations = self._projectInfoRetrieve("CONFIGURATIONS") + configurations = self.projectInfo("CONFIGURATIONS") module_categories = {} - for module, information in self._projectInfoRetrieve("MODULES").items(): + for module, information in self.projectInfo("MODULES").items(): if information["enabled"]: if information["category"] not in module_categories.keys(): module_categories[information["category"]] = [] @@ -83,42 +78,4 @@ class BCreationPage(BWizardPage): top_level.append(module_title) self.pageContent.summaryTree.insertTopLevelItems(0, top_level) - def _connectSignals(self): - self.connect(self.pageContent.createButton, SIGNAL("clicked(bool)"), self._createProject) - - def _createProject(self): - QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) - self._confirm_group.setVisible(False) - bertos_utils.createBertosProject(self.wizard().project()) - self._final_group.setVisible(True) - self._completed = True - QApplication.restoreOverrideCursor() - self.emit(SIGNAL("completeChanged()")) - - def isComplete(self): - return self._completed - -class QWidgetGroup(QObject): - """ - Container class, this class contains widgets and permit to set some - properties of the contained widgets at the same time. - """ - def __init__(self, *elements): - self._widgets = [] - for element in elements: - self._widgets.append(element) - - def addWidget(self, widget): - if widget not in self._widgets: - self._widgets.append(widget) - - def setVisible(self, visible): - for widget in self._widgets: - widget.setVisible(visible) - - def isVisible(self): - for widget in self._widgets: - if not widget.isVisible(): - return False - return True - + #### \ No newline at end of file