eric6_browser.py

changeset 6628
c3f0f6bffd21
parent 6625
a67fee7bc09c
child 6630
bddd12f27a4c
--- a/eric6_browser.py	Fri Dec 14 19:49:55 2018 +0100
+++ b/eric6_browser.py	Fri Dec 14 19:51:12 2018 +0100
@@ -37,16 +37,17 @@
 
 
 if qVersionTuple() < (5, 6, 0):
-    from PyQt5.QtCore import QTimer
-    from PyQt5.QtWidgets import QApplication
-    from E5Gui import E5MessageBox
-    app = QApplication([])
-    QTimer.singleShot(0, lambda: E5MessageBox.critical(
-        None,
-        "eric6 Web Browser",
-        "You need at least Qt Version 5.6.0 to execute the web browser.")
-    )
-    app.exec_()
+    if "--quiet" not in sys.argv:
+        from PyQt5.QtCore import QTimer
+        from PyQt5.QtWidgets import QApplication
+        from E5Gui import E5MessageBox
+        app = QApplication([])
+        QTimer.singleShot(0, lambda: E5MessageBox.critical(
+            None,
+            "eric6 Web Browser",
+            "You need at least Qt Version 5.6.0 to execute the web browser.")
+        )
+        app.exec_()
     sys.exit(100)
 
 SettingsDir = None
@@ -75,16 +76,17 @@
 try:
     from PyQt5 import QtWebEngineWidgets    # __IGNORE_WARNING__
 except ImportError:
-    from PyQt5.QtCore import QTimer
-    from PyQt5.QtWidgets import QApplication
-    from E5Gui import E5MessageBox          # __IGNORE_WARNING__
-    app = QApplication([])
-    QTimer.singleShot(0, lambda: E5MessageBox.critical(
-        None,
-        "eric6 Web Browser",
-        "QtWebEngineWidgets is not installed but needed to execute the"
-        " web browser."))
-    app.exec_()
+    if "--quiet" not in sys.argv:
+        from PyQt5.QtCore import QTimer
+        from PyQt5.QtWidgets import QApplication
+        from E5Gui import E5MessageBox          # __IGNORE_WARNING__
+        app = QApplication([])
+        QTimer.singleShot(0, lambda: E5MessageBox.critical(
+            None,
+            "eric6 Web Browser",
+            "QtWebEngineWidgets is not installed but needed to execute the"
+            " web browser."))
+        app.exec_()
     sys.exit(100)
 
 import Globals
@@ -129,6 +131,9 @@
         elif arg == "--qthelp":
             qthelp = True
             argv.remove(arg)
+        elif arg == "--quiet":
+            # only needed until we reach this point
+            argv.remove(arg)
         elif arg == "--single":
             single = True
             argv.remove(arg)
@@ -156,6 +161,7 @@
          "use the given directory as the one containing the config files"),
         ("--private", "start the browser in private browsing mode"),
         ("--qthelp", "start the browser with support for QtHelp"),
+        ("--quiet", "don't show any startup error messages"),
         ("--search=word", "search for the given word"),
         ("--settings=settingsDir",
          "use the given directory to store the settings files"),

eric ide

mercurial