Skip to content

Commit 071614b

Browse files
committed
add open designspace button
1 parent 5c7d479 commit 071614b

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

Batch.roboFontExt/lib/batch.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def build(self, sources=[]):
8787
|---| @sources
8888
> (+-) @sourcesAddRemoveButton
8989
> ( Add Open UFOs ) @sourcesAddOpenUFOsButton
90-
90+
> ( Add Open Designspaces) @sourcesAddOpenDesignspacesButton
9191
---
9292
9393
* HorizontalStack
@@ -124,6 +124,9 @@ def build(self, sources=[]):
124124
sourcesAddOpenUFOsButton=dict(
125125
gravity="leading",
126126
),
127+
sourcesAddOpenDesignspacesButton=dict(
128+
gravity="leading",
129+
),
127130
help=dict(
128131
gravity="leading",
129132
),
@@ -183,6 +186,11 @@ def sourcesAddOpenUFOsButtonCallback(self, sender):
183186
paths = [font.path for font in AllFonts() if font.path is not None]
184187
tableAddPathItems(self.w.getItem("sources"), paths)
185188

189+
def sourcesAddOpenDesignspacesButtonCallback(self, sender):
190+
# add open designspace's only when they are saved on disk
191+
paths = [designspace.path for designspace in AllDesignspaces() if designspace.path is not None]
192+
tableAddPathItems(self.w.getItem("sources"), paths)
193+
186194
def sourcesDropCandidateCallback(self, info):
187195
table = self.w.getItem("sources")
188196
sender = info["sender"]

0 commit comments

Comments
 (0)