diff --git a/src/Mod/Start/CMakeLists.txt b/src/Mod/Start/CMakeLists.txt index 2cf11990b..60af59dad 100644 --- a/src/Mod/Start/CMakeLists.txt +++ b/src/Mod/Start/CMakeLists.txt @@ -16,6 +16,7 @@ if(BUILD_GUI) LoadMRU0.py LoadMRU1.py LoadMRU2.py + LoadMRU3.py LoadArchExample.py LoadFemExample2D.py LoadFemExample3D.py diff --git a/src/Mod/Start/StartPage/LoadMRU3.py b/src/Mod/Start/StartPage/LoadMRU3.py new file mode 100644 index 000000000..5664ad033 --- /dev/null +++ b/src/Mod/Start/StartPage/LoadMRU3.py @@ -0,0 +1,27 @@ +#*************************************************************************** +#* * +#* Copyright (c) 2012 * +#* Yorik van Havre * +#* * +#* This program is free software; you can redistribute it and/or modify * +#* it under the terms of the GNU Lesser General Public License (LGPL) * +#* as published by the Free Software Foundation; either version 2 of * +#* the License, or (at your option) any later version. * +#* for detail see the LICENCE text file. * +#* * +#* This program is distributed in the hope that it will be useful, * +#* but WITHOUT ANY WARRANTY; without even the implied warranty of * +#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +#* GNU Library General Public License for more details. * +#* * +#* You should have received a copy of the GNU Library General Public * +#* License along with this program; if not, write to the Free Software * +#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +#* USA * +#* * +#*************************************************************************** + +import FreeCAD,FreeCADGui,sys +rf=FreeCAD.ParamGet("User parameter:BaseApp/Preferences/RecentFiles") +FreeCAD.loadFile(rf.GetString("MRU3")) + diff --git a/src/Mod/Start/StartPage/StartPage.py b/src/Mod/Start/StartPage/StartPage.py index b6d858ea4..3591cf84f 100644 --- a/src/Mod/Start/StartPage/StartPage.py +++ b/src/Mod/Start/StartPage/StartPage.py @@ -131,6 +131,10 @@ text61 = translate("StartPage","Obtain a development version") text62 = translate("StartPage","Development versions are made available by community members from time to time and usually contain the latest changes, but are more likely to contain bugs.") text63 = translate("StartPage","See all commits") text64 = translate("StartPage","Load an FEM 2D example analysis") +text65 = translate("StartPage","FreeCAD Standard File") +text66 = translate("StartPage","Author") +text67 = translate("StartPage","Company") +text68 = translate("StartPage","License") # get FreeCAD version @@ -372,6 +376,14 @@ page = """ max-width: 300px; clear: both; } + + #description p span { + text-align: left; + } + + .disabled { + opacity: 0.5; + } pre { width: 300px !important; @@ -559,8 +571,19 @@ def getInfo(filename): files=zfile.namelist() # check for meta-file if it's really a FreeCAD document if files[0] == "Document.xml": - html += "

FreeCAD Standard File

" + html += "

" + text65 + "

" image="thumbnails/Thumbnail.png" + doc = zfile.read(files[0]) + doc = doc.replace("\n"," ") + author = re.findall("Property name=\"CreatedBy.*?String value=\"(.*?)\"\/>",doc) + if author: + html += "

" + text66 + ": " + author[0] + "

" + company = re.findall("Property name=\"Company.*?String value=\"(.*?)\"\/>",doc) + if company: + html += "

" + text67 + ": " + company[0] + "

" + lic = re.findall("Property name=\"License.*?String value=\"(.*?)\"\/>",doc) + if lic: + html += "

" + text68 + ": " + lic[0] + "

" if image in files: image=zfile.read(image) thumbfile = tempfile.mkstemp(suffix='.png')[1] @@ -568,8 +591,9 @@ def getInfo(filename): thumb.write(image) thumb.close() html += '
' + else: + print ("not a freecad file: "+os.path.splitext(filename)[1].upper()) else: html += "

" + text41 + "

" @@ -580,7 +604,7 @@ def getRecentFiles(): rf = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/RecentFiles") ct = rf.GetInt("RecentFiles") html = '' return html