Skip to content

Commit

Permalink
移除保存存档前的备份提示
Browse files Browse the repository at this point in the history
  • Loading branch information
XcantloadX committed Oct 10, 2024
1 parent 28ed26c commit f9a5169
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions app/native_ui/implement.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ def _excepthook(type, value, tb):
sys.excepthook = _excepthook

def save_hook(editor: SaveEditor, save: PresideData | PresideDataXbox):
ret = wx.MessageBox(_(u'是否备份当前存档?'), '提示', wx.OK | wx.CANCEL | wx.ICON_QUESTION)
if ret == wx.OK:
save_path = wx.SaveFileSelector('请选择备份路径', '.bak', default_name=_(u'逆转裁判存档备份.bak'))
if not save_path:
wx.MessageBox(_(u'备份已取消。'), _(u'提示'), wx.OK | wx.ICON_INFORMATION)
else:
original_save_path = editor.save_path
if not original_save_path:
raise NoOpenSaveFileError()
shutil.copy2(original_save_path, save_path)
# ret = wx.MessageBox(_(u'是否备份当前存档?'), '提示', wx.OK | wx.CANCEL | wx.ICON_QUESTION)
# if ret == wx.OK:
# save_path = wx.SaveFileSelector('请选择备份路径', '.bak', default_name=_(u'逆转裁判存档备份.bak'))
# if not save_path:
# wx.MessageBox(_(u'备份已取消。'), _(u'提示'), wx.OK | wx.ICON_INFORMATION)
# else:
# original_save_path = editor.save_path
# if not original_save_path:
# raise NoOpenSaveFileError()
# shutil.copy2(original_save_path, save_path)
return True

class Dialog(wx.Dialog):
Expand Down

0 comments on commit f9a5169

Please sign in to comment.