- take a document without yet any page
- create a new page using a template
result: you get correctly the TD template folder open to select a template file
- select a template of your choice
- select the page in the document tree and use the File menu to export the page as SVG
result: you get the TD template folder as proposal
This should not happen because a template folder is for templates, and , more important for users without admin permissions on Windows, they cannot write into the template folder.
Therefore the proposed folder should be the one where the file is currently saved in.
- nevertheless, choose a folder of your choice and export the page as SVG
- now create a new page from template
result: you don't get the templates folder but the folder where you just exported the SVG to
This is a problem, because one is a bit lost where to get the templates. Since the templates folder is known, one should in every case this folder when creating new pages from templates.
[fixed] wrong default folder for saving and creating pages
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
[fixed] wrong default folder for saving and creating pages
Last edited by uwestoehr on Thu Jan 28, 2021 3:30 pm, edited 1 time in total.
Re: wrong default folder for saving and creating pages
This seems to be a general problem in FreeCAD 0.19. Opening a document starts for me in the binary folder, despite there is a path saved in user.sys where I did saved my last document. This should be the folder where I want to open my documents.
There should be predefined pathes given for the opening of drawings, images, templates, macros, render settings and what else FreeCAD is dealing with.
Ulrich
There should be predefined pathes given for the opening of drawings, images, templates, macros, render settings and what else FreeCAD is dealing with.
Ulrich
Re: wrong default folder for saving and creating pages
I cannot reproduce this. On Windows 10 and Windows 7 I get with FC 0.18.4 and
OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18846 (Git)
Build type: Release
Branch: master
Hash: ceeb776fff25c679752571d5d8e6c4c8b1fd9008
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
File -> Open opens the last used folder.
Re: wrong default folder for saving and creating pages
Hi aapo,
this is one of the known TD issues I once listed here:
https://forum.freecadweb.org/viewtopic.php?f=35&t=40608
that I could not fix yet. Can you reproduce this and/or have an idea how to fix this?
I thought this can easily be solved via the Qt file dialog settings but I was stuck since the native Win file dialog is used.
In principle we know the FC file location, so the fix would simply be to open the file dialog with this folder when exporting a page.
this is one of the known TD issues I once listed here:
https://forum.freecadweb.org/viewtopic.php?f=35&t=40608
that I could not fix yet. Can you reproduce this and/or have an idea how to fix this?
I thought this can easily be solved via the Qt file dialog settings but I was stuck since the native Win file dialog is used.
In principle we know the FC file location, so the fix would simply be to open the file dialog with this folder when exporting a page.
aapo wrote: .
Re: wrong default folder for saving and creating pages
Yep, the problem seems to simply be that Gui::FileDialog::getOpenFileName() and Gui::FileDialog::getSaveFileName() understandably keep track of the latest opened directory. However, with TD templates there seems to be a hard-coded directory path for templates, and therefore we need to make sure that when we open a template using Gui::FileDialog::getOpenFileName() we don't overwrite the default working dir with the template dir. The easiest way that occurred to me, is to keep track of the real working directory in the template opening function, and set it back to correct one after finding the template file name.uwestoehr wrote: ↑Thu Jan 28, 2021 2:46 am this is one of the known TD issues I once listed here:
https://forum.freecadweb.org/viewtopic.php?f=35&t=40608
that I could not fix yet. Can you reproduce this and/or have an idea how to fix this?
The PR is here, it's just two lines of code: https://github.com/FreeCAD/FreeCAD/pull/4326
Re: wrong default folder for saving and creating pages
Aaaanndd, it's already committed, 12 minutes after I made the PR. So, no need to review the changes! Thanks!