Skip to content

Commit

Permalink
[TD] Avoid changing default open/save dir to templateDir when opening…
Browse files Browse the repository at this point in the history
… a Page template.
  • Loading branch information
aapo-aapo authored and wwmayer committed Jan 28, 2021
1 parent 6870b02 commit 92846ad
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Mod/TechDraw/Gui/Command.cpp
Expand Up @@ -183,11 +183,13 @@ CmdTechDrawPageTemplate::CmdTechDrawPageTemplate()
void CmdTechDrawPageTemplate::activated(int iMsg)
{
Q_UNUSED(iMsg);
QString work_dir = Gui::FileDialog::getWorkingDirectory();
QString templateDir = Preferences::defaultTemplateDir();
QString templateFileName = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(),
QString::fromUtf8(QT_TR_NOOP("Select a Template File")),
templateDir,
QString::fromUtf8(QT_TR_NOOP("Template (*.svg *.dxf)")));
Gui::FileDialog::setWorkingDirectory(work_dir); // Don't overwrite WD with templateDir

if (templateFileName.isEmpty()) {
return;
Expand Down

0 comments on commit 92846ad

Please sign in to comment.