From a1be5a080fc2f2e3faa20fc7a29adc6e2d68e2d6 Mon Sep 17 00:00:00 2001 From: Tamara Hogenhout Date: Fri, 15 Jan 2016 16:06:01 +0100 Subject: [PATCH] Allows for a file to be opened using the terminal or something alike for instance when the file is dragged onto the logo(MacOS) or with 'open with'(Windows) Fixes to #CURA-707 Fixes to #CURA-620 Fixes #591 --- cura/CuraApplication.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 59495bd66a..68e725e94a 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -271,6 +271,7 @@ class CuraApplication(QtApplication): @pyqtSlot(str) def setJobName(self, name): + name = os.path.splitext(name)[0] #when a file is opened using the terminal; the filename comes from _onFileLoaded and still contains its extension. This cuts the extension off if nescessary. if self._job_name != name: self._job_name = name self.jobNameChanged.emit() @@ -584,9 +585,9 @@ class CuraApplication(QtApplication): def _onFileLoaded(self, job): node = job.getResult() if node != None: + self.setJobName(os.path.basename(job.getFileName())) node.setSelectable(True) node.setName(os.path.basename(job.getFileName())) - op = AddSceneNodeOperation(node, self.getController().getScene().getRoot()) op.push()