diff --git a/LunaTranslator/LunaTranslator/LunaTranslator.py b/LunaTranslator/LunaTranslator/LunaTranslator.py index c4f42dda..1d43bbcc 100644 --- a/LunaTranslator/LunaTranslator/LunaTranslator.py +++ b/LunaTranslator/LunaTranslator/LunaTranslator.py @@ -11,7 +11,7 @@ from myutils.config import ( static_data, tryreadconfig, ) -import zipfile, sqlite3 +import sqlite3 from myutils.utils import ( minmaxmoveobservefunc, parsemayberegexreplace, @@ -719,37 +719,12 @@ class MAINUI: else: pids = self.textsource.pids if sum([int(pid_running(pid)) for pid in pids]) == 0: - self.safebackupsavedata( - self.textsource.pname, - self.textsource.basename + "_" + self.textsource.md5, - ) self.textsource = None except: print_exc() - @threader - def safebackupsavedata(self, exe, signame): - path = savehook_new_data[exe]["autosavesavedata"] - if not os.path.exists(path): - return - data_head = time.strftime("%Y-%m-%d-%H-%M-%S.zip", time.localtime()) - savedirbase = globalconfig["backupsavedatato"] - if os.path.exists(savedirbase) == False: - savedirbase = "./cache/backup" - savedir = os.path.join(savedirbase, signame) - os.makedirs(savedir, exist_ok=True) - - def zip_directory(directory_path, output_path): - with zipfile.ZipFile(output_path, "w", zipfile.ZIP_DEFLATED) as zipf: - for root, _, files in os.walk(directory_path): - for file in files: - file_path = os.path.join(root, file) - relative_path = os.path.relpath(file_path, directory_path) - zipf.write(file_path, relative_path) - - zip_directory(path, savedir + "/" + data_head) def autohookmonitorthread(self): while self.isrunning: diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py index 3cd1a306..3aed0fe6 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py @@ -719,7 +719,6 @@ class dialog_setting_game_internal(QWidget): "统计", "语音", "预翻译", - "存档备份", ] ), [ @@ -732,7 +731,6 @@ class dialog_setting_game_internal(QWidget): functools.partial(self.doaddtab, self.getstatistic, exepath), functools.partial(self.doaddtab, self.getttssetting, exepath), functools.partial(self.doaddtab, self.getpretranstab, exepath), - functools.partial(self.doaddtab, self.getbackup, exepath), ], delay=True, ) @@ -831,44 +829,6 @@ class dialog_setting_game_internal(QWidget): w = wfunct(exe) layout.addWidget(w) - def getbackup(self, exepath): - _w = QWidget() - formLayout = QFormLayout() - _w.setLayout(formLayout) - - formLayout.addRow( - _TR("路径"), - getsimplepatheditor( - savehook_new_data[exepath]["autosavesavedata"], - False, - True, - None, - lambda _: savehook_new_data[exepath].__setitem__( - "autosavesavedata", os.path.normpath(_) - ), - True, - ), - ) - - formLayout.addRow( - _TR("备份到"), - getsimplepatheditor( - ( - globalconfig["backupsavedatato"] - if os.path.exists(globalconfig["backupsavedatato"]) - else os.path.abspath("./cache/backup") - ), - False, - True, - None, - lambda _: savehook_new_data[exepath].__setitem__( - "backupsavedatato", os.path.normpath(_) - ), - True, - ), - ) - - return _w def starttab(self, exepath): _w = QWidget() diff --git a/LunaTranslator/LunaTranslator/myutils/config.py b/LunaTranslator/LunaTranslator/myutils/config.py index 4c90a9c9..f14816b8 100644 --- a/LunaTranslator/LunaTranslator/myutils/config.py +++ b/LunaTranslator/LunaTranslator/myutils/config.py @@ -95,7 +95,7 @@ def getdefaultsavehook(gamepath, title=None): # "vndbtags": [],#->webtags "usertags": [], # "traceplaytime_v2": [], # [[start,end]]->db.traceplaytime_v4,这个东西增加到太快了,有点膨胀 - "autosavesavedata": "", + # "autosavesavedata": "", # 判断是否为自定义元数据,避免覆写 # "isimagepathusersetted": False, # "isimagepathusersetted_much": False, diff --git a/LunaTranslator/files/defaultconfig/config.json b/LunaTranslator/files/defaultconfig/config.json index f345644b..8aacebca 100644 --- a/LunaTranslator/files/defaultconfig/config.json +++ b/LunaTranslator/files/defaultconfig/config.json @@ -1738,6 +1738,5 @@ "path": "" }, "proxies": null, - "labelset": [], - "backupsavedatato": "" + "labelset": [] } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ar.json b/LunaTranslator/files/lang/ar.json index 3705bf19..6a31189e 100644 --- a/LunaTranslator/files/lang/ar.json +++ b/LunaTranslator/files/lang/ar.json @@ -737,9 +737,6 @@ "禁止自动朗读的人名": "أسماء الأشخاص المحظورين من القراءة التلقائية", "启动": "بدء", "批量添加": "إضافة دفعة", - "备份路径": "مسار النسخ الاحتياطي", - "存档备份": "أرشيف النسخ الاحتياطي", - "备份到": "النسخ الاحتياطي", "左移": "تحول اليسار", "右移": "حق التحول", "启动游戏不修改顺序": "بدء اللعبة دون تعديل النظام", diff --git a/LunaTranslator/files/lang/cht.json b/LunaTranslator/files/lang/cht.json index 5b069f71..7ca11a0a 100644 --- a/LunaTranslator/files/lang/cht.json +++ b/LunaTranslator/files/lang/cht.json @@ -737,9 +737,6 @@ "禁止自动朗读的人名": "禁止自動朗讀的人名", "启动": "啟動", "批量添加": "批量添加", - "备份路径": "備份路徑", - "存档备份": "存檔備份", - "备份到": "備份到", "左移": "左移", "右移": "右移", "启动游戏不修改顺序": "啟動遊戲不修改順序", diff --git a/LunaTranslator/files/lang/en.json b/LunaTranslator/files/lang/en.json index bd2f5244..bfae3fd7 100644 --- a/LunaTranslator/files/lang/en.json +++ b/LunaTranslator/files/lang/en.json @@ -737,9 +737,6 @@ "禁止自动朗读的人名": "Names that are prohibited from automatic reading", "启动": "start-up", "批量添加": "Batch Add", - "备份路径": "Backup path", - "存档备份": "Archive backup", - "备份到": "Back up to", "左移": "Left shift", "右移": "Right shift", "启动游戏不修改顺序": "Start the game without changing the order", diff --git a/LunaTranslator/files/lang/es.json b/LunaTranslator/files/lang/es.json index a79253bf..c8d5c1ba 100644 --- a/LunaTranslator/files/lang/es.json +++ b/LunaTranslator/files/lang/es.json @@ -737,9 +737,6 @@ "禁止自动朗读的人名": "Nombres de personas cuya lectura automática está prohibida", "启动": "Inicio", "批量添加": "Añadir por lotes", - "备份路径": "Ruta de respaldo", - "存档备份": "Archivo de copias de Seguridad", - "备份到": "Copia de Seguridad a", "左移": "Desplazamiento a la izquierda", "右移": "A la derecha", "启动游戏不修改顺序": "Iniciar el juego sin modificar el orden", diff --git a/LunaTranslator/files/lang/fr.json b/LunaTranslator/files/lang/fr.json index 38099268..4ab577e5 100644 --- a/LunaTranslator/files/lang/fr.json +++ b/LunaTranslator/files/lang/fr.json @@ -737,9 +737,6 @@ "禁止自动朗读的人名": "Noms de personnes interdits de Lecture automatique", "启动": "Démarrage", "批量添加": "Ajouter par lot", - "备份路径": "Chemin de sauvegarde", - "存档备份": "Sauvegarde archivée", - "备份到": "Sauvegarder à", "左移": "Déplacement à gauche", "右移": "Déplacement à droite", "启动游戏不修改顺序": "Lancer le jeu sans modifier l'ordre", diff --git a/LunaTranslator/files/lang/it.json b/LunaTranslator/files/lang/it.json index bd7e358b..a8334537 100644 --- a/LunaTranslator/files/lang/it.json +++ b/LunaTranslator/files/lang/it.json @@ -737,9 +737,6 @@ "禁止自动朗读的人名": "Nomi vietati dalla lettura automatica", "启动": "avviamento", "批量添加": "Aggiungi batch", - "备份路径": "Percorso di backup", - "存档备份": "Archivia backup", - "备份到": "Torna a", "左移": "Spostamento sinistro", "右移": "Spostamento destro", "启动游戏不修改顺序": "Inizia il gioco senza cambiare l'ordine", diff --git a/LunaTranslator/files/lang/ja.json b/LunaTranslator/files/lang/ja.json index f9458c19..9bf3f757 100644 --- a/LunaTranslator/files/lang/ja.json +++ b/LunaTranslator/files/lang/ja.json @@ -737,9 +737,6 @@ "禁止自动朗读的人名": "自動朗読禁止の人名", "启动": "スタートアップ", "批量添加": "一括追加", - "备份路径": "バックアップパス", - "存档备份": "アーカイブバックアップ", - "备份到": "バックアップ先", "左移": "左へ移動", "右移": "右へ移動", "启动游戏不修改顺序": "ゲームを起動しても順序は変更されません", diff --git a/LunaTranslator/files/lang/ko.json b/LunaTranslator/files/lang/ko.json index 4927cb5e..cfcedbdb 100644 --- a/LunaTranslator/files/lang/ko.json +++ b/LunaTranslator/files/lang/ko.json @@ -737,9 +737,6 @@ "禁止自动朗读的人名": "자동 발음이 금지된 사람 이름", "启动": "시작", "批量添加": "대량 추가", - "备份路径": "백업 경로", - "存档备份": "아카이브 백업", - "备份到": "백업 대상", "左移": "왼쪽 이동", "右移": "오른쪽 이동", "启动游戏不修改顺序": "게임을 시작하면 순서를 수정하지 않습니다.", diff --git a/LunaTranslator/files/lang/pl.json b/LunaTranslator/files/lang/pl.json index 10bb138c..3401e728 100644 --- a/LunaTranslator/files/lang/pl.json +++ b/LunaTranslator/files/lang/pl.json @@ -737,9 +737,6 @@ "禁止自动朗读的人名": "Nazwy, które są zabronione automatycznego odczytu", "启动": "uruchomienie", "批量添加": "Dodaj partię", - "备份路径": "Ścieżka kopii zapasowej", - "存档备份": "Kopia zapasowa archiwum", - "备份到": "Powrót do", "左移": "Przesunięcie w lewo", "右移": "Prawa zmiana", "启动游戏不修改顺序": "Rozpocznij grę bez zmiany kolejności", diff --git a/LunaTranslator/files/lang/ru.json b/LunaTranslator/files/lang/ru.json index ecaf26de..7a5ce2bd 100644 --- a/LunaTranslator/files/lang/ru.json +++ b/LunaTranslator/files/lang/ru.json @@ -737,9 +737,6 @@ "禁止自动朗读的人名": "Имя человека, которое запрещено читать автоматически", "启动": "Запуск", "批量添加": "Добавление пакетов", - "备份路径": "Путь к резервному копированию", - "存档备份": "Архивное резервное копирование", - "备份到": "Резервное копирование", "左移": "Переместить налево", "右移": "Направо.", "启动游戏不修改顺序": "Запустить игру без изменения порядка", diff --git a/LunaTranslator/files/lang/th.json b/LunaTranslator/files/lang/th.json index e1906279..7506b9c8 100644 --- a/LunaTranslator/files/lang/th.json +++ b/LunaTranslator/files/lang/th.json @@ -737,9 +737,6 @@ "禁止自动朗读的人名": "ชื่อของบุคคลที่ห้ามอ่านออกเสียงโดยอัตโนมัติ", "启动": "เริ่ม", "批量添加": "เพิ่มจำนวนมาก", - "备份路径": "เส้นทางการสำรองข้อมูล", - "存档备份": "การสำรองข้อมูลที่เก็บถาวร", - "备份到": "สำรองข้อมูลไปยัง", "左移": "เลื่อนซ้าย", "右移": "ย้ายขวา", "启动游戏不修改顺序": "เริ่มเกมโดยไม่มีการปรับเปลี่ยนลำดับ", diff --git a/LunaTranslator/files/lang/tr.json b/LunaTranslator/files/lang/tr.json index 80e58805..307f232a 100644 --- a/LunaTranslator/files/lang/tr.json +++ b/LunaTranslator/files/lang/tr.json @@ -737,9 +737,6 @@ "禁止自动朗读的人名": "Otomatik okuma yasaklanmış isimler", "启动": "start-up", "批量添加": "Toplu Ekle", - "备份路径": "Yedekleme yolu", - "存档备份": "Arşiv yedekleme", - "备份到": "Geri dön.", "左移": "Sol vardiyası", "右移": "Sağ değişiklik", "启动游戏不修改顺序": "Düzeni değiştirmeden oyunu başlat", diff --git a/LunaTranslator/files/lang/uk.json b/LunaTranslator/files/lang/uk.json index 31c3b56e..fd40f6a9 100644 --- a/LunaTranslator/files/lang/uk.json +++ b/LunaTranslator/files/lang/uk.json @@ -737,9 +737,6 @@ "禁止自动朗读的人名": "Назви, які заборонені автоматичне читання", "启动": "запуск", "批量添加": "Додати партію", - "备份路径": "Шлях до резервної копії", - "存档备份": "Резервна копія архіву", - "备份到": "Назад до", "左移": "Ліва зміна", "右移": "Права зміна", "启动游戏不修改顺序": "Почати гру без зміни порядку", diff --git a/LunaTranslator/files/lang/vi.json b/LunaTranslator/files/lang/vi.json index f7421db3..ef91aed2 100644 --- a/LunaTranslator/files/lang/vi.json +++ b/LunaTranslator/files/lang/vi.json @@ -737,9 +737,6 @@ "禁止自动朗读的人名": "Tên người bị cấm đọc tự động", "启动": "Bắt đầu", "批量添加": "Thêm hàng loạt", - "备份路径": "Đường dẫn sao lưu", - "存档备份": "Lưu trữ sao lưu", - "备份到": "Sao lưu vào", "左移": "Dịch trái", "右移": "Dịch phải", "启动游戏不修改顺序": "Bắt đầu trò chơi Không thay đổi thứ tự", diff --git a/LunaTranslator/files/lang/zh.json b/LunaTranslator/files/lang/zh.json index b2d779af..8368d184 100644 --- a/LunaTranslator/files/lang/zh.json +++ b/LunaTranslator/files/lang/zh.json @@ -739,9 +739,6 @@ "禁止自动朗读的人名": "", "启动": "", "批量添加": "", - "备份路径": "", - "存档备份": "", - "备份到": "", "左移": "", "右移": "", "启动游戏不修改顺序": "",