From 4d907fd14c2fe774243ea65dce68f0592f881557 Mon Sep 17 00:00:00 2001 From: duplo Date: Mon, 31 May 2010 10:45:54 +0000 Subject: [PATCH] Remove Output page. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3886 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/BCreationPage.py | 16 ++++ wizard/BOutputPage.py | 134 ---------------------------------- wizard/BProjectPresets.py | 4 +- wizard/BToolchainPage.py | 4 +- wizard/bertos.py | 3 +- wizard/ui/output_select.ui | 50 ------------- wizard/ui/project_creation.ui | 9 ++- 7 files changed, 29 insertions(+), 191 deletions(-) delete mode 100644 wizard/BOutputPage.py delete mode 100644 wizard/ui/output_select.ui diff --git a/wizard/BCreationPage.py b/wizard/BCreationPage.py index 8cd1d369..d8172155 100644 --- a/wizard/BCreationPage.py +++ b/wizard/BCreationPage.py @@ -51,11 +51,16 @@ class BCreationPage(BWizardPage): self._completed = False ## Overloaded BWizardPage methods ## + + def connectSignals(self): + self.connect(self.pageContent.codeliteCheckBox, SIGNAL("stateChanged(int)"), self.codelitePluginChanged) def setupUi(self): summary = self.pageContent.summaryTree summary.setHeaderHidden(True) summary.setColumnCount(1) + self.pageContent.codeliteCheckBox.setChecked("codelite" not in self.plugins()) + self.codelitePluginChanged() self.setButtonText(QWizard.NextButton, self.tr("Create")) def reloadData(self): @@ -112,3 +117,14 @@ class BCreationPage(BWizardPage): self.pageContent.summaryTree.expandItem(item) #### + + ## Slots ## + + def codelitePluginChanged(self): + if not self.pageContent.codeliteCheckBox.isChecked(): + output = ["codelite"] + else: + output= [] + self.setProjectInfo("OUTPUT", output) + + #### \ No newline at end of file diff --git a/wizard/BOutputPage.py b/wizard/BOutputPage.py deleted file mode 100644 index 77ef748c..00000000 --- a/wizard/BOutputPage.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python -# encoding: utf-8 -# -# This file is part of BeRTOS. -# -# Bertos is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# -# As a special exception, you may use this file as part of a free software -# library without restriction. Specifically, if other files instantiate -# templates or use macros or inline functions from this file, or you compile -# this file and link it with other files to produce an executable, this -# file does not by itself cause the resulting executable to be covered by -# the GNU General Public License. This exception does not however -# invalidate any other reasons why the executable file might be covered by -# the GNU General Public License. -# -# Copyright 2008 Develer S.r.l. (http://www.develer.com/) -# -# $Id$ -# -# Author: Lorenzo Berni -# - -import os - -from PyQt4.QtGui import * -from BWizardPage import * -import bertos_utils - -import plugins - -from const import * - -class BOutputPage(BWizardPage): - """ - Page of the wizard that show a little summary of the previous decisions. - """ - - def __init__(self): - BWizardPage.__init__(self, UI_LOCATION + "/output_select.ui") - self.setTitle(self.tr("Choose the project output")) - - ## Overloaded BWizardPage methods. ## - - def connectSignals(self): - """ - Overload of the BWizardPage connectSignals method. - """ - for plugin in self._plugin_dict: - self.connect(plugin, SIGNAL("stateChanged(int)"), self.modeChecked) - - def setupUi(self): - """ - Overload of the BWizardPage setupUi method. - """ - self._plugin_dict = {} - scrollLayout = QVBoxLayout() - group, check = self.createNewOutput("BeRTOS Build System", - "Classic BeRTOS makefile based project", - True, False) - scrollLayout.addWidget(group) - plugin_list = self.plugins() - for plugin in self.availablePlugins(): - module = bertos_utils.loadPlugin(plugin) - selected = False - if plugin in plugin_list: selected = True - group, check = self.createNewOutput(module.PLUGIN_NAME, - module.PLUGIN_DESCRIPTION, - selected, True) - scrollLayout.addWidget(group) - self._plugin_dict[check] = plugin - scrollLayout.addStretch() - widget = QWidget() - widget.setLayout(scrollLayout) - self.pageContent.scrollArea.setWidget(widget) - - def reloadData(self): - """ - Overload of the BWizardPage reloadData method. - """ - self.modeChecked() - - #### - - ## Slots ## - - def modeChecked(self): - """ - Slot called when one of the mode checkbox is checked. It stores it. - """ - plugins = [] - for checkBox, plugin in self._plugin_dict.items(): - if checkBox.checkState() == Qt.Checked: - plugins.append(plugin) - self.setPlugins(plugins) - self.setProjectInfo("OUTPUT", plugins) - - #### - - def availablePlugins(self): - """ - Returns the list of the available plugins. - """ - return plugins.plugin_list - - def createNewOutput(self, name, description, checked=True, enabled=True): - """ - Create a groupBox for the given pieces of information. Returns the - groupBox and the checkBox - """ - check = QCheckBox(description) - if checked: - check.setCheckState(Qt.Checked) - else: - check.setCheckState(Qt.Unchecked) - groupLayout = QVBoxLayout() - groupLayout.addWidget(check) - group = QGroupBox(name) - group.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Maximum) - group.setLayout(groupLayout) - group.setEnabled(enabled) - return group, check \ No newline at end of file diff --git a/wizard/BProjectPresets.py b/wizard/BProjectPresets.py index b92eaa3d..5b5fa7a1 100644 --- a/wizard/BProjectPresets.py +++ b/wizard/BProjectPresets.py @@ -42,7 +42,7 @@ from PyQt4.QtGui import * from BWizardPage import BWizardPage -from BOutputPage import BOutputPage +from BCreationPage import BCreationPage from BToolchainPage import BToolchainPage from bertos_utils import _cmp @@ -148,7 +148,7 @@ class BProjectPresets(BWizardPage): toolchain_info = tm._validateToolchain(toolchain) toolchain_info["path"] = toolchain self.setProjectInfo("TOOLCHAIN", toolchain_info) - return self.wizard().pageIndex(BOutputPage) + return self.wizard().pageIndex(BCreationPage) else: return self.wizard().pageIndex(BToolchainPage) else: diff --git a/wizard/BToolchainPage.py b/wizard/BToolchainPage.py index 90603631..791a2f33 100644 --- a/wizard/BToolchainPage.py +++ b/wizard/BToolchainPage.py @@ -37,7 +37,7 @@ import os import collections from BWizardPage import * -from BOutputPage import BOutputPage +from BCreationPage import BCreationPage import BToolchainSearch import bertos_utils @@ -79,7 +79,7 @@ class BToolchainPage(BWizardPage): """ # Route to Output page if it's a predefined easy project. if self.projectInfo("PROJECT_FROM_PRESET") and self.projectInfo("BASE_MODE"): - return self.wizard().pageIndex(BOutputPage) + return self.wizard().pageIndex(BCreationPage) else: return QWizardPage.nextId(self) diff --git a/wizard/bertos.py b/wizard/bertos.py index 80488454..38b7224c 100755 --- a/wizard/bertos.py +++ b/wizard/bertos.py @@ -55,7 +55,6 @@ from BVersionPage import BVersionPage from BCpuPage import BCpuPage from BToolchainPage import BToolchainPage from BModulePage import BModulePage -from BOutputPage import BOutputPage from BCreationPage import BCreationPage from BFinalPage import BFinalPage @@ -67,7 +66,7 @@ from LoadException import VersionException, ToolchainException def newProject(): QApplication.instance().project = BProject() - page_list = [BIntroPage, BFolderPage, BVersionPage, BBoardPage, BProjectPresets, BCpuPage, BToolchainPage, BModulePage, BOutputPage, BCreationPage, BFinalPage] + page_list = [BIntroPage, BFolderPage, BVersionPage, BBoardPage, BProjectPresets, BCpuPage, BToolchainPage, BModulePage, BCreationPage, BFinalPage] wizard = BWizard(page_list) wizard.show() wizard.exec_() diff --git a/wizard/ui/output_select.ui b/wizard/ui/output_select.ui deleted file mode 100644 index ad4bfe72..00000000 --- a/wizard/ui/output_select.ui +++ /dev/null @@ -1,50 +0,0 @@ - - - Form - - - - 0 - 0 - 349 - 270 - - - - - 0 - 0 - - - - Form - - - - - - - 0 - 0 - - - - true - - - - - 0 - 0 - 321 - 242 - - - - - - - - - - diff --git a/wizard/ui/project_creation.ui b/wizard/ui/project_creation.ui index af4f585b..23f45a3d 100644 --- a/wizard/ui/project_creation.ui +++ b/wizard/ui/project_creation.ui @@ -13,10 +13,17 @@ Form - + + + + + Do not create Codelite project files + + + -- 2.25.1