eric6/Preferences/ConfigurationPages/WebBrowserAppearancePage.py

Wed, 30 Dec 2020 11:00:44 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 30 Dec 2020 11:00:44 +0100
branch
maintenance
changeset 7924
8a96736d465e
parent 7780
41420f82c0ac
child 7945
76daafe10009
permissions
-rw-r--r--

Updated copyright for 2021.

0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7924
8a96736d465e Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7780
diff changeset
3 # Copyright (c) 2006 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
5532
3a7c5deab9b7 Added support for new functionality provided by Qt 5.8.0 to the QtWebEngine based web browser (including spell checking).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
7 Module implementing the Web Browser Appearance configuration page.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
4805
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
10 from PyQt5.QtGui import QFont
4674
41f716db325e Some enhancements of the configuration pages for the selection of fonts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
11 from PyQt5.QtWidgets import QFontDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
4576
a258569d44db Changed more configuration pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
13 from E5Gui.E5PathPicker import E5PathPickerModes
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7
diff changeset
15 from .ConfigurationPageBase import ConfigurationPageBase
4804
f794ff054d8f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4676
diff changeset
16 from .Ui_WebBrowserAppearancePage import Ui_WebBrowserAppearancePage
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 import Preferences
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19
4676
c65b401b775e Implemented a fix for the last change to work with Qt4/PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4674
diff changeset
20 try:
c65b401b775e Implemented a fix for the last change to work with Qt4/PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4674
diff changeset
21 MonospacedFontsOption = QFontDialog.MonospacedFonts
c65b401b775e Implemented a fix for the last change to work with Qt4/PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4674
diff changeset
22 except AttributeError:
c65b401b775e Implemented a fix for the last change to work with Qt4/PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4674
diff changeset
23 MonospacedFontsOption = QFontDialog.FontDialogOptions(0x10)
c65b401b775e Implemented a fix for the last change to work with Qt4/PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4674
diff changeset
24
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
25
4804
f794ff054d8f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4676
diff changeset
26 class WebBrowserAppearancePage(ConfigurationPageBase,
f794ff054d8f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4676
diff changeset
27 Ui_WebBrowserAppearancePage):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 """
4804
f794ff054d8f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4676
diff changeset
29 Class implementing the Web Browser Appearance page.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 def __init__(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 """
4804
f794ff054d8f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4676
diff changeset
35 super(WebBrowserAppearancePage, self).__init__()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 self.setupUi(self)
4804
f794ff054d8f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4676
diff changeset
37 self.setObjectName("WebBrowserAppearancePage")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38
4576
a258569d44db Changed more configuration pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
39 self.styleSheetPicker.setMode(E5PathPickerModes.OpenFileMode)
4582
3a1d1d4c6f4f Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4576
diff changeset
40 self.styleSheetPicker.setFilters(self.tr(
3a1d1d4c6f4f Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4576
diff changeset
41 "Cascading Style Sheets (*.css);;All files (*)"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42
1109
9552b5e16a07 Added some more search engines to the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
43 self.__displayMode = None
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 # set initial values
4805
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
46 defaultFontSize = Preferences.getWebBrowser("DefaultFontSize")
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
47 fixedFontSize = Preferences.getWebBrowser("DefaultFixedFontSize")
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
48 self.defaultSizeSpinBox.setValue(defaultFontSize)
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
49 self.fixedSizeSpinBox.setValue(fixedFontSize)
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
50 self.minSizeSpinBox.setValue(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
51 Preferences.getWebBrowser("MinimumFontSize"))
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
52 self.minLogicalSizeSpinBox.setValue(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
53 Preferences.getWebBrowser("MinimumLogicalFontSize"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54
4805
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
55 self.standardFontCombo.setCurrentFont(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
56 QFont(Preferences.getWebBrowser("StandardFontFamily"),
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
57 defaultFontSize, QFont.Normal, False))
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
58 self.fixedFontCombo.setCurrentFont(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
59 QFont(Preferences.getWebBrowser("FixedFontFamily"),
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
60 fixedFontSize, QFont.Normal, False))
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
61 self.serifFontCombo.setCurrentFont(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
62 QFont(Preferences.getWebBrowser("SerifFontFamily"),
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
63 defaultFontSize, QFont.Normal, False))
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
64 self.sansSerifFontCombo.setCurrentFont(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
65 QFont(Preferences.getWebBrowser("SansSerifFontFamily"),
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
66 defaultFontSize, QFont.Normal, False))
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
67 self.cursiveFontCombo.setCurrentFont(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
68 QFont(Preferences.getWebBrowser("CursiveFontFamily"),
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
69 defaultFontSize, QFont.Normal, True))
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
70 self.fantasyFontCombo.setCurrentFont(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
71 QFont(Preferences.getWebBrowser("FantasyFontFamily"),
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
72 defaultFontSize, QFont.Normal, False))
5031
e4dbcb22d912 Started adjusting the new web browser to the extended functionality of Qt 5.7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4816
diff changeset
73 try:
e4dbcb22d912 Started adjusting the new web browser to the extended functionality of Qt 5.7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4816
diff changeset
74 # Qt 5.7+
e4dbcb22d912 Started adjusting the new web browser to the extended functionality of Qt 5.7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4816
diff changeset
75 self.pictographFontCombo.setCurrentFont(
e4dbcb22d912 Started adjusting the new web browser to the extended functionality of Qt 5.7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4816
diff changeset
76 QFont(Preferences.getWebBrowser("PictographFontFamily"),
e4dbcb22d912 Started adjusting the new web browser to the extended functionality of Qt 5.7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4816
diff changeset
77 defaultFontSize, QFont.Normal, False))
e4dbcb22d912 Started adjusting the new web browser to the extended functionality of Qt 5.7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4816
diff changeset
78 except KeyError:
e4dbcb22d912 Started adjusting the new web browser to the extended functionality of Qt 5.7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4816
diff changeset
79 self.pictographFontLabel.setEnabled(False)
e4dbcb22d912 Started adjusting the new web browser to the extended functionality of Qt 5.7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4816
diff changeset
80 self.pictographFontCombo.setEnabled(False)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81
7567
bb196e51827d Web Browser: added a configurable URL entry color to indicate sites with certificate issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
82 self.initColour("SecureUrlColor",
bb196e51827d Web Browser: added a configurable URL entry color to indicate sites with certificate issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
83 self.secureURLsColourButton,
bb196e51827d Web Browser: added a configurable URL entry color to indicate sites with certificate issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
84 Preferences.getWebBrowser)
bb196e51827d Web Browser: added a configurable URL entry color to indicate sites with certificate issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
85 self.initColour("InsecureUrlColor",
bb196e51827d Web Browser: added a configurable URL entry color to indicate sites with certificate issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
86 self.insecureURLsColourButton,
bb196e51827d Web Browser: added a configurable URL entry color to indicate sites with certificate issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
87 Preferences.getWebBrowser)
bb196e51827d Web Browser: added a configurable URL entry color to indicate sites with certificate issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
88 self.initColour("MaliciousUrlColor",
bb196e51827d Web Browser: added a configurable URL entry color to indicate sites with certificate issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
89 self.maliciousURLsColourButton,
bb196e51827d Web Browser: added a configurable URL entry color to indicate sites with certificate issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
90 Preferences.getWebBrowser)
bb196e51827d Web Browser: added a configurable URL entry color to indicate sites with certificate issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
91 self.initColour("PrivateModeUrlColor",
bb196e51827d Web Browser: added a configurable URL entry color to indicate sites with certificate issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
92 self.privateModeURLsColourButton,
4804
f794ff054d8f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4676
diff changeset
93 Preferences.getWebBrowser)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94
3010
befeff46ec0f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
95 self.autoLoadImagesCheckBox.setChecked(
4804
f794ff054d8f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4676
diff changeset
96 Preferences.getWebBrowser("AutoLoadImages"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97
4804
f794ff054d8f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4676
diff changeset
98 self.styleSheetPicker.setText(
f794ff054d8f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4676
diff changeset
99 Preferences.getWebBrowser("UserStyleSheet"))
1109
9552b5e16a07 Added some more search engines to the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
100
1636
6a25bb84e2a3 Added the capability to configure the web browser behavior, when multiple tabs are about to be closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
101 self.warnOnMultipleCloseCheckBox.setChecked(
4804
f794ff054d8f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4676
diff changeset
102 Preferences.getWebBrowser("WarnOnMultipleClose"))
5745
4f4316e83318 -- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5532
diff changeset
103
6089
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
104 try:
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
105 # Qt 5.10
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
106 self.scrollbarsCheckBox.setChecked(
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
107 Preferences.getWebBrowser("ShowScrollBars"))
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
108 except KeyError:
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
109 self.scrollbarsCheckBox.setEnabled(False)
5745
4f4316e83318 -- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5532
diff changeset
110 self.toolbarsCheckBox.setChecked(
4f4316e83318 -- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5532
diff changeset
111 Preferences.getWebBrowser("ShowToolbars"))
1109
9552b5e16a07 Added some more search engines to the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
112
9552b5e16a07 Added some more search engines to the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
113 def setMode(self, displayMode):
9552b5e16a07 Added some more search engines to the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
114 """
9552b5e16a07 Added some more search engines to the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
115 Public method to perform mode dependent setups.
9552b5e16a07 Added some more search engines to the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
116
9552b5e16a07 Added some more search engines to the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
117 @param displayMode mode of the configuration dialog
3010
befeff46ec0f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
118 (ConfigurationWidget.DefaultMode,
befeff46ec0f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
119 ConfigurationWidget.HelpBrowserMode,
1109
9552b5e16a07 Added some more search engines to the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
120 ConfigurationWidget.TrayStarterMode)
9552b5e16a07 Added some more search engines to the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
121 """
2408
dc3a7c9d8f6e Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
122 from ..ConfigurationDialog import ConfigurationWidget
7628
f904d0eef264 Checked the reported security related issue reports generated by the new security checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7567
diff changeset
123 if displayMode in (
1109
9552b5e16a07 Added some more search engines to the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
124 ConfigurationWidget.DefaultMode,
4804
f794ff054d8f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4676
diff changeset
125 ConfigurationWidget.WebBrowserMode,
7628
f904d0eef264 Checked the reported security related issue reports generated by the new security checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7567
diff changeset
126 ):
f904d0eef264 Checked the reported security related issue reports generated by the new security checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7567
diff changeset
127 self.__displayMode = displayMode
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129 def save(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131 Public slot to save the Help Viewers configuration.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132 """
4805
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
133 Preferences.setWebBrowser(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
134 "StandardFontFamily",
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
135 self.standardFontCombo.currentFont().family())
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
136 Preferences.setWebBrowser(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
137 "FixedFontFamily",
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
138 self.fixedFontCombo.currentFont().family())
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
139 Preferences.setWebBrowser(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
140 "SerifFontFamily",
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
141 self.serifFontCombo.currentFont().family())
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
142 Preferences.setWebBrowser(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
143 "SansSerifFontFamily",
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
144 self.sansSerifFontCombo.currentFont().family())
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
145 Preferences.setWebBrowser(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
146 "CursiveFontFamily",
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
147 self.cursiveFontCombo.currentFont().family())
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
148 Preferences.setWebBrowser(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
149 "FantasyFontFamily",
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
150 self.fantasyFontCombo.currentFont().family())
5031
e4dbcb22d912 Started adjusting the new web browser to the extended functionality of Qt 5.7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4816
diff changeset
151 if self.pictographFontCombo.isEnabled():
e4dbcb22d912 Started adjusting the new web browser to the extended functionality of Qt 5.7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4816
diff changeset
152 Preferences.setWebBrowser(
e4dbcb22d912 Started adjusting the new web browser to the extended functionality of Qt 5.7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4816
diff changeset
153 "PictographFontFamily",
e4dbcb22d912 Started adjusting the new web browser to the extended functionality of Qt 5.7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4816
diff changeset
154 self.pictographFontCombo.currentFont().family())
4805
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
155
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
156 Preferences.setWebBrowser(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
157 "DefaultFontSize",
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
158 self.defaultSizeSpinBox.value())
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
159 Preferences.setWebBrowser(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
160 "DefaultFixedFontSize",
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
161 self.fixedSizeSpinBox.value())
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
162 Preferences.setWebBrowser(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
163 "MinimumFontSize",
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
164 self.minSizeSpinBox.value())
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
165 Preferences.setWebBrowser(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
166 "MinimumLogicalFontSize",
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4804
diff changeset
167 self.minLogicalSizeSpinBox.value())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168
4804
f794ff054d8f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4676
diff changeset
169 Preferences.setWebBrowser(
3025
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3010
diff changeset
170 "AutoLoadImages",
7
c679fb30c8f3 Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
171 self.autoLoadImagesCheckBox.isChecked())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172
4804
f794ff054d8f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4676
diff changeset
173 Preferences.setWebBrowser(
f794ff054d8f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4676
diff changeset
174 "UserStyleSheet",
f794ff054d8f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4676
diff changeset
175 self.styleSheetPicker.text())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176
4804
f794ff054d8f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4676
diff changeset
177 self.saveColours(Preferences.setWebBrowser)
1109
9552b5e16a07 Added some more search engines to the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
178
4804
f794ff054d8f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4676
diff changeset
179 Preferences.setWebBrowser(
3025
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3010
diff changeset
180 "WarnOnMultipleClose",
1636
6a25bb84e2a3 Added the capability to configure the web browser behavior, when multiple tabs are about to be closed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
181 self.warnOnMultipleCloseCheckBox.isChecked())
5745
4f4316e83318 -- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5532
diff changeset
182
6089
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
183 if self.scrollbarsCheckBox.isEnabled():
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
184 Preferences.setWebBrowser(
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
185 "ShowScrollBars",
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
186 self.scrollbarsCheckBox.isChecked())
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
187
5745
4f4316e83318 -- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5532
diff changeset
188 Preferences.setWebBrowser(
4f4316e83318 -- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5532
diff changeset
189 "ShowToolbars",
4f4316e83318 -- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5532
diff changeset
190 self.toolbarsCheckBox.isChecked())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
191
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
192
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
193 def create(dlg):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
195 Module function to create the configuration page.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197 @param dlg reference to the configuration dialog
2964
84b65fb9e780 Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
198 @return reference to the instantiated page (ConfigurationPageBase)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
199 """
4804
f794ff054d8f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4676
diff changeset
200 page = WebBrowserAppearancePage()
880
52ed20236a1c Added the option to not use the native file dialog to prevent crashes on Linux.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
201 return page

eric ide

mercurial