Change beRTOS to BeRTOS in the wizard gui
[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 BWizardPage import *
13 import bertos_utils
14
15 class BStartPage(BWizardPage):
16     
17     def __init__(self):
18         BWizardPage.__init__(self, "start.ui")
19         self._connectSignals()
20         self.setTitle(self.tr("Create or edit a BeRTOS project"))
21         self._initializeButtons()
22         self._setupUi()
23         
24     def _connectSignals(self):
25         self.connect(self.pageContent.newButton, SIGNAL("clicked()"), self.newProject)
26         self.connect(self.pageContent.editButton, SIGNAL("clicked()"), self.editProject)
27     
28     def _initializeButtons(self):
29         self.buttonGroup = QButtonGroup()
30         self.buttonGroup.addButton(self.pageContent.newButton)
31         self.buttonGroup.addButton(self.pageContent.editButton)
32         self.buttonGroup.setExclusive(True)
33
34     def _setupUi(self):
35         self.pageContent.newDescription.setVisible(False)
36         self.pageContent.editDescription.setVisible(False)
37     
38     def newProject(self):
39         filename = QFileDialog.getSaveFileName(self, self.tr("Destination directory"), "", "", "", QFileDialog.ShowDirsOnly)
40         if not filename.isEmpty():
41             self.pageContent.newDescription.setText("(\"" + filename + "\")")
42             self.pageContent.newDescription.setVisible(True)
43             # TODO: It's better to create it at the end of the wizard...
44             bertos_utils.createBertosProject(filename)
45         else:
46             self.pageContent.newDescription.setText("")
47             self.pageContent.newDescription.setVisible(False)
48     
49     def editProject(self):
50         pass