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:
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):
gameinternalid = self.get_gameinternalid(k)

View File

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