Move the start page in a separate QWidget and remove it from the QWizard
[bertos.git] / wizard / BStartPage.py
1 #!/usr/bin/env python
2 # encoding: utf-8
3 #
4 # Copyright 2008 Develer S.r.l. (http://www.develer.com/)
5 # All rights reserved.
6 #
7 # $Id:$
8 #
9 # Author: Lorenzo Berni <duplo@develer.com>
10 #
11
12 from PyQt4.QtCore import *
13 from PyQt4.QtGui import *
14 import PyQt4.uic as uic
15
16 class BStartPage(QWidget):
17     
18     def __init__(self):
19         QDialog.__init__(self)
20         self._setupUi()
21         self._connectSignals()
22         self.setWindowTitle(self.tr("Create or edit a BeRTOS project"))
23         self._initializeButtons()
24     
25     def _setupUi(self):
26         self.content = uic.loadUi("start.ui", None)
27         layout = QVBoxLayout()
28         layout.addWidget(self.content)
29         self.setLayout(layout)
30     
31     def _connectSignals(self):
32         self.connect(self.content.newButton, SIGNAL("clicked()"), self.newProject)
33         self.connect(self.content.editButton, SIGNAL("clicked()"), self.editProject)
34     
35     def _initializeButtons(self):
36         self.buttonGroup = QButtonGroup()
37         self.buttonGroup.addButton(self.content.newButton)
38         self.buttonGroup.addButton(self.content.editButton)
39         self.buttonGroup.setExclusive(True)
40         
41     def newProject(self):
42         self.emit(SIGNAL("newProject"))
43         self.close()
44     
45     def editProject(self):
46         self.emit(SIGNAL("editProject"))
47         self.close()