eric6/WebBrowser/FeaturePermissions/FeaturePermissionBar.py

changeset 7533
88261c96484b
parent 7360
9190402e4505
child 7781
607a6098cb44
equal deleted inserted replaced
7532:1358e9d67a1c 7533:88261c96484b
73 "{0} wants to use desktop notifications.") 73 "{0} wants to use desktop notifications.")
74 except AttributeError: 74 except AttributeError:
75 pass 75 pass
76 76
77 self.__permissionFeatureIconNames = { 77 self.__permissionFeatureIconNames = {
78 QWebEnginePage.Geolocation: "geolocation.png", 78 QWebEnginePage.Geolocation: "geolocation",
79 QWebEnginePage.MediaAudioCapture: "audiocapture.png", 79 QWebEnginePage.MediaAudioCapture: "audiocapture",
80 QWebEnginePage.MediaVideoCapture: "camera.png", 80 QWebEnginePage.MediaVideoCapture: "camera",
81 QWebEnginePage.MediaAudioVideoCapture: "audio-video.png", 81 QWebEnginePage.MediaAudioVideoCapture: "audio-video",
82 QWebEnginePage.MouseLock: "mouse.png", 82 QWebEnginePage.MouseLock: "mouse",
83 } 83 }
84 try: 84 try:
85 # these are defined as of Qt 5.10.0/PyQt 5.10.0 85 # these are defined as of Qt 5.10.0/PyQt 5.10.0
86 self.__permissionFeatureIconNames.update({ 86 self.__permissionFeatureIconNames.update({
87 QWebEnginePage.DesktopVideoCapture: "desktopVideoCapture.png", 87 QWebEnginePage.DesktopVideoCapture: "desktopVideoCapture",
88 QWebEnginePage.DesktopAudioVideoCapture: 88 QWebEnginePage.DesktopAudioVideoCapture:
89 "desktopAudioVideoCapture.png", 89 "desktopAudioVideoCapture",
90 }) 90 })
91 except AttributeError: 91 except AttributeError:
92 pass 92 pass
93 try: 93 try:
94 # this was re-added in Qt 5.13.0 94 # this was re-added in Qt 5.13.0
95 self.__permissionFeatureIconNames[ 95 self.__permissionFeatureIconNames[
96 QWebEnginePage.Notifications] = "notification.png" 96 QWebEnginePage.Notifications] = "notification"
97 except AttributeError: 97 except AttributeError:
98 pass 98 pass
99 99
100 self.setAutoFillBackground(True) 100 self.setAutoFillBackground(True)
101 self.__layout = QHBoxLayout() 101 self.__layout = QHBoxLayout()
108 self.__layout.addStretch() 108 self.__layout.addStretch()
109 self.__rememberButton = QPushButton(self.tr("Remember"), self) 109 self.__rememberButton = QPushButton(self.tr("Remember"), self)
110 self.__rememberButton.setCheckable(True) 110 self.__rememberButton.setCheckable(True)
111 self.__allowButton = QPushButton(self.tr("Allow"), self) 111 self.__allowButton = QPushButton(self.tr("Allow"), self)
112 self.__denyButton = QPushButton(self.tr("Deny"), self) 112 self.__denyButton = QPushButton(self.tr("Deny"), self)
113 self.__discardButton = QPushButton(UI.PixmapCache.getIcon("close.png"), 113 self.__discardButton = QPushButton(UI.PixmapCache.getIcon("close"),
114 "", self) 114 "", self)
115 self.__allowButton.clicked.connect(self.__permissionGranted) 115 self.__allowButton.clicked.connect(self.__permissionGranted)
116 self.__denyButton.clicked.connect(self.__permissionDenied) 116 self.__denyButton.clicked.connect(self.__permissionDenied)
117 self.__discardButton.clicked.connect(self.__permissionUnknown) 117 self.__discardButton.clicked.connect(self.__permissionUnknown)
118 self.__layout.addWidget(self.__rememberButton) 118 self.__layout.addWidget(self.__rememberButton)

eric ide

mercurial