Show wizard version.
[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 from const import *
17 from version import wizard_version
18
19 class BStartPage(QDialog):
20
21     def __init__(self):
22         QDialog.__init__(self)
23         self.setupUi()
24         self.connectSignals()
25         self.setWindowTitle(self.tr("Create or edit a BeRTOS project - rev.%1").arg(wizard_version))
26         self.initializeButtons()
27
28     def setupUi(self):
29         self.content = uic.loadUi(UI_LOCATION + "/start.ui", None)
30         self.setWindowIcon(QIcon(":/images/appicon.png"))
31         layout = QVBoxLayout()
32         layout.addWidget(self.content)
33         self.setLayout(layout)
34
35     def connectSignals(self):
36         self.connect(self.content.newButton, SIGNAL("clicked()"), self.newProject)
37         self.connect(self.content.editButton, SIGNAL("clicked()"), self.editProject)
38
39     def initializeButtons(self):
40         self.button_group = QButtonGroup()
41         self.button_group.addButton(self.content.newButton)
42         self.button_group.addButton(self.content.editButton)
43         self.button_group.setExclusive(True)
44
45     def newProject(self):
46         self.close()
47         self.emit(SIGNAL("newProject"))
48
49     def editProject(self):
50         self.close()
51         self.emit(SIGNAL("editProject"))