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 QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
44 self._confirmGroup.setVisible(False)
45 bertos_utils.createBertosProject(self.wizard().project())
46 self._finalGroup.setVisible(True)
47 self._completed = True
48 QApplication.restoreOverrideCursor()
49 self.emit(SIGNAL("completeChanged()"))
52 return self._completed
54 class QWidgetGroup(QObject):
56 Container class, this class contains widgets and permit to set some
57 properties of the contained widgets at the same time.
59 def __init__(self, *elements):
61 for element in elements:
62 self._widgets.append(element)
64 def addWidget(self, widget):
65 if widget not in self._widgets:
66 self._widgets.append(widget)
68 def setVisible(self, visible):
69 for widget in self._widgets:
70 widget.setVisible(visible)
73 for widget in self._widgets:
74 if not widget.isVisible():