From d3bad69f02fa4a731b7edd463f2a987d89151309 Mon Sep 17 00:00:00 2001 From: "Mauro Rosero P." Date: Sat, 15 Mar 2025 19:22:51 -0500 Subject: [PATCH] =?UTF-8?q?[FIXED]=20Corregir=20selecci=C3=B3n=20de=20arch?= =?UTF-8?q?ivos=20en=20qr=5Fsecret.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Reemplazar función dialog_input_filepath que no funcionaba correctamente - Implementar selección de archivos directamente con dialog y --fselect - Mejorar tamaño y visibilidad del selector de archivos (15x60) - Añadir validación apropiada para asegurar que se seleccionó un archivo válido 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- bin/qr_secret.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/bin/qr_secret.sh b/bin/qr_secret.sh index a9d5bbb..ee21616 100755 --- a/bin/qr_secret.sh +++ b/bin/qr_secret.sh @@ -135,16 +135,21 @@ get_output_name() { # Seleccionar archivo QR select_qr_file() { - # Usar dialog_input_filepath para seleccionar un archivo - file_path="$HOME" - dialog_input_filepath "$file_path" "Seleccione una imagen QR" + # Usar dialog directamente para seleccionar un archivo + local home_dir="$HOME/" - if [ "$valid_file" == "2" ]; then - # Usuario canceló + exec 3>&1 + local selected_file=$(dialog --backtitle "$title" --title "$apps_title" \ + --stdout --fselect "$home_dir" 15 60) + local exit_code=$? + exec 3>&- + + if [ $exit_code -ne 0 ] || [ ! -f "$selected_file" ]; then + # Usuario canceló o no seleccionó un archivo válido return 1 fi - echo "$file_path" + echo "$selected_file" return 0 }