From b333a096c37feeb75055054a4e9d12684d7f8f36 Mon Sep 17 00:00:00 2001 From: Frederik Berlaen Date: Thu, 14 Nov 2024 23:24:57 +0100 Subject: [PATCH] notify on save for unsaved sources fixing #101 --- .../lib/designspaceEditor/ui.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/DesignspaceEditor2.roboFontExt/lib/designspaceEditor/ui.py b/DesignspaceEditor2.roboFontExt/lib/designspaceEditor/ui.py index 03db16d..961bf48 100644 --- a/DesignspaceEditor2.roboFontExt/lib/designspaceEditor/ui.py +++ b/DesignspaceEditor2.roboFontExt/lib/designspaceEditor/ui.py @@ -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])