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()
28 self._confirmGroup = QWidgetGroup(self.pageContent.summaryTree,
29 self.pageContent.createButton)
30 self._workingGroup = QWidgetGroup(self.pageContent.spinnerLabel)
31 self._workingGroup.setVisible(False)
32 self._finalGroup = QWidgetGroup(self.pageContent.iconLabel,
33 self.pageContent.textLabel)
34 self._finalGroup.setVisible(False)
36 def _connectSignals(self):
37 self.connect(self.pageContent.createButton, SIGNAL("clicked(bool)"), self._createProject)
39 def _createProject(self):
40 self._confirmGroup.setVisible(False)
41 #self._workingGroup.setVisible(True)
42 #self._movie = QMovie("images/load_spinner.gif")
43 #print self._movie.isValid()
44 #self.pageContent.spinnerLabel.setMovie(self._movie)
46 bertos_utils.createBertosProject(self.wizard().project())
48 #self._workingGroup.setVisible(False)
49 self._finalGroup.setVisible(True)
50 self.emit(SIGNAL("completeChanged()"))
53 return self._finalGroup.isVisible()
55 class QWidgetGroup(QObject):
57 Container class, this class contains widgets and permit to set some
58 properties of the contained widgets at the same time.
60 def __init__(self, *elements):
62 for element in elements:
63 self._widgets.append(element)
65 def addWidget(self, widget):
66 if widget not in self._widgets:
67 self._widgets.append(widget)
69 def setVisible(self, visible):
70 for widget in self._widgets:
71 widget.setVisible(visible)
74 for widget in self._widgets:
75 if not widget.isVisible():