Kein PW bei Export
Dieser Commit ist enthalten in:
@ -1,7 +1,7 @@
|
||||
"""
|
||||
Erfolgs-Dialog für Profil-Export
|
||||
|
||||
Zeigt exportierte Dateien und optional das generierte Passwort an.
|
||||
Zeigt exportierte Dateien an.
|
||||
"""
|
||||
|
||||
import os
|
||||
@ -9,11 +9,11 @@ import logging
|
||||
import subprocess
|
||||
import platform
|
||||
from pathlib import Path
|
||||
from typing import List, Optional
|
||||
from typing import List
|
||||
|
||||
from PyQt5.QtWidgets import (
|
||||
QDialog, QVBoxLayout, QHBoxLayout, QLabel, QPushButton,
|
||||
QFrame, QGraphicsDropShadowEffect, QApplication, QScrollArea, QWidget
|
||||
QFrame, QGraphicsDropShadowEffect, QScrollArea, QWidget
|
||||
)
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtGui import QFont, QColor
|
||||
@ -28,8 +28,7 @@ class ExportSuccessDialog(QDialog):
|
||||
self,
|
||||
parent=None,
|
||||
exported_files: List[str] = None,
|
||||
export_directory: str = "",
|
||||
password: Optional[str] = None
|
||||
export_directory: str = ""
|
||||
):
|
||||
"""
|
||||
Initialisiert den Erfolgs-Dialog.
|
||||
@ -38,12 +37,10 @@ class ExportSuccessDialog(QDialog):
|
||||
parent: Parent-Widget
|
||||
exported_files: Liste der exportierten Dateinamen
|
||||
export_directory: Verzeichnis wo Dateien gespeichert wurden
|
||||
password: Optional generiertes Passwort (nur bei Passwortschutz)
|
||||
"""
|
||||
super().__init__(parent)
|
||||
self.exported_files = exported_files or []
|
||||
self.export_directory = export_directory
|
||||
self.password = password
|
||||
self.init_ui()
|
||||
|
||||
def init_ui(self):
|
||||
@ -55,10 +52,8 @@ class ExportSuccessDialog(QDialog):
|
||||
self.setAttribute(Qt.WA_TranslucentBackground, True)
|
||||
self.setModal(True)
|
||||
|
||||
# Dynamische Höhe basierend auf Inhalt
|
||||
# Dynamische Höhe basierend auf Anzahl der Dateien
|
||||
base_height = 280
|
||||
if self.password:
|
||||
base_height += 80 # Extra Platz für Passwort-Anzeige
|
||||
if len(self.exported_files) > 2:
|
||||
base_height += 20 * (len(self.exported_files) - 2) # Extra für mehr Dateien
|
||||
|
||||
@ -153,72 +148,6 @@ class ExportSuccessDialog(QDialog):
|
||||
|
||||
container_layout.addWidget(scroll_area)
|
||||
|
||||
# Passwort-Anzeige (nur wenn Passwort vorhanden)
|
||||
if self.password:
|
||||
password_frame = QFrame()
|
||||
password_frame.setStyleSheet("""
|
||||
QFrame {
|
||||
background-color: #FEF3C7;
|
||||
border: 1px solid #FCD34D;
|
||||
border-radius: 6px;
|
||||
padding: 12px;
|
||||
}
|
||||
""")
|
||||
password_layout = QVBoxLayout(password_frame)
|
||||
password_layout.setSpacing(8)
|
||||
|
||||
# Warnung
|
||||
warning_label = QLabel("⚠ Bitte Passwort speichern!")
|
||||
warning_label.setStyleSheet("""
|
||||
color: #92400E;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
""")
|
||||
|
||||
# Passwort mit Copy-Button
|
||||
password_row = QHBoxLayout()
|
||||
password_row.setSpacing(10)
|
||||
|
||||
password_label = QLabel(f"🔒 Passwort: {self.password}")
|
||||
password_label.setStyleSheet("""
|
||||
color: #78350F;
|
||||
font-size: 13px;
|
||||
font-family: 'Courier New', monospace;
|
||||
font-weight: 600;
|
||||
""")
|
||||
password_label.setTextInteractionFlags(Qt.TextSelectableByMouse)
|
||||
|
||||
copy_button = QPushButton("Kopieren")
|
||||
copy_button.setMaximumWidth(80)
|
||||
copy_button.setMinimumHeight(28)
|
||||
copy_button.setCursor(Qt.PointingHandCursor)
|
||||
copy_button.setStyleSheet("""
|
||||
QPushButton {
|
||||
background-color: #F59E0B;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
padding: 4px 8px;
|
||||
}
|
||||
QPushButton:hover {
|
||||
background-color: #D97706;
|
||||
}
|
||||
QPushButton:pressed {
|
||||
background-color: #B45309;
|
||||
}
|
||||
""")
|
||||
copy_button.clicked.connect(self.copy_password)
|
||||
|
||||
password_row.addWidget(password_label, 1)
|
||||
password_row.addWidget(copy_button)
|
||||
|
||||
password_layout.addWidget(warning_label)
|
||||
password_layout.addLayout(password_row)
|
||||
|
||||
container_layout.addWidget(password_frame)
|
||||
|
||||
# Speicherort
|
||||
location_label = QLabel(f"Gespeichert in:")
|
||||
location_label.setStyleSheet("color: #6B7280; font-size: 12px;")
|
||||
@ -299,30 +228,6 @@ class ExportSuccessDialog(QDialog):
|
||||
# Container zum Hauptlayout hinzufügen
|
||||
main_layout.addWidget(self.container)
|
||||
|
||||
def copy_password(self):
|
||||
"""Kopiert das Passwort in die Zwischenablage"""
|
||||
if self.password:
|
||||
clipboard = QApplication.clipboard()
|
||||
clipboard.setText(self.password)
|
||||
logger.info("Passwort in Zwischenablage kopiert")
|
||||
|
||||
# Kurzes visuelles Feedback
|
||||
sender = self.sender()
|
||||
if sender:
|
||||
original_text = sender.text()
|
||||
sender.setText("✓ Kopiert!")
|
||||
sender.setStyleSheet(sender.styleSheet().replace("#F59E0B", "#10B981"))
|
||||
|
||||
# Nach 2 Sekunden zurücksetzen
|
||||
from PyQt5.QtCore import QTimer
|
||||
QTimer.singleShot(2000, lambda: self._reset_copy_button(sender, original_text))
|
||||
|
||||
def _reset_copy_button(self, button, original_text):
|
||||
"""Setzt den Copy-Button zurück"""
|
||||
if button:
|
||||
button.setText(original_text)
|
||||
button.setStyleSheet(button.styleSheet().replace("#10B981", "#F59E0B"))
|
||||
|
||||
def open_folder(self):
|
||||
"""Öffnet den Export-Ordner im Datei-Explorer"""
|
||||
if not self.export_directory or not os.path.exists(self.export_directory):
|
||||
@ -373,8 +278,7 @@ class ExportSuccessDialog(QDialog):
|
||||
def show_export_success(
|
||||
parent,
|
||||
exported_files: List[str],
|
||||
export_directory: str,
|
||||
password: Optional[str] = None
|
||||
export_directory: str
|
||||
):
|
||||
"""
|
||||
Zeigt den Export-Erfolgs-Dialog modal an.
|
||||
@ -383,7 +287,6 @@ def show_export_success(
|
||||
parent: Parent-Widget
|
||||
exported_files: Liste der exportierten Dateinamen
|
||||
export_directory: Verzeichnis wo Dateien gespeichert wurden
|
||||
password: Optional generiertes Passwort
|
||||
"""
|
||||
dialog = ExportSuccessDialog(parent, exported_files, export_directory, password)
|
||||
dialog = ExportSuccessDialog(parent, exported_files, export_directory)
|
||||
dialog.exec_()
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
"""
|
||||
Export-Dialog für Account-Profile
|
||||
|
||||
Ermöglicht Auswahl von Export-Formaten und Passwortschutz.
|
||||
Ermöglicht Auswahl von Export-Formaten.
|
||||
"""
|
||||
|
||||
import logging
|
||||
@ -153,36 +153,6 @@ class ProfileExportDialog(QDialog):
|
||||
|
||||
container_layout.addWidget(format_group)
|
||||
|
||||
# Passwortschutz-Checkbox
|
||||
self.password_checkbox = QCheckBox("Mit Passwort schützen")
|
||||
self.password_checkbox.setChecked(False)
|
||||
self.password_checkbox.setStyleSheet("""
|
||||
QCheckBox {
|
||||
font-size: 13px;
|
||||
font-family: 'Poppins', sans-serif;
|
||||
font-weight: 500;
|
||||
color: #374151;
|
||||
spacing: 8px;
|
||||
}
|
||||
QCheckBox::indicator {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
border-radius: 4px;
|
||||
border: 2px solid #D1D5DB;
|
||||
}
|
||||
QCheckBox::indicator:checked {
|
||||
background-color: #10B981;
|
||||
border-color: #10B981;
|
||||
}
|
||||
""")
|
||||
|
||||
# Info-Text für Passwortschutz
|
||||
password_info = QLabel("(Wird automatisch generiert)")
|
||||
password_info.setStyleSheet("color: #9CA3AF; font-size: 11px; font-family: 'Poppins', sans-serif; margin-left: 26px;")
|
||||
|
||||
container_layout.addWidget(self.password_checkbox)
|
||||
container_layout.addWidget(password_info)
|
||||
|
||||
# Spacer
|
||||
container_layout.addStretch()
|
||||
|
||||
@ -271,8 +241,8 @@ class ProfileExportDialog(QDialog):
|
||||
)
|
||||
return
|
||||
|
||||
# Passwortschutz-Option
|
||||
password_protect = self.password_checkbox.isChecked()
|
||||
# Passwortschutz ist entfernt - immer False
|
||||
password_protect = False
|
||||
|
||||
# Signal emittieren
|
||||
self.export_confirmed.emit(selected_formats, password_protect)
|
||||
@ -295,7 +265,8 @@ class ProfileExportDialog(QDialog):
|
||||
if self.pdf_checkbox.isChecked():
|
||||
formats.append("pdf")
|
||||
|
||||
password_protect = self.password_checkbox.isChecked()
|
||||
# Passwortschutz ist entfernt - immer False
|
||||
password_protect = False
|
||||
|
||||
return formats, password_protect
|
||||
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren