This commit is contained in:
恍兮惚兮 2024-06-09 21:47:30 +08:00
parent 01d2354e45
commit dcfe077807
2 changed files with 21 additions and 10 deletions

View File

@ -892,6 +892,13 @@ class MAINUI:
else: else:
return ret[0] return ret[0]
def resetgameinternal(self, fr, to):
_id = self.get_gameinternalid(fr)
self.sqlsavegameinfo.execute(
"UPDATE gameinternalid SET gamepath = ? WHERE (gameinternalid = ?)",
(to, _id),
)
def traceplaytime(self, k, start, end, new): def traceplaytime(self, k, start, end, new):
gameinternalid = self.get_gameinternalid(k) gameinternalid = self.get_gameinternalid(k)

View File

@ -628,20 +628,24 @@ def maybehavebutton(self, game, post):
class dialog_setting_game_internal(QWidget): class dialog_setting_game_internal(QWidget):
def selectexe(self): def selectexe(self):
# 修改exe之后不要去动列表否则会有一致性问题很难搞就这样吧。
f = QFileDialog.getOpenFileName(directory=self.exepath) f = QFileDialog.getOpenFileName(directory=self.exepath)
res = f[0] res = f[0]
if res != "": if res == "":
return
res = os.path.normpath(res) res = os.path.normpath(res)
if res in savehook_new_list: if res in savehook_new_list:
return return
savehook_new_list[savehook_new_list.index(self.exepath)] = res _origin = savehook_new_list[savehook_new_list.index(self.exepath)]
savehook_new_data[res] = savehook_new_data[self.exepath] savehook_new_list[savehook_new_list.index(self.exepath)] = res
_icon = getExeIcon(res, cache=True) savehook_new_data[res] = savehook_new_data[self.exepath]
gobject.baseobject.resetgameinternal(_origin, res)
_icon = getExeIcon(res, cache=True)
self.setWindowIcon(_icon) self.setWindowIcon(_icon)
self.editpath.setText(res) self.editpath.setText(res)
self.exepath = res self.exepath = res
def __init__(self, parent, exepath) -> None: def __init__(self, parent, exepath) -> None:
super().__init__(parent) super().__init__(parent)