Start: Allow to not show start page on file open
This commit is contained in:
committed by
Yorik van Havre
parent
36cd5a55cf
commit
1007c822d6
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>476</width>
|
||||
<height>533</height>
|
||||
<height>559</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -433,6 +433,32 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>Apply on start with opening</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="1">
|
||||
<widget class="Gui::PrefCheckBox" name="checkBox_3">
|
||||
<property name="toolTip">
|
||||
<string>If FreeCAD is started by opening a file, apply the two settings above</string>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>DoNotShowOnOpen</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Start</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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. <a href=\"https://www.gitbook.com/book/yorikvanhavre/a-freecad-manual/details\">e-book versions</a> 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", "<p>The <a href=\"http://forum.freecadweb.org\">FreeCAD forum</a> 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 <a href=\"https://forum.freecadweb.org/viewforum.php?f=3\">Help on using FreeCAD</a> section.</p><p>If it is the first time you are posting on the forum, be sure to <a href=\"https://forum.freecadweb.org/viewtopic.php?f=3&t=2264\">read the guidelines</a> first!</p><p>FreeCAD also maintains a public <a href=\"https://www.freecadweb.org/tracker\">bug tracker</a> 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 <a href=\"https://forum.freecadweb.org/viewtopic.php?f=3&t=5236\">bug submission guide</a> before posting.</p>")
|
||||
|
||||
Reference in New Issue
Block a user