Add support for loading files from command line

Fixes #8
This commit is contained in:
Arjen Hiemstra 2015-05-15 15:18:27 +02:00
parent fdde91be67
commit 6eb9f5139b

View File

@ -85,6 +85,9 @@ class CuraApplication(QtApplication):
self._plugin_registry.loadPlugin("CuraEngineBackend")
def addCommandLineOptions(self, parser):
parser.add_argument("file", nargs="*", help="Files to load after starting the application.")
def run(self):
self._i18n_catalog = i18nCatalog("cura");
@ -153,6 +156,10 @@ class CuraApplication(QtApplication):
if self._engine.rootObjects:
self.closeSplash()
for file in self.getCommandLineOption("file", []):
job = ReadMeshJob(os.path.abspath(file))
job.start()
self.exec_()
def registerObjects(self, engine):