--- /dev/null
+#!/usr/bin/env python
+# encoding: utf-8
+#
+# Copyright 2009 Develer S.r.l. (http://www.develer.com/)
+# All rights reserved.
+#
+# $Id:$
+#
+# Author: Lorenzo Berni <duplo@develer.com>
+#
+
+from PyQt4.QtGui import *
+
+from BWizardPage import *
+import bertos_utils
+
+from const import *
+
+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()
+
+ def _setupUi(self):
+ self._confirmGroup = QWidgetGroup(self.pageContent.summaryTree,
+ self.pageContent.createButton)
+ self._workingGroup = QWidgetGroup(self.pageContent.spinnerLabel)
+ self._workingGroup.setVisible(False)
+ self._finalGroup = QWidgetGroup(self.pageContent.iconLabel,
+ self.pageContent.textLabel)
+ self._finalGroup.setVisible(False)
+
+ def _connectSignals(self):
+ self.connect(self.pageContent.createButton, SIGNAL("clicked(bool)"), self._createProject)
+
+ def _createProject(self):
+ self._confirmGroup.setVisible(False)
+ #self._workingGroup.setVisible(True)
+ #self._movie = QMovie("images/load_spinner.gif")
+ #print self._movie.isValid()
+ #self.pageContent.spinnerLabel.setMovie(self._movie)
+ #self._movie.start()
+ bertos_utils.createBertosProject(self.wizard().project())
+ #del self._movie
+ #self._workingGroup.setVisible(False)
+ self._finalGroup.setVisible(True)
+ self.emit(SIGNAL("completeChanged()"))
+
+ def isComplete(self):
+ return self._finalGroup.isVisible()
+
+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
+
--- /dev/null
+<ui version="4.0" >
+ <class>Form</class>
+ <widget class="QWidget" name="Form" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>402</width>
+ <height>336</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <widget class="QTreeWidget" name="summaryTree" >
+ <column>
+ <property name="text" >
+ <string>1</string>
+ </property>
+ </column>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QToolButton" name="createButton" >
+ <property name="text" >
+ <string>Create</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="spinnerLabel" >
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_3" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3" >
+ <item>
+ <widget class="QLabel" name="iconLabel" >
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="pixmap" >
+ <pixmap resource="../bertos.qrc" >:/images/ok.png</pixmap>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="textLabel" >
+ <property name="text" >
+ <string>The project has been created correctly</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="../bertos.qrc" />
+ </resources>
+ <connections/>
+</ui>