diff --git a/src/Mod/Start/CMakeLists.txt b/src/Mod/Start/CMakeLists.txt
index 7581fc42a8..425e0d18e3 100644
--- a/src/Mod/Start/CMakeLists.txt
+++ b/src/Mod/Start/CMakeLists.txt
@@ -21,6 +21,7 @@ if(BUILD_GUI)
images/developerhub.png
images/manual.png
images/freecad.png
+ images/installed.png
)
add_subdirectory(Gui)
diff --git a/src/Mod/Start/StartPage/StartPage.css b/src/Mod/Start/StartPage/StartPage.css
index ca29d29c51..c0d1b43b46 100644
--- a/src/Mod/Start/StartPage/StartPage.css
+++ b/src/Mod/Start/StartPage/StartPage.css
@@ -18,9 +18,12 @@ h1 {
}
h2 {
text-align: center;
- fint-size: 0.9em;
clear: both;
}
+hr {
+ height: 20px;
+ border: none;
+}
.hidden {
display: none;
}
@@ -56,7 +59,8 @@ ul.tabs li a:hover {
background-color: TEXTCOLOR;
color: BASECOLOR;
}
-ul.tabs li a.active {
+ul.tabs li a.active, ul.tabs li a.active:hover {
+ color: TEXTCOLOR;
background-color: BASECOLOR;
border-bottom: 1px solid BASECOLOR;
}
@@ -113,7 +117,7 @@ ul.icons {
max-width: 24px;
max-height: 24px;
}
-.forumbox img {
+.forum img {
max-width: 100% !important;
max-height: 100% !important;
}
@@ -128,7 +132,6 @@ h3 a {
}
#commits ul {
margin: 30px 0;
- padding: 10px;
}
#commits ul li, .forum ul li {
margin-bottom: 10px;
@@ -149,10 +152,6 @@ ul.workbenches li, ul.addonslist li {
display: inline;
width: 50%;
}
-.forum ul {
- padding: 10px;
-}
-.forumbox {
- margin-top: 20px;
- display: none; /* forumbox */
+.forum {
+ display: none; /* forum display */
}
diff --git a/src/Mod/Start/StartPage/StartPage.html b/src/Mod/Start/StartPage/StartPage.html
index 44b5c18007..5a082bbe52 100644
--- a/src/Mod/Start/StartPage/StartPage.html
+++ b/src/Mod/Start/StartPage/StartPage.html
@@ -80,7 +80,11 @@
-
T_RECENTCOMMITS
+
T_RECENTCOMMITS
-
+
-
+
-
T_OFFLINEPLACEHOLDER
-
-
-
+
T_OFFLINEPLACEHOLDER
+
-
+
-
T_FORUM
-
-
+
T_FORUM
-
-
-
T_OFFLINEPLACEHOLDER
-
-
+
-
+
+
+
T_OFFLINEPLACEHOLDER
+
+
+
+
diff --git a/src/Mod/Start/StartPage/StartPage.js b/src/Mod/Start/StartPage/StartPage.js
index 2f8f39b17b..578d78b436 100644
--- a/src/Mod/Start/StartPage/StartPage.js
+++ b/src/Mod/Start/StartPage/StartPage.js
@@ -1,5 +1,6 @@
var allowDownloads = 0;
var showForum = 0;
+var wblist = [];
function toggle(tab) {
@@ -74,7 +75,11 @@ function printAddons(data) {
var blacklist = ['addons_installer.FCMacro','FreeCAD-Addon-Details.md','README.md'];
for (var i = 0; i < data.data.length; i++) {
if ( (data.data[i].name[0] != ".") && (blacklist.indexOf(data.data[i].name) < 0) ) {
- html.push('
', data.data[i].name, '');
+ if (wblist.indexOf(data.data[i].name.toLowerCase()) == -1) {
+ html.push('
', data.data[i].name, '');
+ } else {
+ html.push('
', data.data[i].name, ' 
');
+ }
}
}
html.push('');
diff --git a/src/Mod/Start/StartPage/StartPage.py b/src/Mod/Start/StartPage/StartPage.py
index 31b0cdaea7..2a32dbc644 100644
--- a/src/Mod/Start/StartPage/StartPage.py
+++ b/src/Mod/Start/StartPage/StartPage.py
@@ -32,6 +32,7 @@ FreeCADGui.updateLocale()
iconprovider = QtGui.QFileIconProvider()
iconbank = {} # to store already created icons so we don't overpollute the temp dir
+tempfolder = None # store icons inside a subfolder in temp dir
def gethexcolor(color):
@@ -69,7 +70,7 @@ def getInfo(filename):
"returns available file information"
- global iconbank
+ global iconbank,tempfolder
def getLocalTime(timestamp):
"returns a local time from a timestamp"
@@ -119,7 +120,7 @@ def getInfo(filename):
image = iconbank[filename]
else:
imagedata=zfile.read("thumbnails/Thumbnail.png")
- image = tempfile.mkstemp(suffix='.png')[1]
+ image = tempfile.mkstemp(dir=tempfolder,suffix='.png')[1]
thumb = open(image,"wb")
thumb.write(imagedata)
thumb.close()
@@ -134,7 +135,7 @@ def getInfo(filename):
else:
icon = iconprovider.icon(i)
px = icon.pixmap(128,128)
- image = tempfile.mkstemp(suffix='.png')[1]
+ image = tempfile.mkstemp(dir=tempfolder,suffix='.png')[1]
px.save(image)
iconbank[t] = image
@@ -148,7 +149,19 @@ def handle():
"builds the HTML code of the start page"
- global iconbank
+ global iconbank,tempfolder
+
+
+ # reuse stuff from previous runs to reduce temp dir clutter
+
+ import Start
+ if hasattr(Start,"iconbank"):
+ iconbank = Start.iconbank
+ if hasattr(Start,"tempfolder"):
+ tempfolder = Start.tempfolder
+ else:
+ tempfolder = tempfile.mkdtemp(prefix="FreeCADStartThumbnails")
+
# build the html page skeleton
@@ -201,7 +214,9 @@ def handle():
HTML = HTML.replace("T_WBHELP",TranslationTexts.T_WBHELP)
HTML = HTML.replace("T_DESCR_WBHELP",TranslationTexts.T_DESCR_WBHELP)
HTML = HTML.replace("T_COMMUNITYHELP",TranslationTexts.T_COMMUNITYHELP)
- HTML = HTML.replace("T_DESCR_COMMUNITYHELP",TranslationTexts.T_DESCR_COMMUNITYHELP)
+ HTML = HTML.replace("T_DESCR_COMMUNITYHELP1",TranslationTexts.T_DESCR_COMMUNITYHELP1)
+ HTML = HTML.replace("T_DESCR_COMMUNITYHELP2",TranslationTexts.T_DESCR_COMMUNITYHELP2)
+ HTML = HTML.replace("T_DESCR_COMMUNITYHELP3",TranslationTexts.T_DESCR_COMMUNITYHELP3)
HTML = HTML.replace("T_ADDONS",TranslationTexts.T_ADDONS)
HTML = HTML.replace("T_DESCR_ADDONS",TranslationTexts.T_DESCR_ADDONS)
HTML = HTML.replace("T_OFFLINEHELP",TranslationTexts.T_OFFLINEHELP)
@@ -212,6 +227,8 @@ def handle():
HTML = HTML.replace("T_CUSTOM",TranslationTexts.T_CUSTOM)
HTML = HTML.replace("T_FORUM",TranslationTexts.T_FORUM)
HTML = HTML.replace("T_DESCR_FORUM",TranslationTexts.T_DESCR_FORUM)
+ HTML = HTML.replace("T_EXTERNALLINKS",TranslationTexts.T_EXTERNALLINKS)
+
# build a "create new" icon with the FreeCAD background color gradient
@@ -226,7 +243,7 @@ def handle():
pa = QtGui.QPainter(i)
pa.fillRect(i.rect(),gradient)
pa.end()
- createimg = tempfile.mkstemp(suffix='.png')[1]
+ createimg = tempfile.mkstemp(dir=tempfolder,suffix='.png')[1]
i.save(createimg)
iconbank["createimg"] = createimg
@@ -327,11 +344,13 @@ def handle():
# build UL_WORKBENCHES
+ wblist = []
UL_WORKBENCHES = '
'
FreeCAD.getResourceDir()
for wb in sorted(FreeCADGui.listWorkbenches().keys()):
if wb.endswith("Workbench"):
wn = wb[:-9]
+ wblist.append(wn.lower())
if wb in iconbank:
img = iconbank[wb]
else:
@@ -341,22 +360,24 @@ def handle():
if hasattr(w,"Icon"):
xpm = w.Icon
if "XPM" in xpm:
+ xpm = xpm.replace("\n ","\n") # some XPMs have some indent that QT doesn't like
r = [s[:-1].strip('"') for s in re.findall("(?s)\{(.*?)\};",xpm)[0].split("\n")[1:]]
p = QtGui.QPixmap(r)
p = p.scaled(24,24)
- img = tempfile.mkstemp(suffix='.png')[1]
+ img = tempfile.mkstemp(dir=tempfolder,suffix='.png')[1]
p.save(img)
else:
img = xpm
else:
img="images/freecad.png"
iconbank[wb] = img
- UL_WORKBENCHES += ''
- UL_WORKBENCHES += '
'
+ UL_WORKBENCHES += '
- '
+ UL_WORKBENCHES += '
'
UL_WORKBENCHES += ''+wn.replace("ReverseEngineering","ReverseEng")+''
- UL_WORKBENCHES += ' '
+ UL_WORKBENCHES += ''
UL_WORKBENCHES += '
'
HTML = HTML.replace("UL_WORKBENCHES",UL_WORKBENCHES)
+ HTML = HTML.replace("var wblist = [];","var wblist = " + str(wblist) + ";")
# set and replace colors
@@ -365,7 +386,7 @@ def handle():
if p.GetString("BackgroundImage",""):
BACKGROUND = gethexcolor(p.GetUnsigned("BackgroundColor1",1331197183))+" url("+p.GetString("BackgroundImage","")+")"
else:
- BACKGROUND = gethexcolor(p.GetUnsigned("BackgroundColor1",1331197183))
+ BACKGROUND = gethexcolor(p.GetUnsigned("BackgroundColor1",1331197183))
# linear gradient not supported by QT "linear-gradient("+gethexcolor(p.GetUnsigned("BackgroundColor1",1331197183))+","+gethexcolor(p.GetUnsigned("BackgroundColor2",2141107711))+")"
LINKCOLOR = gethexcolor(p.GetUnsigned("LinkColor",65535))
BASECOLOR = gethexcolor(p.GetUnsigned("PageColor",4294967295))
@@ -390,11 +411,19 @@ def handle():
if FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Start").GetBool("AllowDownload",False):
HTML = HTML.replace("var allowDownloads = 0;","var allowDownloads = 1;")
+
# enable or disable forum
if FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Start").GetBool("ShowForum",False):
HTML = HTML.replace("var showForum = 0;","var showForum = 1;")
- HTML = HTML.replace("display: none; /* forumbox */","display: block; /* forumbox */")
+ HTML = HTML.replace("display: none; /* forum display */","display: block; /* forum display */")
+
+
+ # store variables for further use
+
+ Start.iconbank = iconbank
+ Start.tempfolder = tempfolder
+
# encode if necessary
@@ -443,9 +472,9 @@ def postStart():
def checkPostOpenStartPage():
-
+
"on Start WB startup, check if we are loading a file and therefore need to close the StartPage"
-
+
import Start
if FreeCAD.ParamGet('User parameter:BaseApp/Preferences/Mod/Start').GetBool('DoNotShowOnOpen',False) and (not hasattr(Start,'CanOpenStartPage')):
if len(sys.argv) > 1:
diff --git a/src/Mod/Start/StartPage/TranslationTexts.py b/src/Mod/Start/StartPage/TranslationTexts.py
index 800cbeb1e5..f1c9d274b7 100644
--- a/src/Mod/Start/StartPage/TranslationTexts.py
+++ b/src/Mod/Start/StartPage/TranslationTexts.py
@@ -57,11 +57,13 @@ T_DESCR_DEVHUB = translate("StartPage", "This section contains material for deve
T_MANUAL = translate("StartPage", "Manual")
T_DESCR_MANUAL = translate("StartPage", "The FreeCAD manual is another, more linear way to present the information contained in this wiki. It is made to be read like a book, and will gently introduce you to many other pages from the hubs above.
e-book versions are also available.")
T_WBHELP = translate("StartPage", "Workbenches documentation")
-T_DESCR_WBHELP = translate("StartPage", "These are the help pages of all the workbenches currently installed on this computer")
+T_DESCR_WBHELP = translate("StartPage", "These are the help pages of all the workbenches currently installed on this computer.")
T_COMMUNITYHELP = translate("StartPage", "Getting help from the community")
-T_DESCR_COMMUNITYHELP = translate("StartPage", "
The FreeCAD forum is a great place to get help from other FreeCAD users and developers. The forum has many sections for different types of issues and discussion subjects. If in doubt, post in the more general Help on using FreeCAD section.
If it is the first time you are posting on the forum, be sure to read the guidelines first!
FreeCAD also maintains a public bug tracker where anybody can submit bugs and propose new features. To avoid causing extra work and give the best chances to see your bug solved, make sure you read the bug submission guide before posting.
")
+T_DESCR_COMMUNITYHELP1 = translate("StartPage", "The
FreeCAD forum is a great place to get help from other FreeCAD users and developers. The forum has many sections for different types of issues and discussion subjects. If in doubt, post in the more general
Help on using FreeCAD section.")
+T_DESCR_COMMUNITYHELP2 = translate("StartPage", "If it is the first time you are posting on the forum, be sure to
read the guidelines first!")
+T_DESCR_COMMUNITYHELP3 = translate("StartPage", "FreeCAD also maintains a public
bug tracker where anybody can submit bugs and propose new features. To avoid causing extra work and give the best chances to see your bug solved, make sure you read the
bug submission guide before posting.")
T_ADDONS = translate("StartPage", "Available addons")
-T_DESCR_ADDONS = translate("StartPage", "Below is a list of available extra workbenches to be added to your FreeCAD installation. Browse and install them from menu Tools -> Addons mananger. You can learn more about any of them by clicking the links below.")
+T_DESCR_ADDONS = translate("StartPage", "Below is a list of available extra workbenches that can be added to your FreeCAD installation. Browse and install them from menu Tools -> Addons mananger. You can learn more about any of them by clicking the links below.")
T_OFFLINEHELP = translate("StartPage", "If not bundled with your FreeCAD version, install the FreeCAD documentation package to get documentation hubs, workbench help and individual command documentation without an internet connection.")
T_OFFLINEPLACEHOLDER = translate("StartPage", "Cannot fetch information from GitHub.
Authorize FreeCAD to access the internet and reload the Start page.")
T_RECENTCOMMITS = translate("StartPage", "Recent commits")
@@ -74,5 +76,4 @@ T_CREATENEW = translate("StartPage", "Create new...")
T_UNKNOWN = translate("StartPage", "Unknown")
T_FORUM = translate("StartPage", "Forum")
T_DESCR_FORUM = translate("StartPage", "The latest posts on the
FreeCAD forum:")
-
-
+T_EXTERNALLINKS = translate("StartPage", "To open any of the links above in your desktop browser, Right-click -> Open in external browser")
diff --git a/src/Mod/Start/StartPage/images/installed.png b/src/Mod/Start/StartPage/images/installed.png
new file mode 100644
index 0000000000..2d754544fc
Binary files /dev/null and b/src/Mod/Start/StartPage/images/installed.png differ