Compiles automatically the resources if needed
[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 from distutils.dep_util import newer
14
15 from PyQt4.QtCore import *
16 from PyQt4.QtGui import *
17
18 import BProject
19
20 import BStartPage
21 import BWizard
22
23 def newProject():
24     wizard = BWizard.BWizard()
25     wizard.show()
26     wizard.exec_()
27     
28 def editProject():
29     print "editProject"
30
31 def showStartPage():
32     QApplication.instance().dialog = BStartPage.BStartPage()
33     QApplication.instance().connect(QApplication.instance().dialog, SIGNAL("newProject"), newProject)
34     QApplication.instance().connect(QApplication.instance().dialog, SIGNAL("editProject"), editProject)
35     QApplication.instance().dialog.show()
36
37 def main():
38     app = QApplication(sys.argv)
39     app.settings = QSettings("Develer", "Bertos Configurator")
40     app.project = BProject.BProject()
41     if newer("bertos.qrc", "bertos.rcc"):
42         os.system("rcc -binary bertos.qrc > bertos.rcc")
43     QResource.registerResource("bertos.rcc")
44     showStartPage()
45     sys.exit(app.exec_())
46
47 if __name__ == '__main__':
48     main()
49