diff options
author | Jaime van Kessel <nallath@gmail.com> | 2017-10-16 16:05:51 +0300 |
---|---|---|
committer | Jaime van Kessel <nallath@gmail.com> | 2017-10-16 16:05:51 +0300 |
commit | 70f0e8752bb55debb60e028819b12579cc6e0697 (patch) | |
tree | 616beba3aa075865484d3f9c423a1a10bdba2df2 /cura/CuraApplication.py | |
parent | 38b9df80f395b9b65972afd14f3a8a82b16f4496 (diff) |
Add extra --headless flag to commandline
Diffstat (limited to 'cura/CuraApplication.py')
-rwxr-xr-x | cura/CuraApplication.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 6a4b996080..13d67d5c70 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -533,6 +533,7 @@ class CuraApplication(QtApplication): super().addCommandLineOptions(parser) parser.add_argument("file", nargs="*", help="Files to load after starting the application.") parser.add_argument("--single-instance", action="store_true", default=False) + parser.add_argument("--headless", action = "store_true", default=False) # Set up a local socket server which listener which coordinates single instances Curas and accepts commands. def _setUpSingleInstanceServer(self): @@ -679,9 +680,12 @@ class CuraApplication(QtApplication): qmlRegisterSingletonType(MachineActionManager.MachineActionManager, "Cura", 1, 0, "MachineActionManager", self.getMachineActionManager) self.setMainQml(Resources.getPath(self.ResourceTypes.QmlFiles, "Cura.qml")) self._qml_import_paths.append(Resources.getPath(self.ResourceTypes.QmlFiles)) - self.initializeEngine() - if self._engine.rootObjects: + run_headless = self.getCommandLineOption("headless", False) + if not run_headless: + self.initializeEngine() + + if run_headless or self._engine.rootObjects: self.closeSplash() for file in self.getCommandLineOption("file", []): @@ -1227,6 +1231,9 @@ class CuraApplication(QtApplication): # see GroupDecorator._onChildrenChanged def _createSplashScreen(self): + run_headless = self.getCommandLineOption("headless", False) + if run_headless: + return None return CuraSplashScreen.CuraSplashScreen() def _onActiveMachineChanged(self): |