mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
direct
This commit is contained in:
parent
c1b364f8b5
commit
db92d6e768
@ -8,9 +8,12 @@ from myutils.githubupdate import updatemethod, getvesionmethod
|
|||||||
from gui.usefulwidget import (
|
from gui.usefulwidget import (
|
||||||
D_getsimpleswitch,
|
D_getsimpleswitch,
|
||||||
D_getsimplecombobox,
|
D_getsimplecombobox,
|
||||||
|
getsimplecombobox,
|
||||||
makescrollgrid,
|
makescrollgrid,
|
||||||
makesubtab_lazy,
|
makesubtab_lazy,
|
||||||
)
|
)
|
||||||
|
from gui.setting_display_text import on_not_find_qweb
|
||||||
|
|
||||||
|
|
||||||
@threader
|
@threader
|
||||||
def getversion(self):
|
def getversion(self):
|
||||||
@ -139,10 +142,29 @@ def createimageview(self):
|
|||||||
return lb
|
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):
|
def setTab_aboutlazy(self, basel):
|
||||||
webviews = ["IEFrame", "WebView2"]
|
|
||||||
if gobject.testuseqwebengine():
|
|
||||||
webviews.append("QWebEngine")
|
|
||||||
grid2 = [
|
grid2 = [
|
||||||
[
|
[
|
||||||
("自动下载更新(需要连接github)", 5),
|
("自动下载更新(需要连接github)", 5),
|
||||||
@ -162,11 +184,7 @@ def setTab_aboutlazy(self, basel):
|
|||||||
[("网页显示", -1)],
|
[("网页显示", -1)],
|
||||||
[
|
[
|
||||||
(
|
(
|
||||||
D_getsimplecombobox(
|
functools.partial(_createseletengeinecombo_1, self),
|
||||||
webviews,
|
|
||||||
globalconfig,
|
|
||||||
"usewebview",
|
|
||||||
),
|
|
||||||
5,
|
5,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
from qtsymbols import *
|
from qtsymbols import *
|
||||||
import functools
|
import functools, platform
|
||||||
import gobject, os
|
import gobject, os
|
||||||
from myutils.config import globalconfig, _TRL, _TR, static_data
|
from myutils.config import globalconfig, _TRL, _TR, static_data
|
||||||
from gui.inputdialog import multicolorset
|
from gui.inputdialog import multicolorset
|
||||||
from myutils.wrapper import tryprint
|
from myutils.wrapper import tryprint
|
||||||
from gui.usefulwidget import (
|
from gui.usefulwidget import (
|
||||||
D_getsimplecombobox,
|
D_getsimplecombobox,
|
||||||
|
getsimplecombobox,
|
||||||
Singleton_close,
|
Singleton_close,
|
||||||
saveposwindow,
|
saveposwindow,
|
||||||
|
getQMessageBox,
|
||||||
getsimpleswitch,
|
getsimpleswitch,
|
||||||
D_getspinbox,
|
D_getspinbox,
|
||||||
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):
|
def resetgroudswitchcallback(self, group):
|
||||||
clearlayout(self.goodfontsettingsformlayout)
|
clearlayout(self.goodfontsettingsformlayout)
|
||||||
|
|
||||||
goodfontgroupswitch = FocusCombo()
|
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":
|
if group == "webview" or group == "QWebEngine":
|
||||||
_btn = QPushButton(_TR("额外的html"))
|
_btn = QPushButton(_TR("额外的html"))
|
||||||
self.goodfontsettingsformlayout.addRow(_btn)
|
self.goodfontsettingsformlayout.addRow(_btn)
|
||||||
@ -235,16 +259,28 @@ def creategoodfontwid(self):
|
|||||||
self, globalconfig["rendertext_using"]
|
self, globalconfig["rendertext_using"]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def __changeselectablestate(self, x):
|
def __changeselectablestate(self, x):
|
||||||
gobject.baseobject.translation_ui.refreshtoolicon()
|
gobject.baseobject.translation_ui.refreshtoolicon()
|
||||||
gobject.baseobject.translation_ui.translate_text.textbrowser.setselectable(x)
|
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):
|
def xianshigrid(self):
|
||||||
visengine = ["Webview2", "Qt"]
|
|
||||||
visengine_internal = ["webview", "textbrowser"]
|
|
||||||
if gobject.testuseqwebengine():
|
|
||||||
visengine.append("QWebEngine")
|
|
||||||
visengine_internal.append("QWebEngine")
|
|
||||||
textgrid = [
|
textgrid = [
|
||||||
[
|
[
|
||||||
(
|
(
|
||||||
@ -303,15 +339,7 @@ def xianshigrid(self):
|
|||||||
[
|
[
|
||||||
("显示引擎_重启生效", 3),
|
("显示引擎_重启生效", 3),
|
||||||
(
|
(
|
||||||
D_getsimplecombobox(
|
functools.partial(_createseletengeinecombo, self),
|
||||||
visengine,
|
|
||||||
globalconfig,
|
|
||||||
"rendertext_using",
|
|
||||||
internallist=visengine_internal,
|
|
||||||
callback=functools.partial(
|
|
||||||
resetgroudswitchcallback, self
|
|
||||||
),
|
|
||||||
),
|
|
||||||
6,
|
6,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -437,7 +465,9 @@ def xianshigrid(self):
|
|||||||
D_getsimpleswitch(
|
D_getsimpleswitch(
|
||||||
globalconfig,
|
globalconfig,
|
||||||
"selectable",
|
"selectable",
|
||||||
callback=functools.partial(__changeselectablestate,self),
|
callback=functools.partial(
|
||||||
|
__changeselectablestate, self
|
||||||
|
),
|
||||||
parent=self,
|
parent=self,
|
||||||
name="selectable_btn",
|
name="selectable_btn",
|
||||||
),
|
),
|
||||||
|
@ -809,5 +809,6 @@
|
|||||||
"可选取的": "قابل للاختيار",
|
"可选取的": "قابل للاختيار",
|
||||||
"投影距离": "المسافة المتوقعة",
|
"投影距离": "المسافة المتوقعة",
|
||||||
"反转颜色": "عكس اللون",
|
"反转颜色": "عكس اللون",
|
||||||
"内嵌": "جزءا لا يتجزأ من"
|
"内嵌": "جزءا لا يتجزأ من",
|
||||||
|
"未找到QWebEngine,点击确定前往下载QWebEngine": "لم يتم العثور على qwebengine ، انقر فوق موافق لتحميل qwebengine"
|
||||||
}
|
}
|
@ -809,5 +809,6 @@
|
|||||||
"可选取的": "可選取的",
|
"可选取的": "可選取的",
|
||||||
"投影距离": "投影距離",
|
"投影距离": "投影距離",
|
||||||
"反转颜色": "反轉顏色",
|
"反转颜色": "反轉顏色",
|
||||||
"内嵌": "內嵌"
|
"内嵌": "內嵌",
|
||||||
|
"未找到QWebEngine,点击确定前往下载QWebEngine": "未找到QWebEngine,點擊確定前往下載QWebEngine"
|
||||||
}
|
}
|
@ -809,5 +809,6 @@
|
|||||||
"可选取的": "Selectable",
|
"可选取的": "Selectable",
|
||||||
"投影距离": "Projection distance",
|
"投影距离": "Projection distance",
|
||||||
"反转颜色": "invert colors",
|
"反转颜色": "invert colors",
|
||||||
"内嵌": "Embedded"
|
"内嵌": "Embedded",
|
||||||
|
"未找到QWebEngine,点击确定前往下载QWebEngine": "QWebEngine not found, click OK to download QWebEngine"
|
||||||
}
|
}
|
@ -809,5 +809,6 @@
|
|||||||
"可选取的": "Seleccionable",
|
"可选取的": "Seleccionable",
|
||||||
"投影距离": "Distancia de proyección",
|
"投影距离": "Distancia de proyección",
|
||||||
"反转颜色": "Invertir color",
|
"反转颜色": "Invertir color",
|
||||||
"内嵌": "Incrustación"
|
"内嵌": "Incrustación",
|
||||||
|
"未找到QWebEngine,点击确定前往下载QWebEngine": "No se ha encontrado qwebengine, haga clic en aceptar para descargar qwebengine"
|
||||||
}
|
}
|
@ -809,5 +809,6 @@
|
|||||||
"可选取的": "Sélectionnable",
|
"可选取的": "Sélectionnable",
|
||||||
"投影距离": "Distance de projection",
|
"投影距离": "Distance de projection",
|
||||||
"反转颜色": "Inverser les couleurs",
|
"反转颜色": "Inverser les couleurs",
|
||||||
"内嵌": "Intégré"
|
"内嵌": "Intégré",
|
||||||
|
"未找到QWebEngine,点击确定前往下载QWebEngine": "Qwebengine n'a pas été trouvé, appuyez sur OK pour aller télécharger qwebengine"
|
||||||
}
|
}
|
@ -809,5 +809,6 @@
|
|||||||
"可选取的": "Selezionabile",
|
"可选取的": "Selezionabile",
|
||||||
"投影距离": "Distanza di proiezione",
|
"投影距离": "Distanza di proiezione",
|
||||||
"反转颜色": "inverti colori",
|
"反转颜色": "inverti colori",
|
||||||
"内嵌": "Incorporato"
|
"内嵌": "Incorporato",
|
||||||
|
"未找到QWebEngine,点击确定前往下载QWebEngine": "QWebEngine non trovato, fare clic su OK per scaricare QWebEngine"
|
||||||
}
|
}
|
@ -809,5 +809,6 @@
|
|||||||
"可选取的": "選択可能",
|
"可选取的": "選択可能",
|
||||||
"投影距离": "とうえいきょり",
|
"投影距离": "とうえいきょり",
|
||||||
"反转颜色": "色を反転",
|
"反转颜色": "色を反転",
|
||||||
"内嵌": "インライン"
|
"内嵌": "インライン",
|
||||||
|
"未找到QWebEngine,点击确定前往下载QWebEngine": "QWebEngineが見つかりませんでした。OKをクリックしてQWebEngineをダウンロードしてください"
|
||||||
}
|
}
|
@ -809,5 +809,6 @@
|
|||||||
"可选取的": "선택 가능",
|
"可选取的": "선택 가능",
|
||||||
"投影距离": "투영 거리",
|
"投影距离": "투영 거리",
|
||||||
"反转颜色": "색상 반전",
|
"反转颜色": "색상 반전",
|
||||||
"内嵌": "내장"
|
"内嵌": "내장",
|
||||||
|
"未找到QWebEngine,点击确定前往下载QWebEngine": "QWebEngine을 찾을 수 없음, 확인을 클릭하여 QWebEngine 다운로드"
|
||||||
}
|
}
|
@ -809,5 +809,6 @@
|
|||||||
"可选取的": "Wybór",
|
"可选取的": "Wybór",
|
||||||
"投影距离": "Odległość projekcji",
|
"投影距离": "Odległość projekcji",
|
||||||
"反转颜色": "odwróć kolory",
|
"反转颜色": "odwróć kolory",
|
||||||
"内嵌": "Wbudowane"
|
"内嵌": "Wbudowane",
|
||||||
|
"未找到QWebEngine,点击确定前往下载QWebEngine": "QWebEngine nie znaleziono, kliknij przycisk OK, aby pobrać QWebEngine"
|
||||||
}
|
}
|
@ -809,5 +809,6 @@
|
|||||||
"可选取的": "Выбор",
|
"可选取的": "Выбор",
|
||||||
"投影距离": "Расстояние проекции",
|
"投影距离": "Расстояние проекции",
|
||||||
"反转颜色": "Инвертировать цвет",
|
"反转颜色": "Инвертировать цвет",
|
||||||
"内嵌": "Встраивание"
|
"内嵌": "Встраивание",
|
||||||
|
"未找到QWebEngine,点击确定前往下载QWebEngine": "Не найден QWebEngine, нажмите, чтобы определить, чтобы загрузить QWebEngine"
|
||||||
}
|
}
|
@ -809,5 +809,6 @@
|
|||||||
"可选取的": "เลือกได้",
|
"可选取的": "เลือกได้",
|
||||||
"投影距离": "ระยะการฉาย",
|
"投影距离": "ระยะการฉาย",
|
||||||
"反转颜色": "การย้อนกลับสี",
|
"反转颜色": "การย้อนกลับสี",
|
||||||
"内嵌": "อินไลน์"
|
"内嵌": "อินไลน์",
|
||||||
|
"未找到QWebEngine,点击确定前往下载QWebEngine": "ไม่พบ QWebEngine คลิก OK เพื่อดาวน์โหลด QWebEngine"
|
||||||
}
|
}
|
@ -809,5 +809,6 @@
|
|||||||
"可选取的": "Seçilebilir",
|
"可选取的": "Seçilebilir",
|
||||||
"投影距离": "Projeksyon mesafesi",
|
"投影距离": "Projeksyon mesafesi",
|
||||||
"反转颜色": "Ters renkler",
|
"反转颜色": "Ters renkler",
|
||||||
"内嵌": "İçeri"
|
"内嵌": "İçeri",
|
||||||
|
"未找到QWebEngine,点击确定前往下载QWebEngine": "QWebEngine"
|
||||||
}
|
}
|
@ -809,5 +809,6 @@
|
|||||||
"可选取的": "Вибраний",
|
"可选取的": "Вибраний",
|
||||||
"投影距离": "Відстань проекту",
|
"投影距离": "Відстань проекту",
|
||||||
"反转颜色": "звернути кольори",
|
"反转颜色": "звернути кольори",
|
||||||
"内嵌": "Вбудовано"
|
"内嵌": "Вбудовано",
|
||||||
|
"未找到QWebEngine,点击确定前往下载QWebEngine": "QWebEngine не знайдено, натисніть кнопку Гаразд, щоб звантажити QWebEngine"
|
||||||
}
|
}
|
@ -809,5 +809,6 @@
|
|||||||
"可选取的": "Chọn",
|
"可选取的": "Chọn",
|
||||||
"投影距离": "Khoảng cách chiếu",
|
"投影距离": "Khoảng cách chiếu",
|
||||||
"反转颜色": "Đảo ngược mà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"
|
||||||
}
|
}
|
@ -809,5 +809,6 @@
|
|||||||
"固定值": "",
|
"固定值": "",
|
||||||
"投影距离": "",
|
"投影距离": "",
|
||||||
"反转颜色": "",
|
"反转颜色": "",
|
||||||
"内嵌": ""
|
"内嵌": "",
|
||||||
|
"未找到QWebEngine,点击确定前往下载QWebEngine": ""
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user