4 # Copyright 2009 Develer S.r.l. (http://www.develer.com/)
9 # Author: Lorenzo Berni <duplo@develer.com>
12 from PyQt4.QtGui import *
14 from BWizardPage import *
19 class BCreationPage(BWizardPage):
22 BWizardPage.__init__(self, UI_LOCATION + "/project_creation.ui")
23 self.setTitle(self.tr("Create the BeRTOS project"))
25 self._connectSignals()
26 self._completed = False
29 self._completed = False
33 self._confirmGroup = QWidgetGroup(self.pageContent.summaryTree,
34 self.pageContent.createButton)
35 self._finalGroup = QWidgetGroup(self.pageContent.iconLabel,
36 self.pageContent.textLabel)
37 self._finalGroup.setVisible(False)
39 def _connectSignals(self):
40 self.connect(self.pageContent.createButton, SIGNAL("clicked(bool)"), self._createProject)
42 def _createProject(self):
43 self._confirmGroup.setVisible(False)
44 bertos_utils.createBertosProject(self.wizard().project())
45 self._finalGroup.setVisible(True)
46 self._completed = True
47 self.emit(SIGNAL("completeChanged()"))
50 return self._completed
52 class QWidgetGroup(QObject):
54 Container class, this class contains widgets and permit to set some
55 properties of the contained widgets at the same time.
57 def __init__(self, *elements):
59 for element in elements:
60 self._widgets.append(element)
62 def addWidget(self, widget):
63 if widget not in self._widgets:
64 self._widgets.append(widget)
66 def setVisible(self, visible):
67 for widget in self._widgets:
68 widget.setVisible(visible)
71 for widget in self._widgets:
72 if not widget.isVisible():