Arch: Ability to add windows presets

This commit is contained in:
Yorik van Havre
2020-04-08 18:55:49 +02:00
parent 2b922312f3
commit bbea2dbb7c

View File

@@ -784,6 +784,15 @@ class _CommandWindow:
self.librarypresets.append([wtype+" - "+subtype+" - "+os.path.splitext(subfile)[0],os.path.join(subdir,subfile)])
else:
librarypath = None
# check for existing presets
presetdir = os.path.join(FreeCAD.getUserAppDataDir(),"Arch")
for tp in ["Windows","Doors"]:
wdir = os.path.join(presetdir,tp)
if os.path.exists(wdir):
for wfile in os.listdir(wdir):
if wfile.lower().endswith(".fcstd"):
self.librarypresets.append([tp[:-1]+" - "+wfile[:-6],wfile])
# presets box
labelp = QtGui.QLabel(translate("Arch","Preset"))