X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2Fbertos.py;h=a5610a75b6e74f919ea9618a89780bf5e2a52112;hb=388d3841c38fe298c64cf14dafeb7d9800c774e3;hp=4bd6af676b3b2c5c3ed471b3fc23b28d4759bf6f;hpb=df3bd7f742da8c015304fa21e01eb966ff76a089;p=bertos.git diff --git a/wizard/bertos.py b/wizard/bertos.py index 4bd6af67..a5610a75 100755 --- a/wizard/bertos.py +++ b/wizard/bertos.py @@ -55,6 +55,8 @@ from BOutputPage import BOutputPage from BCreationPage import BCreationPage from BFinalPage import BFinalPage +from BEditingDialog import BEditingDialog + import bertos_utils def newProject(): @@ -74,11 +76,10 @@ def newProject(): subprocess.call(command_line + " \"" + relevant_file + "\"") sys.exit() -def editProject(): - page_list = [BOpenPage, BVersionPage, BCpuPage, BToolchainPage, BModulePage, BOutputPage, BCreationPage, BFinalPage] - wizard = BWizard.BWizard(page_list) - wizard.show() - wizard.exec_() +def editProject(project_file): + QApplication.instance().project = bertos_utils.loadBertosProject(project_file) + dialog = BEditingDialog() + dialog.exec_() def showStartPage(): QApplication.instance().dialog = BStartPage.BStartPage() @@ -95,17 +96,11 @@ def main(): if not (hasattr(sys, "frozen") and sys.frozen) and newer("bertos.qrc", "bertos.rcc"): os.system("rcc -binary bertos.qrc -o bertos.rcc") QResource.registerResource("bertos.rcc") - if "--create" in sys.argv and "--edit" not in sys.argv: - newProject() - elif "--edit" in sys.argv and "--create" not in sys.argv: - editProject() - elif "--create" in sys.argv and "--edit" in sys.argv: - # TODO need an explaining message - print " ".join(sys.argv) - print "Invalid usage!" - pass + if len(sys.argv) == 3 and sys.argv[1] == "--edit": + editProject(sys.argv[2]) else: newProject() + if __name__ == '__main__': main()