mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
More stupid PyQt enums
This commit is contained in:
parent
8a380d3496
commit
2bb1f38fd6
@ -12,7 +12,7 @@ from PyQt5.Qt import (
|
|||||||
QApplication, QByteArray, QHBoxLayout, QIcon, QLabel, QMenu, QSize, QSizePolicy,
|
QApplication, QByteArray, QHBoxLayout, QIcon, QLabel, QMenu, QSize, QSizePolicy,
|
||||||
QStackedLayout, Qt, QTimer, QToolBar, QUrl, QVBoxLayout, QWidget, pyqtSignal
|
QStackedLayout, Qt, QTimer, QToolBar, QUrl, QVBoxLayout, QWidget, pyqtSignal
|
||||||
)
|
)
|
||||||
from PyQt5.QtWebEngineCore import QWebEngineUrlSchemeHandler, QWebEngineUrlRequestJob
|
from PyQt5.QtWebEngineCore import QWebEngineUrlSchemeHandler, QWebEngineUrlRequestJob, QWebEngineUrlRequestInfo
|
||||||
from PyQt5.QtWebEngineWidgets import (
|
from PyQt5.QtWebEngineWidgets import (
|
||||||
QWebEnginePage, QWebEngineProfile, QWebEngineScript, QWebEngineView, QWebEngineSettings
|
QWebEnginePage, QWebEngineProfile, QWebEngineScript, QWebEngineView, QWebEngineSettings
|
||||||
)
|
)
|
||||||
@ -316,7 +316,7 @@ class WebPage(QWebEnginePage):
|
|||||||
prints('%s:%s: %s' % (source_id, linenumber, msg))
|
prints('%s:%s: %s' % (source_id, linenumber, msg))
|
||||||
|
|
||||||
def acceptNavigationRequest(self, url, req_type, is_main_frame):
|
def acceptNavigationRequest(self, url, req_type, is_main_frame):
|
||||||
if req_type == self.NavigationTypeReload:
|
if req_type == QWebEngineUrlRequestInfo.NavigationType.NavigationTypeReload:
|
||||||
return True
|
return True
|
||||||
if url.scheme() in (FAKE_PROTOCOL, 'data'):
|
if url.scheme() in (FAKE_PROTOCOL, 'data'):
|
||||||
return True
|
return True
|
||||||
|
@ -11,7 +11,7 @@ from PyQt5.Qt import (
|
|||||||
QT_VERSION, QApplication, QBuffer, QByteArray, QFontDatabase, QFontInfo, QPalette, QEvent,
|
QT_VERSION, QApplication, QBuffer, QByteArray, QFontDatabase, QFontInfo, QPalette, QEvent,
|
||||||
QHBoxLayout, QMimeData, QSize, Qt, QTimer, QUrl, QWidget, pyqtSignal, QIODevice, QLocale
|
QHBoxLayout, QMimeData, QSize, Qt, QTimer, QUrl, QWidget, pyqtSignal, QIODevice, QLocale
|
||||||
)
|
)
|
||||||
from PyQt5.QtWebEngineCore import QWebEngineUrlSchemeHandler, QWebEngineUrlRequestJob
|
from PyQt5.QtWebEngineCore import QWebEngineUrlSchemeHandler, QWebEngineUrlRequestJob, QWebEngineUrlRequestInfo
|
||||||
from PyQt5.QtWebEngineWidgets import (
|
from PyQt5.QtWebEngineWidgets import (
|
||||||
QWebEnginePage, QWebEngineProfile, QWebEngineScript, QWebEngineView, QWebEngineSettings
|
QWebEnginePage, QWebEngineProfile, QWebEngineScript, QWebEngineView, QWebEngineSettings
|
||||||
)
|
)
|
||||||
@ -366,9 +366,9 @@ class WebPage(QWebEnginePage):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def acceptNavigationRequest(self, url, req_type, is_main_frame):
|
def acceptNavigationRequest(self, url, req_type, is_main_frame):
|
||||||
if req_type == self.NavigationTypeReload:
|
if req_type == QWebEngineUrlRequestInfo.NavigationType.NavigationTypeReload:
|
||||||
return True
|
return True
|
||||||
if req_type == self.NavigationTypeBackForward:
|
if req_type == QWebEngineUrlRequestInfo.NavigationType.NavigationTypeBackForward:
|
||||||
return True
|
return True
|
||||||
if url.scheme() in (FAKE_PROTOCOL, 'data'):
|
if url.scheme() in (FAKE_PROTOCOL, 'data'):
|
||||||
return True
|
return True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user