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