Removed web specific actions from context menu

This commit is contained in:
RemixDev 2020-08-22 12:57:29 +02:00
parent c35dfa2223
commit 08903f6195

View file

@ -19,7 +19,6 @@ from deemix.utils.localpaths import getConfigFolder
server_lock = Lock()
class LoginWindow(QDialog):
class CustomPage(QWebEnginePage):
def acceptNavigationRequest(self, url, type, main):
if url.toString() == "https://www.deezer.com/":
@ -32,9 +31,7 @@ class LoginWindow(QDialog):
super().__init__(parent)
self.webview = QWebEngineView()
profile = QWebEngineProfile(self.webview)
profile.clearHttpCache()
profile.setPersistentCookiesPolicy(QWebEngineProfile.NoPersistentCookies)
profile.setHttpCacheType(QWebEngineProfile.NoCache)
self.page = self.CustomPage(profile, self.webview)
self.page.loadFinished.connect(self.checkURL)
self.webview.setPage(self.page)
@ -61,6 +58,11 @@ class MainWindow(QMainWindow):
appLogin_trigger = pyqtSignal()
class MainWebpage(QWebEnginePage):
def __init__(self, parent):
super().__init__(parent)
actions = [0,1,2,3,10,11,12,13,14,31,16,19,25,26,28,30,32]
for a in actions:
self.action(a).setVisible(False)
class ExternalWebpage(QWebEnginePage):
def __init__(self, parent):