Skip to content

Commit

Permalink
v9.5.6
Browse files Browse the repository at this point in the history
1、记住上次选择目录
2、需改按钮提示
  • Loading branch information
cgkings committed Dec 29, 2024
1 parent e3e9bf4 commit 8dbaf98
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
22 changes: 20 additions & 2 deletions NFO.Editor.Qt5.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,18 @@ def on_rating_key_release(self, widget, event):

def open_folder(self):
"""选择并打开NFO文件夹"""
folder_selected = QFileDialog.getExistingDirectory(self, "选择NFO文件夹")
# 获取上次打开的目录
settings = QSettings("NFOEditor", "Directories")
last_dir = settings.value("last_nfo_dir", "")

folder_selected = QFileDialog.getExistingDirectory(
self, "选择NFO文件夹", last_dir # 使用上次的目录作为起始目录
)

if folder_selected:
self.folder_path = folder_selected
# 保存当前选择的目录
settings.setValue("last_nfo_dir", folder_selected)
# 直接加载文件而不更新label
self.load_files_in_folder()

Expand All @@ -370,9 +379,18 @@ def open_folder(self):

def select_target_folder(self):
"""选择目标文件夹处理函数"""
target_folder = QFileDialog.getExistingDirectory(self, "选择目标文件夹")
# 获取上次打开的目标目录
settings = QSettings("NFOEditor", "Directories")
last_target_dir = settings.value("last_target_dir", "")

target_folder = QFileDialog.getExistingDirectory(
self, "选择目标文件夹", last_target_dir # 使用上次的目录作为起始目录
)

if target_folder:
self.current_target_path = target_folder
# 保存当前选择的目标目录
settings.setValue("last_target_dir", target_folder)
self.load_target_files(target_folder)

# 显示目标文件夹树并恢复其列伸缩因子
Expand Down
2 changes: 1 addition & 1 deletion NFO_Editor_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(self):
self.screen_dpi = self.screen().logicalDotsPerInch()
self.scale_factor = self.screen_dpi / 96.0

self.setWindowTitle("大锤 NFO Editor Qt v9.5.5")
self.setWindowTitle("大锤 NFO Editor Qt v9.5.6")
self.resize(1280, 800)

# 初始化状态栏
Expand Down

0 comments on commit 8dbaf98

Please sign in to comment.