|
|
|
|
@@ -262,9 +262,18 @@ def build_new_file_card(template):
|
|
|
|
|
quick start button"""
|
|
|
|
|
|
|
|
|
|
templates = {
|
|
|
|
|
"empty_file": [TranslationTexts.T_TEMPLATE_EMPTYFILE_NAME, TranslationTexts.T_TEMPLATE_EMPTYFILE_DESC],
|
|
|
|
|
"open_file": [TranslationTexts.T_TEMPLATE_OPENFILE_NAME, TranslationTexts.T_TEMPLATE_OPENFILE_DESC],
|
|
|
|
|
"parametric_part": [TranslationTexts.T_TEMPLATE_PARAMETRICPART_NAME, TranslationTexts.T_TEMPLATE_PARAMETRICPART_DESC],
|
|
|
|
|
"empty_file": [
|
|
|
|
|
TranslationTexts.T_TEMPLATE_EMPTYFILE_NAME,
|
|
|
|
|
TranslationTexts.T_TEMPLATE_EMPTYFILE_DESC,
|
|
|
|
|
],
|
|
|
|
|
"open_file": [
|
|
|
|
|
TranslationTexts.T_TEMPLATE_OPENFILE_NAME,
|
|
|
|
|
TranslationTexts.T_TEMPLATE_OPENFILE_DESC,
|
|
|
|
|
],
|
|
|
|
|
"parametric_part": [
|
|
|
|
|
TranslationTexts.T_TEMPLATE_PARAMETRICPART_NAME,
|
|
|
|
|
TranslationTexts.T_TEMPLATE_PARAMETRICPART_DESC,
|
|
|
|
|
],
|
|
|
|
|
# "csg_part": [TranslationTexts.T_TEMPLATE_CSGPART_NAME, TranslationTexts.T_TEMPLATE_CSGPART_DESC],
|
|
|
|
|
"2d_draft": [
|
|
|
|
|
TranslationTexts.T_TEMPLATE_2DDRAFT_NAME,
|
|
|
|
|
@@ -368,9 +377,14 @@ def handle():
|
|
|
|
|
JS = f.read()
|
|
|
|
|
with open(css_filename, "r") as f:
|
|
|
|
|
CSS = f.read()
|
|
|
|
|
HTML = HTML.replace("JS",JS)
|
|
|
|
|
HTML = HTML.replace("DEFAULT_CSS",CSS)
|
|
|
|
|
HTML = HTML.replace("CUSTOM_CSS",FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Start").GetString("CustomCSS","").replace("\n",""))
|
|
|
|
|
HTML = HTML.replace("JS", JS)
|
|
|
|
|
HTML = HTML.replace("DEFAULT_CSS", CSS)
|
|
|
|
|
HTML = HTML.replace(
|
|
|
|
|
"CUSTOM_CSS",
|
|
|
|
|
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Start")
|
|
|
|
|
.GetString("CustomCSS", "")
|
|
|
|
|
.replace("\n", ""),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# set the language
|
|
|
|
|
|
|
|
|
|
@@ -718,27 +732,27 @@ def handle():
|
|
|
|
|
else:
|
|
|
|
|
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))
|
|
|
|
|
BOXCOLOR = gethexcolor(p.GetUnsigned("BoxColor",3722305023))
|
|
|
|
|
TEXTCOLOR = gethexcolor(p.GetUnsigned("PageTextColor",255))
|
|
|
|
|
BGTCOLOR = gethexcolor(p.GetUnsigned("BackgroundTextColor",1600086015))
|
|
|
|
|
LINKCOLOR = gethexcolor(p.GetUnsigned("LinkColor", 65535))
|
|
|
|
|
BASECOLOR = gethexcolor(p.GetUnsigned("PageColor", 4294967295))
|
|
|
|
|
BOXCOLOR = gethexcolor(p.GetUnsigned("BoxColor", 3722305023))
|
|
|
|
|
TEXTCOLOR = gethexcolor(p.GetUnsigned("PageTextColor", 255))
|
|
|
|
|
BGTCOLOR = gethexcolor(p.GetUnsigned("BackgroundTextColor", 1600086015))
|
|
|
|
|
SHADOW = "#888888"
|
|
|
|
|
if QtGui.QColor(BASECOLOR).valueF() < 0.5: # dark page - we need to make darker shadows
|
|
|
|
|
SHADOW = "#000000"
|
|
|
|
|
FONTFAMILY = p.GetString("FontFamily", "Arial,Helvetica,sans")
|
|
|
|
|
if not FONTFAMILY:
|
|
|
|
|
FONTFAMILY = "Arial,Helvetica,sans"
|
|
|
|
|
FONTSIZE = p.GetInt("FontSize",13)
|
|
|
|
|
HTML = HTML.replace("BASECOLOR",BASECOLOR)
|
|
|
|
|
HTML = HTML.replace("BOXCOLOR",BOXCOLOR)
|
|
|
|
|
HTML = HTML.replace("LINKCOLOR",LINKCOLOR)
|
|
|
|
|
HTML = HTML.replace("TEXTCOLOR",TEXTCOLOR)
|
|
|
|
|
HTML = HTML.replace("BGTCOLOR",BGTCOLOR)
|
|
|
|
|
HTML = HTML.replace("BACKGROUND",BACKGROUND)
|
|
|
|
|
HTML = HTML.replace("SHADOW",SHADOW)
|
|
|
|
|
HTML = HTML.replace("FONTFAMILY",FONTFAMILY)
|
|
|
|
|
HTML = HTML.replace("FONTSIZE",str(FONTSIZE)+"px")
|
|
|
|
|
FONTSIZE = p.GetInt("FontSize", 13)
|
|
|
|
|
HTML = HTML.replace("BASECOLOR", BASECOLOR)
|
|
|
|
|
HTML = HTML.replace("BOXCOLOR", BOXCOLOR)
|
|
|
|
|
HTML = HTML.replace("LINKCOLOR", LINKCOLOR)
|
|
|
|
|
HTML = HTML.replace("TEXTCOLOR", TEXTCOLOR)
|
|
|
|
|
HTML = HTML.replace("BGTCOLOR", BGTCOLOR)
|
|
|
|
|
HTML = HTML.replace("BACKGROUND", BACKGROUND)
|
|
|
|
|
HTML = HTML.replace("SHADOW", SHADOW)
|
|
|
|
|
HTML = HTML.replace("FONTFAMILY", FONTFAMILY)
|
|
|
|
|
HTML = HTML.replace("FONTSIZE", str(FONTSIZE) + "px")
|
|
|
|
|
|
|
|
|
|
# enable web access if permitted
|
|
|
|
|
|
|
|
|
|
|