Open the wizard with the exec_() statement only when needed
[bertos.git] / wizard / bertos.py
index 627e93aeec2d3a260c4e7c1bc19bf0f091f935d4..80001466c8bd9548c0a80e3e5966caa9967ff4f5 100644 (file)
 #
 
 import sys
+
 from PyQt4.QtCore import *
 from PyQt4.QtGui import *
+
 import BStartPage
+
+import BFolderPage
 import BVersionPage
 
-def main():
-    app = QApplication(sys.argv)
-    QResource.registerResource("bertos.rcc")
-    startPage = BStartPage.BStartPage()
+def newProject():
     wizard = QWizard()
-    wizard.setWindowTitle("Welcome in beRTOS configuration wizard")
-    wizard.addPage(startPage)
+    wizard.setWindowTitle("Create a BeRTOS project")
+    wizard.addPage(BFolderPage.BFolderPage())
     wizard.addPage(BVersionPage.BVersionPage())
     wizard.show()
-    sys.exit(app.exec_())
+    wizard.exec_()
+    
+def editProject():
+    print "editProject"
+
+def showStartPage():
+    QApplication.instance().dialog = BStartPage.BStartPage()
+    QApplication.instance().connect(QApplication.instance().dialog, SIGNAL("newProject"), newProject)
+    QApplication.instance().connect(QApplication.instance().dialog, SIGNAL("editProject"), editProject)
+    QApplication.instance().dialog.show()
 
+def main():
+    app = QApplication(sys.argv)
+    app.settings = QSettings("Develer", "Bertos Configurator")
+    QResource.registerResource("bertos.rcc")
+    showStartPage()
+    sys.exit(app.exec_())
 
 if __name__ == '__main__':
     main()