eric6/WebBrowser/FeaturePermissions/FeaturePermissionManager.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 7781
607a6098cb44
child 8143
2c730d5fd177
permissions
-rw-r--r--

Updated copyright for 2021.

4355
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7924
8a96736d465e Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
3 # Copyright (c) 2015 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
4355
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the feature permission manager object.
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10 from PyQt5.QtCore import QObject
4356
975993ebd7fb Finished implementing the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4355
diff changeset
11 from PyQt5.QtWidgets import QDialog
4742
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
12 from PyQt5.QtWebEngineWidgets import QWebEnginePage
4355
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14 import Globals
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15 import Preferences
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 class FeaturePermissionManager(QObject):
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 """
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 Class implementing the feature permission manager object.
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 """
4742
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
22 SettingsKeyFormat = "WebBrowser/FeaturePermissions/{0}"
4355
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 def __init__(self, parent=None):
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 """
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 Constructor
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 @param parent reference to the parent object
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 @type QObject
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 """
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 super(FeaturePermissionManager, self).__init__(parent)
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 self.__featurePermissions = {
4742
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
34 QWebEnginePage.Geolocation: {
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
35 QWebEnginePage.PermissionGrantedByUser: [],
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
36 QWebEnginePage.PermissionDeniedByUser: [],
4355
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 },
4742
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
38 QWebEnginePage.MediaAudioCapture: {
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
39 QWebEnginePage.PermissionGrantedByUser: [],
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
40 QWebEnginePage.PermissionDeniedByUser: [],
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
41 },
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
42 QWebEnginePage.MediaVideoCapture: {
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
43 QWebEnginePage.PermissionGrantedByUser: [],
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
44 QWebEnginePage.PermissionDeniedByUser: [],
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
45 },
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
46 QWebEnginePage.MediaAudioVideoCapture: {
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
47 QWebEnginePage.PermissionGrantedByUser: [],
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
48 QWebEnginePage.PermissionDeniedByUser: [],
4355
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 },
4904
ea8f13f76d26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4788
diff changeset
50 QWebEnginePage.MouseLock: {
ea8f13f76d26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4788
diff changeset
51 QWebEnginePage.PermissionGrantedByUser: [],
ea8f13f76d26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4788
diff changeset
52 QWebEnginePage.PermissionDeniedByUser: [],
ea8f13f76d26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4788
diff changeset
53 },
4355
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 }
6084
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
55 try:
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
56 # these are defined as of Qt 5.10.0/PyQt 5.10.0
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
57 self.__featurePermissions.update({
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
58 QWebEnginePage.DesktopVideoCapture: {
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
59 QWebEnginePage.PermissionGrantedByUser: [],
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
60 QWebEnginePage.PermissionDeniedByUser: [],
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
61 },
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
62 QWebEnginePage.DesktopAudioVideoCapture: {
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
63 QWebEnginePage.PermissionGrantedByUser: [],
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
64 QWebEnginePage.PermissionDeniedByUser: [],
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
65 },
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
66 })
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
67 except AttributeError:
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
68 pass
7179
912bc70b5b01 WebBrowser: added support for the QWebEnginePage.Notifications as Qt 5.13.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
69 try:
912bc70b5b01 WebBrowser: added support for the QWebEnginePage.Notifications as Qt 5.13.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
70 # this was re-added in Qt 5.13.0
912bc70b5b01 WebBrowser: added support for the QWebEnginePage.Notifications as Qt 5.13.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
71 self.__featurePermissions[QWebEnginePage.Notifications] = {
912bc70b5b01 WebBrowser: added support for the QWebEnginePage.Notifications as Qt 5.13.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
72 QWebEnginePage.PermissionGrantedByUser: [],
912bc70b5b01 WebBrowser: added support for the QWebEnginePage.Notifications as Qt 5.13.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
73 QWebEnginePage.PermissionDeniedByUser: [],
912bc70b5b01 WebBrowser: added support for the QWebEnginePage.Notifications as Qt 5.13.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
74 }
912bc70b5b01 WebBrowser: added support for the QWebEnginePage.Notifications as Qt 5.13.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
75 except AttributeError:
912bc70b5b01 WebBrowser: added support for the QWebEnginePage.Notifications as Qt 5.13.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
76 pass
6084
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
77
4355
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 self.__featurePermissionsKeys = {
4742
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
79 (QWebEnginePage.Geolocation,
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
80 QWebEnginePage.PermissionGrantedByUser):
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
81 "GeolocationGranted",
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
82 (QWebEnginePage.Geolocation,
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
83 QWebEnginePage.PermissionDeniedByUser):
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
84 "GeolocationDenied",
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
85 (QWebEnginePage.MediaAudioCapture,
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
86 QWebEnginePage.PermissionGrantedByUser):
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
87 "MediaAudioCaptureGranted",
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
88 (QWebEnginePage.MediaAudioCapture,
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
89 QWebEnginePage.PermissionDeniedByUser):
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
90 "MediaAudioCaptureDenied",
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
91 (QWebEnginePage.MediaVideoCapture,
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
92 QWebEnginePage.PermissionGrantedByUser):
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
93 "MediaVideoCaptureGranted",
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
94 (QWebEnginePage.MediaVideoCapture,
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
95 QWebEnginePage.PermissionDeniedByUser):
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
96 "MediaVideoCaptureDenied",
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
97 (QWebEnginePage.MediaAudioVideoCapture,
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
98 QWebEnginePage.PermissionGrantedByUser):
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
99 "MediaAudioVideoCaptureGranted",
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
100 (QWebEnginePage.MediaAudioVideoCapture,
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
101 QWebEnginePage.PermissionDeniedByUser):
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
102 "MediaAudioVideoCaptureDenied",
4904
ea8f13f76d26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4788
diff changeset
103 (QWebEnginePage.MouseLock,
ea8f13f76d26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4788
diff changeset
104 QWebEnginePage.PermissionGrantedByUser):
ea8f13f76d26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4788
diff changeset
105 "MouseLockGranted",
ea8f13f76d26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4788
diff changeset
106 (QWebEnginePage.MouseLock,
ea8f13f76d26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4788
diff changeset
107 QWebEnginePage.PermissionDeniedByUser):
ea8f13f76d26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4788
diff changeset
108 "MouseLockDenied",
4355
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 }
6084
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
110 try:
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
111 # these are defined as of Qt 5.10.0/PyQt 5.10.0
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
112 self.__featurePermissionsKeys.update({
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
113 (QWebEnginePage.DesktopVideoCapture,
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
114 QWebEnginePage.PermissionGrantedByUser):
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
115 "DesktopVideoCaptureGranted",
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
116 (QWebEnginePage.DesktopVideoCapture,
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
117 QWebEnginePage.PermissionDeniedByUser):
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
118 "DesktopVideoCaptureDenied",
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
119 (QWebEnginePage.DesktopAudioVideoCapture,
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
120 QWebEnginePage.PermissionGrantedByUser):
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
121 "DesktopAudioVideoCaptureGranted",
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
122 (QWebEnginePage.DesktopAudioVideoCapture,
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
123 QWebEnginePage.PermissionDeniedByUser):
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
124 "DesktopAudioVideoCaptureDenied",
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
125 })
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
126 except AttributeError:
c6f3f66bf7aa Added support for HTML5 "Desktop Video Capture" and "Desktop Audio and Video Capture" as of Qt 5.10.0/PyQt 5.10.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
127 pass
7179
912bc70b5b01 WebBrowser: added support for the QWebEnginePage.Notifications as Qt 5.13.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
128 try:
912bc70b5b01 WebBrowser: added support for the QWebEnginePage.Notifications as Qt 5.13.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
129 # this was re-added in Qt 5.13.0
912bc70b5b01 WebBrowser: added support for the QWebEnginePage.Notifications as Qt 5.13.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
130 self.__featurePermissionsKeys.update({
912bc70b5b01 WebBrowser: added support for the QWebEnginePage.Notifications as Qt 5.13.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
131 (QWebEnginePage.Notifications,
912bc70b5b01 WebBrowser: added support for the QWebEnginePage.Notifications as Qt 5.13.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
132 QWebEnginePage.PermissionGrantedByUser):
912bc70b5b01 WebBrowser: added support for the QWebEnginePage.Notifications as Qt 5.13.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
133 "NotificationsGranted",
912bc70b5b01 WebBrowser: added support for the QWebEnginePage.Notifications as Qt 5.13.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
134 (QWebEnginePage.Notifications,
912bc70b5b01 WebBrowser: added support for the QWebEnginePage.Notifications as Qt 5.13.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
135 QWebEnginePage.PermissionDeniedByUser):
912bc70b5b01 WebBrowser: added support for the QWebEnginePage.Notifications as Qt 5.13.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
136 "NotificationsDenied",
912bc70b5b01 WebBrowser: added support for the QWebEnginePage.Notifications as Qt 5.13.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
137 })
912bc70b5b01 WebBrowser: added support for the QWebEnginePage.Notifications as Qt 5.13.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
138 except AttributeError:
912bc70b5b01 WebBrowser: added support for the QWebEnginePage.Notifications as Qt 5.13.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
139 pass
4355
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141 self.__loaded = False
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
142
4742
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
143 def requestFeaturePermission(self, page, origin, feature):
4355
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144 """
4356
975993ebd7fb Finished implementing the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4355
diff changeset
145 Public method to request a feature permission.
4355
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 @param page reference to the requesting web page
4742
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
148 @type QWebEnginePage
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
149 @param origin security origin requesting the feature
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
150 @type QUrl
4355
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151 @param feature requested feature
4742
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
152 @type QWebEnginePage.Feature
4355
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153 """
4742
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
154 if origin is None or origin.isEmpty():
4355
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
155 return
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
156
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157 if not self.__loaded:
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158 self.__loadSettings()
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159
4742
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
160 host = origin.host()
4355
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162 if feature in self.__featurePermissions:
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163 for permission in self.__featurePermissions[feature]:
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164 if host in self.__featurePermissions[feature][permission]:
4742
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
165 page.setFeaturePermission(origin, feature, permission)
4355
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 return
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167
4742
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
168 from .FeaturePermissionBar import FeaturePermissionBar
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
169 bar = FeaturePermissionBar(page, origin, feature, self)
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
170 bar.show()
4355
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172 def rememberFeaturePermission(self, host, feature, permission):
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173 """
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174 Public method to remember a user decision for a feature permission.
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176 @param host host name to remember the decision for
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 @type str
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178 @param feature feature to be remembered
4742
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
179 @type QWebEnginePage.Feature
4355
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
180 @param permission feature permission to be remembered
4742
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
181 @type QWebEnginePage.PermissionPolicy
4355
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
182 """
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183 if feature in self.__featurePermissions:
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
184 if host not in self.__featurePermissions[feature][permission]:
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
185 self.__featurePermissions[feature][permission].append(host)
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186 self.__saveSettings()
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
187
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
188 def __loadSettings(self):
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
189 """
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
190 Private method to load the remembered feature permissions.
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
191 """
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
192 if self.__loaded:
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
193 # no reloading allowed
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194 return
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
195
7268
a28338eaf694 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
196 for (feature, permission), key in (
a28338eaf694 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
197 self.__featurePermissionsKeys.items()
a28338eaf694 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
198 ):
a28338eaf694 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
199 self.__featurePermissions[feature][permission] = (
4355
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
200 Globals.toList(Preferences.Prefs.settings.value(
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201 FeaturePermissionManager.SettingsKeyFormat.format(key),
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
202 []
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 ))
7268
a28338eaf694 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
204 )
4355
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
205
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
206 self.__loaded = True
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
207
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
208 def __saveSettings(self):
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
209 """
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
210 Private method to save the remembered feature permissions.
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
211 """
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
212 if not self.__loaded:
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
213 return
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
214
4742
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
215 import WebBrowser.WebBrowserWindow
4788
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4742
diff changeset
216 if WebBrowser.WebBrowserWindow.WebBrowserWindow.isPrivate():
4742
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
217 return
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
218
7268
a28338eaf694 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
219 for (feature, permission), key in (
a28338eaf694 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
220 self.__featurePermissionsKeys.items()
a28338eaf694 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
221 ):
4355
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
222 Preferences.Prefs.settings.setValue(
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
223 FeaturePermissionManager.SettingsKeyFormat.format(key),
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
224 self.__featurePermissions[feature][permission])
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
225
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
226 def showFeaturePermissionsDialog(self):
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
227 """
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228 Public method to show a dialog to manage the remembered feature
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229 permissions.
40ec6bef4c22 Started to implement the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230 """
4356
975993ebd7fb Finished implementing the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4355
diff changeset
231 if not self.__loaded:
975993ebd7fb Finished implementing the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4355
diff changeset
232 self.__loadSettings()
975993ebd7fb Finished implementing the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4355
diff changeset
233
975993ebd7fb Finished implementing the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4355
diff changeset
234 from .FeaturePermissionsDialog import FeaturePermissionsDialog
975993ebd7fb Finished implementing the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4355
diff changeset
235 dlg = FeaturePermissionsDialog(self.__featurePermissions)
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
236 if dlg.exec() == QDialog.Accepted:
4356
975993ebd7fb Finished implementing the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4355
diff changeset
237 newFeaturePermissions = dlg.getData()
975993ebd7fb Finished implementing the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4355
diff changeset
238 self.__featurePermissions = newFeaturePermissions
975993ebd7fb Finished implementing the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4355
diff changeset
239 self.__saveSettings()

eric ide

mercurial