eric6_browser.py

changeset 6628
c3f0f6bffd21
parent 6625
a67fee7bc09c
child 6630
bddd12f27a4c
equal deleted inserted replaced
6627:acd62f281a99 6628:c3f0f6bffd21
35 35
36 from Globals import qVersionTuple 36 from Globals import qVersionTuple
37 37
38 38
39 if qVersionTuple() < (5, 6, 0): 39 if qVersionTuple() < (5, 6, 0):
40 from PyQt5.QtCore import QTimer 40 if "--quiet" not in sys.argv:
41 from PyQt5.QtWidgets import QApplication 41 from PyQt5.QtCore import QTimer
42 from E5Gui import E5MessageBox 42 from PyQt5.QtWidgets import QApplication
43 app = QApplication([]) 43 from E5Gui import E5MessageBox
44 QTimer.singleShot(0, lambda: E5MessageBox.critical( 44 app = QApplication([])
45 None, 45 QTimer.singleShot(0, lambda: E5MessageBox.critical(
46 "eric6 Web Browser", 46 None,
47 "You need at least Qt Version 5.6.0 to execute the web browser.") 47 "eric6 Web Browser",
48 ) 48 "You need at least Qt Version 5.6.0 to execute the web browser.")
49 app.exec_() 49 )
50 app.exec_()
50 sys.exit(100) 51 sys.exit(100)
51 52
52 SettingsDir = None 53 SettingsDir = None
53 54
54 for arg in sys.argv[:]: 55 for arg in sys.argv[:]:
73 "ThirdParty", "EditorConfig")) 74 "ThirdParty", "EditorConfig"))
74 75
75 try: 76 try:
76 from PyQt5 import QtWebEngineWidgets # __IGNORE_WARNING__ 77 from PyQt5 import QtWebEngineWidgets # __IGNORE_WARNING__
77 except ImportError: 78 except ImportError:
78 from PyQt5.QtCore import QTimer 79 if "--quiet" not in sys.argv:
79 from PyQt5.QtWidgets import QApplication 80 from PyQt5.QtCore import QTimer
80 from E5Gui import E5MessageBox # __IGNORE_WARNING__ 81 from PyQt5.QtWidgets import QApplication
81 app = QApplication([]) 82 from E5Gui import E5MessageBox # __IGNORE_WARNING__
82 QTimer.singleShot(0, lambda: E5MessageBox.critical( 83 app = QApplication([])
83 None, 84 QTimer.singleShot(0, lambda: E5MessageBox.critical(
84 "eric6 Web Browser", 85 None,
85 "QtWebEngineWidgets is not installed but needed to execute the" 86 "eric6 Web Browser",
86 " web browser.")) 87 "QtWebEngineWidgets is not installed but needed to execute the"
87 app.exec_() 88 " web browser."))
89 app.exec_()
88 sys.exit(100) 90 sys.exit(100)
89 91
90 import Globals 92 import Globals
91 from Globals import AppInfo 93 from Globals import AppInfo
92 94
127 private = True 129 private = True
128 argv.remove(arg) 130 argv.remove(arg)
129 elif arg == "--qthelp": 131 elif arg == "--qthelp":
130 qthelp = True 132 qthelp = True
131 argv.remove(arg) 133 argv.remove(arg)
134 elif arg == "--quiet":
135 # only needed until we reach this point
136 argv.remove(arg)
132 elif arg == "--single": 137 elif arg == "--single":
133 single = True 138 single = True
134 argv.remove(arg) 139 argv.remove(arg)
135 elif arg.startswith("--"): 140 elif arg.startswith("--"):
136 argv.remove(arg) 141 argv.remove(arg)
154 options = [ 159 options = [
155 ("--config=configDir", 160 ("--config=configDir",
156 "use the given directory as the one containing the config files"), 161 "use the given directory as the one containing the config files"),
157 ("--private", "start the browser in private browsing mode"), 162 ("--private", "start the browser in private browsing mode"),
158 ("--qthelp", "start the browser with support for QtHelp"), 163 ("--qthelp", "start the browser with support for QtHelp"),
164 ("--quiet", "don't show any startup error messages"),
159 ("--search=word", "search for the given word"), 165 ("--search=word", "search for the given word"),
160 ("--settings=settingsDir", 166 ("--settings=settingsDir",
161 "use the given directory to store the settings files"), 167 "use the given directory to store the settings files"),
162 ("--single", "start the browser as a single application"), 168 ("--single", "start the browser as a single application"),
163 ] 169 ]

eric ide

mercurial