mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
fix(nks): workio on save_as if Untitled didnt do anything
This commit is contained in:
parent
c271c94bbe
commit
cd4ad045e6
1 changed files with 4 additions and 7 deletions
|
|
@ -22,19 +22,16 @@ def has_unsaved_changes():
|
||||||
|
|
||||||
|
|
||||||
def save_file(filepath):
|
def save_file(filepath):
|
||||||
|
file = os.path.basename(filepath)
|
||||||
project = hiero.core.projects()[-1]
|
project = hiero.core.projects()[-1]
|
||||||
|
|
||||||
# close `Untitled` project
|
if project:
|
||||||
if "Untitled" not in project.name():
|
log.info("Saving project: `{}` as '{}'".format(project.name(), file))
|
||||||
log.info("Saving project: `{}`".format(project.name()))
|
|
||||||
project.saveAs(filepath)
|
project.saveAs(filepath)
|
||||||
elif not project:
|
else:
|
||||||
log.info("Creating new project...")
|
log.info("Creating new project...")
|
||||||
project = hiero.core.newProject()
|
project = hiero.core.newProject()
|
||||||
project.saveAs(filepath)
|
project.saveAs(filepath)
|
||||||
else:
|
|
||||||
log.info("Dropping `Untitled` project...")
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
def open_file(filepath):
|
def open_file(filepath):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue