Commit Graph

205 Commits

Author SHA1 Message Date
wmayer
41ccf4f0c7 Start: fixes #10221: /tmp/FreeCADStartThumbnails* directories are not removed when FreeCAD terminates
The commit adds some new functions:

* getThumbnailDir()
  Returns the path to the thumbnail directory which is a sub-directory of the Cache directory.
  There is no need to always create a unique directory after each restart because it doesn't harm
  if the thumbnail directoy contains deprecated files.

* createThumbnailDir()
  Creates the thumbnail directoy if it doesn't exist yet.

* getSha1Hash
  Helper function to compute a SHA-1 hash of a given path. If the same path is passed
  then the hash value will be the same.
  This way it can be avoided to create a different image file from a project file
  after each restart.

* getUniquePNG
  Computes the path of a PNG image file for a given project file. It's also possible
  to pass an arbitrary string as argument.

* useCachedPNG
  If the PNG image exists and if it's newer than the project file True is returned
  and False otherwise.

The changes in detail are:
1. For a given project file it is checked if the thumbnail directory already contains
   a cached image. If it's newer than the project file it will used, otherwise it will
   be re-created.

2. For the system icon to a given file format it is only checked if the icon already exists.
   If yes, it will be used.
2023-10-09 13:54:11 +02:00
Yorik van Havre
455b3f5540 Merge pull request #10535 from Syres916/Py_311_Unicode_Fix
[Start] Fix Python 3.11 Unicode Errors
2023-09-13 11:41:53 +02:00
pre-commit-ci[bot]
e92ed45df9 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-09-12 13:02:35 -04:00
pre-commit-ci[bot]
82abb33555 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-09-04 17:32:18 +00:00
Syres916
6f57f36620 [Start] Fix Python 3.11 Unicode Errors
Example Error :
  File "/home/john/freecad-daily-build/Mod/Start/StartPage/StartPage.py", line 422, in handle
    ALTCSS = f.read()
             ^^^^^^^^
  File "/usr/lib/python3.11/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 421: ordinal not in range(128)
2023-09-04 18:15:20 +01:00
Chris Hennes
6da62b83fa Merge pull request #10520 from qewer33/startpage-quickstart-open
StartPage: Add custom CSS option, re-organize preferences and further fixes
2023-09-04 11:54:39 -05:00
Chris Hennes
0611c1d9eb Start: Final application of pre-commit 2023-09-04 08:18:51 -05:00
qewer33
221e337a04 Apply pre-commit 2023-09-03 23:51:49 +03:00
qewer33
b6df38eb7f Fix CI tests failing 2023-09-03 20:52:58 +03:00
qewer
2dc6a69d65 Merge branch 'master' into startpage-quickstart-open 2023-09-03 19:47:28 +03:00
qewer33
1ece491dfd StartPage remove hide scrollbars option 2023-09-03 19:30:57 +03:00
qewer33
068e77c974 StartPage fixes 2023-09-03 19:23:13 +03:00
qewer33
5be49a56f9 StartPage implement custom CSS preference 2023-09-03 16:21:49 +03:00
wmayer
fae6f8f5bb Start: apply clang format 2023-09-03 14:21:53 +02:00
luzpaz
40d2a90e3a Fix typos 2023-08-31 22:29:17 -05:00
qewer33
a1d20ec97d Turn StartPage "Import" quickstart button into "Open" 2023-08-31 22:04:50 +03:00
qewer33
0c7459d7d7 StartPage CSS fixes 2023-08-31 17:39:34 +03:00
qewer33
584e766d5c Add StartPage CSS warning comment 2023-08-28 18:15:15 +03:00
qewer33
230501d3d5 Add file thumbnail icons hide and size options to StartPage 2023-08-28 18:07:33 +03:00
qewer33
53ca19458e Make StartPage tips use BackgroundTextColor 2023-08-28 16:52:34 +03:00
qewer33
23ad8ffcd2 Change default StartPage BackgroundTextColor value 2023-08-28 16:50:19 +03:00
qewer
d141e7167f StartPage: Visual overhaul and CSS fixes (#10391)
* StartPage visual overhaul and CSS fixes
* Add qewer33 to CONTRIBUTORS
2023-08-27 13:27:53 -05:00
qewer
dfbedc75b7 StartPage: Fix new file templates issues (#10291)
* Make StartPage new file template buttons use if instead of match

* Make StartPage Part design new file template not create a sketch

* Remove StartPage Part new file template and rename Part Design template based on community feedback

* StartPage LoadNew.py fix indentation
2023-08-21 13:58:29 -05:00
luzpaz
09a965d595 Fix typos 2023-08-21 20:20:47 +02:00
qewer33
ee0cdc773d Tweak StartPage new file template descriptions and make arch template work with the BIM workbench 2023-08-13 21:42:19 +03:00
qewer33
5d3e023e4f Fix StartPage javascript error when switching tabs 2023-08-11 20:02:33 +03:00
qewer33
0d522e16b9 Add new file section and file templates to StartPage 2023-08-11 19:50:26 +03:00
bdieterm
0fc81ccfc7 fix encoding on StartPage file information 2023-07-22 17:37:46 +02:00
Petter Reinholdtsen
6cd1febd3d Removed trailing whitespace discovered by github linter.
While working on https://github.com/FreeCAD/FreeCAD/pull/9880,
I discovered a lot of linter issues.  These fixes all of them.
2023-07-10 16:06:52 +02:00
Petter Reinholdtsen
6f85a9bed6 Change Start page to no longer dial home by default.
When starting FreeCAD for the first time, it load the HTML content of
src/Mod/Start/StartPage/StartPage.html and show it as a friendly startup page.
Unfortunately, one of the tabs in the startup page is an iframe loading the content of
https://blog.freecadorg/.  The effect is that every time one start FreeCAD, it dial
home over the Internet with a HTTP request to the mentioned URL.  This is a privacy
problem.  At the moment the blog page in turn will connect to https//i0.wp.com/ and
https//s0.wp.com/, in effect also reporting the startup to Wordpress.  Please do not
dial out without the expressed approval and on request of the user of the program.

This patch change the startup page to instead of putting the blog posts in a tab, it
will link to the blog and the connection is only established when the user click on
'BLOG' in the start page.  It include a link tooltop to make it easier to understand
that this will bring the user to a new page.
2023-07-07 14:37:54 +02:00
Syres916
d01c963877 Reduce the number of lines of code 2023-07-07 10:45:22 +01:00
Syres916
da66e8bf6e Reduce number of lines of code 2023-07-07 10:44:02 +01:00
Syres916
64852d073f Correct filename variable 2023-07-04 14:36:47 +01:00
Syres916
bf01d23b76 Remove Duplicate line 2023-07-04 14:19:47 +01:00
Syres916
41b02ca703 [Start] LoadMRU Update Conditionals 2023-07-04 14:17:44 +01:00
Syres916
591b1241f9 [Start] LoadCustom update conditionals 2023-07-04 14:16:18 +01:00
Syres916
adc8645dd1 [Start] Fix Minor Regression on LoadCustom
Handle image files using FreeCADGui but all other formats using FreeCAD
2023-07-03 15:47:48 +01:00
Chris Hennes
cfc895d38f Start: Remove frameborder attribute from iframe
This attribute is obsolete. CSS should be usesd instead.
2023-06-19 17:10:51 -05:00
Pesc0
5d17c9cf7f Added freecad blog tab to start page 2023-06-15 13:58:27 +02:00
Yorik van Havre
9f7b9b3496 Start: Fixed loading from custom folder 2023-05-10 14:26:43 +02:00
luzpaz
38a01939e0 Migrate domain name from freecadweb to freecad (#9352)
* Migrate domain name from freecadweb to freecad
* Migrate src/Mod/Material files
* Migrate Stylesheet related files
* Migrate *.svg files
* Migrate miscellaneous files
* Migrate some build files
* Migrate recently added TD AR_IRAM template files

Closes #6415
2023-04-24 15:19:20 -05:00
luzpaz
72166fed46 Fix misc. typos and whitespace 2023-02-22 23:46:18 +01:00
Yorik van Havre
8138892878 Merge pull request #8496 from yorikvanhavre/Start-default
Start: Allow to change the default import module for a filetype
2023-02-22 10:27:34 +01:00
luzpaz
a134129868 Fix various trailing whitespace issues 2023-02-16 09:30:22 -05:00
Yorik van Havre
63043f0d33 Start: Allow to change the default import module for a filetype
By setting a DefaultImportXXX preferences parameter under Mod/Start,
one can specify a default import module to use when clicking a .XXX
file on the Start page. This is specially useful for filetypes that
have several importers, and the Start page would not let users
choose which importer to use.

Later on if this proves useful we can set up an UI to let the user
set their preferences better.
2023-02-15 14:53:15 +01:00
Yorik van Havre
ac9fde2a3d Fixes startpage css - fixes #8330 2023-02-05 15:09:23 +01:00
Yorik van Havre
2056cd94f9 Start: Added option to hide start page scrollbars 2023-02-04 22:50:23 +01:00
Adrián Insaurralde Avalos
4256a08f70 Adjust Startpage version info to new format
due to the changes from 0a659d9e74
2022-12-25 14:52:45 +01:00
Chris Hennes
dd8b4a68ef Start: Add icon for FCMacro files
Closes #7709
2022-12-21 22:51:02 -06:00
Yorik van Havre
6af8701a7e Start: Set minimum height for notes panel 2022-11-29 12:03:55 +01:00