feat: agent-side folder tags resolution and windows recycle bin ctypes integration

This commit is contained in:
Carlos Tello
2026-08-17 00:27:02 -03:00
parent 8b2260bf14
commit 2cb23591ee
2 changed files with 106 additions and 6 deletions
+33 -1
View File
@@ -271,11 +271,16 @@ class AddFolderDialog(QDialog):
dest_layout = QHBoxLayout()
self.txt_dest = QLineEdit()
self.txt_dest.setPlaceholderText("Ej: D:\\LocalBackup (Opcional)")
self.txt_dest.setPlaceholderText("Ej: D:\\LocalBackup\\<yyyy>-<mm>-<dd>")
btn_browse_dest = QPushButton("Explorar...")
btn_browse_dest.clicked.connect(self._browse_dest_folder)
btn_tags = QPushButton("Tags...")
btn_tags.clicked.connect(self._show_tags_menu)
dest_layout.addWidget(self.txt_dest)
dest_layout.addWidget(btn_browse_dest)
dest_layout.addWidget(btn_tags)
form.addRow("Copia Local Adicional:", dest_layout)
layout.addLayout(form)
@@ -304,6 +309,33 @@ class AddFolderDialog(QDialog):
if folder:
self.txt_dest.setText(folder)
def _show_tags_menu(self):
from PyQt6.QtWidgets import QMenu
from PyQt6.QtGui import QAction
menu = QMenu(self)
tags = [
("<yyyy>", "Año actual (4 dígitos)"),
("<yy>", "Año actual (2 dígitos)"),
("<month>", "Nombre del mes (ej: Jul)"),
("<mm>", "Mes actual (01-12)"),
("<m>", "Mes actual (1-12)"),
("<dd>", "Día actual (01-31)"),
("<d>", "Día actual (1-31)"),
("<dow>", "Día de la semana (1=Lunes...7=Domingo)"),
("<hour>", "Hora actual (00-23)"),
("<minute>", "Minuto actual (00-59)")
]
for tag, desc in tags:
action = QAction(f"{tag} - {desc}", self)
action.triggered.connect(lambda checked=False, t=tag: self.txt_dest.insert(t))
menu.addAction(action)
btn = self.sender()
if btn:
menu.exec(btn.mapToGlobal(btn.rect().bottomLeft()))
def _validate_and_accept(self):
if not self.txt_path.text() or not os.path.exists(self.txt_path.text()):
QMessageBox.warning(self, "Ruta Inválida", "Por favor selecciona una carpeta existente en Windows.")