This commit is contained in:
恍兮惚兮 2024-06-23 14:44:07 +08:00
parent c1b364f8b5
commit db92d6e768
17 changed files with 104 additions and 41 deletions

View File

@ -8,9 +8,12 @@ from myutils.githubupdate import updatemethod, getvesionmethod
from gui.usefulwidget import (
D_getsimpleswitch,
D_getsimplecombobox,
getsimplecombobox,
makescrollgrid,
makesubtab_lazy,
)
from gui.setting_display_text import on_not_find_qweb
@threader
def getversion(self):
@ -139,10 +142,29 @@ def createimageview(self):
return lb
def _checkmaybefailed(self, idx):
if idx == 2 and not gobject.testuseqwebengine():
self.seletengeinecombo_1.setCurrentIndex(self.seletengeinecombo_1.lastindex)
on_not_find_qweb(self)
return
self.seletengeinecombo_1.lastindex = self.seletengeinecombo_1.currentIndex()
def _createseletengeinecombo_1(self):
webviews = ["MSHTML", "WebView2", "QWebEngine"]
self.seletengeinecombo_1 = getsimplecombobox(
webviews,
globalconfig,
"usewebview",
callback=functools.partial(_checkmaybefailed, self),
)
self.seletengeinecombo_1.lastindex = self.seletengeinecombo_1.currentIndex()
return self.seletengeinecombo_1
def setTab_aboutlazy(self, basel):
webviews = ["IEFrame", "WebView2"]
if gobject.testuseqwebengine():
webviews.append("QWebEngine")
grid2 = [
[
("自动下载更新(需要连接github)", 5),
@ -162,11 +184,7 @@ def setTab_aboutlazy(self, basel):
[("网页显示", -1)],
[
(
D_getsimplecombobox(
webviews,
globalconfig,
"usewebview",
),
functools.partial(_createseletengeinecombo_1, self),
5,
)
],

View File

@ -1,13 +1,15 @@
from qtsymbols import *
import functools
import functools, platform
import gobject, os
from myutils.config import globalconfig, _TRL, _TR, static_data
from gui.inputdialog import multicolorset
from myutils.wrapper import tryprint
from gui.usefulwidget import (
D_getsimplecombobox,
getsimplecombobox,
Singleton_close,
saveposwindow,
getQMessageBox,
getsimpleswitch,
D_getspinbox,
getspinbox,
@ -187,13 +189,35 @@ def createinternalfontsettings(self, forml, group, _type):
)
def on_not_find_qweb(self):
def _okcallback():
links = [
"https://github.com/HIllya51/RESOURCES/releases/download/softwares/QWebEngine_x86.zip",
"https://github.com/HIllya51/RESOURCES/releases/download/softwares/QWebEngine_x64.zip",
][platform.architecture()[0] == "64bit"]
os.startfile(links)
getQMessageBox(
self,
_TR("错误"),
"未找到QWebEngine点击确定前往下载QWebEngine",
True,
True,
okcallback=_okcallback,
)
def resetgroudswitchcallback(self, group):
clearlayout(self.goodfontsettingsformlayout)
goodfontgroupswitch = FocusCombo()
# if group == "textbrowser" or group == "QWebEngine":
if group == "QWebEngine" and not gobject.testuseqwebengine():
self.seletengeinecombo.setCurrentIndex(self.seletengeinecombo.lastindex)
on_not_find_qweb(self)
return
self.seletengeinecombo.lastindex = self.seletengeinecombo.currentIndex()
if group == "webview" or group == "QWebEngine":
_btn = QPushButton(_TR("额外的html"))
self.goodfontsettingsformlayout.addRow(_btn)
@ -235,16 +259,28 @@ def creategoodfontwid(self):
self, globalconfig["rendertext_using"]
)
def __changeselectablestate(self, x):
gobject.baseobject.translation_ui.refreshtoolicon()
gobject.baseobject.translation_ui.translate_text.textbrowser.setselectable(x)
def _createseletengeinecombo(self):
visengine = ["Qt", "Webview2", "QWebEngine"]
visengine_internal = ["textbrowser", "webview", "QWebEngine"]
self.seletengeinecombo = getsimplecombobox(
visengine,
globalconfig,
"rendertext_using",
internallist=visengine_internal,
callback=functools.partial(resetgroudswitchcallback, self),
)
self.seletengeinecombo.lastindex = self.seletengeinecombo.currentIndex()
return self.seletengeinecombo
def xianshigrid(self):
visengine = ["Webview2", "Qt"]
visengine_internal = ["webview", "textbrowser"]
if gobject.testuseqwebengine():
visengine.append("QWebEngine")
visengine_internal.append("QWebEngine")
textgrid = [
[
(
@ -303,15 +339,7 @@ def xianshigrid(self):
[
("显示引擎_重启生效", 3),
(
D_getsimplecombobox(
visengine,
globalconfig,
"rendertext_using",
internallist=visengine_internal,
callback=functools.partial(
resetgroudswitchcallback, self
),
),
functools.partial(_createseletengeinecombo, self),
6,
),
],
@ -437,7 +465,9 @@ def xianshigrid(self):
D_getsimpleswitch(
globalconfig,
"selectable",
callback=functools.partial(__changeselectablestate,self),
callback=functools.partial(
__changeselectablestate, self
),
parent=self,
name="selectable_btn",
),

View File

@ -809,5 +809,6 @@
"可选取的": "قابل للاختيار",
"投影距离": "المسافة المتوقعة",
"反转颜色": "عكس اللون",
"内嵌": "جزءا لا يتجزأ من"
"内嵌": "جزءا لا يتجزأ من",
"未找到QWebEngine点击确定前往下载QWebEngine": "لم يتم العثور على qwebengine ، انقر فوق موافق لتحميل qwebengine"
}

View File

@ -809,5 +809,6 @@
"可选取的": "可選取的",
"投影距离": "投影距離",
"反转颜色": "反轉顏色",
"内嵌": "內嵌"
"内嵌": "內嵌",
"未找到QWebEngine点击确定前往下载QWebEngine": "未找到QWebEngine點擊確定前往下載QWebEngine"
}

View File

@ -809,5 +809,6 @@
"可选取的": "Selectable",
"投影距离": "Projection distance",
"反转颜色": "invert colors",
"内嵌": "Embedded"
"内嵌": "Embedded",
"未找到QWebEngine点击确定前往下载QWebEngine": "QWebEngine not found, click OK to download QWebEngine"
}

View File

@ -809,5 +809,6 @@
"可选取的": "Seleccionable",
"投影距离": "Distancia de proyección",
"反转颜色": "Invertir color",
"内嵌": "Incrustación"
"内嵌": "Incrustación",
"未找到QWebEngine点击确定前往下载QWebEngine": "No se ha encontrado qwebengine, haga clic en aceptar para descargar qwebengine"
}

View File

@ -809,5 +809,6 @@
"可选取的": "Sélectionnable",
"投影距离": "Distance de projection",
"反转颜色": "Inverser les couleurs",
"内嵌": "Intégré"
"内嵌": "Intégré",
"未找到QWebEngine点击确定前往下载QWebEngine": "Qwebengine n'a pas été trouvé, appuyez sur OK pour aller télécharger qwebengine"
}

View File

@ -809,5 +809,6 @@
"可选取的": "Selezionabile",
"投影距离": "Distanza di proiezione",
"反转颜色": "inverti colori",
"内嵌": "Incorporato"
"内嵌": "Incorporato",
"未找到QWebEngine点击确定前往下载QWebEngine": "QWebEngine non trovato, fare clic su OK per scaricare QWebEngine"
}

View File

@ -809,5 +809,6 @@
"可选取的": "選択可能",
"投影距离": "とうえいきょり",
"反转颜色": "色を反転",
"内嵌": "インライン"
"内嵌": "インライン",
"未找到QWebEngine点击确定前往下载QWebEngine": "QWebEngineが見つかりませんでした。OKをクリックしてQWebEngineをダウンロードしてください"
}

View File

@ -809,5 +809,6 @@
"可选取的": "선택 가능",
"投影距离": "투영 거리",
"反转颜色": "색상 반전",
"内嵌": "내장"
"内嵌": "내장",
"未找到QWebEngine点击确定前往下载QWebEngine": "QWebEngine을 찾을 수 없음, 확인을 클릭하여 QWebEngine 다운로드"
}

View File

@ -809,5 +809,6 @@
"可选取的": "Wybór",
"投影距离": "Odległość projekcji",
"反转颜色": "odwróć kolory",
"内嵌": "Wbudowane"
"内嵌": "Wbudowane",
"未找到QWebEngine点击确定前往下载QWebEngine": "QWebEngine nie znaleziono, kliknij przycisk OK, aby pobrać QWebEngine"
}

View File

@ -809,5 +809,6 @@
"可选取的": "Выбор",
"投影距离": "Расстояние проекции",
"反转颜色": "Инвертировать цвет",
"内嵌": "Встраивание"
"内嵌": "Встраивание",
"未找到QWebEngine点击确定前往下载QWebEngine": "Не найден QWebEngine, нажмите, чтобы определить, чтобы загрузить QWebEngine"
}

View File

@ -809,5 +809,6 @@
"可选取的": "เลือกได้",
"投影距离": "ระยะการฉาย",
"反转颜色": "การย้อนกลับสี",
"内嵌": "อินไลน์"
"内嵌": "อินไลน์",
"未找到QWebEngine点击确定前往下载QWebEngine": "ไม่พบ QWebEngine คลิก OK เพื่อดาวน์โหลด QWebEngine"
}

View File

@ -809,5 +809,6 @@
"可选取的": "Seçilebilir",
"投影距离": "Projeksyon mesafesi",
"反转颜色": "Ters renkler",
"内嵌": "İçeri"
"内嵌": "İçeri",
"未找到QWebEngine点击确定前往下载QWebEngine": "QWebEngine"
}

View File

@ -809,5 +809,6 @@
"可选取的": "Вибраний",
"投影距离": "Відстань проекту",
"反转颜色": "звернути кольори",
"内嵌": "Вбудовано"
"内嵌": "Вбудовано",
"未找到QWebEngine点击确定前往下载QWebEngine": "QWebEngine не знайдено, натисніть кнопку Гаразд, щоб звантажити QWebEngine"
}

View File

@ -809,5 +809,6 @@
"可选取的": "Chọn",
"投影距离": "Khoảng cách chiếu",
"反转颜色": "Đảo ngược màu",
"内嵌": "Nội tuyến"
"内嵌": "Nội tuyến",
"未找到QWebEngine点击确定前往下载QWebEngine": "Không tìm thấy QWebEngine, nhấn OK để tải xuống QWebEngine"
}

View File

@ -809,5 +809,6 @@
"固定值": "",
"投影距离": "",
"反转颜色": "",
"内嵌": ""
"内嵌": "",
"未找到QWebEngine点击确定前往下载QWebEngine": ""
}