Add the CPU select page to the wizard
[bertos.git] / wizard / bertos.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 import sys
13
14 from PyQt4.QtCore import *
15 from PyQt4.QtGui import *
16
17 import BProject
18
19 import BStartPage
20
21 import BFolderPage
22 import BVersionPage
23 import BCpuPage
24
25 def newProject():
26     wizard = QWizard()
27     wizard.setWindowTitle("Create a BeRTOS project")
28     wizard.addPage(BFolderPage.BFolderPage())
29     wizard.addPage(BVersionPage.BVersionPage())
30     wizard.addPage(BCpuPage.BCpuPage())
31     wizard.show()
32     wizard.exec_()
33     
34 def editProject():
35     print "editProject"
36
37 def showStartPage():
38     QApplication.instance().dialog = BStartPage.BStartPage()
39     QApplication.instance().connect(QApplication.instance().dialog, SIGNAL("newProject"), newProject)
40     QApplication.instance().connect(QApplication.instance().dialog, SIGNAL("editProject"), editProject)
41     QApplication.instance().dialog.show()
42
43 def main():
44     app = QApplication(sys.argv)
45     app.settings = QSettings("Develer", "Bertos Configurator")
46     app.project = BProject.BProject()
47     QResource.registerResource("bertos.rcc")
48     showStartPage()
49     sys.exit(app.exec_())
50
51 if __name__ == '__main__':
52     main()
53