template directory to camassets

This commit is contained in:
sliptonic
2025-09-16 11:12:25 -05:00
parent 15adc6f2c8
commit cc8ea38a47
2 changed files with 11 additions and 1 deletions

View File

@@ -134,7 +134,7 @@ class CommandJobTemplateExport:
foo = QtGui.QFileDialog.getSaveFileName(
QtGui.QApplication.activeWindow(),
"Path - Job Template",
Path.Preferences.filePath(),
str(Path.Preferences.getTemplateDirectory()),
"job_*.json",
)[0]
if foo:

View File

@@ -158,6 +158,13 @@ def getToolBitPath() -> pathlib.Path:
return getAssetPath() / "Tools" / "Bit"
def getTemplateDirectory() -> pathlib.Path:
"""Returns the directory where job templates should be saved."""
template_path = getAssetPath() / "Templates"
template_path.mkdir(parents=True, exist_ok=True)
return template_path
def getLastToolLibrary() -> Optional[str]:
pref = tool_preferences()
return pref.GetString(LastToolLibrary) or None
@@ -239,6 +246,9 @@ def macroFilePath():
def searchPaths():
paths = []
# Add new CamAssets/Templates directory first (highest priority)
paths.append(str(getTemplateDirectory()))
# Add legacy locations for backward compatibility
p = defaultFilePath()
if p:
paths.append(p)