The main file handle the wizard and the start window
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 16 Dec 2008 14:56:26 +0000 (14:56 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 16 Dec 2008 14:56:26 +0000 (14:56 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2046 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/bertos.py

index 65f73f8ef1765a7f589de58c3f748f9d22b0bbd4..72c417735fdd1dbf8cda1624b264adebff6ba539 100644 (file)
 #
 
 import sys
+
 from PyQt4.QtCore import *
 from PyQt4.QtGui import *
+
 import BStartPage
+
 import BVersionPage
 
+def newProject():
+    QApplication.instance().wizard = QWizard()
+    QApplication.instance().wizard.setWindowTitle("Create a BeRTOS project")
+    QApplication.instance().wizard.addPage(BVersionPage.BVersionPage())
+    QApplication.instance().wizard.show()
+    
+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")
-    startPage = BStartPage.BStartPage()
-    wizard = QWizard()
-    wizard.setWindowTitle("Welcome in BeRTOS configuration wizard")
-    wizard.addPage(startPage)
-    wizard.addPage(BVersionPage.BVersionPage())
-    wizard.show()
+    showStartPage()
     sys.exit(app.exec_())
 
-
 if __name__ == '__main__':
     main()