diff --git a/src/Mod/Start/Gui/DlgStartPreferences.ui b/src/Mod/Start/Gui/DlgStartPreferences.ui index 35c823862f..5ea9edae43 100644 --- a/src/Mod/Start/Gui/DlgStartPreferences.ui +++ b/src/Mod/Start/Gui/DlgStartPreferences.ui @@ -7,7 +7,7 @@ 0 0 476 - 533 + 559 @@ -433,6 +433,32 @@ + + + + Apply on start with opening + + + + + + + If FreeCAD is started by opening a file, apply the two settings above + + + Qt::RightToLeft + + + + + + DoNotShowOnOpen + + + Mod/Start + + + diff --git a/src/Mod/Start/Gui/DlgStartPreferencesImp.cpp b/src/Mod/Start/Gui/DlgStartPreferencesImp.cpp index 4d50877f9d..8293182f56 100644 --- a/src/Mod/Start/Gui/DlgStartPreferencesImp.cpp +++ b/src/Mod/Start/Gui/DlgStartPreferencesImp.cpp @@ -93,6 +93,7 @@ void DlgStartPreferencesImp::saveSettings() radioButton_2->onSave(); checkBox_1->onSave(); checkBox_2->onSave(); + checkBox_3->onSave(); } void DlgStartPreferencesImp::loadSettings() @@ -116,6 +117,7 @@ void DlgStartPreferencesImp::loadSettings() radioButton_2->onRestore(); checkBox_1->onRestore(); checkBox_2->onRestore(); + checkBox_3->onRestore(); } /** diff --git a/src/Mod/Start/Gui/Workbench.cpp b/src/Mod/Start/Gui/Workbench.cpp index d0377edda6..6a8b492e8e 100644 --- a/src/Mod/Start/Gui/Workbench.cpp +++ b/src/Mod/Start/Gui/Workbench.cpp @@ -73,7 +73,7 @@ void StartGui::Workbench::activated() QByteArray utf8Title = title.toUtf8(); QByteArray cmd; QTextStream str(&cmd); - str << "import WebGui" << endl; + str << "import WebGui,sys,Start" << endl; str << "from StartPage import StartPage" << endl; str << endl; str << "class WebPage(object):" << endl; @@ -101,6 +101,7 @@ void StartGui::Workbench::activated() str << " self.pargrp.Detach(self.webPage)" << endl; str << endl; str << "webView=WebView()" << endl; + str << "StartPage.checkPostOpenStartPage()" << endl; Base::Interpreter().runString(cmd); // Gui::Command::runCommand(Gui::Command::Gui, cmd); diff --git a/src/Mod/Start/StartPage/StartPage.py b/src/Mod/Start/StartPage/StartPage.py index 8af3f8d884..83f29ac82d 100644 --- a/src/Mod/Start/StartPage/StartPage.py +++ b/src/Mod/Start/StartPage/StartPage.py @@ -31,7 +31,7 @@ FreeCADGui.addLanguagePath(":/translations") FreeCADGui.updateLocale() iconprovider = QtGui.QFileIconProvider() -iconbank = {} # to store already created icons +iconbank = {} # to store already created icons so we don't overpollute the temp dir def gethexcolor(color): @@ -55,7 +55,7 @@ def isplainfile(filename): if basename.startswith("."): return False if basename[-1].isdigit(): - if basename[-7:-1].lower() == "fcstd": + if basename[-7:-1].lower() == "fcstd": # freecad backup file return False if basename.endswith("~"): return False @@ -373,7 +373,7 @@ def handle(): TEXTCOLOR = gethexcolor(p.GetUnsigned("PageTextColor",255)) BGTCOLOR = gethexcolor(p.GetUnsigned("BackgroundTextColor",4294703103)) SHADOW = "#888888" - if QtGui.QColor(BASECOLOR).valueF() < 0.5: # dark page + if QtGui.QColor(BASECOLOR).valueF() < 0.5: # dark page - we need to make darker shadows SHADOW = "#000000" HTML = HTML.replace("BASECOLOR",BASECOLOR) @@ -436,3 +436,14 @@ def postStart(): subw.close() + +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: + postStart() + Start.CanOpenStartPage = True + diff --git a/src/Mod/Start/StartPage/TranslationTexts.py b/src/Mod/Start/StartPage/TranslationTexts.py index f4c9a0f37a..800cbeb1e5 100644 --- a/src/Mod/Start/StartPage/TranslationTexts.py +++ b/src/Mod/Start/StartPage/TranslationTexts.py @@ -56,7 +56,7 @@ T_DEVHUB = translate("StartPage", "Developers hub") T_DESCR_DEVHUB = translate("StartPage", "This section contains material for developers: How to compile FreeCAD yourself, how the FreeCAD source code is structured and how to navigate in it, and how to develop new workbenches, or embed FreeCAD in your own application.") 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 help") +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_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.

")