feature/generador-instaladores-linux-windows
This commit is contained in:
@@ -104,24 +104,29 @@ class ConfigTab(QWidget):
|
||||
|
||||
self.sql_windows_auth_checkbox = QCheckBox()
|
||||
self.sql_windows_auth_checkbox.setChecked(True)
|
||||
self.sql_windows_auth_checkbox.toggled.connect(self._on_auth_changed)
|
||||
sql_layout.addRow("Usar Windows Auth:", self.sql_windows_auth_checkbox)
|
||||
|
||||
self.sql_username_input = QLineEdit()
|
||||
self.sql_username_input.setEnabled(False)
|
||||
sql_layout.addRow("Usuario SQL:", self.sql_username_input)
|
||||
|
||||
self.sql_password_input = QLineEdit()
|
||||
self.sql_password_input.setEchoMode(QLineEdit.EchoMode.Password)
|
||||
self.sql_password_input.setEnabled(False)
|
||||
sql_layout.addRow("Contraseña SQL:", self.sql_password_input)
|
||||
|
||||
# Conectar el handler DESPUÉS de crear usuario/contraseña: en Linux se
|
||||
# desmarca el checkbox (abajo), lo que dispararía _on_auth_changed antes de
|
||||
# que existan esos campos si se conectara arriba.
|
||||
self.sql_windows_auth_checkbox.toggled.connect(self._on_auth_changed)
|
||||
if sys.platform != "win32":
|
||||
# Windows Auth no aplica en Linux: forzar SQL Auth y habilitar campos.
|
||||
self.sql_windows_auth_checkbox.setChecked(False)
|
||||
self.sql_windows_auth_checkbox.setEnabled(False)
|
||||
self.sql_windows_auth_checkbox.setToolTip(
|
||||
"Windows Auth no está disponible en Linux; use SQL Auth."
|
||||
)
|
||||
|
||||
self.sql_username_input = QLineEdit()
|
||||
self.sql_username_input.setEnabled(False)
|
||||
sql_layout.addRow("Usuario SQL:", self.sql_username_input)
|
||||
|
||||
self.sql_password_input = QLineEdit()
|
||||
self.sql_password_input.setEchoMode(QLineEdit.EchoMode.Password)
|
||||
self.sql_password_input.setEnabled(False)
|
||||
sql_layout.addRow("Contraseña SQL:", self.sql_password_input)
|
||||
|
||||
test_sql_btn = QPushButton("🔌 Probar Conexión")
|
||||
test_sql_btn.clicked.connect(self._test_sql_connection)
|
||||
sql_layout.addRow("", test_sql_btn)
|
||||
@@ -431,12 +436,17 @@ class ConfigTab(QWidget):
|
||||
line_edit.setText(folder)
|
||||
|
||||
def _browse_seven_zip(self):
|
||||
"""Abre el diálogo para seleccionar 7z.exe."""
|
||||
"""Abre el diálogo para seleccionar el ejecutable de 7-Zip."""
|
||||
if sys.platform == "win32":
|
||||
title = "Seleccionar 7z.exe"
|
||||
default_dir = "C:\\Program Files\\7-Zip"
|
||||
file_filter = "Ejecutables (*.exe)"
|
||||
else:
|
||||
title = "Seleccionar 7z / 7zz"
|
||||
default_dir = ""
|
||||
file_filter = "Ejecutables (*)"
|
||||
file_path, _ = QFileDialog.getOpenFileName(
|
||||
self,
|
||||
"Seleccionar 7z.exe",
|
||||
"C:\\Program Files\\7-Zip",
|
||||
"Ejecutables (*.exe)"
|
||||
self, title, default_dir, file_filter
|
||||
)
|
||||
if file_path:
|
||||
self.seven_zip_input.setText(file_path)
|
||||
@@ -475,6 +485,9 @@ class ConfigTab(QWidget):
|
||||
|
||||
def _on_auth_changed(self, checked: bool):
|
||||
"""Maneja el cambio en el tipo de autenticación."""
|
||||
# Guard: la señal puede dispararse durante la construcción de la UI.
|
||||
if not hasattr(self, "sql_username_input"):
|
||||
return
|
||||
self.sql_username_input.setEnabled(not checked)
|
||||
self.sql_password_input.setEnabled(not checked)
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""Tab de logs y soporte."""
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from PySide6.QtWidgets import (
|
||||
@@ -91,10 +92,15 @@ class LogsTab(QWidget):
|
||||
self.logs_text.setPlainText("\n".join(log_lines))
|
||||
|
||||
def _open_logs_folder(self):
|
||||
"""Abre la carpeta de logs en el explorador."""
|
||||
"""Abre la carpeta de logs en el explorador de archivos del sistema."""
|
||||
try:
|
||||
if LOGS_DIR.exists():
|
||||
subprocess.run(["explorer", str(LOGS_DIR)])
|
||||
if sys.platform == "win32":
|
||||
subprocess.run(["explorer", str(LOGS_DIR)])
|
||||
elif sys.platform == "darwin":
|
||||
subprocess.run(["open", str(LOGS_DIR)])
|
||||
else:
|
||||
subprocess.run(["xdg-open", str(LOGS_DIR)])
|
||||
else:
|
||||
QMessageBox.warning(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user