From 0694ea2638dc7819c286cbc9010100cbcb06ef20 Mon Sep 17 00:00:00 2001 From: Boris Yumankulov Date: Mon, 30 Jun 2025 16:37:25 +0500 Subject: [PATCH] fix: restore .exe file selection with Confirm button in FileExplorer Signed-off-by: Boris Yumankulov --- portprotonqt/input_manager.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/portprotonqt/input_manager.py b/portprotonqt/input_manager.py index 2624b5b..0136e82 100644 --- a/portprotonqt/input_manager.py +++ b/portprotonqt/input_manager.py @@ -158,7 +158,6 @@ class InputManager(QObject): logger.error(f"Error restoring gamepad handlers: {e}") def handle_file_explorer_button(self, button_code): - """Обработка кнопок геймпада для FileExplorer""" try: if not self.file_explorer or not hasattr(self.file_explorer, 'file_list'): return @@ -183,8 +182,12 @@ class InputManager(QObject): # Открываем директорию self.file_explorer.current_path = os.path.normpath(full_path) self.file_explorer.update_file_list() + elif not self.file_explorer.directory_only: + # Выбираем файл, если directory_only=False + self.file_explorer.file_signal.file_selected.emit(os.path.normpath(full_path)) + self.file_explorer.accept() else: - logger.debug("Selected item is not a directory, cannot open: %s", full_path) + logger.debug("Selected item is not a directory, cannot select: %s", full_path) elif button_code in BUTTONS['back']: self.file_explorer.close() elif button_code in BUTTONS['prev_dir']: