diff --git a/src/Mod/Start/CMakeLists.txt b/src/Mod/Start/CMakeLists.txt index 60af59dad4..599eb8914a 100644 --- a/src/Mod/Start/CMakeLists.txt +++ b/src/Mod/Start/CMakeLists.txt @@ -22,21 +22,21 @@ if(BUILD_GUI) LoadFemExample3D.py Mesh.py PartDesign.py - Background.jpg - FreeCAD.png - PartDesign.png - ArchDesign.png - Mesh.png - Complete.png - PartDesignExample.png - ArchExample.png - web.png - blank.png - freecad-doc.png - complete.jpg + images/Background.jpg + images/FreeCAD.png + images/PartDesign.png + images/ArchDesign.png + images/Mesh.png + images/Complete.png + images/PartDesignExample.png + images/ArchExample.png + images/web.png + images/blank.png + images/freecad-doc.png + images/complete.jpg Ship.py - Ship.png - ShipExample.png + images/Ship.png + images/ShipExample.png ) add_subdirectory(Gui) diff --git a/src/Mod/Start/StartPage/StartPage.py b/src/Mod/Start/StartPage/StartPage.py index f1ef838b18..57b6670122 100644 --- a/src/Mod/Start/StartPage/StartPage.py +++ b/src/Mod/Start/StartPage/StartPage.py @@ -1,731 +1,726 @@ -#*************************************************************************** -#* * -#* 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 * -#* * -#*************************************************************************** - -# This is the start page template - -import os,FreeCAD,FreeCADGui,tempfile,time,zipfile,urllib,re,sys -from PySide import QtGui -from xml.etree.ElementTree import parse - -try: - import io as cStringIO -except: - import cStringIO - -try: - import io as cStringIO -except: - import cStringIO - -FreeCADGui.addLanguagePath(":/translations") -FreeCADGui.updateLocale() - -def translate(context,text): - "convenience function for the Qt translator" - # return str(QtGui.QApplication.translate(context, text, None, QtGui.QApplication.UnicodeUTF8).toUtf8()) - try: - _encoding = QtGui.QApplication.UnicodeUTF8 - u = QtGui.QApplication.translate(context, text, None, _encoding) - except AttributeError: - u = QtGui.QApplication.translate(context, text, None) - - if sys.version_info.major < 3: - u = u.encode("utf8") - - # s = cStringIO.StringIO() - # for i in u: - # if sys.version_info.major > 2: #below only works correctly in python3 - # if i == 39: - # s.write("\\'") - # else: - # s.write(chr(i)) - # else: - # if ord(i) == 39: - # s.write(unicode("\\'")) - # else: - # s.write(unicode(i)) - # t = s.getvalue() - # s.close() - # return t - - return u.replace(chr(39), "\\'") - -# texts to be translated - -text01 = translate("StartPage","FreeCAD Start Center") -text02 = translate("StartPage","Start a new project") -text03 = translate("StartPage","Recent Files") -text04 = translate("StartPage","Latest videos") -text05 = translate("StartPage","Latest commits") -text06 = translate("StartPage","On the web") -text07 = translate("StartPage","This is the FreeCAD Homepage. Here you will be able to find a lot of information about FreeCAD, including tutorials, examples and user documentation.") -text08 = translate("StartPage","FreeCAD Homepage") -text09 = translate("StartPage","Example projects") -text10 = translate("StartPage","Schenkel STEP file") -text11 = translate("StartPage","Load a PartDesign example") -text12 = translate("StartPage","Load a Drawing extraction") -text13 = translate("StartPage","Load a Robot simulation example") -text14 = translate("StartPage","Projects from the Web") -text15 = translate("StartPage","Schenkel STEP") -text16 = translate("StartPage","Complex Part") -text17 = translate("StartPage","Close this window after opening or creating a file") -text18 = translate("StartPage","Don't show me this window again next time") -text19 = translate("StartPage","Designing parts") -text20 = translate("StartPage","The Part Design workbench is designed to create complex pieces based on constrained 2D sketches. Use it to draw 2D shapes, constrain some of their elements and extrude them to form 3D pieces.") -text21 = translate("StartPage","Example workflow") -text22 = translate("StartPage","Part Design") -text23 = translate("StartPage","Designing architectural elements") -text24 = translate("StartPage","The Architectural Design workbench is specially designed for working with architectural elements such as walls or windows. Start by drawing 2D shapes, and use them as guides to build architecutral objects.") -text25 = translate("StartPage","Architectural Design") -text26 = translate("StartPage","Working with Meshes") -text27 = translate("StartPage","The Mesh Workbench is used to work with Mesh objects. Meshes are simpler 3D objects than Part objects, but they are often easier to import and export to/from other applications.") -text28 = translate("StartPage","FreeCAD offers you several tools to convert between Mesh and Part objects.") -text29 = translate("StartPage","Work with Meshes") -text30 = translate("StartPage","The complete workbench") -text31 = translate("StartPage","FreeCAD Complete workbench") -text32 = translate("StartPage","populated with some of the most commonly used tools.") -text33 = translate("StartPage","file size:") -text34 = translate("StartPage","creation time:") -text35 = translate("StartPage","last modified:") -text36 = translate("StartPage","location:") -text37 = translate("StartPage","User manual") -text38 = translate("StartPage","http://www.freecadweb.org/wiki/Online_Help_Toc") -text39 = translate("StartPage","Tutorials") -text40 = translate("StartPage","Python resources") -text41 = translate("StartPage","File not found") -text42 = translate("StartPage","from @FreeCADNews") -text43 = translate("StartPage","The FreeCAD-tutorial blog") -text44 = translate("StartPage","from FreeCADNews channel") -text45 = translate("StartPage","This is the official user manual of FreeCAD, built, maintained and translated by the FreeCAD community.") -text46 = translate("StartPage","The tutorials section on the FreeCAD website") -text47 = translate("StartPage","The section of the FreeCAD website dedicated to python scripting, with examples, explanations, and API commands.") -text48 = translate("StartPage","A blog dedicated to teaching FreeCAD, maintained by members of the FreeCAD community") -text49 = translate("StartPage","Getting started") -text50 = translate("StartPage","The FreeCAD interface is divided in workbenches, which are sets of tools suited for a specific task. You can start with one of the workbenches in this list, or with the complete workbench, which presents you with some of the most used tools gathered from other workbenches. Click to read more about workbenches on the FreeCAD website.") -text51 = translate("StartPage","http://www.freecadweb.org/wiki/Workbenches") -text52 = translate("StartPage","Ship Design") -text53 = translate("StartPage","Designing and calculating ships") -text54 = translate("StartPage","The Ship Design module offers several tools to help ship designers to view, model and calculate profiles and other specific properties of ship hulls.") -text55 = translate("StartPage","Load an Architectural example model") -text56 = translate("StartPage","http://www.freecadweb.org/wiki/Tutorials") -text57 = translate("StartPage","http://www.freecadweb.org/wiki/Power_users_hub") -text58 = translate("StartPage","Your version of FreeCAD is up to date.") -text59 = translate("StartPage","There is a new release of FreeCAD available.") -text60 = translate("StartPage","Load an FEM 3D example analysis") -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 - -v = FreeCAD.Version() -vmajor = v[0] -vminor = v[1] -vbuild = v[2].split(" ")[0] - -# here is the html page skeleton - -page = """ - - - FreeCAD - Start page - - - - - - - - - -

 """ + text01 + """
 

- -
-   -
- -
- -
-

""" + text02 + """

- defaultworkbenches -
- -
-

""" + text03 + """

- recentfiles -
- -
-

""" + text05 + """

-
news feed
-
- -
-

""" + text06 + """

- defaultlinks -
- -
-

""" + text09 + """

- defaultexamples -
- - customblocks - -
- - - - - -""" - -def getWebExamples(): - return """ - """ - -def getExamples(): - return """ - """ - -def getLinks(): - return """ - """ - -def getWorkbenches(): - return """ - """ - -def getInfo(filename): - "returns available file information" - - def getLocalTime(timestamp): - "returns a local time from a timestamp" - return time.strftime("%m/%d/%Y %H:%M:%S",time.localtime(timestamp)) - - def getSize(size): - "returns a human-readable size" - if size > 1024*1024: - hsize = str(size/(1024*1024)) + "Mb" - elif size > 1024: - hsize = str(size/1024) + "Kb" - else: - hsize = str(size) + "b" - return hsize - - html = '

'+os.path.basename(filename)+'

' - - if os.path.exists(filename): - # get normal file info - s = os.stat(filename) - html += "

" + text33 + " " + getSize(s.st_size) + "
" - html += text34 + " " + getLocalTime(s.st_ctime) + "
" - html += text35 + " " + getLocalTime(s.st_mtime) + "
" - html += "" + text36 + " " + filename + "

" - # get additional info from fcstd files - if os.path.splitext(filename)[1].upper() in [".FCSTD"]: - zfile=zipfile.ZipFile(filename) - files=zfile.namelist() - # check for meta-file if it's really a FreeCAD document - if files[0] == "Document.xml": - html += "

" + text65 + "

" - image="thumbnails/Thumbnail.png" - doc = str(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] - thumb = open(thumbfile,"wb") - thumb.write(image) - thumb.close() - html += '
' - else: - print ("not a freecad file: "+os.path.splitext(filename)[1].upper()) - else: - html += "

" + text41 + "

" - - return html - -def getRecentFiles(): - "returns a list of 3 latest recent files" - rf = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/RecentFiles") - ct = rf.GetInt("RecentFiles") - html = '' - return html - -def getFeed(url,numitems=3): - "returns a html list with links from the given RSS feed url" - xml = parse(urllib.urlopen(url)).getroot() - items = [] - channel = xml.find('channel') - for element in channel.findall('item'): - items.append({'title': element.find('title').text, - 'description': element.find('description').text, - 'link': element.find('link').text}) - if len(items) > numitems: - items = items[:numitems] - resp = '' - print(resp) - return resp - -def getCustomBlocks(): - "fetches custom html files in FreeCAD user dir" - output = "" - return output - -def setColors(html): - "gets theme colors from the system, and sets appropriate styles" - defaults = {"#basecolor":"#191B26", - "#linkcolor":"#0092E8", - "#textcolor":"#FFFFFF", - "#windowcolor":"#FFFFFF", - "#windowtextcolor":"#000000"} - try: - palette = QtGui.qApp.palette() - except: - pass - else: - #defaults["#basecolor"] = palette.base().color().name() - defaults["#basecolor"] = "#171A2B url(Background.jpg)" - #defaults["#linkcolor"] = palette.link().color().name() # UGLY!! - defaults["#textcolor"] = palette.text().color().name() - defaults["#windowcolor"] = palette.window().color().name() - defaults["#windowtextcolor"] = palette.windowText().color().name() - for k,v in defaults.items(): - html = html.replace(k,str(v)) - return html - -def handle(): - "returns the complete html startpage" - - # add recent files - recentfiles = getRecentFiles() - html = page.replace("recentfiles",recentfiles) - - # add default workbenches - html = html.replace("defaultworkbenches",getWorkbenches()) - - # add default web links - html = html.replace("defaultlinks",getLinks()) - - # add default examples - html = html.replace("defaultexamples",getExamples()) - - # add web examples - #html = html.replace("webexamples",getWebExamples()) - - # add custom blocks - html = html.replace("customblocks",getCustomBlocks()) - - # fetches system colors - html = setColors(html) - - return html - -def exportTestFile(): - f = open(os.path.expanduser("~")+os.sep+"freecad-startpage.html","wb") - f.write(handle()) +#*************************************************************************** +#* * +#* 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 * +#* * +#*************************************************************************** + +# This is the start page template + +import os,FreeCAD,FreeCADGui,tempfile,time,zipfile,urllib,re,sys +from PySide import QtGui +from xml.etree.ElementTree import parse + +try: + import io as cStringIO +except: + import cStringIO + +FreeCADGui.addLanguagePath(":/translations") +FreeCADGui.updateLocale() + +def translate(context,text): + "convenience function for the Qt translator" + # return str(QtGui.QApplication.translate(context, text, None, QtGui.QApplication.UnicodeUTF8).toUtf8()) + try: + _encoding = QtGui.QApplication.UnicodeUTF8 + u = QtGui.QApplication.translate(context, text, None, _encoding) + except AttributeError: + u = QtGui.QApplication.translate(context, text, None) + + if sys.version_info.major < 3: + u = u.encode("utf8") + + # s = cStringIO.StringIO() + # for i in u: + # if sys.version_info.major > 2: #below only works correctly in python3 + # if i == 39: + # s.write("\\'") + # else: + # s.write(chr(i)) + # else: + # if ord(i) == 39: + # s.write(unicode("\\'")) + # else: + # s.write(unicode(i)) + # t = s.getvalue() + # s.close() + # return t + + return u.replace(chr(39), "\\'") + +# texts to be translated + +text01 = translate("StartPage","FreeCAD Start Center") +text02 = translate("StartPage","Start a new project") +text03 = translate("StartPage","Recent Files") +text04 = translate("StartPage","Latest videos") +text05 = translate("StartPage","Latest commits") +text06 = translate("StartPage","On the web") +text07 = translate("StartPage","This is the FreeCAD Homepage. Here you will be able to find a lot of information about FreeCAD, including tutorials, examples and user documentation.") +text08 = translate("StartPage","FreeCAD Homepage") +text09 = translate("StartPage","Example projects") +text10 = translate("StartPage","Schenkel STEP file") +text11 = translate("StartPage","Load a PartDesign example") +text12 = translate("StartPage","Load a Drawing extraction") +text13 = translate("StartPage","Load a Robot simulation example") +text14 = translate("StartPage","Projects from the Web") +text15 = translate("StartPage","Schenkel STEP") +text16 = translate("StartPage","Complex Part") +text17 = translate("StartPage","Close this window after opening or creating a file") +text18 = translate("StartPage","Don't show me this window again next time") +text19 = translate("StartPage","Designing parts") +text20 = translate("StartPage","The Part Design workbench is designed to create complex pieces based on constrained 2D sketches. Use it to draw 2D shapes, constrain some of their elements and extrude them to form 3D pieces.") +text21 = translate("StartPage","Example workflow") +text22 = translate("StartPage","Part Design") +text23 = translate("StartPage","Designing architectural elements") +text24 = translate("StartPage","The Architectural Design workbench is specially designed for working with architectural elements such as walls or windows. Start by drawing 2D shapes, and use them as guides to build architecutral objects.") +text25 = translate("StartPage","Architectural Design") +text26 = translate("StartPage","Working with Meshes") +text27 = translate("StartPage","The Mesh Workbench is used to work with Mesh objects. Meshes are simpler 3D objects than Part objects, but they are often easier to import and export to/from other applications.") +text28 = translate("StartPage","FreeCAD offers you several tools to convert between Mesh and Part objects.") +text29 = translate("StartPage","Work with Meshes") +text30 = translate("StartPage","The complete workbench") +text31 = translate("StartPage","FreeCAD Complete workbench") +text32 = translate("StartPage","populated with some of the most commonly used tools.") +text33 = translate("StartPage","file size:") +text34 = translate("StartPage","creation time:") +text35 = translate("StartPage","last modified:") +text36 = translate("StartPage","location:") +text37 = translate("StartPage","User manual") +text38 = translate("StartPage","http://www.freecadweb.org/wiki/Online_Help_Toc") +text39 = translate("StartPage","Tutorials") +text40 = translate("StartPage","Python resources") +text41 = translate("StartPage","File not found") +text42 = translate("StartPage","from @FreeCADNews") +text43 = translate("StartPage","The FreeCAD-tutorial blog") +text44 = translate("StartPage","from FreeCADNews channel") +text45 = translate("StartPage","This is the official user manual of FreeCAD, built, maintained and translated by the FreeCAD community.") +text46 = translate("StartPage","The tutorials section on the FreeCAD website") +text47 = translate("StartPage","The section of the FreeCAD website dedicated to python scripting, with examples, explanations, and API commands.") +text48 = translate("StartPage","A blog dedicated to teaching FreeCAD, maintained by members of the FreeCAD community") +text49 = translate("StartPage","Getting started") +text50 = translate("StartPage","The FreeCAD interface is divided in workbenches, which are sets of tools suited for a specific task. You can start with one of the workbenches in this list, or with the complete workbench, which presents you with some of the most used tools gathered from other workbenches. Click to read more about workbenches on the FreeCAD website.") +text51 = translate("StartPage","http://www.freecadweb.org/wiki/Workbenches") +text52 = translate("StartPage","Ship Design") +text53 = translate("StartPage","Designing and calculating ships") +text54 = translate("StartPage","The Ship Design module offers several tools to help ship designers to view, model and calculate profiles and other specific properties of ship hulls.") +text55 = translate("StartPage","Load an Architectural example model") +text56 = translate("StartPage","http://www.freecadweb.org/wiki/Tutorials") +text57 = translate("StartPage","http://www.freecadweb.org/wiki/Power_users_hub") +text58 = translate("StartPage","Your version of FreeCAD is up to date.") +text59 = translate("StartPage","There is a new release of FreeCAD available.") +text60 = translate("StartPage","Load an FEM 3D example analysis") +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 + +v = FreeCAD.Version() +vmajor = v[0] +vminor = v[1] +vbuild = v[2].split(" ")[0] + +# here is the html page skeleton + +page = """ + + + FreeCAD - Start page + + + + + + + + + +

 """ + text01 + """
 

