mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 10:17:52 -06:00
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
This commit is contained in:
parent
8dc6353738
commit
a1be5a080f
1 changed files with 2 additions and 1 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue