mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
update
This commit is contained in:
parent
278a8a944d
commit
1091508dab
@ -3,6 +3,7 @@ import os, threading
|
|||||||
from traceback import print_exc
|
from traceback import print_exc
|
||||||
from myutils.config import (
|
from myutils.config import (
|
||||||
globalconfig,
|
globalconfig,
|
||||||
|
_TR,
|
||||||
savehook_new_list,
|
savehook_new_list,
|
||||||
savehook_new_data,
|
savehook_new_data,
|
||||||
setlanguage,
|
setlanguage,
|
||||||
@ -18,7 +19,7 @@ from myutils.utils import (
|
|||||||
getpostfile,
|
getpostfile,
|
||||||
stringfyerror,
|
stringfyerror,
|
||||||
)
|
)
|
||||||
from PyQt5.QtWidgets import QApplication
|
from PyQt5.QtWidgets import QApplication, QMenu, QAction, QFrame
|
||||||
from PyQt5.QtCore import Qt, QObject, QEvent
|
from PyQt5.QtCore import Qt, QObject, QEvent
|
||||||
from myutils.wrapper import threader
|
from myutils.wrapper import threader
|
||||||
from gui.showword import searchwordW
|
from gui.showword import searchwordW
|
||||||
@ -32,7 +33,7 @@ from gui.languageset import languageset
|
|||||||
import zhconv, functools
|
import zhconv, functools
|
||||||
import gui.transhist
|
import gui.transhist
|
||||||
import gui.edittext
|
import gui.edittext
|
||||||
import importlib
|
import importlib, qtawesome
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from gui.settin import Settin
|
from gui.settin import Settin
|
||||||
from gui.showocrimage import showocrimage
|
from gui.showocrimage import showocrimage
|
||||||
@ -40,7 +41,7 @@ from gui.attachprocessdialog import AttachProcessDialog
|
|||||||
import windows
|
import windows
|
||||||
import gobject
|
import gobject
|
||||||
import winsharedutils
|
import winsharedutils
|
||||||
from winsharedutils import pid_running
|
from winsharedutils import pid_running, isDark
|
||||||
from myutils.post import POSTSOLVE
|
from myutils.post import POSTSOLVE
|
||||||
|
|
||||||
|
|
||||||
@ -108,7 +109,7 @@ class MAINUI:
|
|||||||
context = None
|
context = None
|
||||||
try:
|
try:
|
||||||
if method["object"].using:
|
if method["object"].using:
|
||||||
if 'process_before' in dir(method["object"]):
|
if "process_before" in dir(method["object"]):
|
||||||
content, context = method["object"].process_before(content)
|
content, context = method["object"].process_before(content)
|
||||||
except:
|
except:
|
||||||
print_exc()
|
print_exc()
|
||||||
@ -121,7 +122,7 @@ class MAINUI:
|
|||||||
context = mp[i]
|
context = mp[i]
|
||||||
try:
|
try:
|
||||||
if method["object"].using:
|
if method["object"].using:
|
||||||
if 'process_after' in dir(method["object"]):
|
if "process_after" in dir(method["object"]):
|
||||||
res = method["object"].process_after(res, context)
|
res = method["object"].process_after(res, context)
|
||||||
except:
|
except:
|
||||||
print_exc()
|
print_exc()
|
||||||
@ -720,6 +721,13 @@ class MAINUI:
|
|||||||
|
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
|
|
||||||
|
def setdarktheme(self, widget, dark):
|
||||||
|
if widget.testAttribute(Qt.WA_TranslucentBackground):
|
||||||
|
return
|
||||||
|
winsharedutils.SetTheme(
|
||||||
|
int(widget.winId()), dark, globalconfig["WindowBackdrop"]
|
||||||
|
)
|
||||||
|
|
||||||
def aa(self):
|
def aa(self):
|
||||||
class WindowEventFilter(QObject):
|
class WindowEventFilter(QObject):
|
||||||
def eventFilter(_, obj, event):
|
def eventFilter(_, obj, event):
|
||||||
@ -727,18 +735,12 @@ class MAINUI:
|
|||||||
|
|
||||||
hwnd = obj.winId()
|
hwnd = obj.winId()
|
||||||
if hwnd: # window create/destroy,when destroy winId is None
|
if hwnd: # window create/destroy,when destroy winId is None
|
||||||
if (
|
if self.currentisdark is not None:
|
||||||
self.currentisdark is not None
|
self.setdarktheme(obj, self.currentisdark)
|
||||||
and obj.testAttribute(Qt.WA_TranslucentBackground) == False
|
|
||||||
):
|
|
||||||
winsharedutils.SetTheme(
|
|
||||||
int(obj.winId()),
|
|
||||||
self.currentisdark,
|
|
||||||
globalconfig["WindowBackdrop"],
|
|
||||||
)
|
|
||||||
windows.SetProp(
|
windows.SetProp(
|
||||||
int(obj.winId()), "Magpie.ToolWindow", windows.HANDLE(1)
|
int(obj.winId()), "Magpie.ToolWindow", windows.HANDLE(1)
|
||||||
)
|
)
|
||||||
|
self.setshowintab_checked(obj)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
self.currentisdark = None
|
self.currentisdark = None
|
||||||
@ -789,14 +791,101 @@ class MAINUI:
|
|||||||
except:
|
except:
|
||||||
print_exc()
|
print_exc()
|
||||||
|
|
||||||
def mainuiloadafter(self):
|
def setshowintab_checked(self, widget):
|
||||||
|
if widget == self.translation_ui:
|
||||||
|
winsharedutils.showintab(int(widget.winId()), globalconfig["showintab"])
|
||||||
|
return
|
||||||
|
window_flags = widget.windowFlags()
|
||||||
|
if Qt.FramelessWindowHint & window_flags == Qt.FramelessWindowHint:
|
||||||
|
return
|
||||||
|
if isinstance(widget, QMenu):
|
||||||
|
return
|
||||||
|
if isinstance(widget, QFrame):
|
||||||
|
return
|
||||||
|
winsharedutils.showintab(int(widget.winId()), globalconfig["showintab_sub"])
|
||||||
|
|
||||||
|
def inittray(self):
|
||||||
|
|
||||||
|
trayMenu = QMenu(self.settin_ui)
|
||||||
|
showAction = QAction(
|
||||||
|
_TR("&显示"),
|
||||||
|
trayMenu,
|
||||||
|
triggered=self.translation_ui.show_,
|
||||||
|
)
|
||||||
|
settingAction = QAction(
|
||||||
|
qtawesome.icon("fa.gear"),
|
||||||
|
_TR("&设置"),
|
||||||
|
trayMenu,
|
||||||
|
triggered=lambda: self.settin_ui.showsignal.emit(),
|
||||||
|
)
|
||||||
|
quitAction = QAction(
|
||||||
|
qtawesome.icon("fa.times"),
|
||||||
|
_TR("&退出"),
|
||||||
|
trayMenu,
|
||||||
|
triggered=self.translation_ui.close,
|
||||||
|
)
|
||||||
|
trayMenu.addAction(showAction)
|
||||||
|
trayMenu.addAction(settingAction)
|
||||||
|
trayMenu.addSeparator()
|
||||||
|
trayMenu.addAction(quitAction)
|
||||||
|
self.translation_ui.tray.setContextMenu(trayMenu)
|
||||||
|
|
||||||
|
def setshowintab(self):
|
||||||
|
for widget in QApplication.topLevelWidgets():
|
||||||
|
self.setshowintab_checked(widget)
|
||||||
|
|
||||||
|
def setcommonstylesheet(self):
|
||||||
|
|
||||||
|
dl = globalconfig["darklight"]
|
||||||
|
if dl == 0:
|
||||||
|
dark = False
|
||||||
|
elif dl == 1:
|
||||||
|
dark = True
|
||||||
|
elif dl == 2:
|
||||||
|
dark = isDark()
|
||||||
|
darklight = ["light", "dark"][dark]
|
||||||
|
|
||||||
|
self.currentisdark = dark
|
||||||
|
|
||||||
|
for widget in QApplication.topLevelWidgets():
|
||||||
|
self.setdarktheme(widget, dark)
|
||||||
|
style = ""
|
||||||
|
for _ in (0,):
|
||||||
|
try:
|
||||||
|
idx = globalconfig[darklight + "theme"] - int(not dark)
|
||||||
|
if idx == -1:
|
||||||
|
break
|
||||||
|
_fn = static_data["themes"][darklight][idx]["file"]
|
||||||
|
|
||||||
|
if _fn.endswith(".py"):
|
||||||
|
style = importlib.import_module(
|
||||||
|
"files.themes." + _fn[:-3]
|
||||||
|
).stylesheet()
|
||||||
|
elif _fn.endswith(".qss"):
|
||||||
|
with open(
|
||||||
|
"./files/themes/{}".format(_fn),
|
||||||
|
"r",
|
||||||
|
) as ff:
|
||||||
|
style = ff.read()
|
||||||
|
except:
|
||||||
|
print_exc()
|
||||||
|
style += (
|
||||||
|
"*{font: %spt '" % (globalconfig["settingfontsize"])
|
||||||
|
+ (globalconfig["settingfonttype"])
|
||||||
|
+ "' ; }"
|
||||||
|
)
|
||||||
|
self.settin_ui.setStyleSheet(style)
|
||||||
|
|
||||||
|
def mainuiloadafter(self):
|
||||||
|
self.setshowintab()
|
||||||
self.safeloadprocessmodels()
|
self.safeloadprocessmodels()
|
||||||
self.prepare()
|
self.prepare()
|
||||||
self.startxiaoxueguan()
|
self.startxiaoxueguan()
|
||||||
self.starthira()
|
self.starthira()
|
||||||
self.startoutputer()
|
self.startoutputer()
|
||||||
self.settin_ui = Settin(self.translation_ui)
|
self.settin_ui = Settin(self.translation_ui)
|
||||||
|
self.inittray()
|
||||||
|
self.setcommonstylesheet()
|
||||||
self.transhis = gui.transhist.transhist(self.settin_ui)
|
self.transhis = gui.transhist.transhist(self.settin_ui)
|
||||||
self.startreader()
|
self.startreader()
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from PyQt5.QtWidgets import QPushButton, QVBoxLayout, QFileDialog
|
from PyQt5.QtWidgets import QPushButton, QFileDialog
|
||||||
from PyQt5.QtWidgets import QHBoxLayout, QVBoxLayout, QTextEdit, QWidget
|
from PyQt5.QtWidgets import QHBoxLayout, QVBoxLayout, QTextEdit, QWidget
|
||||||
|
|
||||||
from PyQt5.QtGui import QTextCursor
|
from PyQt5.QtGui import QTextCursor
|
||||||
@ -6,7 +6,6 @@ from PyQt5.QtCore import Qt
|
|||||||
from myutils.config import _TR, globalconfig
|
from myutils.config import _TR, globalconfig
|
||||||
from gui.usefulwidget import saveposwindow
|
from gui.usefulwidget import saveposwindow
|
||||||
from myutils.wrapper import Singleton_close
|
from myutils.wrapper import Singleton_close
|
||||||
from winsharedutils import showintab
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
@ -32,8 +31,6 @@ class dialog_memory(saveposwindow):
|
|||||||
key="memorydialoggeo",
|
key="memorydialoggeo",
|
||||||
)
|
)
|
||||||
self.setWindowTitle(_TR("备忘录"))
|
self.setWindowTitle(_TR("备忘录"))
|
||||||
if globalconfig["showintab_sub"]:
|
|
||||||
showintab(int(self.winId()), True)
|
|
||||||
self.gamemd5 = gamemd5
|
self.gamemd5 = gamemd5
|
||||||
formLayout = QVBoxLayout() #
|
formLayout = QVBoxLayout() #
|
||||||
self.showtext = QTextEdit()
|
self.showtext = QTextEdit()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import functools, time
|
import time
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from gui.specialwidget import ScrollFlow, chartwidget, lazyscrollflow
|
from gui.specialwidget import ScrollFlow, chartwidget, lazyscrollflow
|
||||||
from PyQt5.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
@ -10,20 +10,11 @@ from PyQt5.QtWidgets import (
|
|||||||
QLineEdit,
|
QLineEdit,
|
||||||
QComboBox,
|
QComboBox,
|
||||||
QFormLayout,
|
QFormLayout,
|
||||||
)
|
|
||||||
import functools, threading
|
|
||||||
from traceback import print_exc
|
|
||||||
from PyQt5.QtWidgets import (
|
|
||||||
QHBoxLayout,
|
QHBoxLayout,
|
||||||
QTableView,
|
QTableView,
|
||||||
QAbstractItemView,
|
QAbstractItemView,
|
||||||
QLabel,
|
QLabel,
|
||||||
QTabWidget,
|
QTabWidget,
|
||||||
)
|
|
||||||
import windows
|
|
||||||
from PyQt5.QtCore import QRect, QSize, Qt, pyqtSignal, QObject
|
|
||||||
import os
|
|
||||||
from PyQt5.QtWidgets import (
|
|
||||||
QApplication,
|
QApplication,
|
||||||
QSizePolicy,
|
QSizePolicy,
|
||||||
QWidget,
|
QWidget,
|
||||||
@ -31,6 +22,11 @@ from PyQt5.QtWidgets import (
|
|||||||
QAction,
|
QAction,
|
||||||
QTabBar,
|
QTabBar,
|
||||||
)
|
)
|
||||||
|
import functools, threading
|
||||||
|
from traceback import print_exc
|
||||||
|
import windows
|
||||||
|
from PyQt5.QtCore import QRect, QSize, Qt, pyqtSignal, QObject
|
||||||
|
import os
|
||||||
from PyQt5.QtGui import (
|
from PyQt5.QtGui import (
|
||||||
QCloseEvent,
|
QCloseEvent,
|
||||||
QIntValidator,
|
QIntValidator,
|
||||||
@ -38,8 +34,9 @@ from PyQt5.QtGui import (
|
|||||||
QPixmap,
|
QPixmap,
|
||||||
QPainter,
|
QPainter,
|
||||||
QPen,
|
QPen,
|
||||||
|
QStandardItem,
|
||||||
|
QStandardItemModel,
|
||||||
)
|
)
|
||||||
from PyQt5.QtCore import Qt
|
|
||||||
from gui.usefulwidget import (
|
from gui.usefulwidget import (
|
||||||
getsimplecombobox,
|
getsimplecombobox,
|
||||||
getspinbox,
|
getspinbox,
|
||||||
@ -48,11 +45,7 @@ from gui.usefulwidget import (
|
|||||||
getspinbox,
|
getspinbox,
|
||||||
selectcolor,
|
selectcolor,
|
||||||
)
|
)
|
||||||
from PyQt5.QtCore import QRect, QSize, Qt, pyqtSignal
|
|
||||||
import os
|
import os
|
||||||
from winsharedutils import showintab
|
|
||||||
from PyQt5.QtGui import QStandardItem, QStandardItemModel
|
|
||||||
from PyQt5.QtCore import Qt, QSize
|
|
||||||
from myutils.config import savehook_new_list, savehook_new_data, vndbtagdata
|
from myutils.config import savehook_new_list, savehook_new_data, vndbtagdata
|
||||||
from myutils.hwnd import getExeIcon
|
from myutils.hwnd import getExeIcon
|
||||||
import gobject
|
import gobject
|
||||||
@ -1462,6 +1455,7 @@ class dialog_savedgame_new(saveposwindow):
|
|||||||
if path.lower().endswith(".exe") == False:
|
if path.lower().endswith(".exe") == False:
|
||||||
continue
|
continue
|
||||||
if path not in savehook_new_list:
|
if path not in savehook_new_list:
|
||||||
|
checkifnewgame(path)
|
||||||
self.newline(path, True)
|
self.newline(path, True)
|
||||||
|
|
||||||
def clicked3(self):
|
def clicked3(self):
|
||||||
@ -1472,6 +1466,7 @@ class dialog_savedgame_new(saveposwindow):
|
|||||||
if res != "":
|
if res != "":
|
||||||
res = res.replace("/", "\\")
|
res = res.replace("/", "\\")
|
||||||
if res not in savehook_new_list:
|
if res not in savehook_new_list:
|
||||||
|
checkifnewgame(res)
|
||||||
self.newline(res, True)
|
self.newline(res, True)
|
||||||
|
|
||||||
def tagschanged(self, tags):
|
def tagschanged(self, tags):
|
||||||
@ -1568,8 +1563,6 @@ class dialog_savedgame_new(saveposwindow):
|
|||||||
global _global_dialog_savedgame_new
|
global _global_dialog_savedgame_new
|
||||||
_global_dialog_savedgame_new = self
|
_global_dialog_savedgame_new = self
|
||||||
self.setWindowTitle(_TR("游戏管理"))
|
self.setWindowTitle(_TR("游戏管理"))
|
||||||
if globalconfig["showintab_sub"]:
|
|
||||||
showintab(int(self.winId()), True)
|
|
||||||
formLayout = QVBoxLayout()
|
formLayout = QVBoxLayout()
|
||||||
|
|
||||||
layout = QHBoxLayout()
|
layout = QHBoxLayout()
|
||||||
@ -1728,7 +1721,6 @@ class dialog_savedgame_new(saveposwindow):
|
|||||||
return gameitem
|
return gameitem
|
||||||
|
|
||||||
def newline(self, k, first=False):
|
def newline(self, k, first=False):
|
||||||
checkifnewgame(k)
|
|
||||||
|
|
||||||
itemw = globalconfig["dialog_savegame_layout"]["itemw"]
|
itemw = globalconfig["dialog_savegame_layout"]["itemw"]
|
||||||
itemh = globalconfig["dialog_savegame_layout"]["itemh"]
|
itemh = globalconfig["dialog_savegame_layout"]["itemh"]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from PyQt5.QtCore import Qt
|
from PyQt5.QtGui import QCursor
|
||||||
from PyQt5.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
QPlainTextEdit,
|
QPlainTextEdit,
|
||||||
QAction,
|
QAction,
|
||||||
@ -90,7 +90,7 @@ class edittext(closeashidewindow):
|
|||||||
menu = QMenu(self.textOutput)
|
menu = QMenu(self.textOutput)
|
||||||
qingkong = QAction(_TR("清空"))
|
qingkong = QAction(_TR("清空"))
|
||||||
menu.addAction(qingkong)
|
menu.addAction(qingkong)
|
||||||
action = menu.exec(self.mapToGlobal(self.textOutput.pos()) + point)
|
action = menu.exec(QCursor.pos())
|
||||||
if action == qingkong:
|
if action == qingkong:
|
||||||
self.textOutput.clear()
|
self.textOutput.clear()
|
||||||
|
|
||||||
|
@ -1,16 +1,12 @@
|
|||||||
from PyQt5.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
QMenu,
|
QMenu,
|
||||||
QApplication,
|
|
||||||
QMainWindow,
|
QMainWindow,
|
||||||
QLabel,
|
QLabel,
|
||||||
QAction,
|
QAction,
|
||||||
QDialog,
|
|
||||||
QDesktopWidget,
|
|
||||||
)
|
)
|
||||||
from PyQt5.QtGui import QPainter, QPen, QColor, QResizeEvent
|
from PyQt5.QtGui import QPainter, QPen, QColor, QCursor
|
||||||
from PyQt5.QtCore import Qt, QPoint, QRect, QEvent
|
from PyQt5.QtCore import Qt, QPoint, QRect
|
||||||
from myutils.config import _TR
|
from myutils.config import _TR
|
||||||
import gobject
|
|
||||||
from myutils.config import globalconfig
|
from myutils.config import globalconfig
|
||||||
from gui.resizeablemainwindow import Mainw
|
from gui.resizeablemainwindow import Mainw
|
||||||
import windows, winsharedutils
|
import windows, winsharedutils
|
||||||
@ -38,7 +34,7 @@ class rangeadjust(Mainw):
|
|||||||
menu = QMenu(self)
|
menu = QMenu(self)
|
||||||
close = QAction(_TR("关闭"))
|
close = QAction(_TR("关闭"))
|
||||||
menu.addAction(close)
|
menu.addAction(close)
|
||||||
action = menu.exec(self.mapToGlobal(p))
|
action = menu.exec(QCursor.pos())
|
||||||
if action == close:
|
if action == close:
|
||||||
self._rect = None
|
self._rect = None
|
||||||
self.close()
|
self.close()
|
||||||
|
@ -716,6 +716,9 @@ class hookselect(closeashidewindow):
|
|||||||
self.changeprocessclear()
|
self.changeprocessclear()
|
||||||
|
|
||||||
def showmenu(self, p: QPoint):
|
def showmenu(self, p: QPoint):
|
||||||
|
r = self.tttable.currentIndex().row()
|
||||||
|
if r < 0:
|
||||||
|
return
|
||||||
menu = QMenu(self.tttable)
|
menu = QMenu(self.tttable)
|
||||||
remove = QAction(_TR("移除"))
|
remove = QAction(_TR("移除"))
|
||||||
copy = QAction(_TR("复制特殊码"))
|
copy = QAction(_TR("复制特殊码"))
|
||||||
@ -723,9 +726,6 @@ class hookselect(closeashidewindow):
|
|||||||
menu.addAction(copy)
|
menu.addAction(copy)
|
||||||
action = menu.exec(self.tttable.cursor().pos())
|
action = menu.exec(self.tttable.cursor().pos())
|
||||||
|
|
||||||
r = self.tttable.currentIndex().row()
|
|
||||||
if r < 0:
|
|
||||||
return
|
|
||||||
hc, hn, tp = self.save[r]
|
hc, hn, tp = self.save[r]
|
||||||
if action == remove:
|
if action == remove:
|
||||||
pid = tp.processId
|
pid = tp.processId
|
||||||
|
@ -1,26 +1,18 @@
|
|||||||
from PyQt5.QtCore import pyqtSignal, Qt, QSize, QObject, QEvent
|
from PyQt5.QtCore import pyqtSignal, Qt, QSize
|
||||||
from PyQt5.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
QLabel,
|
|
||||||
QScrollArea,
|
|
||||||
QWidget,
|
QWidget,
|
||||||
QGridLayout,
|
|
||||||
QVBoxLayout,
|
|
||||||
QListWidget,
|
QListWidget,
|
||||||
QHBoxLayout,
|
QHBoxLayout,
|
||||||
QListWidgetItem,
|
QListWidgetItem,
|
||||||
QMenu,
|
QMenu,
|
||||||
QAction,
|
QAction,
|
||||||
QApplication,
|
|
||||||
)
|
)
|
||||||
from PyQt5.QtGui import QResizeEvent, QFont, QFontMetrics
|
from PyQt5.QtGui import QFont, QFontMetrics
|
||||||
from PyQt5.QtWidgets import QTabWidget
|
from PyQt5.QtWidgets import QTabWidget
|
||||||
import qtawesome, gobject, importlib, sys
|
import qtawesome, gobject
|
||||||
import functools, threading, windows, winsharedutils
|
import threading, windows, winsharedutils
|
||||||
from traceback import print_exc
|
|
||||||
from winsharedutils import isDark
|
|
||||||
from myutils.config import globalconfig, _TR
|
from myutils.config import globalconfig, _TR
|
||||||
from myutils.utils import wavmp3player
|
from myutils.utils import wavmp3player
|
||||||
from myutils.config import static_data
|
|
||||||
from gui.settingpage1 import setTabOne, setTabOne_direct
|
from gui.settingpage1 import setTabOne, setTabOne_direct
|
||||||
from gui.settingpage2 import setTabTwo, settab2d
|
from gui.settingpage2 import setTabTwo, settab2d
|
||||||
from gui.settingpage_xianshishezhi import setTabThree, setTabThree_direct
|
from gui.settingpage_xianshishezhi import setTabThree, setTabThree_direct
|
||||||
@ -31,11 +23,7 @@ from gui.setting_lang import setTablang, setTablangd
|
|||||||
from gui.setting_proxy import setTab_proxy
|
from gui.setting_proxy import setTab_proxy
|
||||||
from gui.settingpage7 import setTab7, settab7direct
|
from gui.settingpage7 import setTab7, settab7direct
|
||||||
from gui.settingpage_about import setTab_about, setTab_about_dicrect
|
from gui.settingpage_about import setTab_about, setTab_about_dicrect
|
||||||
from gui.usefulwidget import closeashidewindow, tabadd_lazy
|
from gui.usefulwidget import closeashidewindow, makesubtab_lazy
|
||||||
|
|
||||||
|
|
||||||
class gridwidget(QWidget):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class TabWidget(QWidget):
|
class TabWidget(QWidget):
|
||||||
@ -89,60 +77,7 @@ class Settin(closeashidewindow):
|
|||||||
showandsolvesig = pyqtSignal(str)
|
showandsolvesig = pyqtSignal(str)
|
||||||
setstylesheetsignal = pyqtSignal()
|
setstylesheetsignal = pyqtSignal()
|
||||||
|
|
||||||
def resizefunction(self):
|
|
||||||
ww = self.size().width() - self.list_width - 30
|
|
||||||
for w in self.needfitwidgets:
|
|
||||||
w.setFixedWidth(int(ww))
|
|
||||||
for grid, maxl in self.needfitcols:
|
|
||||||
for c in range(maxl):
|
|
||||||
grid.setColumnMinimumWidth(
|
|
||||||
c,
|
|
||||||
int(ww / maxl),
|
|
||||||
)
|
|
||||||
|
|
||||||
def resizeEvent(self, a0: QResizeEvent) -> None:
|
|
||||||
|
|
||||||
self.resizefunction()
|
|
||||||
return super().resizeEvent(a0)
|
|
||||||
|
|
||||||
def automakegrid(self, grid, lis, save=False, savelist=None):
|
|
||||||
maxl = 0
|
|
||||||
|
|
||||||
for nowr, line in enumerate(lis):
|
|
||||||
nowc = 0
|
|
||||||
if save:
|
|
||||||
ll = []
|
|
||||||
for i in line:
|
|
||||||
if type(i) == str:
|
|
||||||
cols = 1
|
|
||||||
wid = QLabel(_TR(i))
|
|
||||||
elif type(i) != tuple:
|
|
||||||
wid, cols = i, 1
|
|
||||||
elif len(i) == 2:
|
|
||||||
|
|
||||||
wid, cols = i
|
|
||||||
if type(wid) == str:
|
|
||||||
wid = QLabel(_TR(wid))
|
|
||||||
elif len(i) == 3:
|
|
||||||
wid, cols, arg = i
|
|
||||||
if type(wid) == str:
|
|
||||||
wid = QLabel((wid))
|
|
||||||
if arg == "link":
|
|
||||||
wid.setOpenExternalLinks(True)
|
|
||||||
grid.addWidget(wid, nowr, nowc, 1, cols)
|
|
||||||
if save:
|
|
||||||
ll.append(wid)
|
|
||||||
nowc += cols
|
|
||||||
maxl = max(maxl, nowc)
|
|
||||||
if save:
|
|
||||||
savelist.append(ll)
|
|
||||||
|
|
||||||
grid.setRowMinimumHeight(nowr, 35)
|
|
||||||
self.needfitcols.append([grid, maxl])
|
|
||||||
|
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
self.needfitwidgets = []
|
|
||||||
self.needfitcols = []
|
|
||||||
super(Settin, self).__init__(parent, globalconfig, "setting_geo_2")
|
super(Settin, self).__init__(parent, globalconfig, "setting_geo_2")
|
||||||
# self.setWindowFlag(Qt.Tool,False)
|
# self.setWindowFlag(Qt.Tool,False)
|
||||||
# self.setWindowFlags(self.windowFlags()&~Qt.WindowMinimizeButtonHint)
|
# self.setWindowFlags(self.windowFlags()&~Qt.WindowMinimizeButtonHint)
|
||||||
@ -158,7 +93,6 @@ class Settin(closeashidewindow):
|
|||||||
self.hooks = []
|
self.hooks = []
|
||||||
|
|
||||||
self.usevoice = 0
|
self.usevoice = 0
|
||||||
self.inittray()
|
|
||||||
setTabOne_direct(self)
|
setTabOne_direct(self)
|
||||||
settab2d(self)
|
settab2d(self)
|
||||||
settab7direct(self)
|
settab7direct(self)
|
||||||
@ -168,14 +102,13 @@ class Settin(closeashidewindow):
|
|||||||
setTablangd(self)
|
setTablangd(self)
|
||||||
setTab_about_dicrect(self)
|
setTab_about_dicrect(self)
|
||||||
|
|
||||||
self.setstylesheet()
|
self.setstylesheetsignal.connect(gobject.baseobject.setcommonstylesheet)
|
||||||
self.setstylesheetsignal.connect(self.setstylesheet)
|
|
||||||
threading.Thread(target=self.darklistener).start()
|
threading.Thread(target=self.darklistener).start()
|
||||||
|
|
||||||
self.setWindowTitle(_TR("设置"))
|
self.setWindowTitle(_TR("设置"))
|
||||||
self.setWindowIcon(qtawesome.icon("fa.gear"))
|
self.setWindowIcon(qtawesome.icon("fa.gear"))
|
||||||
|
|
||||||
self.tab_widget = self.makesubtab_lazy(klass=TabWidget)
|
self.tab_widget = makesubtab_lazy(klass=TabWidget)
|
||||||
self.setCentralWidget(self.tab_widget)
|
self.setCentralWidget(self.tab_widget)
|
||||||
|
|
||||||
self.tab_widget.setStyleSheet(
|
self.tab_widget.setStyleSheet(
|
||||||
@ -209,28 +142,6 @@ class Settin(closeashidewindow):
|
|||||||
self.tab_widget.list_widget.setFixedWidth(width)
|
self.tab_widget.list_widget.setFixedWidth(width)
|
||||||
self.list_width = width
|
self.list_width = width
|
||||||
|
|
||||||
def inittray(self):
|
|
||||||
|
|
||||||
showAction = QAction(
|
|
||||||
_TR("&显示"),
|
|
||||||
self,
|
|
||||||
triggered=gobject.baseobject.translation_ui.show_,
|
|
||||||
)
|
|
||||||
settingAction = QAction(
|
|
||||||
_TR("&设置"),
|
|
||||||
self,
|
|
||||||
triggered=lambda: gobject.baseobject.settin_ui.showsignal.emit(),
|
|
||||||
)
|
|
||||||
quitAction = QAction(
|
|
||||||
_TR("&退出"), self, triggered=gobject.baseobject.translation_ui.close
|
|
||||||
)
|
|
||||||
self.trayMenu = QMenu(self)
|
|
||||||
self.trayMenu.addAction(showAction)
|
|
||||||
self.trayMenu.addAction(settingAction)
|
|
||||||
self.trayMenu.addSeparator()
|
|
||||||
self.trayMenu.addAction(quitAction)
|
|
||||||
gobject.baseobject.translation_ui.tray.setContextMenu(self.trayMenu)
|
|
||||||
|
|
||||||
def opensolvetextfun(self):
|
def opensolvetextfun(self):
|
||||||
self.show()
|
self.show()
|
||||||
self.tab_widget.setCurrentIndex(3)
|
self.tab_widget.setCurrentIndex(3)
|
||||||
@ -243,114 +154,3 @@ class Settin(closeashidewindow):
|
|||||||
if globalconfig["darklight"] == 2:
|
if globalconfig["darklight"] == 2:
|
||||||
self.setstylesheetsignal.emit()
|
self.setstylesheetsignal.emit()
|
||||||
windows.WaitForSingleObject(sema, windows.INFINITE)
|
windows.WaitForSingleObject(sema, windows.INFINITE)
|
||||||
|
|
||||||
def setstylesheet(self):
|
|
||||||
|
|
||||||
dl = globalconfig["darklight"]
|
|
||||||
if dl == 0:
|
|
||||||
dark = False
|
|
||||||
elif dl == 1:
|
|
||||||
dark = True
|
|
||||||
elif dl == 2:
|
|
||||||
dark = isDark()
|
|
||||||
darklight = ["light", "dark"][dark]
|
|
||||||
|
|
||||||
gobject.baseobject.currentisdark = dark
|
|
||||||
|
|
||||||
for widget in QApplication.topLevelWidgets():
|
|
||||||
if widget.testAttribute(Qt.WA_TranslucentBackground):
|
|
||||||
continue
|
|
||||||
winsharedutils.SetTheme(
|
|
||||||
int(widget.winId()), dark, globalconfig["WindowBackdrop"]
|
|
||||||
)
|
|
||||||
style = ""
|
|
||||||
for _ in (0,):
|
|
||||||
try:
|
|
||||||
idx = globalconfig[darklight + "theme"] - int(not dark)
|
|
||||||
if idx == -1:
|
|
||||||
break
|
|
||||||
_fn = static_data["themes"][darklight][idx]["file"]
|
|
||||||
|
|
||||||
if _fn.endswith(".py"):
|
|
||||||
style = importlib.import_module(
|
|
||||||
"files.themes." + _fn[:-3]
|
|
||||||
).stylesheet()
|
|
||||||
elif _fn.endswith(".qss"):
|
|
||||||
with open(
|
|
||||||
"./files/themes/{}".format(_fn),
|
|
||||||
"r",
|
|
||||||
) as ff:
|
|
||||||
style = ff.read()
|
|
||||||
except:
|
|
||||||
print_exc()
|
|
||||||
style = ""
|
|
||||||
style += (
|
|
||||||
"*{font: %spt '" % (globalconfig["settingfontsize"])
|
|
||||||
+ (globalconfig["settingfonttype"])
|
|
||||||
+ "' ; }"
|
|
||||||
)
|
|
||||||
self.setStyleSheet(style)
|
|
||||||
|
|
||||||
def makevbox(self, wids):
|
|
||||||
q = QWidget()
|
|
||||||
v = QVBoxLayout()
|
|
||||||
q.setLayout(v)
|
|
||||||
v.setContentsMargins(0, 0, 0, 0)
|
|
||||||
for wid in wids:
|
|
||||||
v.addWidget(wid)
|
|
||||||
return q
|
|
||||||
|
|
||||||
def makegrid(self, grid, save=False, savelist=None, savelay=None):
|
|
||||||
|
|
||||||
gridlayoutwidget = gridwidget()
|
|
||||||
gridlay = QGridLayout()
|
|
||||||
gridlayoutwidget.setLayout(gridlay)
|
|
||||||
gridlayoutwidget.setStyleSheet("gridwidget{background-color:transparent;}")
|
|
||||||
self.needfitwidgets.append(gridlayoutwidget)
|
|
||||||
gridlayoutwidget.setFixedHeight(len(grid) * 35)
|
|
||||||
margins = gridlay.contentsMargins()
|
|
||||||
gridlay.setContentsMargins(margins.left(), 0, margins.right(), 0)
|
|
||||||
self.automakegrid(gridlay, grid, save, savelist)
|
|
||||||
if save:
|
|
||||||
savelay.append(gridlay)
|
|
||||||
return gridlayoutwidget
|
|
||||||
|
|
||||||
def makescroll(self, widget):
|
|
||||||
scroll = QScrollArea()
|
|
||||||
scroll.setHorizontalScrollBarPolicy(1)
|
|
||||||
scroll.setStyleSheet("""QScrollArea{background-color:transparent;border:0px}""")
|
|
||||||
|
|
||||||
self.needfitwidgets.append(widget)
|
|
||||||
scroll.setWidget(widget)
|
|
||||||
return scroll
|
|
||||||
|
|
||||||
def makesubtab(self, titles, widgets):
|
|
||||||
tab = QTabWidget()
|
|
||||||
for i, wid in enumerate(widgets):
|
|
||||||
tab.addTab(wid, _TR(titles[i]))
|
|
||||||
return tab
|
|
||||||
|
|
||||||
def makesubtab_lazy(self, titles=None, functions=None, klass=None):
|
|
||||||
if klass:
|
|
||||||
tab = klass()
|
|
||||||
else:
|
|
||||||
tab = QTabWidget()
|
|
||||||
|
|
||||||
def __(t, i):
|
|
||||||
try:
|
|
||||||
w = t.currentWidget()
|
|
||||||
if "lazyfunction" in dir(w):
|
|
||||||
w.lazyfunction()
|
|
||||||
delattr(w, "lazyfunction")
|
|
||||||
self.resizefunction()
|
|
||||||
except:
|
|
||||||
print_exc()
|
|
||||||
|
|
||||||
tab.currentChanged.connect(functools.partial(__, tab))
|
|
||||||
if titles and functions:
|
|
||||||
for i, func in enumerate(functions):
|
|
||||||
self.tabadd_lazy(tab, titles[i], func)
|
|
||||||
return tab
|
|
||||||
|
|
||||||
def tabadd_lazy(self, tab, title, getrealwidgetfunction):
|
|
||||||
tabadd_lazy(tab, title, getrealwidgetfunction)
|
|
||||||
|
@ -1,10 +1,16 @@
|
|||||||
import os
|
import os
|
||||||
from myutils.config import globalconfig, _TRL, static_data, getlanguse
|
from myutils.config import globalconfig, _TRL, static_data, getlanguse
|
||||||
from gui.usefulwidget import getsimplecombobox, getcolorbutton
|
from gui.usefulwidget import (
|
||||||
|
getsimplecombobox,
|
||||||
|
getcolorbutton,
|
||||||
|
makegrid,
|
||||||
|
tabadd_lazy,
|
||||||
|
makescroll,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def setTablang(self):
|
def setTablang(self):
|
||||||
self.tabadd_lazy(self.tab_widget, ("语言设置"), lambda: setTablanglz(self))
|
tabadd_lazy(self.tab_widget, ("语言设置"), lambda: setTablanglz(self))
|
||||||
|
|
||||||
|
|
||||||
def setTablangd(self):
|
def setTablangd(self):
|
||||||
@ -45,9 +51,7 @@ def setTablanglz(self):
|
|||||||
globalconfig,
|
globalconfig,
|
||||||
"",
|
"",
|
||||||
callback=lambda: os.startfile(
|
callback=lambda: os.startfile(
|
||||||
os.path.abspath(
|
os.path.abspath("./files/lang/{}.json".format(getlanguse()))
|
||||||
"./files/lang/{}.json".format(getlanguse())
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
icon="fa.gear",
|
icon="fa.gear",
|
||||||
constcolor="#FF69B4",
|
constcolor="#FF69B4",
|
||||||
@ -58,7 +62,7 @@ def setTablanglz(self):
|
|||||||
[],
|
[],
|
||||||
]
|
]
|
||||||
|
|
||||||
gridlayoutwidget = self.makegrid(grids)
|
gridlayoutwidget = makegrid(grids)
|
||||||
gridlayoutwidget = self.makescroll(gridlayoutwidget)
|
gridlayoutwidget = makescroll(gridlayoutwidget)
|
||||||
|
|
||||||
return gridlayoutwidget
|
return gridlayoutwidget
|
||||||
|
@ -2,7 +2,14 @@ from PyQt5.QtWidgets import QLineEdit, QPushButton
|
|||||||
from myutils.config import _TR
|
from myutils.config import _TR
|
||||||
from myutils.config import globalconfig
|
from myutils.config import globalconfig
|
||||||
from myutils.utils import splittranslatortypes
|
from myutils.utils import splittranslatortypes
|
||||||
from gui.usefulwidget import getsimpleswitch
|
from gui.usefulwidget import (
|
||||||
|
getsimpleswitch,
|
||||||
|
makegrid,
|
||||||
|
makesubtab_lazy,
|
||||||
|
tabadd_lazy,
|
||||||
|
makevbox,
|
||||||
|
makescroll,
|
||||||
|
)
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
@ -77,18 +84,18 @@ def setTab_proxy_lazy(self):
|
|||||||
item="ocr",
|
item="ocr",
|
||||||
name="./Lunatranslator/ocrengines/%s.py",
|
name="./Lunatranslator/ocrengines/%s.py",
|
||||||
)
|
)
|
||||||
tab = self.makesubtab_lazy(
|
tab = makesubtab_lazy(
|
||||||
["在线翻译", "注册在线翻译", "在线OCR"],
|
["在线翻译", "注册在线翻译", "在线OCR"],
|
||||||
[
|
[
|
||||||
lambda: self.makescroll(self.makegrid(mianfei)),
|
lambda: makescroll(makegrid(mianfei)),
|
||||||
lambda: self.makescroll(self.makegrid(shoufei)),
|
lambda: makescroll(makegrid(shoufei)),
|
||||||
lambda: self.makescroll(self.makegrid(ocrs)),
|
lambda: makescroll(makegrid(ocrs)),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
gridlayoutwidget = self.makegrid(grid1)
|
gridlayoutwidget = makegrid(grid1)
|
||||||
return self.makevbox([gridlayoutwidget, tab])
|
return makevbox([gridlayoutwidget, tab])
|
||||||
|
|
||||||
|
|
||||||
def setTab_proxy(self):
|
def setTab_proxy(self):
|
||||||
self.tabadd_lazy(self.tab_widget, ("代理设置"), lambda: setTab_proxy_lazy(self))
|
tabadd_lazy(self.tab_widget, ("代理设置"), lambda: setTab_proxy_lazy(self))
|
||||||
|
@ -19,9 +19,14 @@ from gui.inputdialog import regexedit
|
|||||||
from gui.usefulwidget import (
|
from gui.usefulwidget import (
|
||||||
getsimplecombobox,
|
getsimplecombobox,
|
||||||
getspinbox,
|
getspinbox,
|
||||||
|
makescroll,
|
||||||
getcolorbutton,
|
getcolorbutton,
|
||||||
|
makegrid,
|
||||||
|
tabadd_lazy,
|
||||||
yuitsu_switch,
|
yuitsu_switch,
|
||||||
|
makevbox,
|
||||||
getsimpleswitch,
|
getsimpleswitch,
|
||||||
|
makesubtab_lazy,
|
||||||
)
|
)
|
||||||
from gui.codeacceptdialog import codeacceptdialog
|
from gui.codeacceptdialog import codeacceptdialog
|
||||||
from myutils.utils import makehtml, getfilemd5
|
from myutils.utils import makehtml, getfilemd5
|
||||||
@ -507,21 +512,21 @@ def setTabOne_direct(self):
|
|||||||
|
|
||||||
|
|
||||||
def setTabOne(self):
|
def setTabOne(self):
|
||||||
self.tabadd_lazy(self.tab_widget, ("文本输入"), lambda: setTabOne_lazy(self))
|
tabadd_lazy(self.tab_widget, ("文本输入"), lambda: setTabOne_lazy(self))
|
||||||
|
|
||||||
|
|
||||||
def setTabOne_lazy(self):
|
def setTabOne_lazy(self):
|
||||||
|
|
||||||
tab = self.makesubtab_lazy(
|
tab = makesubtab_lazy(
|
||||||
["HOOK设置", "OCR设置", "剪贴板", "内嵌翻译", "文本输出"],
|
["HOOK设置", "OCR设置", "剪贴板", "内嵌翻译", "文本输出"],
|
||||||
[
|
[
|
||||||
lambda: self.makescroll(self.makegrid(gethookgrid(self))),
|
lambda: makescroll(makegrid(gethookgrid(self))),
|
||||||
lambda: self.makescroll(self.makegrid(getocrgrid(self))),
|
lambda: makescroll(makegrid(getocrgrid(self))),
|
||||||
lambda: self.makescroll(self.makegrid(getTabclip(self))),
|
lambda: makescroll(makegrid(getTabclip(self))),
|
||||||
lambda: self.makescroll(self.makegrid(gethookembedgrid(self))),
|
lambda: makescroll(makegrid(gethookembedgrid(self))),
|
||||||
lambda: self.makescroll(self.makegrid(outputgrid(self))),
|
lambda: makescroll(makegrid(outputgrid(self))),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
gridlayoutwidget = self.makegrid(self.tab1grids)
|
gridlayoutwidget = makegrid(self.tab1grids)
|
||||||
return self.makevbox([gridlayoutwidget, tab])
|
return makevbox([gridlayoutwidget, tab])
|
||||||
|
@ -8,7 +8,17 @@ from myutils.config import globalconfig, _TR
|
|||||||
from myutils.utils import selectdebugfile, splittranslatortypes, checkportavailable
|
from myutils.utils import selectdebugfile, splittranslatortypes, checkportavailable
|
||||||
import os, time, requests, threading
|
import os, time, requests, threading
|
||||||
from gui.inputdialog import autoinitdialog, autoinitdialog_items
|
from gui.inputdialog import autoinitdialog, autoinitdialog_items
|
||||||
from gui.usefulwidget import getspinbox, getcolorbutton, getsimpleswitch, selectcolor
|
from gui.usefulwidget import (
|
||||||
|
getspinbox,
|
||||||
|
getcolorbutton,
|
||||||
|
getsimpleswitch,
|
||||||
|
selectcolor,
|
||||||
|
makegrid,
|
||||||
|
makesubtab_lazy,
|
||||||
|
makescroll,
|
||||||
|
makevbox,
|
||||||
|
tabadd_lazy,
|
||||||
|
)
|
||||||
import time, hashlib
|
import time, hashlib
|
||||||
|
|
||||||
|
|
||||||
@ -94,7 +104,7 @@ def initsome11(self, l, label=None):
|
|||||||
|
|
||||||
|
|
||||||
def setTabTwo(self):
|
def setTabTwo(self):
|
||||||
self.tabadd_lazy(self.tab_widget, ("翻译设置"), lambda: setTabTwo_lazy(self))
|
tabadd_lazy(self.tab_widget, ("翻译设置"), lambda: setTabTwo_lazy(self))
|
||||||
|
|
||||||
|
|
||||||
def settab2d(self):
|
def settab2d(self):
|
||||||
@ -245,16 +255,16 @@ def setTabTwo_lazy(self):
|
|||||||
developgrid += initsome11(self, develop)
|
developgrid += initsome11(self, develop)
|
||||||
online_reg_grid += initsome11(self, shoufei)
|
online_reg_grid += initsome11(self, shoufei)
|
||||||
pretransgrid += initsome11(self, pre)
|
pretransgrid += initsome11(self, pre)
|
||||||
tab = self.makesubtab_lazy(
|
tab = makesubtab_lazy(
|
||||||
["在线翻译", "develop", "注册在线翻译", "离线翻译", "预翻译"],
|
["在线翻译", "develop", "注册在线翻译", "离线翻译", "预翻译"],
|
||||||
[
|
[
|
||||||
lambda: self.makescroll(self.makegrid(onlinegrid)),
|
lambda: makescroll(makegrid(onlinegrid)),
|
||||||
lambda: self.makescroll(self.makegrid(developgrid)),
|
lambda: makescroll(makegrid(developgrid)),
|
||||||
lambda: self.makescroll(self.makegrid(online_reg_grid)),
|
lambda: makescroll(makegrid(online_reg_grid)),
|
||||||
lambda: self.makescroll(self.makegrid(offlinegrid)),
|
lambda: makescroll(makegrid(offlinegrid)),
|
||||||
lambda: self.makescroll(self.makegrid(pretransgrid)),
|
lambda: makescroll(makegrid(pretransgrid)),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
gridlayoutwidget = self.makegrid(grids)
|
gridlayoutwidget = makegrid(grids)
|
||||||
return self.makevbox([gridlayoutwidget, tab])
|
return makevbox([gridlayoutwidget, tab])
|
||||||
|
@ -17,7 +17,15 @@ from myutils.config import (
|
|||||||
_TR,
|
_TR,
|
||||||
)
|
)
|
||||||
import functools, gobject
|
import functools, gobject
|
||||||
from gui.usefulwidget import getcolorbutton, getsimpleswitch
|
from gui.usefulwidget import (
|
||||||
|
getcolorbutton,
|
||||||
|
getsimpleswitch,
|
||||||
|
makevbox,
|
||||||
|
makescroll,
|
||||||
|
makegrid,
|
||||||
|
makesubtab_lazy,
|
||||||
|
tabadd_lazy,
|
||||||
|
)
|
||||||
from gui.codeacceptdialog import codeacceptdialog
|
from gui.codeacceptdialog import codeacceptdialog
|
||||||
from gui.inputdialog import (
|
from gui.inputdialog import (
|
||||||
postconfigdialog,
|
postconfigdialog,
|
||||||
@ -73,7 +81,7 @@ def settab7direct(self):
|
|||||||
|
|
||||||
|
|
||||||
def setTab7(self):
|
def setTab7(self):
|
||||||
self.tabadd_lazy(self.tab_widget, ("文本处理"), lambda: setTab7_lazy(self))
|
tabadd_lazy(self.tab_widget, ("文本处理"), lambda: setTab7_lazy(self))
|
||||||
|
|
||||||
|
|
||||||
def getcomparelayout(self):
|
def getcomparelayout(self):
|
||||||
@ -229,9 +237,10 @@ def setTab7_lazy(self):
|
|||||||
constcolor="#FF69B4",
|
constcolor="#FF69B4",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
grids2 += [[("", 12)]]
|
||||||
|
|
||||||
def __():
|
def __():
|
||||||
_w = self.makescroll(self.makegrid(grids, True, savelist, savelay))
|
_w = makescroll(makegrid(grids, True, savelist, savelay))
|
||||||
_w.setContextMenuPolicy(Qt.CustomContextMenu)
|
_w.setContextMenuPolicy(Qt.CustomContextMenu)
|
||||||
|
|
||||||
def showmenu(p: QPoint):
|
def showmenu(p: QPoint):
|
||||||
@ -251,9 +260,9 @@ def setTab7_lazy(self):
|
|||||||
_w.customContextMenuRequested.connect(showmenu)
|
_w.customContextMenuRequested.connect(showmenu)
|
||||||
return _w
|
return _w
|
||||||
|
|
||||||
tab = self.makesubtab_lazy(
|
tab = makesubtab_lazy(
|
||||||
["文本预处理", "翻译优化"],
|
["文本预处理", "翻译优化"],
|
||||||
[lambda: __(), lambda: self.makescroll(self.makegrid(grids2))],
|
[lambda: __(), lambda: makescroll(makegrid(grids2))],
|
||||||
)
|
)
|
||||||
|
|
||||||
return self.makevbox([tab, self.comparelayout])
|
return makevbox([tab, self.comparelayout])
|
||||||
|
@ -1,7 +1,14 @@
|
|||||||
from PyQt5.QtCore import Qt
|
from PyQt5.QtCore import Qt
|
||||||
from PyQt5.QtGui import QPixmap, QImage
|
from PyQt5.QtGui import QPixmap, QImage
|
||||||
from PyQt5.QtWidgets import QWidget, QLabel, QProgressBar
|
from PyQt5.QtWidgets import QLabel, QProgressBar
|
||||||
from gui.usefulwidget import getsimpleswitch, getsimplecombobox
|
from gui.usefulwidget import (
|
||||||
|
getsimpleswitch,
|
||||||
|
getsimplecombobox,
|
||||||
|
makegrid,
|
||||||
|
makescroll,
|
||||||
|
makesubtab_lazy,
|
||||||
|
tabadd_lazy,
|
||||||
|
)
|
||||||
from myutils.config import globalconfig, _TR, static_data
|
from myutils.config import globalconfig, _TR, static_data
|
||||||
from myutils.wrapper import threader
|
from myutils.wrapper import threader
|
||||||
import platform, winsharedutils, sys
|
import platform, winsharedutils, sys
|
||||||
@ -64,11 +71,11 @@ def setTab_about_dicrect(self):
|
|||||||
|
|
||||||
|
|
||||||
def setTab_about(self):
|
def setTab_about(self):
|
||||||
self.tabadd_lazy(self.tab_widget, ("其他设置"), lambda: setTab_aboutlazy(self))
|
tabadd_lazy(self.tab_widget, ("其他设置"), lambda: setTab_aboutlazy(self))
|
||||||
|
|
||||||
|
|
||||||
def double_(self, grid):
|
def double_(self, grid):
|
||||||
return self.makescroll(self.makegrid(grid))
|
return makescroll(makegrid(grid))
|
||||||
|
|
||||||
|
|
||||||
def resourcegrid(self):
|
def resourcegrid(self):
|
||||||
@ -98,7 +105,7 @@ def resourcegrid(self):
|
|||||||
__ = True
|
__ = True
|
||||||
grid.append([(_TR(name), 1, ""), (makehtml(link, __), 2, "link")])
|
grid.append([(_TR(name), 1, ""), (makehtml(link, __), 2, "link")])
|
||||||
makewidgetsfunctions.append(partial(double_, self, grid))
|
makewidgetsfunctions.append(partial(double_, self, grid))
|
||||||
return self.makesubtab_lazy(titles, makewidgetsfunctions)
|
return makesubtab_lazy(titles, makewidgetsfunctions)
|
||||||
|
|
||||||
|
|
||||||
def setTab_aboutlazy(self):
|
def setTab_aboutlazy(self):
|
||||||
@ -149,8 +156,19 @@ def setTab_aboutlazy(self):
|
|||||||
(makehtml("https://qm.qq.com/q/qE32v9NYBO", show=912525396), 3, "link"),
|
(makehtml("https://qm.qq.com/q/qE32v9NYBO", show=912525396), 3, "link"),
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
[("如果你感觉该软件对你有帮助,欢迎微信扫码赞助,谢谢~", 4)],
|
[("如果你感觉该软件对你有帮助,欢迎微信扫码赞助,谢谢~", 0)],
|
||||||
]
|
]
|
||||||
|
lb = QLabel(self)
|
||||||
|
img = QPixmap.fromImage(QImage("./files/zan.jpg"))
|
||||||
|
img.setDevicePixelRatio(self.devicePixelRatioF())
|
||||||
|
img = img.scaled(
|
||||||
|
600,
|
||||||
|
600,
|
||||||
|
Qt.KeepAspectRatio,
|
||||||
|
Qt.SmoothTransformation,
|
||||||
|
)
|
||||||
|
lb.setPixmap(img)
|
||||||
|
shuominggrid += [[(lb, 0)]]
|
||||||
else:
|
else:
|
||||||
shuominggrid += [
|
shuominggrid += [
|
||||||
[],
|
[],
|
||||||
@ -169,41 +187,15 @@ def setTab_aboutlazy(self):
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
tab = self.makesubtab_lazy(
|
|
||||||
|
tab = makesubtab_lazy(
|
||||||
["相关说明", "其他设置", "资源下载"],
|
["相关说明", "其他设置", "资源下载"],
|
||||||
[
|
[
|
||||||
lambda: self.makevbox(
|
lambda: makescroll(
|
||||||
[
|
makegrid(shuominggrid),
|
||||||
self.makegrid(shuominggrid),
|
|
||||||
(
|
|
||||||
imgwidget("./files/zan.jpg")
|
|
||||||
if globalconfig["languageuse"] == 0
|
|
||||||
else QLabel()
|
|
||||||
),
|
),
|
||||||
]
|
lambda: makescroll(makegrid(grid2)),
|
||||||
),
|
|
||||||
lambda: self.makescroll(self.makegrid(grid2)),
|
|
||||||
lambda: resourcegrid(self),
|
lambda: resourcegrid(self),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
return tab
|
return tab
|
||||||
|
|
||||||
|
|
||||||
class imgwidget(QWidget):
|
|
||||||
def __init__(self, src) -> None:
|
|
||||||
super().__init__()
|
|
||||||
self.lb = QLabel(self)
|
|
||||||
rate = self.devicePixelRatioF()
|
|
||||||
self.img = QPixmap.fromImage(QImage(src))
|
|
||||||
self.img.setDevicePixelRatio(rate)
|
|
||||||
|
|
||||||
def paintEvent(self, a0) -> None:
|
|
||||||
self.lb.resize(self.size())
|
|
||||||
self.lb.setPixmap(
|
|
||||||
self.img.scaled(
|
|
||||||
self.size() * self.devicePixelRatioF(),
|
|
||||||
Qt.KeepAspectRatio,
|
|
||||||
Qt.SmoothTransformation,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
return super().paintEvent(a0)
|
|
||||||
|
@ -4,6 +4,9 @@ from gui.inputdialog import autoinitdialog, autoinitdialog_items
|
|||||||
from gui.usefulwidget import (
|
from gui.usefulwidget import (
|
||||||
getcolorbutton,
|
getcolorbutton,
|
||||||
yuitsu_switch,
|
yuitsu_switch,
|
||||||
|
makescroll,
|
||||||
|
makegrid,
|
||||||
|
tabadd_lazy,
|
||||||
getsimpleswitch,
|
getsimpleswitch,
|
||||||
getsimplecombobox,
|
getsimplecombobox,
|
||||||
)
|
)
|
||||||
@ -11,7 +14,7 @@ import gobject
|
|||||||
|
|
||||||
|
|
||||||
def setTabcishu(self):
|
def setTabcishu(self):
|
||||||
self.tabadd_lazy(self.tab_widget, ("辞书设置"), lambda: setTabcishu_l(self))
|
tabadd_lazy(self.tab_widget, ("辞书设置"), lambda: setTabcishu_l(self))
|
||||||
|
|
||||||
|
|
||||||
def gethiragrid(self):
|
def gethiragrid(self):
|
||||||
@ -171,7 +174,7 @@ def setTabcishu_l(self):
|
|||||||
(getsimpleswitch(globalconfig, "searchwordusewebview"), 1),
|
(getsimpleswitch(globalconfig, "searchwordusewebview"), 1),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
gridlayoutwidget = self.makegrid(grids)
|
gridlayoutwidget = makegrid(grids)
|
||||||
gridlayoutwidget = self.makescroll(gridlayoutwidget)
|
gridlayoutwidget = makescroll(gridlayoutwidget)
|
||||||
|
|
||||||
return gridlayoutwidget
|
return gridlayoutwidget
|
||||||
|
@ -1,11 +1,16 @@
|
|||||||
import functools
|
import functools
|
||||||
from myutils.config import globalconfig, static_data, _TR
|
from myutils.config import globalconfig, _TR
|
||||||
from myutils.winsyshotkey import SystemHotkey, registerException
|
from myutils.winsyshotkey import SystemHotkey, registerException
|
||||||
from PyQt5.QtGui import QKeySequence
|
|
||||||
import winsharedutils
|
import winsharedutils
|
||||||
import gobject, windows
|
import gobject, windows
|
||||||
from PyQt5.QtWidgets import QLabel
|
from PyQt5.QtWidgets import QLabel
|
||||||
from gui.usefulwidget import getsimpleswitch, getsimplekeyseq
|
from gui.usefulwidget import (
|
||||||
|
getsimpleswitch,
|
||||||
|
getsimplekeyseq,
|
||||||
|
makegrid,
|
||||||
|
tabadd_lazy,
|
||||||
|
makescroll,
|
||||||
|
)
|
||||||
from myutils.hwnd import grabwindow
|
from myutils.hwnd import grabwindow
|
||||||
from myutils.utils import getimageformat, parsekeystringtomodvkcode, unsupportkey
|
from myutils.utils import getimageformat, parsekeystringtomodvkcode, unsupportkey
|
||||||
|
|
||||||
@ -58,7 +63,7 @@ def setTab_quick_direct(self):
|
|||||||
|
|
||||||
def setTab_quick(self):
|
def setTab_quick(self):
|
||||||
|
|
||||||
self.tabadd_lazy(self.tab_widget, ("快捷按键"), lambda: setTab_quick_lazy(self))
|
tabadd_lazy(self.tab_widget, ("快捷按键"), lambda: setTab_quick_lazy(self))
|
||||||
|
|
||||||
|
|
||||||
def setTab_quick_lazy(self):
|
def setTab_quick_lazy(self):
|
||||||
@ -97,8 +102,8 @@ def setTab_quick_lazy(self):
|
|||||||
(self.referlabels[name], 4),
|
(self.referlabels[name], 4),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
gridlayoutwidget = self.makegrid(grids)
|
gridlayoutwidget = makegrid(grids)
|
||||||
gridlayoutwidget = self.makescroll(gridlayoutwidget)
|
gridlayoutwidget = makescroll(gridlayoutwidget)
|
||||||
return gridlayoutwidget
|
return gridlayoutwidget
|
||||||
# self.yitiaolong("快捷按键",grids)
|
# self.yitiaolong("快捷按键",grids)
|
||||||
|
|
||||||
|
@ -8,7 +8,10 @@ import gobject
|
|||||||
from gui.usefulwidget import (
|
from gui.usefulwidget import (
|
||||||
getsimplecombobox,
|
getsimplecombobox,
|
||||||
getspinbox,
|
getspinbox,
|
||||||
|
makegrid,
|
||||||
|
makescroll,
|
||||||
getcolorbutton,
|
getcolorbutton,
|
||||||
|
tabadd_lazy,
|
||||||
yuitsu_switch,
|
yuitsu_switch,
|
||||||
getsimpleswitch,
|
getsimpleswitch,
|
||||||
)
|
)
|
||||||
@ -21,7 +24,7 @@ def setTab5_direct(self):
|
|||||||
|
|
||||||
|
|
||||||
def setTab5(self):
|
def setTab5(self):
|
||||||
self.tabadd_lazy(self.tab_widget, ("语音合成"), lambda: setTab5lz(self))
|
tabadd_lazy(self.tab_widget, ("语音合成"), lambda: setTab5lz(self))
|
||||||
|
|
||||||
|
|
||||||
def getttsgrid(self):
|
def getttsgrid(self):
|
||||||
@ -147,8 +150,8 @@ def setTab5lz(self):
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
gridlayoutwidget = self.makegrid(grids)
|
gridlayoutwidget = makegrid(grids)
|
||||||
gridlayoutwidget = self.makescroll(gridlayoutwidget)
|
gridlayoutwidget = makescroll(gridlayoutwidget)
|
||||||
return gridlayoutwidget
|
return gridlayoutwidget
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
import functools
|
import functools
|
||||||
from PyQt5.QtCore import Qt
|
|
||||||
from PyQt5.QtGui import QFont
|
from PyQt5.QtGui import QFont
|
||||||
|
|
||||||
from PyQt5.QtWidgets import QTableView, QAbstractItemView, QLabel, QVBoxLayout
|
from PyQt5.QtWidgets import QTableView, QAbstractItemView
|
||||||
from PyQt5.QtWidgets import QDialog, QVBoxLayout, QHeaderView
|
from PyQt5.QtWidgets import QHeaderView
|
||||||
from PyQt5.QtCore import Qt, QSize
|
from PyQt5.QtCore import Qt
|
||||||
|
|
||||||
from PyQt5.QtGui import QStandardItem, QStandardItemModel
|
from PyQt5.QtGui import QStandardItem, QStandardItemModel
|
||||||
from PyQt5.QtWidgets import QLabel, QSlider, QFontComboBox, QDialog, QGridLayout
|
from PyQt5.QtWidgets import QLabel, QSlider, QFontComboBox, QDialog, QGridLayout
|
||||||
@ -16,8 +15,13 @@ from winsharedutils import showintab
|
|||||||
from gui.inputdialog import getsomepath1
|
from gui.inputdialog import getsomepath1
|
||||||
from gui.usefulwidget import (
|
from gui.usefulwidget import (
|
||||||
getsimplecombobox,
|
getsimplecombobox,
|
||||||
|
makegrid,
|
||||||
getspinbox,
|
getspinbox,
|
||||||
|
tabadd_lazy,
|
||||||
|
makescroll,
|
||||||
|
makevbox,
|
||||||
getcolorbutton,
|
getcolorbutton,
|
||||||
|
makesubtab_lazy,
|
||||||
getsimpleswitch,
|
getsimpleswitch,
|
||||||
selectcolor,
|
selectcolor,
|
||||||
)
|
)
|
||||||
@ -51,110 +55,74 @@ def setTabThree_direct(self):
|
|||||||
|
|
||||||
def setTabThree(self):
|
def setTabThree(self):
|
||||||
|
|
||||||
self.tabadd_lazy(self.tab_widget, ("显示设置"), lambda: setTabThree_lazy(self))
|
tabadd_lazy(self.tab_widget, ("显示设置"), lambda: setTabThree_lazy(self))
|
||||||
|
|
||||||
|
|
||||||
def createbuttonwidget(self):
|
def createbuttonwidget(self):
|
||||||
|
# return table
|
||||||
|
grids = [["显示", "", "", "对齐", "图标", "图标2", "说明"]]
|
||||||
|
sortlist = globalconfig["toolbutton"]["rank2"]
|
||||||
|
savelist = []
|
||||||
|
savelay = []
|
||||||
|
|
||||||
model = QStandardItemModel()
|
def changerank(item, up):
|
||||||
model.setHorizontalHeaderLabels(
|
|
||||||
_TRL(["显示", "", "", "对齐", "图标", "图标2", "说明"])
|
|
||||||
)
|
|
||||||
|
|
||||||
table = QTableView()
|
idx = sortlist.index(item)
|
||||||
|
|
||||||
table.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
|
|
||||||
table.horizontalHeader().setStretchLastSection(True)
|
|
||||||
table.setEditTriggers(QAbstractItemView.NoEditTriggers)
|
|
||||||
table.setSelectionBehavior(QAbstractItemView.SelectRows)
|
|
||||||
table.setSelectionMode((QAbstractItemView.SingleSelection))
|
|
||||||
table.setWordWrap(False)
|
|
||||||
table.setModel(model)
|
|
||||||
|
|
||||||
def changerank2(key, up):
|
|
||||||
idx = globalconfig["toolbutton"]["rank2"].index(key)
|
|
||||||
idx2 = idx + (-1 if up else 1)
|
idx2 = idx + (-1 if up else 1)
|
||||||
if idx2 < 0 or idx2 >= len(globalconfig["toolbutton"]["rank2"]):
|
if idx2 < 0 or idx2 >= len(sortlist):
|
||||||
return
|
return
|
||||||
|
headoffset = 1
|
||||||
idx2 = idx + (-1 if up else 1)
|
idx2 = idx + (-1 if up else 1)
|
||||||
(
|
sortlist[idx], sortlist[idx2] = sortlist[idx2], sortlist[idx]
|
||||||
globalconfig["toolbutton"]["rank2"][idx],
|
for i, ww in enumerate(savelist[idx + headoffset]):
|
||||||
globalconfig["toolbutton"]["rank2"][idx2],
|
|
||||||
) = (
|
|
||||||
globalconfig["toolbutton"]["rank2"][idx2],
|
|
||||||
globalconfig["toolbutton"]["rank2"][idx],
|
|
||||||
)
|
|
||||||
|
|
||||||
model.removeRow(idx2)
|
w1 = savelay[0].indexOf(ww)
|
||||||
newline(idx, globalconfig["toolbutton"]["rank2"][idx]),
|
w2 = savelay[0].indexOf(savelist[idx2 + headoffset][i])
|
||||||
|
p1 = savelay[0].getItemPosition(w1)
|
||||||
|
p2 = savelay[0].getItemPosition(w2)
|
||||||
|
savelay[0].removeWidget(ww)
|
||||||
|
savelay[0].removeWidget(savelist[idx2 + headoffset][i])
|
||||||
|
|
||||||
|
savelay[0].addWidget(savelist[idx2 + headoffset][i], *p1)
|
||||||
|
savelay[0].addWidget(ww, *p2)
|
||||||
|
savelist[idx + headoffset], savelist[idx2 + headoffset] = (
|
||||||
|
savelist[idx2 + headoffset],
|
||||||
|
savelist[idx + headoffset],
|
||||||
|
)
|
||||||
gobject.baseobject.translation_ui.adjustbuttons()
|
gobject.baseobject.translation_ui.adjustbuttons()
|
||||||
|
|
||||||
def newline(row, k):
|
for i, k in enumerate(sortlist):
|
||||||
if "belong" in globalconfig["toolbutton"]["buttons"][k]:
|
|
||||||
belong = (
|
|
||||||
"("
|
|
||||||
+ _TR("仅")
|
|
||||||
+ " ".join(globalconfig["toolbutton"]["buttons"][k]["belong"])
|
|
||||||
+ ")"
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
belong = ""
|
|
||||||
model.insertRow(
|
|
||||||
row,
|
|
||||||
[
|
|
||||||
QStandardItem(),
|
|
||||||
QStandardItem(),
|
|
||||||
QStandardItem(),
|
|
||||||
QStandardItem(),
|
|
||||||
QStandardItem(),
|
|
||||||
QStandardItem(),
|
|
||||||
QStandardItem(
|
|
||||||
_TR(globalconfig["toolbutton"]["buttons"][k]["tip"]) + " " + belong
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
table.setIndexWidget(
|
|
||||||
model.index(row, 0),
|
|
||||||
getsimpleswitch(
|
|
||||||
globalconfig["toolbutton"]["buttons"][k],
|
|
||||||
"use",
|
|
||||||
callback=lambda _: gobject.baseobject.translation_ui.adjustbuttons(),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
button_up = getcolorbutton(
|
button_up = getcolorbutton(
|
||||||
globalconfig,
|
globalconfig,
|
||||||
"",
|
"",
|
||||||
callback=functools.partial(changerank2, k, True),
|
callback=functools.partial(changerank, k, True),
|
||||||
icon="fa.arrow-up",
|
icon="fa.arrow-up",
|
||||||
constcolor="#FF69B4",
|
constcolor="#FF69B4",
|
||||||
)
|
)
|
||||||
button_down = getcolorbutton(
|
button_down = getcolorbutton(
|
||||||
globalconfig,
|
globalconfig,
|
||||||
"",
|
"",
|
||||||
callback=functools.partial(changerank2, k, False),
|
callback=functools.partial(changerank, k, False),
|
||||||
icon="fa.arrow-down",
|
icon="fa.arrow-down",
|
||||||
constcolor="#FF69B4",
|
constcolor="#FF69B4",
|
||||||
)
|
)
|
||||||
table.setIndexWidget(
|
|
||||||
model.index(row, 1),
|
|
||||||
button_up,
|
|
||||||
)
|
|
||||||
table.setIndexWidget(
|
|
||||||
model.index(row, 2),
|
|
||||||
button_down,
|
|
||||||
)
|
|
||||||
|
|
||||||
table.setIndexWidget(
|
l = [
|
||||||
model.index(row, 3),
|
getsimpleswitch(
|
||||||
|
globalconfig["toolbutton"]["buttons"][k],
|
||||||
|
"use",
|
||||||
|
callback=lambda _: gobject.baseobject.translation_ui.adjustbuttons(),
|
||||||
|
),
|
||||||
|
button_up,
|
||||||
|
button_down,
|
||||||
getsimplecombobox(
|
getsimplecombobox(
|
||||||
_TRL(["居左", "居右", "居中"]),
|
_TRL(["居左", "居右", "居中"]),
|
||||||
globalconfig["toolbutton"]["buttons"][k],
|
globalconfig["toolbutton"]["buttons"][k],
|
||||||
"align",
|
"align",
|
||||||
callback=lambda _: gobject.baseobject.translation_ui.adjustbuttons(),
|
callback=lambda _: gobject.baseobject.translation_ui.adjustbuttons(),
|
||||||
|
fixedsize=True,
|
||||||
),
|
),
|
||||||
)
|
|
||||||
table.setIndexWidget(
|
|
||||||
model.index(row, 4),
|
|
||||||
getcolorbutton(
|
getcolorbutton(
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
@ -166,10 +134,9 @@ def createbuttonwidget(self):
|
|||||||
color=globalconfig["buttoncolor"],
|
color=globalconfig["buttoncolor"],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
]
|
||||||
if "icon2" in globalconfig["toolbutton"]["buttons"][k]:
|
if "icon2" in globalconfig["toolbutton"]["buttons"][k]:
|
||||||
table.setIndexWidget(
|
l.append(
|
||||||
model.index(row, 5),
|
|
||||||
getcolorbutton(
|
getcolorbutton(
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
@ -182,11 +149,20 @@ def createbuttonwidget(self):
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
for row, k in enumerate(globalconfig["toolbutton"]["rank2"]):
|
l.append("")
|
||||||
newline(row, k)
|
if "belong" in globalconfig["toolbutton"]["buttons"][k]:
|
||||||
|
belong = (
|
||||||
return table
|
"_"
|
||||||
|
+ "仅"
|
||||||
|
+ "_"
|
||||||
|
+ " ".join(globalconfig["toolbutton"]["buttons"][k]["belong"])
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
belong = ""
|
||||||
|
l.append(globalconfig["toolbutton"]["buttons"][k]["tip"] + belong)
|
||||||
|
grids.append(l)
|
||||||
|
return makescroll(makegrid(grids, True, savelist, savelay))
|
||||||
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@ -268,7 +244,7 @@ def setTabThree_lazy(self):
|
|||||||
|
|
||||||
def callback(x):
|
def callback(x):
|
||||||
globalconfig.__setitem__("settingfonttype", x)
|
globalconfig.__setitem__("settingfonttype", x)
|
||||||
self.setstylesheet()
|
gobject.baseobject.setcommonstylesheet()
|
||||||
|
|
||||||
self.sfont_comboBox.activated[str].connect(callback)
|
self.sfont_comboBox.activated[str].connect(callback)
|
||||||
self.sfont_comboBox.setCurrentFont(QFont(globalconfig["settingfonttype"]))
|
self.sfont_comboBox.setCurrentFont(QFont(globalconfig["settingfonttype"]))
|
||||||
@ -437,14 +413,6 @@ def setTabThree_lazy(self):
|
|||||||
],
|
],
|
||||||
]
|
]
|
||||||
|
|
||||||
def __changefontsize(x):
|
|
||||||
self.setstylesheet()
|
|
||||||
self.resizefunction()
|
|
||||||
|
|
||||||
def __changeshowintab(x):
|
|
||||||
gobject.baseobject.translation_ui.showintab = x
|
|
||||||
showintab(int(gobject.baseobject.translation_ui.winId()), x)
|
|
||||||
|
|
||||||
def themelist(t):
|
def themelist(t):
|
||||||
return [_["name"] for _ in static_data["themes"][t]]
|
return [_["name"] for _ in static_data["themes"][t]]
|
||||||
|
|
||||||
@ -474,10 +442,21 @@ def setTabThree_lazy(self):
|
|||||||
(getspinbox(1, 100, globalconfig, "disappear_delay"), 2),
|
(getspinbox(1, 100, globalconfig, "disappear_delay"), 2),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
("任务栏中显示", 6),
|
("任务栏中显示_翻译窗口", 6),
|
||||||
getsimpleswitch(globalconfig, "showintab", callback=__changeshowintab),
|
getsimpleswitch(
|
||||||
|
globalconfig,
|
||||||
|
"showintab",
|
||||||
|
callback=lambda _: gobject.baseobject.setshowintab(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
[
|
||||||
|
("任务栏中显示_其他", 6),
|
||||||
|
getsimpleswitch(
|
||||||
|
globalconfig,
|
||||||
|
"showintab_sub",
|
||||||
|
callback=lambda _: gobject.baseobject.setshowintab(),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
[("子窗口任务栏中显示", 6), getsimpleswitch(globalconfig, "showintab_sub")],
|
|
||||||
[
|
[
|
||||||
("选择文本窗口中文本框只读", 6),
|
("选择文本窗口中文本框只读", 6),
|
||||||
getsimpleswitch(
|
getsimpleswitch(
|
||||||
@ -495,7 +474,11 @@ def setTabThree_lazy(self):
|
|||||||
("字体大小", 4),
|
("字体大小", 4),
|
||||||
(
|
(
|
||||||
getspinbox(
|
getspinbox(
|
||||||
1, 100, globalconfig, "settingfontsize", callback=__changefontsize
|
1,
|
||||||
|
100,
|
||||||
|
globalconfig,
|
||||||
|
"settingfontsize",
|
||||||
|
callback=lambda _: gobject.baseobject.setcommonstylesheet(),
|
||||||
),
|
),
|
||||||
2,
|
2,
|
||||||
),
|
),
|
||||||
@ -592,7 +575,6 @@ def setTabThree_lazy(self):
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
[],
|
|
||||||
[
|
[
|
||||||
("明暗", 6),
|
("明暗", 6),
|
||||||
(
|
(
|
||||||
@ -600,7 +582,7 @@ def setTabThree_lazy(self):
|
|||||||
_TRL(["明亮", "黑暗", "跟随系统"]),
|
_TRL(["明亮", "黑暗", "跟随系统"]),
|
||||||
globalconfig,
|
globalconfig,
|
||||||
"darklight",
|
"darklight",
|
||||||
callback=lambda _: self.setstylesheet(),
|
callback=lambda _: gobject.baseobject.setcommonstylesheet(),
|
||||||
),
|
),
|
||||||
5,
|
5,
|
||||||
),
|
),
|
||||||
@ -612,7 +594,7 @@ def setTabThree_lazy(self):
|
|||||||
_TRL(["默认"]) + themelist("light"),
|
_TRL(["默认"]) + themelist("light"),
|
||||||
globalconfig,
|
globalconfig,
|
||||||
"lighttheme",
|
"lighttheme",
|
||||||
callback=lambda _: self.setstylesheet(),
|
callback=lambda _: gobject.baseobject.setcommonstylesheet(),
|
||||||
),
|
),
|
||||||
5,
|
5,
|
||||||
),
|
),
|
||||||
@ -624,13 +606,14 @@ def setTabThree_lazy(self):
|
|||||||
themelist("dark"),
|
themelist("dark"),
|
||||||
globalconfig,
|
globalconfig,
|
||||||
"darktheme",
|
"darktheme",
|
||||||
callback=lambda _: self.setstylesheet(),
|
callback=lambda _: gobject.baseobject.setcommonstylesheet(),
|
||||||
),
|
),
|
||||||
5,
|
5,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
[],
|
||||||
[
|
[
|
||||||
("WindowEffect", 6),
|
("窗口特效_翻译窗口", 6),
|
||||||
(
|
(
|
||||||
getsimplecombobox(
|
getsimplecombobox(
|
||||||
["Disable", "Acrylic", "Aero"],
|
["Disable", "Acrylic", "Aero"],
|
||||||
@ -645,13 +628,13 @@ def setTabThree_lazy(self):
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
("WindowBackdrop", 6),
|
("窗口特效_其他", 6),
|
||||||
(
|
(
|
||||||
getsimplecombobox(
|
getsimplecombobox(
|
||||||
["Solid", "Acrylic", "Mica", "MicaAlt"],
|
["Solid", "Acrylic", "Mica", "MicaAlt"],
|
||||||
globalconfig,
|
globalconfig,
|
||||||
"WindowBackdrop",
|
"WindowBackdrop",
|
||||||
callback=lambda _: self.setstylesheet(),
|
callback=lambda _: gobject.baseobject.setcommonstylesheet(),
|
||||||
),
|
),
|
||||||
5,
|
5,
|
||||||
),
|
),
|
||||||
@ -950,21 +933,21 @@ def setTabThree_lazy(self):
|
|||||||
getsimpleswitch(globalconfig, "hookmagpie"),
|
getsimpleswitch(globalconfig, "hookmagpie"),
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
tab = self.makesubtab_lazy(
|
tab = makesubtab_lazy(
|
||||||
["文本设置", "界面主题", "窗口行为", "工具按钮", "窗口缩放"],
|
["文本设置", "界面主题", "窗口行为", "工具按钮", "窗口缩放"],
|
||||||
[
|
[
|
||||||
lambda: self.makescroll(self.makegrid(textgrid)),
|
lambda: makescroll(makegrid(textgrid)),
|
||||||
lambda: self.makescroll(self.makegrid(uigrid)),
|
lambda: makescroll(makegrid(uigrid)),
|
||||||
lambda: self.makescroll(self.makegrid(xingweigrid)),
|
lambda: makescroll(makegrid(xingweigrid)),
|
||||||
lambda: createbuttonwidget(self),
|
lambda: createbuttonwidget(self),
|
||||||
lambda: self.makevbox(
|
lambda: makevbox(
|
||||||
[
|
[
|
||||||
self.makegrid(commonfsgrid),
|
makegrid(commonfsgrid),
|
||||||
self.makesubtab_lazy(
|
makesubtab_lazy(
|
||||||
["Magpie", "外部缩放软件"],
|
["Magpie", "外部缩放软件"],
|
||||||
[
|
[
|
||||||
lambda: self.makescroll(self.makegrid(innermagpie)),
|
lambda: makescroll(makegrid(innermagpie)),
|
||||||
lambda: self.makescroll(self.makegrid(losslessgrid)),
|
lambda: makescroll(makegrid(losslessgrid)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
@ -327,7 +327,7 @@ class lazyscrollflow(QWidget):
|
|||||||
self.widgets = []
|
self.widgets = []
|
||||||
self.fakegeos = []
|
self.fakegeos = []
|
||||||
self._spacing = 6
|
self._spacing = 6
|
||||||
self._margin = 9
|
self._margin = self._spacing # 9
|
||||||
self.lock = threading.Lock()
|
self.lock = threading.Lock()
|
||||||
self.internalwid = QWidget(self)
|
self.internalwid = QWidget(self)
|
||||||
self.qscrollarea = ScrollArea(self)
|
self.qscrollarea = ScrollArea(self)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
from PyQt5.QtWidgets import QPlainTextEdit, QAction, QMenu, QFileDialog
|
from PyQt5.QtWidgets import QPlainTextEdit, QAction, QMenu, QFileDialog
|
||||||
from PyQt5.QtCore import Qt, pyqtSignal
|
from PyQt5.QtCore import Qt, pyqtSignal
|
||||||
|
from PyQt5.QtGui import QCursor
|
||||||
import qtawesome, functools, winsharedutils
|
import qtawesome, functools, winsharedutils
|
||||||
from gui.usefulwidget import closeashidewindow
|
from gui.usefulwidget import closeashidewindow
|
||||||
from myutils.config import globalconfig, _TR
|
from myutils.config import globalconfig, _TR
|
||||||
@ -54,7 +55,7 @@ class transhist(closeashidewindow):
|
|||||||
menu.addAction(hideshowraw)
|
menu.addAction(hideshowraw)
|
||||||
menu.addAction(hideshowapi)
|
menu.addAction(hideshowapi)
|
||||||
|
|
||||||
action = menu.exec(self.mapToGlobal(p))
|
action = menu.exec(QCursor.pos())
|
||||||
if action == qingkong:
|
if action == qingkong:
|
||||||
tb.clear()
|
tb.clear()
|
||||||
elif action == copy:
|
elif action == copy:
|
||||||
|
@ -258,8 +258,8 @@ class QUnFrameWindow(resizableframeless):
|
|||||||
self.translate_text.addsearchwordmask(hira, text, callback)
|
self.translate_text.addsearchwordmask(hira, text, callback)
|
||||||
|
|
||||||
if globalconfig["autodisappear"]:
|
if globalconfig["autodisappear"]:
|
||||||
flag = (self.showintab and self.isMinimized()) or (
|
flag = (globalconfig['showintab'] and self.isMinimized()) or (
|
||||||
not self.showintab and self.isHidden()
|
not globalconfig['showintab'] and self.isHidden()
|
||||||
)
|
)
|
||||||
|
|
||||||
if flag:
|
if flag:
|
||||||
@ -282,8 +282,8 @@ class QUnFrameWindow(resizableframeless):
|
|||||||
if self._move_drag:
|
if self._move_drag:
|
||||||
return
|
return
|
||||||
|
|
||||||
flag = (self.showintab and self.isMinimized()) or (
|
flag = (globalconfig['showintab'] and self.isMinimized()) or (
|
||||||
not self.showintab and self.isHidden()
|
not globalconfig['showintab'] and self.isHidden()
|
||||||
)
|
)
|
||||||
|
|
||||||
if flag:
|
if flag:
|
||||||
@ -481,13 +481,13 @@ class QUnFrameWindow(resizableframeless):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def hide_(self):
|
def hide_(self):
|
||||||
if self.showintab:
|
if globalconfig['showintab']:
|
||||||
windows.ShowWindow(int(self.winId()), windows.SW_SHOWMINIMIZED)
|
windows.ShowWindow(int(self.winId()), windows.SW_SHOWMINIMIZED)
|
||||||
else:
|
else:
|
||||||
self.hide()
|
self.hide()
|
||||||
|
|
||||||
def show_(self):
|
def show_(self):
|
||||||
if self.showintab:
|
if globalconfig['showintab']:
|
||||||
windows.ShowWindow(int(self.winId()), windows.SW_SHOWNOACTIVATE)
|
windows.ShowWindow(int(self.winId()), windows.SW_SHOWNOACTIVATE)
|
||||||
else:
|
else:
|
||||||
self.show()
|
self.show()
|
||||||
@ -597,11 +597,9 @@ class QUnFrameWindow(resizableframeless):
|
|||||||
self.setWindowIcon(icon)
|
self.setWindowIcon(icon)
|
||||||
self.tray = QSystemTrayIcon()
|
self.tray = QSystemTrayIcon()
|
||||||
self.tray.setIcon(icon)
|
self.tray.setIcon(icon)
|
||||||
showintab(int(self.winId()), globalconfig["showintab"])
|
|
||||||
self.isfirstshow = True
|
self.isfirstshow = True
|
||||||
self.setAttribute(Qt.WA_TranslucentBackground)
|
self.setAttribute(Qt.WA_TranslucentBackground)
|
||||||
self.setAttribute(Qt.WA_ShowWithoutActivating, True)
|
self.setAttribute(Qt.WA_ShowWithoutActivating, True)
|
||||||
self.showintab = globalconfig["showintab"]
|
|
||||||
self.setWindowTitle("LunaTranslator")
|
self.setWindowTitle("LunaTranslator")
|
||||||
self.hidesignal.connect(self.hide_)
|
self.hidesignal.connect(self.hide_)
|
||||||
self.lastrefreshtime = time.time()
|
self.lastrefreshtime = time.time()
|
||||||
|
@ -4,8 +4,11 @@ from PyQt5.QtWidgets import (
|
|||||||
QApplication,
|
QApplication,
|
||||||
QPushButton,
|
QPushButton,
|
||||||
QMessageBox,
|
QMessageBox,
|
||||||
|
QTabWidget,
|
||||||
|
QScrollArea,
|
||||||
QDialog,
|
QDialog,
|
||||||
QLabel,
|
QLabel,
|
||||||
|
QGridLayout,
|
||||||
QSizePolicy,
|
QSizePolicy,
|
||||||
QHBoxLayout,
|
QHBoxLayout,
|
||||||
QWidget,
|
QWidget,
|
||||||
@ -39,7 +42,7 @@ from PyQt5.QtWidgets import (
|
|||||||
from traceback import print_exc
|
from traceback import print_exc
|
||||||
import qtawesome, functools, threading, time
|
import qtawesome, functools, threading, time
|
||||||
from myutils.wrapper import Singleton
|
from myutils.wrapper import Singleton
|
||||||
from winsharedutils import showintab, HTMLBrowser
|
from winsharedutils import HTMLBrowser
|
||||||
import windows, os, platform
|
import windows, os, platform
|
||||||
|
|
||||||
|
|
||||||
@ -137,8 +140,6 @@ class closeashidewindow(saveposwindow):
|
|||||||
super().__init__(parent, dic, key)
|
super().__init__(parent, dic, key)
|
||||||
self.showsignal.connect(self.showfunction)
|
self.showsignal.connect(self.showfunction)
|
||||||
self.realshowhide.connect(self.realshowhidefunction)
|
self.realshowhide.connect(self.realshowhidefunction)
|
||||||
if globalconfig["showintab_sub"]:
|
|
||||||
showintab(int(self.winId()), True)
|
|
||||||
|
|
||||||
def realshowhidefunction(self, show):
|
def realshowhidefunction(self, show):
|
||||||
if show:
|
if show:
|
||||||
@ -392,13 +393,15 @@ def callbackwrap(d, k, call, _):
|
|||||||
print_exc()
|
print_exc()
|
||||||
|
|
||||||
|
|
||||||
def getsimplecombobox(lst, d, k, callback=None):
|
def getsimplecombobox(lst, d, k, callback=None, fixedsize=False):
|
||||||
s = QComboBox()
|
s = QComboBox()
|
||||||
s.addItems(lst)
|
s.addItems(lst)
|
||||||
if (k not in d) or (d[k] >= len(lst)):
|
if (k not in d) or (d[k] >= len(lst)):
|
||||||
d[k] = 0
|
d[k] = 0
|
||||||
s.setCurrentIndex(d[k])
|
s.setCurrentIndex(d[k])
|
||||||
s.currentIndexChanged.connect(functools.partial(callbackwrap, d, k, callback))
|
s.currentIndexChanged.connect(functools.partial(callbackwrap, d, k, callback))
|
||||||
|
if fixedsize:
|
||||||
|
s.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
|
||||||
return s
|
return s
|
||||||
|
|
||||||
|
|
||||||
@ -525,6 +528,10 @@ def getboxlayout(widgets, lc=QHBoxLayout, margin0=False, makewidget=False):
|
|||||||
return cp_layout
|
return cp_layout
|
||||||
|
|
||||||
|
|
||||||
|
def makevbox(wids):
|
||||||
|
return getboxlayout(wids, lc=QVBoxLayout, margin0=True, makewidget=True)
|
||||||
|
|
||||||
|
|
||||||
def textbrowappendandmovetoend(textOutput, sentence, addspace=True):
|
def textbrowappendandmovetoend(textOutput, sentence, addspace=True):
|
||||||
scrollbar = textOutput.verticalScrollBar()
|
scrollbar = textOutput.verticalScrollBar()
|
||||||
atBottom = (
|
atBottom = (
|
||||||
@ -654,6 +661,7 @@ def getsimplekeyseq(dic, key, callback=None):
|
|||||||
key1.changeedvent.connect(functools.partial(__, dic, key, callback))
|
key1.changeedvent.connect(functools.partial(__, dic, key, callback))
|
||||||
return key1
|
return key1
|
||||||
|
|
||||||
|
|
||||||
class auto_select_webview(QWidget):
|
class auto_select_webview(QWidget):
|
||||||
on_load = pyqtSignal(str)
|
on_load = pyqtSignal(str)
|
||||||
|
|
||||||
@ -756,3 +764,105 @@ def tabadd_lazy(tab, title, getrealwidgetfunction):
|
|||||||
v.setContentsMargins(0, 0, 0, 0)
|
v.setContentsMargins(0, 0, 0, 0)
|
||||||
q.lazyfunction = lambda: v.addWidget(getrealwidgetfunction())
|
q.lazyfunction = lambda: v.addWidget(getrealwidgetfunction())
|
||||||
tab.addTab(q, _TR(title))
|
tab.addTab(q, _TR(title))
|
||||||
|
|
||||||
|
|
||||||
|
def automakegrid(grid: QGridLayout, lis, save=False, savelist=None):
|
||||||
|
|
||||||
|
maxl = 0
|
||||||
|
for nowr, line in enumerate(lis):
|
||||||
|
nowc = 0
|
||||||
|
for i in line:
|
||||||
|
if type(i) == str:
|
||||||
|
cols = 1
|
||||||
|
elif type(i) != tuple:
|
||||||
|
wid, cols = i, 1
|
||||||
|
elif len(i) == 2:
|
||||||
|
|
||||||
|
wid, cols = i
|
||||||
|
elif len(i) == 3:
|
||||||
|
wid, cols, arg = i
|
||||||
|
nowc += cols
|
||||||
|
maxl = max(maxl, nowc)
|
||||||
|
|
||||||
|
for nowr, line in enumerate(lis):
|
||||||
|
nowc = 0
|
||||||
|
if save:
|
||||||
|
ll = []
|
||||||
|
for i in line:
|
||||||
|
if type(i) == str:
|
||||||
|
cols = 1
|
||||||
|
wid = QLabel(_TR(i))
|
||||||
|
elif type(i) != tuple:
|
||||||
|
wid, cols = i, 1
|
||||||
|
elif len(i) == 2:
|
||||||
|
|
||||||
|
wid, cols = i
|
||||||
|
if type(wid) == str:
|
||||||
|
wid = QLabel(_TR(wid))
|
||||||
|
elif len(i) == 3:
|
||||||
|
wid, cols, arg = i
|
||||||
|
if type(wid) == str:
|
||||||
|
wid = QLabel((wid))
|
||||||
|
if arg == "link":
|
||||||
|
wid.setOpenExternalLinks(True)
|
||||||
|
if cols > 0:
|
||||||
|
col = cols
|
||||||
|
elif cols == 0:
|
||||||
|
col = maxl
|
||||||
|
else:
|
||||||
|
col = -maxl // cols
|
||||||
|
grid.addWidget(wid, nowr, nowc, 1, col)
|
||||||
|
if save:
|
||||||
|
ll.append(wid)
|
||||||
|
nowc += cols
|
||||||
|
if save:
|
||||||
|
savelist.append(ll)
|
||||||
|
grid.setRowMinimumHeight(nowr, 30)
|
||||||
|
|
||||||
|
|
||||||
|
def makegrid(grid, save=False, savelist=None, savelay=None):
|
||||||
|
|
||||||
|
class gridwidget(QWidget):
|
||||||
|
pass
|
||||||
|
|
||||||
|
gridlayoutwidget = gridwidget()
|
||||||
|
gridlay = QGridLayout()
|
||||||
|
gridlay.setAlignment(Qt.AlignTop)
|
||||||
|
gridlayoutwidget.setLayout(gridlay)
|
||||||
|
gridlayoutwidget.setStyleSheet("gridwidget{background-color:transparent;}")
|
||||||
|
|
||||||
|
automakegrid(gridlay, grid, save, savelist)
|
||||||
|
if save:
|
||||||
|
savelay.append(gridlay)
|
||||||
|
return gridlayoutwidget
|
||||||
|
|
||||||
|
|
||||||
|
def makesubtab_lazy(titles=None, functions=None, klass=None):
|
||||||
|
if klass:
|
||||||
|
tab = klass()
|
||||||
|
else:
|
||||||
|
tab = QTabWidget()
|
||||||
|
|
||||||
|
def __(t, i):
|
||||||
|
try:
|
||||||
|
w = t.currentWidget()
|
||||||
|
if "lazyfunction" in dir(w):
|
||||||
|
w.lazyfunction()
|
||||||
|
delattr(w, "lazyfunction")
|
||||||
|
except:
|
||||||
|
print_exc()
|
||||||
|
|
||||||
|
tab.currentChanged.connect(functools.partial(__, tab))
|
||||||
|
if titles and functions:
|
||||||
|
for i, func in enumerate(functions):
|
||||||
|
tabadd_lazy(tab, titles[i], func)
|
||||||
|
return tab
|
||||||
|
|
||||||
|
|
||||||
|
def makescroll(widget):
|
||||||
|
scroll = QScrollArea()
|
||||||
|
# scroll.setHorizontalScrollBarPolicy(1)
|
||||||
|
scroll.setStyleSheet("""QScrollArea{background-color:transparent;border:0px}""")
|
||||||
|
scroll.setWidgetResizable(True)
|
||||||
|
scroll.setWidget(widget)
|
||||||
|
return scroll
|
||||||
|
@ -71,6 +71,7 @@
|
|||||||
"uselongtermcache": false,
|
"uselongtermcache": false,
|
||||||
"fixedheight": false,
|
"fixedheight": false,
|
||||||
"showintab": true,
|
"showintab": true,
|
||||||
|
"showintab_sub": true,
|
||||||
"remove_useless_hook": false,
|
"remove_useless_hook": false,
|
||||||
"button_color_close": "#D32424",
|
"button_color_close": "#D32424",
|
||||||
"button_color_normal": "#FFFFFF",
|
"button_color_normal": "#FFFFFF",
|
||||||
@ -209,7 +210,6 @@
|
|||||||
],
|
],
|
||||||
"searchwordusewebview": false,
|
"searchwordusewebview": false,
|
||||||
"settingfonttype": "Arial",
|
"settingfonttype": "Arial",
|
||||||
"showintab_sub": false,
|
|
||||||
"setting_geo_2": [
|
"setting_geo_2": [
|
||||||
100,
|
100,
|
||||||
100,
|
100,
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"file": "dark_win11like.py",
|
"file": "dark_win11like.py",
|
||||||
"name": "win11like"
|
"name": "QTWin11"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"light": [
|
"light": [
|
||||||
@ -33,7 +33,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"file": "light_win11like.py",
|
"file": "light_win11like.py",
|
||||||
"name": "win11like"
|
"name": "QTWin11"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -570,7 +570,6 @@
|
|||||||
"过滤反复刷新的句子": "تصفية الجمل التي يتم تحديثها مرارا وتكرارا",
|
"过滤反复刷新的句子": "تصفية الجمل التي يتم تحديثها مرارا وتكرارا",
|
||||||
"选择图标": "اختيار الرموز",
|
"选择图标": "اختيار الرموز",
|
||||||
"图标2": "أيقونات",
|
"图标2": "أيقونات",
|
||||||
"子窗口任务栏中显示": "عرض في شريط المهام نافذة الطفل",
|
|
||||||
"刷新": "منعش",
|
"刷新": "منعش",
|
||||||
"读取剪贴板": "قراءة الحافظة",
|
"读取剪贴板": "قراءة الحافظة",
|
||||||
"进行一次OCR": "التعرف الضوئي على الحروف",
|
"进行一次OCR": "التعرف الضوئي على الحروف",
|
||||||
@ -802,5 +801,6 @@
|
|||||||
"翻译窗口": "نافذة الترجمة",
|
"翻译窗口": "نافذة الترجمة",
|
||||||
"工具按钮": "أداة زر",
|
"工具按钮": "أداة زر",
|
||||||
"界面主题": "واجهة الموضوع",
|
"界面主题": "واجهة الموضوع",
|
||||||
"窗口行为": "نافذة السلوك"
|
"窗口行为": "نافذة السلوك",
|
||||||
|
"窗口特效": "نافذة المؤثرات الخاصة"
|
||||||
}
|
}
|
@ -570,7 +570,6 @@
|
|||||||
"过滤反复刷新的句子": "過濾反復重繪的句子",
|
"过滤反复刷新的句子": "過濾反復重繪的句子",
|
||||||
"选择图标": "選擇圖標",
|
"选择图标": "選擇圖標",
|
||||||
"图标2": "圖標2",
|
"图标2": "圖標2",
|
||||||
"子窗口任务栏中显示": "子視窗工作列中顯示",
|
|
||||||
"刷新": "刷新",
|
"刷新": "刷新",
|
||||||
"读取剪贴板": "讀取剪貼板",
|
"读取剪贴板": "讀取剪貼板",
|
||||||
"进行一次OCR": "進行一次OCR",
|
"进行一次OCR": "進行一次OCR",
|
||||||
@ -802,5 +801,6 @@
|
|||||||
"翻译窗口": "翻譯視窗",
|
"翻译窗口": "翻譯視窗",
|
||||||
"工具按钮": "工具按鈕",
|
"工具按钮": "工具按鈕",
|
||||||
"界面主题": "介面主題",
|
"界面主题": "介面主題",
|
||||||
"窗口行为": "視窗行為"
|
"窗口行为": "視窗行為",
|
||||||
|
"窗口特效": "視窗特效"
|
||||||
}
|
}
|
@ -570,7 +570,6 @@
|
|||||||
"过滤反复刷新的句子": "Filter repeatedly refreshed sentences",
|
"过滤反复刷新的句子": "Filter repeatedly refreshed sentences",
|
||||||
"选择图标": "Select icon",
|
"选择图标": "Select icon",
|
||||||
"图标2": "Icon 2",
|
"图标2": "Icon 2",
|
||||||
"子窗口任务栏中显示": "Display in the sub window Taskbar",
|
|
||||||
"刷新": "Refresh",
|
"刷新": "Refresh",
|
||||||
"读取剪贴板": "Read clipboard",
|
"读取剪贴板": "Read clipboard",
|
||||||
"进行一次OCR": "Conduct an OCR",
|
"进行一次OCR": "Conduct an OCR",
|
||||||
@ -802,5 +801,6 @@
|
|||||||
"翻译窗口": "Translation Window",
|
"翻译窗口": "Translation Window",
|
||||||
"工具按钮": "Tool buttons",
|
"工具按钮": "Tool buttons",
|
||||||
"界面主题": "Interface Theme",
|
"界面主题": "Interface Theme",
|
||||||
"窗口行为": "Window behavior"
|
"窗口行为": "Window behavior",
|
||||||
|
"窗口特效": "Window effects"
|
||||||
}
|
}
|
@ -570,7 +570,6 @@
|
|||||||
"过滤反复刷新的句子": "Filtrar oraciones actualizadas repetidamente",
|
"过滤反复刷新的句子": "Filtrar oraciones actualizadas repetidamente",
|
||||||
"选择图标": "Seleccionar icono",
|
"选择图标": "Seleccionar icono",
|
||||||
"图标2": "Icono 2",
|
"图标2": "Icono 2",
|
||||||
"子窗口任务栏中显示": "Se muestra en la barra de tareas de la ventana hijo",
|
|
||||||
"刷新": "Refrescar",
|
"刷新": "Refrescar",
|
||||||
"读取剪贴板": "Leer el portapapeles",
|
"读取剪贴板": "Leer el portapapeles",
|
||||||
"进行一次OCR": "Realizar un OCR",
|
"进行一次OCR": "Realizar un OCR",
|
||||||
@ -802,5 +801,6 @@
|
|||||||
"翻译窗口": "Ventana de traducción",
|
"翻译窗口": "Ventana de traducción",
|
||||||
"工具按钮": "Botones de herramientas",
|
"工具按钮": "Botones de herramientas",
|
||||||
"界面主题": "Tema de la interfaz",
|
"界面主题": "Tema de la interfaz",
|
||||||
"窗口行为": "Comportamiento de la ventana"
|
"窗口行为": "Comportamiento de la ventana",
|
||||||
|
"窗口特效": "Efectos especiales de la ventana"
|
||||||
}
|
}
|
@ -570,7 +570,6 @@
|
|||||||
"过滤反复刷新的句子": "Filtrer phrases rafraîchies à plusieurs reprises",
|
"过滤反复刷新的句子": "Filtrer phrases rafraîchies à plusieurs reprises",
|
||||||
"选择图标": "Sélectionner une icône",
|
"选择图标": "Sélectionner une icône",
|
||||||
"图标2": "Icône 2",
|
"图标2": "Icône 2",
|
||||||
"子窗口任务栏中显示": "Affichage dans la barre des tâches de la Sous - fenêtre",
|
|
||||||
"刷新": "Rafraîchir",
|
"刷新": "Rafraîchir",
|
||||||
"读取剪贴板": "Lire le presse - papiers",
|
"读取剪贴板": "Lire le presse - papiers",
|
||||||
"进行一次OCR": "Faites une ocr",
|
"进行一次OCR": "Faites une ocr",
|
||||||
@ -802,5 +801,6 @@
|
|||||||
"翻译窗口": "Fenêtre de traduction",
|
"翻译窗口": "Fenêtre de traduction",
|
||||||
"工具按钮": "Le bouton outils",
|
"工具按钮": "Le bouton outils",
|
||||||
"界面主题": "Thème de l'interface",
|
"界面主题": "Thème de l'interface",
|
||||||
"窗口行为": "Comportement de la fenêtre"
|
"窗口行为": "Comportement de la fenêtre",
|
||||||
|
"窗口特效": "Effets spéciaux de fenêtre"
|
||||||
}
|
}
|
@ -570,7 +570,6 @@
|
|||||||
"过滤反复刷新的句子": "Filtra frasi aggiornate ripetutamente",
|
"过滤反复刷新的句子": "Filtra frasi aggiornate ripetutamente",
|
||||||
"选择图标": "Seleziona icona",
|
"选择图标": "Seleziona icona",
|
||||||
"图标2": "Icona 2",
|
"图标2": "Icona 2",
|
||||||
"子窗口任务栏中显示": "Mostra nella barra delle applicazioni della sottofinestra",
|
|
||||||
"刷新": "Aggiorna",
|
"刷新": "Aggiorna",
|
||||||
"读取剪贴板": "Leggi gli appunti",
|
"读取剪贴板": "Leggi gli appunti",
|
||||||
"进行一次OCR": "Condurre un OCR",
|
"进行一次OCR": "Condurre un OCR",
|
||||||
@ -802,5 +801,6 @@
|
|||||||
"翻译窗口": "Finestra di traduzione",
|
"翻译窗口": "Finestra di traduzione",
|
||||||
"工具按钮": "Pulsanti strumenti",
|
"工具按钮": "Pulsanti strumenti",
|
||||||
"界面主题": "Tema interfaccia",
|
"界面主题": "Tema interfaccia",
|
||||||
"窗口行为": "Comportamento delle finestre"
|
"窗口行为": "Comportamento delle finestre",
|
||||||
|
"窗口特效": "Effetti finestra"
|
||||||
}
|
}
|
@ -570,7 +570,6 @@
|
|||||||
"过滤反复刷新的句子": "繰り返し更新された文をフィルタリングする",
|
"过滤反复刷新的句子": "繰り返し更新された文をフィルタリングする",
|
||||||
"选择图标": "アイコンを選択",
|
"选择图标": "アイコンを選択",
|
||||||
"图标2": "アイコン2",
|
"图标2": "アイコン2",
|
||||||
"子窗口任务栏中显示": "サブウィンドウタスクバーに表示",
|
|
||||||
"刷新": "リフレッシュ",
|
"刷新": "リフレッシュ",
|
||||||
"读取剪贴板": "クリップボードを読み込む",
|
"读取剪贴板": "クリップボードを読み込む",
|
||||||
"进行一次OCR": "OCRを1回実行する",
|
"进行一次OCR": "OCRを1回実行する",
|
||||||
@ -802,5 +801,6 @@
|
|||||||
"翻译窗口": "翻訳ウィンドウ",
|
"翻译窗口": "翻訳ウィンドウ",
|
||||||
"工具按钮": "ツールボタン",
|
"工具按钮": "ツールボタン",
|
||||||
"界面主题": "インタフェーストピック",
|
"界面主题": "インタフェーストピック",
|
||||||
"窗口行为": "ウィンドウの動作"
|
"窗口行为": "ウィンドウの動作",
|
||||||
|
"窗口特效": "ウィンドウ効果"
|
||||||
}
|
}
|
@ -570,7 +570,6 @@
|
|||||||
"过滤反复刷新的句子": "반복적으로 새로 고친 문장 필터링",
|
"过滤反复刷新的句子": "반복적으로 새로 고친 문장 필터링",
|
||||||
"选择图标": "아이콘 선택",
|
"选择图标": "아이콘 선택",
|
||||||
"图标2": "아이콘 2",
|
"图标2": "아이콘 2",
|
||||||
"子窗口任务栏中显示": "하위 창 작업 표시줄에 표시",
|
|
||||||
"刷新": "새로 고침",
|
"刷新": "새로 고침",
|
||||||
"读取剪贴板": "클립보드 읽기",
|
"读取剪贴板": "클립보드 읽기",
|
||||||
"进行一次OCR": "OCR을 한번 진행해보도록 하겠습니다.",
|
"进行一次OCR": "OCR을 한번 진행해보도록 하겠습니다.",
|
||||||
@ -802,5 +801,6 @@
|
|||||||
"翻译窗口": "번역 창",
|
"翻译窗口": "번역 창",
|
||||||
"工具按钮": "도구 단추",
|
"工具按钮": "도구 단추",
|
||||||
"界面主题": "인터페이스 주제",
|
"界面主题": "인터페이스 주제",
|
||||||
"窗口行为": "창 동작"
|
"窗口行为": "창 동작",
|
||||||
|
"窗口特效": "창 효과"
|
||||||
}
|
}
|
@ -570,7 +570,6 @@
|
|||||||
"过滤反复刷新的句子": "Filtruj wielokrotnie odświeżane zdania",
|
"过滤反复刷新的句子": "Filtruj wielokrotnie odświeżane zdania",
|
||||||
"选择图标": "Wybierz ikonę",
|
"选择图标": "Wybierz ikonę",
|
||||||
"图标2": "Ikona 2",
|
"图标2": "Ikona 2",
|
||||||
"子窗口任务栏中显示": "Wyświetlanie w podoknie Pasek zadań",
|
|
||||||
"刷新": "Odśwież",
|
"刷新": "Odśwież",
|
||||||
"读取剪贴板": "Odczytaj schowek",
|
"读取剪贴板": "Odczytaj schowek",
|
||||||
"进行一次OCR": "Przeprowadzenie OCR",
|
"进行一次OCR": "Przeprowadzenie OCR",
|
||||||
@ -802,5 +801,6 @@
|
|||||||
"翻译窗口": "Okno tłumaczenia",
|
"翻译窗口": "Okno tłumaczenia",
|
||||||
"工具按钮": "Przyciski narzędziowe",
|
"工具按钮": "Przyciski narzędziowe",
|
||||||
"界面主题": "Motyw interfejsu",
|
"界面主题": "Motyw interfejsu",
|
||||||
"窗口行为": "Zachowanie okna"
|
"窗口行为": "Zachowanie okna",
|
||||||
|
"窗口特效": "Efekty okien"
|
||||||
}
|
}
|
@ -570,7 +570,6 @@
|
|||||||
"过滤反复刷新的句子": "Фильтровать повторяющиеся предложения",
|
"过滤反复刷新的句子": "Фильтровать повторяющиеся предложения",
|
||||||
"选择图标": "Выберите значок",
|
"选择图标": "Выберите значок",
|
||||||
"图标2": "Значок 2",
|
"图标2": "Значок 2",
|
||||||
"子窗口任务栏中显示": "Показать панель задач подсветки",
|
|
||||||
"刷新": "Обновить",
|
"刷新": "Обновить",
|
||||||
"读取剪贴板": "Прочитать буфер обмена",
|
"读取剪贴板": "Прочитать буфер обмена",
|
||||||
"进行一次OCR": "Выполнить OCR",
|
"进行一次OCR": "Выполнить OCR",
|
||||||
@ -802,5 +801,6 @@
|
|||||||
"翻译窗口": "Окно перевода",
|
"翻译窗口": "Окно перевода",
|
||||||
"工具按钮": "Кнопки инструментов",
|
"工具按钮": "Кнопки инструментов",
|
||||||
"界面主题": "Интерфейсная тема",
|
"界面主题": "Интерфейсная тема",
|
||||||
"窗口行为": "Поведение окна"
|
"窗口行为": "Поведение окна",
|
||||||
|
"窗口特效": "Специальные эффекты окон"
|
||||||
}
|
}
|
@ -396,7 +396,6 @@
|
|||||||
"相关说明": "คำแนะนำที่เกี่ยวข้อง",
|
"相关说明": "คำแนะนำที่เกี่ยวข้อง",
|
||||||
"字体": "แบบอักษร",
|
"字体": "แบบอักษร",
|
||||||
"韩语(CP949,EUC-KR)": "เกาหลี (CP949, EUC-KR)",
|
"韩语(CP949,EUC-KR)": "เกาหลี (CP949, EUC-KR)",
|
||||||
"子窗口任务栏中显示": "แสดงในแถบงานของหน้าต่างย่อย",
|
|
||||||
"分词": "แยกคำ",
|
"分词": "แยกคำ",
|
||||||
"基本设置": "การตั้งค่าพื้นฐาน",
|
"基本设置": "การตั้งค่าพื้นฐาน",
|
||||||
"光标缩放系数": "ค่าสัมประสิทธิ์การซูมเคอร์เซอร์",
|
"光标缩放系数": "ค่าสัมประสิทธิ์การซูมเคอร์เซอร์",
|
||||||
@ -802,5 +801,6 @@
|
|||||||
"翻译窗口": "หน้าต่างการแปล",
|
"翻译窗口": "หน้าต่างการแปล",
|
||||||
"工具按钮": "ปุ่มเครื่องมือ",
|
"工具按钮": "ปุ่มเครื่องมือ",
|
||||||
"界面主题": "ธีมอินเตอร์เฟซ",
|
"界面主题": "ธีมอินเตอร์เฟซ",
|
||||||
"窗口行为": "พฤติกรรมของหน้าต่าง"
|
"窗口行为": "พฤติกรรมของหน้าต่าง",
|
||||||
|
"窗口特效": "เทคนิคพิเศษของหน้าต่าง"
|
||||||
}
|
}
|
@ -570,7 +570,6 @@
|
|||||||
"过滤反复刷新的句子": "Süzgücü tekrar yenilenmiş cümleler",
|
"过滤反复刷新的句子": "Süzgücü tekrar yenilenmiş cümleler",
|
||||||
"选择图标": "İşaretçiyi seç",
|
"选择图标": "İşaretçiyi seç",
|
||||||
"图标2": "İşaretçi 2",
|
"图标2": "İşaretçi 2",
|
||||||
"子窗口任务栏中显示": "Alt pencere Görev Çubuğunda Gösterin",
|
|
||||||
"刷新": "Tazele",
|
"刷新": "Tazele",
|
||||||
"读取剪贴板": "Pano Oku",
|
"读取剪贴板": "Pano Oku",
|
||||||
"进行一次OCR": "OCR yap",
|
"进行一次OCR": "OCR yap",
|
||||||
@ -802,5 +801,6 @@
|
|||||||
"翻译窗口": "Çeviri Penceresi",
|
"翻译窗口": "Çeviri Penceresi",
|
||||||
"工具按钮": "Araç düğmeleri",
|
"工具按钮": "Araç düğmeleri",
|
||||||
"界面主题": "Interface Theme",
|
"界面主题": "Interface Theme",
|
||||||
"窗口行为": "Pencere davranışları"
|
"窗口行为": "Pencere davranışları",
|
||||||
|
"窗口特效": "Pencere etkileri"
|
||||||
}
|
}
|
@ -570,7 +570,6 @@
|
|||||||
"过滤反复刷新的句子": "Фільтрувати повторно оновлені речення",
|
"过滤反复刷新的句子": "Фільтрувати повторно оновлені речення",
|
||||||
"选择图标": "Виберіть піктограму",
|
"选择图标": "Виберіть піктограму",
|
||||||
"图标2": "Піктограма 2",
|
"图标2": "Піктограма 2",
|
||||||
"子窗口任务栏中显示": "Показати у панелі завдань підвікна",
|
|
||||||
"刷新": "Оновити",
|
"刷新": "Оновити",
|
||||||
"读取剪贴板": "Читати буфер обміну даними",
|
"读取剪贴板": "Читати буфер обміну даними",
|
||||||
"进行一次OCR": "Виконати OCR",
|
"进行一次OCR": "Виконати OCR",
|
||||||
@ -802,5 +801,6 @@
|
|||||||
"翻译窗口": "Вікно перекладу",
|
"翻译窗口": "Вікно перекладу",
|
||||||
"工具按钮": "Кнопки інструментів",
|
"工具按钮": "Кнопки інструментів",
|
||||||
"界面主题": "Тема інтерфейсу",
|
"界面主题": "Тема інтерфейсу",
|
||||||
"窗口行为": "Поведінка вікон"
|
"窗口行为": "Поведінка вікон",
|
||||||
|
"窗口特效": "Ефекти вікна"
|
||||||
}
|
}
|
@ -570,7 +570,6 @@
|
|||||||
"过滤反复刷新的句子": "Lọc các câu được làm mới nhiều lần",
|
"过滤反复刷新的句子": "Lọc các câu được làm mới nhiều lần",
|
||||||
"选择图标": "Chọn biểu tượng",
|
"选择图标": "Chọn biểu tượng",
|
||||||
"图标2": "Biểu tượng 2",
|
"图标2": "Biểu tượng 2",
|
||||||
"子窗口任务栏中显示": "Hiển thị trong thanh tác vụ cửa sổ con",
|
|
||||||
"刷新": "Làm mới",
|
"刷新": "Làm mới",
|
||||||
"读取剪贴板": "Đọc bảng nháp",
|
"读取剪贴板": "Đọc bảng nháp",
|
||||||
"进行一次OCR": "Thực hiện OCR",
|
"进行一次OCR": "Thực hiện OCR",
|
||||||
@ -802,5 +801,6 @@
|
|||||||
"翻译窗口": "Cửa sổ dịch",
|
"翻译窗口": "Cửa sổ dịch",
|
||||||
"工具按钮": "Nút công cụ",
|
"工具按钮": "Nút công cụ",
|
||||||
"界面主题": "Giao diện sắc thái",
|
"界面主题": "Giao diện sắc thái",
|
||||||
"窗口行为": "Ứng xử cửa sổ"
|
"窗口行为": "Ứng xử cửa sổ",
|
||||||
|
"窗口特效": "Hiệu ứng cửa sổ"
|
||||||
}
|
}
|
@ -391,7 +391,6 @@
|
|||||||
"相关说明": "",
|
"相关说明": "",
|
||||||
"字体": "",
|
"字体": "",
|
||||||
"韩语(CP949,EUC-KR)": "",
|
"韩语(CP949,EUC-KR)": "",
|
||||||
"子窗口任务栏中显示": "",
|
|
||||||
"分词": "",
|
"分词": "",
|
||||||
"基本设置": "",
|
"基本设置": "",
|
||||||
"光标缩放系数": "",
|
"光标缩放系数": "",
|
||||||
@ -802,5 +801,6 @@
|
|||||||
"翻译窗口": "",
|
"翻译窗口": "",
|
||||||
"工具按钮": "",
|
"工具按钮": "",
|
||||||
"界面主题": "",
|
"界面主题": "",
|
||||||
"窗口行为": ""
|
"窗口行为": "",
|
||||||
|
"窗口特效": ""
|
||||||
}
|
}
|
@ -27,9 +27,9 @@ include(libs/libs.cmake)
|
|||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/version)
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/version)
|
||||||
include(generate_product_version)
|
include(generate_product_version)
|
||||||
|
|
||||||
set(VERSION_MAJOR 2)
|
set(VERSION_MAJOR 3)
|
||||||
set(VERSION_MINOR 53)
|
set(VERSION_MINOR 0)
|
||||||
set(VERSION_PATCH 3)
|
set(VERSION_PATCH 0)
|
||||||
|
|
||||||
add_library(pch pch.cpp)
|
add_library(pch pch.cpp)
|
||||||
target_precompile_headers(pch PUBLIC pch.h)
|
target_precompile_headers(pch PUBLIC pch.h)
|
||||||
|
@ -6,12 +6,12 @@ DECLARE void showintab(HWND hwnd, bool show)
|
|||||||
if (show)
|
if (show)
|
||||||
{
|
{
|
||||||
style_ex |= WS_EX_APPWINDOW;
|
style_ex |= WS_EX_APPWINDOW;
|
||||||
style_ex &= ~WS_EX_TOOLWINDOW;
|
// style_ex &= ~WS_EX_TOOLWINDOW;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
style_ex &= ~WS_EX_APPWINDOW;
|
style_ex &= ~WS_EX_APPWINDOW;
|
||||||
style_ex |= WS_EX_TOOLWINDOW;
|
// style_ex |= WS_EX_TOOLWINDOW;
|
||||||
}
|
}
|
||||||
SetWindowLong(hwnd, GWL_EXSTYLE, style_ex);
|
SetWindowLong(hwnd, GWL_EXSTYLE, style_ex);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user