Kein PW bei Export
Dieser Commit ist enthalten in:
@ -71,7 +71,7 @@ class ProfileExportController:
|
||||
logger.info(f"Export-Optionen: Formate={formats}, Passwort={password_protect}")
|
||||
|
||||
# 3. Speicherort wählen
|
||||
save_directory = self._select_save_location(parent_widget, account_data, formats, password_protect)
|
||||
save_directory = self._select_save_location(parent_widget, account_data, formats)
|
||||
|
||||
if not save_directory:
|
||||
logger.info("Kein Speicherort ausgewählt - Export abgebrochen")
|
||||
@ -79,11 +79,11 @@ class ProfileExportController:
|
||||
|
||||
logger.info(f"Speicherort: {save_directory}")
|
||||
|
||||
# 4. Export durchführen
|
||||
files_dict, password = self.export_service.export_account(
|
||||
# 4. Export durchführen (ohne Passwortschutz)
|
||||
files_dict = self.export_service.export_account(
|
||||
account_data,
|
||||
formats,
|
||||
password_protect
|
||||
password_protect=False
|
||||
)
|
||||
|
||||
if not files_dict:
|
||||
@ -117,8 +117,7 @@ class ProfileExportController:
|
||||
show_export_success(
|
||||
parent_widget,
|
||||
saved_files,
|
||||
save_directory,
|
||||
password
|
||||
save_directory
|
||||
)
|
||||
|
||||
logger.info(f"Export erfolgreich: {len(saved_files)} Datei(en) gespeichert")
|
||||
@ -136,12 +135,6 @@ class ProfileExportController:
|
||||
"Bitte installieren Sie die erforderlichen Bibliotheken:\n"
|
||||
"pip install reportlab svglib"
|
||||
)
|
||||
elif "pyzipper" in error_message.lower():
|
||||
error_message = (
|
||||
"Passwortgeschützter Export ist nicht verfügbar.\n\n"
|
||||
"Bitte installieren Sie die erforderliche Bibliothek:\n"
|
||||
"pip install pyzipper"
|
||||
)
|
||||
|
||||
show_error(
|
||||
parent_widget,
|
||||
@ -154,62 +147,30 @@ class ProfileExportController:
|
||||
self,
|
||||
parent_widget,
|
||||
account_data: Dict[str, Any],
|
||||
formats: list,
|
||||
password_protect: bool
|
||||
formats: list
|
||||
) -> Optional[str]:
|
||||
"""
|
||||
Öffnet einen Datei-Dialog zur Auswahl des Speicherorts.
|
||||
Öffnet einen Verzeichnis-Dialog zur Auswahl des Speicherorts.
|
||||
|
||||
Args:
|
||||
parent_widget: Parent-Widget
|
||||
account_data: Account-Daten
|
||||
formats: Liste der Export-Formate
|
||||
password_protect: Ob Passwortschutz aktiviert ist
|
||||
|
||||
Returns:
|
||||
Ausgewähltes Verzeichnis oder None bei Abbruch
|
||||
"""
|
||||
# Standard-Dateiname generieren
|
||||
if password_protect:
|
||||
# Bei Passwortschutz wird eine ZIP erstellt
|
||||
default_filename = self.export_service.generate_filename(
|
||||
account_data,
|
||||
"zip"
|
||||
)
|
||||
else:
|
||||
# Ohne Passwortschutz: Ersten Format als Beispiel nehmen
|
||||
first_format = formats[0] if formats else "csv"
|
||||
default_filename = self.export_service.generate_filename(
|
||||
account_data,
|
||||
first_format
|
||||
)
|
||||
|
||||
# Standard-Speicherort: Benutzer-Downloads-Ordner
|
||||
default_directory = str(Path.home() / "Downloads")
|
||||
|
||||
if password_protect:
|
||||
# Für ZIP: File-Dialog
|
||||
file_path, _ = QFileDialog.getSaveFileName(
|
||||
parent_widget,
|
||||
"Profil exportieren",
|
||||
os.path.join(default_directory, default_filename),
|
||||
"ZIP-Archiv (*.zip)"
|
||||
)
|
||||
# Verzeichnis-Dialog für mehrere Dateien
|
||||
directory = QFileDialog.getExistingDirectory(
|
||||
parent_widget,
|
||||
"Speicherort für Export auswählen",
|
||||
default_directory
|
||||
)
|
||||
|
||||
if not file_path:
|
||||
return None
|
||||
|
||||
# Verzeichnis aus Dateipfad extrahieren
|
||||
return os.path.dirname(file_path)
|
||||
else:
|
||||
# Für mehrere Dateien: Verzeichnis-Dialog
|
||||
directory = QFileDialog.getExistingDirectory(
|
||||
parent_widget,
|
||||
"Speicherort für Export auswählen",
|
||||
default_directory
|
||||
)
|
||||
|
||||
return directory if directory else None
|
||||
return directory if directory else None
|
||||
|
||||
def export_multiple_accounts(self, parent_widget, account_ids: list) -> bool:
|
||||
"""
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren