Remove Output page.
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 31 May 2010 10:45:54 +0000 (10:45 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 31 May 2010 10:45:54 +0000 (10:45 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3886 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BCreationPage.py
wizard/BOutputPage.py [deleted file]
wizard/BProjectPresets.py
wizard/BToolchainPage.py
wizard/bertos.py
wizard/ui/output_select.ui [deleted file]
wizard/ui/project_creation.ui

index 8cd1d369ca44dfb35882805da02f7f1d5dc3c5ea..d8172155dca5fb9a2a2e62fa304aafdad803e313 100644 (file)
@@ -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 (file)
index 77ef748..0000000
+++ /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 <duplo@develer.com>
-#
-
-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
index b92eaa3dfb571267f70d5742e947919abd89a123..5b5fa7a1d5524c0da049f5fd9114583748f3f9fb 100644 (file)
@@ -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:
index 9060363193ce58b66047dea697b6986ce8c7c474..791a2f339d838f23871e527cf781f81bfc0b3751 100644 (file)
@@ -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)
 
index 80488454120f1f044dfe004bcac91930d6b28c13..38b7224c0691c02181460a2b645a12609830f1ab 100755 (executable)
@@ -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 (file)
index ad4bfe7..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>Form</class>
- <widget class="QWidget" name="Form">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>349</width>
-    <height>270</height>
-   </rect>
-  </property>
-  <property name="sizePolicy">
-   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-    <horstretch>0</horstretch>
-    <verstretch>0</verstretch>
-   </sizepolicy>
-  </property>
-  <property name="windowTitle">
-   <string>Form</string>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout_2">
-   <item>
-    <widget class="QScrollArea" name="scrollArea">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="widgetResizable">
-      <bool>true</bool>
-     </property>
-     <widget class="QWidget" name="scrollAreaWidgetContents">
-      <property name="geometry">
-       <rect>
-        <x>0</x>
-        <y>0</y>
-        <width>321</width>
-        <height>242</height>
-       </rect>
-      </property>
-     </widget>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
index af4f585b68c7a36e0e5ae24de948afa3030174c6..23f45a3dfd1f8177237dc5afdd5ea97086921c7c 100644 (file)
   <property name="windowTitle">
    <string>Form</string>
   </property>
-  <layout class="QVBoxLayout" name="verticalLayout">
+  <layout class="QVBoxLayout" name="verticalLayout" stretch="1,0">
    <item>
     <widget class="QTreeWidget" name="summaryTree"/>
    </item>
+   <item>
+    <widget class="QCheckBox" name="codeliteCheckBox">
+     <property name="text">
+      <string>Do not create Codelite project files</string>
+     </property>
+    </widget>
+   </item>
   </layout>
  </widget>
  <resources>