35 os.makedirs(settingsDir) |
35 os.makedirs(settingsDir) |
36 QSettings.setPath(QSettings.IniFormat, QSettings.UserScope, |
36 QSettings.setPath(QSettings.IniFormat, QSettings.UserScope, |
37 settingsDir) |
37 settingsDir) |
38 sys.argv.remove(arg) |
38 sys.argv.remove(arg) |
39 |
39 |
40 try: |
40 # TODO: adjust this to 5.6.0 when done |
41 from PyQt5 import QtWebEngineWidgets # __IGNORE_WARNING__ |
41 from PyQt5.QtCore import qVersion |
42 except ImportError: |
42 if qVersion() < "5.5.0": |
43 pass |
43 WEBENGINE_AVAILABLE = False |
|
44 else: |
|
45 try: |
|
46 from PyQt5 import QtWebEngineWidgets # __IGNORE_WARNING__ |
|
47 WEBENGINE_AVAILABLE = True |
|
48 except ImportError: |
|
49 WEBENGINE_AVAILABLE = False |
44 |
50 |
45 # make ThirdParty package available as a packages repository |
51 # make ThirdParty package available as a packages repository |
46 sys.path.insert(2, os.path.join(os.path.dirname(__file__), |
52 sys.path.insert(2, os.path.join(os.path.dirname(__file__), |
47 "ThirdParty", "Pygments")) |
53 "ThirdParty", "Pygments")) |
48 |
54 |
57 |
63 |
58 @param argv list of commandline parameters (list of strings) |
64 @param argv list of commandline parameters (list of strings) |
59 @return reference to the main widget (QWidget) |
65 @return reference to the main widget (QWidget) |
60 """ |
66 """ |
61 from Preferences.ConfigurationDialog import ConfigurationWindow |
67 from Preferences.ConfigurationDialog import ConfigurationWindow |
62 w = ConfigurationWindow() |
68 w = ConfigurationWindow(webEngine=WEBENGINE_AVAILABLE) |
63 w.show() |
69 w.show() |
64 w.showConfigurationPageByName("empty") |
70 w.showConfigurationPageByName("empty") |
65 return w |
71 return w |
66 |
72 |
67 |
73 |