From 490d1a5a89a7ee660651b5d238fbf07db8dcb5b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Tue, 16 Apr 2024 00:39:13 +0800 Subject: [PATCH] fix --- .../LunaTranslator/gui/dialog_savedgame.py | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py index 09b33724..cf3112b8 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py @@ -400,15 +400,7 @@ class dialog_setting_game(QDialog): savehook_new_data[res] = savehook_new_data[self.exepath] savehook_new_data.pop(self.exepath) _icon = getExeIcon(res, cache=True) - if self.item: - self.item.savetext = res - self.table.setIndexWidget( - self.model.index(self.model.indexFromItem(self.item).row(), 1), - getcolorbutton( - "", "", functools.partial(opendir, res), qicon=_icon - ), - ) - + self.setWindowIcon(_icon) self.editpath.setText(res) self.exepath = res @@ -417,22 +409,20 @@ class dialog_setting_game(QDialog): self.isopened = False return super().closeEvent(a0) - def __init__(self, parent, exepath, item=None) -> None: + def __init__(self, parent, exepath) -> None: super().__init__(parent, Qt.WindowCloseButtonHint) global _global_dialog_setting_game _global_dialog_setting_game = self self.isopened = True checkifnewgame(exepath) - print(item) vbox = QVBoxLayout(self) # 配置layout self.setLayout(vbox) formwidget = QWidget() formLayout = QFormLayout() formwidget.setLayout(formLayout) - self.item = item self.exepath = exepath - editpath = QLineEdit(exepath) - editpath.setReadOnly(True) + self.editpath = QLineEdit(exepath) + self.editpath.setReadOnly(True) self.setWindowTitle(savehook_new_data[exepath]["title"]) self.setWindowIcon(getExeIcon(exepath, cache=True)) @@ -440,7 +430,7 @@ class dialog_setting_game(QDialog): _TR("路径"), getboxlayout( [ - editpath, + self.editpath, getcolorbutton( "", "",