diff --git a/LunaTranslator/LunaTranslator/transoptimi/gptpromptdict.py b/LunaTranslator/LunaTranslator/transoptimi/gptpromptdict.py index 3749b212..14d24285 100644 --- a/LunaTranslator/LunaTranslator/transoptimi/gptpromptdict.py +++ b/LunaTranslator/LunaTranslator/transoptimi/gptpromptdict.py @@ -1,7 +1,8 @@ -from myutils.config import globalconfig, savehook_new_data +from myutils.config import globalconfig, savehook_new_data, uid2gamepath from myutils.utils import postusewhich from gui.inputdialog import postconfigdialog_ import gobject +from myutils.hwnd import getExeIcon class Process: @@ -23,7 +24,7 @@ class Process: "专有名词翻译_sakura_gpt_词典", ["原文", "翻译", "注释"], dictkeys=["src", "dst", "info"], - ) + ).setWindowIcon(getExeIcon(uid2gamepath[gameuid], cache=True)) def process_before(self, japanese): diff --git a/LunaTranslator/LunaTranslator/transoptimi/noundict.py b/LunaTranslator/LunaTranslator/transoptimi/noundict.py index 292cbe48..6cf17a32 100644 --- a/LunaTranslator/LunaTranslator/transoptimi/noundict.py +++ b/LunaTranslator/LunaTranslator/transoptimi/noundict.py @@ -1,12 +1,13 @@ from myutils.config import noundictconfig, savehook_new_data -import gobject, re, functools, winsharedutils, json +import gobject, re, functools from qtsymbols import * from traceback import print_exc -import gobject from gui.usefulwidget import threebuttons, TableViewW from myutils.wrapper import Singleton_close from myutils.utils import postusewhich from gui.dynalang import LDialog, LLabel, LPushButton, LStandardItemModel, LAction +from myutils.config import uid2gamepath +from myutils.hwnd import getExeIcon @Singleton_close @@ -336,13 +337,11 @@ class Process: @staticmethod def get_setting_window_gameprivate(parent_window, gameuid): - return ( - noundictconfigdialog_private( - parent_window, - savehook_new_data[gameuid]["noundictconfig"], - "专有名词翻译_占位符", - ), - ) + return noundictconfigdialog_private( + parent_window, + savehook_new_data[gameuid]["noundictconfig"], + "专有名词翻译_占位符", + ).setWindowIcon(getExeIcon(uid2gamepath[gameuid], cache=True)) @staticmethod def get_setting_window(parent_window): diff --git a/LunaTranslator/LunaTranslator/transoptimi/transerrorfix.py b/LunaTranslator/LunaTranslator/transoptimi/transerrorfix.py index dfb8c12c..9662d99c 100644 --- a/LunaTranslator/LunaTranslator/transoptimi/transerrorfix.py +++ b/LunaTranslator/LunaTranslator/transoptimi/transerrorfix.py @@ -2,6 +2,8 @@ from myutils.config import transerrorfixdictconfig, savehook_new_data from myutils.utils import parsemayberegexreplace, postusewhich from gui.inputdialog import noundictconfigdialog1 import gobject +from myutils.config import uid2gamepath +from myutils.hwnd import getExeIcon class Process: @@ -22,7 +24,7 @@ class Process: savehook_new_data[gameuid]["transerrorfix"], "翻译结果修正_设置", ["正则", "翻译", "替换"], - ) + ).setWindowIcon(getExeIcon(uid2gamepath[gameuid], cache=True)) def process_after(self, res, mp1): res = parsemayberegexreplace(self.usewhich(), res) diff --git a/LunaTranslator/LunaTranslator/transoptimi/vndbnamemap.py b/LunaTranslator/LunaTranslator/transoptimi/vndbnamemap.py index 9cec7eb3..85c96975 100644 --- a/LunaTranslator/LunaTranslator/transoptimi/vndbnamemap.py +++ b/LunaTranslator/LunaTranslator/transoptimi/vndbnamemap.py @@ -1,8 +1,8 @@ -from myutils.config import savehook_new_data, globalconfig -import gobject, json, functools -from traceback import print_exc -from gui.inputdialog import postconfigdialog_ +from myutils.config import globalconfig, savehook_new_data, uid2gamepath from myutils.utils import postusewhich +from gui.inputdialog import postconfigdialog_ +import gobject, json, functools +from myutils.hwnd import getExeIcon class Process: @@ -33,7 +33,7 @@ class Process: "专有名词翻译_直接替换_设置", ["原文", "翻译"], closecallback=functools.partial(checkchange, gameuid, __), - ) + ).setWindowIcon(getExeIcon(uid2gamepath[gameuid], cache=True)) @property def using_X(self):