FOP-Config: Projektspezifischer Konfigurationsordner und erweitertes Logging
- Project-Modell um optionales fop_config_dir Feld erweitert - TransformationJob verwendet nun projektspezifischen FOP-Config-Pfad - Saxon und FOP stdout/stderr werden nun im Debug-Level geloggt - UI-Elemente für FOP-Config-Ordner-Auswahl hinzugefügt - AppSettings und MainWindow unterstützen neues Feld beim Laden/Speichern 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
+30
-5
@@ -49,11 +49,14 @@ class PdfProjectDlg(QDialog):
|
||||
"""Verbindet die Signale mit den entsprechenden Slots."""
|
||||
# Browse-Button für Projekt-Ordner
|
||||
self.ui.pushButton.clicked.connect(self.browse_project_dir)
|
||||
|
||||
|
||||
# Browse-Button für FOP-Config-Ordner
|
||||
self.ui.btnBrowseFopConfig.clicked.connect(self.browse_fop_config_dir)
|
||||
|
||||
# OK/Cancel Buttons sind bereits in der UI-Datei verbunden
|
||||
# self.ui.buttonBox.accepted.connect(self.accept)
|
||||
# self.ui.buttonBox.rejected.connect(self.reject)
|
||||
|
||||
|
||||
# Überschreibe accept() für Validierung
|
||||
self.ui.buttonBox.accepted.disconnect()
|
||||
self.ui.buttonBox.accepted.connect(self.validate_and_accept)
|
||||
@@ -132,6 +135,10 @@ class PdfProjectDlg(QDialog):
|
||||
|
||||
if 'postgre_sql_db_id' in self.project_data:
|
||||
self._select_combo_by_data(self.ui.cB_Postgres, self.project_data['postgre_sql_db_id'])
|
||||
|
||||
# FOP-Config-Ordner
|
||||
if 'fop_config_dir' in self.project_data and self.project_data['fop_config_dir']:
|
||||
self.ui.lineFopConfigDir.setText(str(self.project_data['fop_config_dir']))
|
||||
|
||||
def _select_combo_by_data(self, combo_box, data_value):
|
||||
"""
|
||||
@@ -166,7 +173,23 @@ class PdfProjectDlg(QDialog):
|
||||
if not self.ui.lineProjectName.text():
|
||||
project_name = os.path.basename(selected_dir)
|
||||
self.ui.lineProjectName.setText(project_name)
|
||||
|
||||
|
||||
def browse_fop_config_dir(self):
|
||||
"""Öffnet einen Dialog zum Auswählen des FOP-Config-Ordners."""
|
||||
current_dir = self.ui.lineFopConfigDir.text()
|
||||
if not current_dir or not os.path.exists(current_dir):
|
||||
current_dir = os.path.expanduser("~")
|
||||
|
||||
selected_dir = QFileDialog.getExistingDirectory(
|
||||
self,
|
||||
"FOP-Config-Ordner auswählen",
|
||||
current_dir,
|
||||
QFileDialog.Option.ShowDirsOnly | QFileDialog.Option.DontResolveSymlinks
|
||||
)
|
||||
|
||||
if selected_dir:
|
||||
self.ui.lineFopConfigDir.setText(selected_dir)
|
||||
|
||||
def validate_and_accept(self):
|
||||
"""Validiert die Eingaben und akzeptiert den Dialog."""
|
||||
# Projekt-Name prüfen
|
||||
@@ -232,10 +255,11 @@ class PdfProjectDlg(QDialog):
|
||||
def get_project_data(self):
|
||||
"""
|
||||
Gibt die eingegebenen Projektdaten zurück.
|
||||
|
||||
|
||||
Returns:
|
||||
dict: Dictionary mit allen Projektdaten
|
||||
"""
|
||||
fop_config_dir = self.ui.lineFopConfigDir.text().strip()
|
||||
return {
|
||||
'name': self.ui.lineProjectName.text().strip(),
|
||||
'project_dir': self.ui.lineProjectDir.text().strip(),
|
||||
@@ -244,7 +268,8 @@ class PdfProjectDlg(QDialog):
|
||||
'saxon_jar_id': self.ui.cB_SaxonJar.currentData(),
|
||||
'apache_fop_id': self.ui.cB_ApacheFop.currentData(),
|
||||
'diff_pdf_id': self.ui.cB_Diff_Pdf.currentData(),
|
||||
'postgre_sql_db_id': self.ui.cB_Postgres.currentData()
|
||||
'postgre_sql_db_id': self.ui.cB_Postgres.currentData(),
|
||||
'fop_config_dir': fop_config_dir if fop_config_dir else None
|
||||
}
|
||||
|
||||
def _configure_edit_mode(self):
|
||||
|
||||
Reference in New Issue
Block a user