+ +
+   +
+ +
+ +
+

""" + text02 + """

+ defaultworkbenches +
+ +
+

""" + text03 + """

+ recentfiles +
+ +
+

""" + text05 + """

+
news feed
+
+ +
+

""" + text06 + """

+ defaultlinks +
+ +
+

""" + text09 + """

+ defaultexamples +
+ + customblocks + +
+ + + + + +""" + +def getWebExamples(): + return """ + """ + +def getExamples(): + return """ + """ + +def getLinks(): + return """ + """ + +def getWorkbenches(): + return """ + """ + +def getInfo(filename): + "returns available file information" + + def getLocalTime(timestamp): + "returns a local time from a timestamp" + return time.strftime("%m/%d/%Y %H:%M:%S",time.localtime(timestamp)) + + def getSize(size): + "returns a human-readable size" + if size > 1024*1024: + hsize = str(size/(1024*1024)) + "Mb" + elif size > 1024: + hsize = str(size/1024) + "Kb" + else: + hsize = str(size) + "b" + return hsize + + html = '

'+os.path.basename(filename)+'

' + + if os.path.exists(filename): + # get normal file info + s = os.stat(filename) + html += "

" + text33 + " " + getSize(s.st_size) + "
" + html += text34 + " " + getLocalTime(s.st_ctime) + "
" + html += text35 + " " + getLocalTime(s.st_mtime) + "
" + html += "" + text36 + " " + filename + "

" + # get additional info from fcstd files + if os.path.splitext(filename)[1].upper() in [".FCSTD"]: + zfile=zipfile.ZipFile(filename) + files=zfile.namelist() + # check for meta-file if it's really a FreeCAD document + if files[0] == "Document.xml": + 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] + thumb = open(thumbfile,"wb") + thumb.write(image) + thumb.close() + html += '
' + else: + print ("not a freecad file: "+os.path.splitext(filename)[1].upper()) + else: + html += "

" + text41 + "

" + + return html + +def getRecentFiles(): + "returns a list of 3 latest recent files" + rf = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/RecentFiles") + ct = rf.GetInt("RecentFiles") + html = '' + return html + +def getFeed(url,numitems=3): + "returns a html list with links from the given RSS feed url" + xml = parse(urllib.urlopen(url)).getroot() + items = [] + channel = xml.find('channel') + for element in channel.findall('item'): + items.append({'title': element.find('title').text, + 'description': element.find('description').text, + 'link': element.find('link').text}) + if len(items) > numitems: + items = items[:numitems] + resp = '' + print(resp) + return resp + +def getCustomBlocks(): + "fetches custom html files in FreeCAD user dir" + output = "" + return output + +def setColors(html): + "gets theme colors from the system, and sets appropriate styles" + defaults = {"#basecolor":"#191B26", + "#linkcolor":"#0092E8", + "#textcolor":"#FFFFFF", + "#windowcolor":"#FFFFFF", + "#windowtextcolor":"#000000"} + try: + palette = QtGui.qApp.palette() + except: + pass + else: + #defaults["#basecolor"] = palette.base().color().name() + defaults["#basecolor"] = "#171A2B url(Background.jpg)" + #defaults["#linkcolor"] = palette.link().color().name() # UGLY!! + defaults["#textcolor"] = palette.text().color().name() + defaults["#windowcolor"] = palette.window().color().name() + defaults["#windowtextcolor"] = palette.windowText().color().name() + for k,v in defaults.items(): + html = html.replace(k,str(v)) + return html + +def handle(): + "returns the complete html startpage" + + # add recent files + recentfiles = getRecentFiles() + html = page.replace("recentfiles",recentfiles) + + # add default workbenches + html = html.replace("defaultworkbenches",getWorkbenches()) + + # add default web links + html = html.replace("defaultlinks",getLinks()) + + # add default examples + html = html.replace("defaultexamples",getExamples()) + + # add web examples + #html = html.replace("webexamples",getWebExamples()) + + # add custom blocks + html = html.replace("customblocks",getCustomBlocks()) + + # fetches system colors + html = setColors(html) + + return html + +def exportTestFile(): + f = open(os.path.expanduser("~")+os.sep+"freecad-startpage.html","wb") + f.write(handle()) f.close() diff --git a/src/Mod/Start/StartPage/ArchDesign.png b/src/Mod/Start/StartPage/images/ArchDesign.png similarity index 100% rename from src/Mod/Start/StartPage/ArchDesign.png rename to src/Mod/Start/StartPage/images/ArchDesign.png diff --git a/src/Mod/Start/StartPage/ArchExample.png b/src/Mod/Start/StartPage/images/ArchExample.png similarity index 100% rename from src/Mod/Start/StartPage/ArchExample.png rename to src/Mod/Start/StartPage/images/ArchExample.png diff --git a/src/Mod/Start/StartPage/Background.jpg b/src/Mod/Start/StartPage/images/Background.jpg similarity index 100% rename from src/Mod/Start/StartPage/Background.jpg rename to src/Mod/Start/StartPage/images/Background.jpg diff --git a/src/Mod/Start/StartPage/Banner.jpeg b/src/Mod/Start/StartPage/images/Banner.jpeg similarity index 100% rename from src/Mod/Start/StartPage/Banner.jpeg rename to src/Mod/Start/StartPage/images/Banner.jpeg diff --git a/src/Mod/Start/StartPage/Complete.png b/src/Mod/Start/StartPage/images/Complete.png similarity index 100% rename from src/Mod/Start/StartPage/Complete.png rename to src/Mod/Start/StartPage/images/Complete.png diff --git a/src/Mod/Start/StartPage/FreeCAD.png b/src/Mod/Start/StartPage/images/FreeCAD.png similarity index 100% rename from src/Mod/Start/StartPage/FreeCAD.png rename to src/Mod/Start/StartPage/images/FreeCAD.png diff --git a/src/Mod/Start/StartPage/Mesh.png b/src/Mod/Start/StartPage/images/Mesh.png similarity index 100% rename from src/Mod/Start/StartPage/Mesh.png rename to src/Mod/Start/StartPage/images/Mesh.png diff --git a/src/Mod/Start/StartPage/PartDesign.png b/src/Mod/Start/StartPage/images/PartDesign.png similarity index 100% rename from src/Mod/Start/StartPage/PartDesign.png rename to src/Mod/Start/StartPage/images/PartDesign.png diff --git a/src/Mod/Start/StartPage/PartDesignExample.png b/src/Mod/Start/StartPage/images/PartDesignExample.png similarity index 100% rename from src/Mod/Start/StartPage/PartDesignExample.png rename to src/Mod/Start/StartPage/images/PartDesignExample.png diff --git a/src/Mod/Start/StartPage/Ship.png b/src/Mod/Start/StartPage/images/Ship.png similarity index 100% rename from src/Mod/Start/StartPage/Ship.png rename to src/Mod/Start/StartPage/images/Ship.png diff --git a/src/Mod/Start/StartPage/ShipExample.png b/src/Mod/Start/StartPage/images/ShipExample.png similarity index 100% rename from src/Mod/Start/StartPage/ShipExample.png rename to src/Mod/Start/StartPage/images/ShipExample.png diff --git a/src/Mod/Start/StartPage/blank.png b/src/Mod/Start/StartPage/images/blank.png similarity index 100% rename from src/Mod/Start/StartPage/blank.png rename to src/Mod/Start/StartPage/images/blank.png diff --git a/src/Mod/Start/StartPage/complete.jpg b/src/Mod/Start/StartPage/images/complete.jpg similarity index 100% rename from src/Mod/Start/StartPage/complete.jpg rename to src/Mod/Start/StartPage/images/complete.jpg diff --git a/src/Mod/Start/StartPage/freecad-doc.png b/src/Mod/Start/StartPage/images/freecad-doc.png similarity index 100% rename from src/Mod/Start/StartPage/freecad-doc.png rename to src/Mod/Start/StartPage/images/freecad-doc.png diff --git a/src/Mod/Start/StartPage/web.png b/src/Mod/Start/StartPage/images/web.png similarity index 100% rename from src/Mod/Start/StartPage/web.png rename to src/Mod/Start/StartPage/images/web.png