From c4ce5ac888d3477da8a9bc2b7cee5bb8e650d311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:04:59 +0800 Subject: [PATCH] fix --- LunaTranslator/LunaTranslator/gui/dialog_savedgame.py | 10 ++++++---- LunaTranslator/requirements.txt | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py index df2d7d9c..0a4933a7 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py @@ -292,7 +292,7 @@ class browserdialog(QDialog): if self.webviewv == 0: self.browser = winsharedutils.HTMLBrowser(int(self.winId())) elif self.webviewv == 1: - from webviewpy import Webview, declare_library_path + from webviewpy import Webview, declare_library_path, webview_exception declare_library_path( os.path.abspath( @@ -303,9 +303,11 @@ class browserdialog(QDialog): ) ) ) - self.browser = Webview( - False, int(self.winId()) - ) # 构造函数里会触发ResizeEvent。虽然确实有问题,但很奇怪前一天晚上正常,第二天起来就崩溃了。 + try: + self.browser = Webview(False, int(self.winId())) + except webview_exception: + self.browser = winsharedutils.HTMLBrowser(int(self.winId())) + self.webviewv == 0 self.setWindowTitle(savehook_new_data[self.exepath]["title"]) self.nettab = QTabWidget(self) self.nettab.setFixedHeight(self.nettab.tabBar().height()) diff --git a/LunaTranslator/requirements.txt b/LunaTranslator/requirements.txt index 8ab8d6d6..ff2a5314 100644 --- a/LunaTranslator/requirements.txt +++ b/LunaTranslator/requirements.txt @@ -1,6 +1,6 @@ PyQt5==5.15.10 PyQt5-Qt5==5.15.2 -webviewpy==1.0.1 +webviewpy==1.0.2 nuitka==2.0.5 imageio pefile \ No newline at end of file