Skip to content

Commit

Permalink
notify on save for unsaved sources
Browse files Browse the repository at this point in the history
fixing #101
  • Loading branch information
typemytype committed Nov 14, 2024
1 parent bb83b02 commit b333a09
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions DesignspaceEditor2.roboFontExt/lib/designspaceEditor/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -2006,10 +2006,14 @@ def saveDesignspace(path):
messageText="No axes defined!",
informativeText="The designspace needs at least one axis before saving."
)

elif any([source.path is None for source in self.operator.sources]):
self.showMessage(
messageText="Save the sources first!",
informativeText="All sources must be saved to disk before saving the designspace."
)
elif self.operator.path is None or AppKit.NSEvent.modifierFlags() & AppKit.NSAlternateKeyMask:
if self.operator.path is None:
# check if w have defined any axes
# check if we have defined any axes
# can't save without axes
# get a filepath first
sourcePaths = set([os.path.dirname(source.path) for source in self.operator.sources if source.path])
Expand Down

0 comments on commit b333a09

Please sign in to comment.