Feat: Projekt-Baum verschlanken und XSL-Dateiname im Edit-Dialog anzeigen (v1.5.0)

Mittlere Spalte (Kontextinfos) aus dem Projekt-Baum entfernt, sodass nur noch
Bezeichnung und Diff-PDF-Anzahl angezeigt werden. XSL-Dateiname wird jetzt als
nur-lese Label oben im XslFileEditDialog angezeigt.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-04 12:31:41 +02:00
parent 8c59187fe9
commit 3d2efe628b
13 changed files with 75 additions and 53 deletions
+8 -17
View File
@@ -120,7 +120,7 @@ class TreeManagerMixin:
if node_type == ItemType.XML_FILE:
# Hole XmlFile-Objekt und XSL-ID aus UserRole
xml_file_obj = item.data(0, Qt.ItemDataRole.UserRole)
xsl_id_str = item.data(1, Qt.ItemDataRole.UserRole)
xsl_id_str = item.data(0, Qt.ItemDataRole.UserRole + 2)
logger.debug(f"XML-File-Daten: xml_file_obj={xml_file_obj}, xsl_id_str={xsl_id_str}")
@@ -630,12 +630,7 @@ class TreeManagerMixin:
xsl_icon = QIcon.fromTheme("text-x-generic")
item.setIcon(0, xsl_icon)
# Setze zusätzliche Informationen in Spalte 1
if isinstance(node, TreeNode):
# TreeNode: Zeige Anzahl der Knoten
child_count = len(node.children) if node.children else 0
item.setText(1, f"{child_count} Knoten")
# Speichere zusätzlich die Node-ID in UserRole+1 für Kompatibilität
item.setData(0, Qt.ItemDataRole.UserRole + 1, node.id)
@@ -646,22 +641,19 @@ class TreeManagerMixin:
child_item = self._create_tree_item_from_node(child)
item.addChild(child_item)
# Setze Diff-PDF-Anzahl in Spalte 2 (wird später aktualisiert)
# Setze Diff-PDF-Anzahl in Spalte 1
diff_count = self._count_diff_pdfs_under_node(node, item)
if diff_count > 0:
item.setText(2, str(diff_count))
item.setText(1, str(diff_count))
elif isinstance(node, XslFile):
# XslFile: Zeige XSL-Datei-Pfad
item.setText(1, str(node.xsl_file))
# Speichere zusätzlich die Node-ID in UserRole+1 für Kompatibilität
item.setData(0, Qt.ItemDataRole.UserRole + 1, node.id)
# Setze Diff-PDF-Anzahl in Spalte 2 (wird später aktualisiert)
# Setze Diff-PDF-Anzahl in Spalte 1
diff_count = self._count_diff_pdfs_under_node(node, item)
if diff_count > 0:
item.setText(2, str(diff_count))
item.setText(1, str(diff_count))
# Prüfe ob XSL-Datei existiert
xsl_file_missing = False
@@ -689,15 +681,14 @@ class TreeManagerMixin:
for xml in node.xmls:
xml_item = QTreeWidgetItem()
xml_item.setText(0, f"XML: {xml.xml.name}")
xml_item.setText(1, str(xml.xml))
# Speichere auch das XmlFile-Objekt für XML-Items
xml_item.setData(0, Qt.ItemDataRole.UserRole, xml)
xml_item.setData(0, Qt.ItemDataRole.UserRole + 1, f"xml_{xml.xml.name}")
# Speichere XSL-ID in Spalte 1, UserRole für einfachen Zugriff
# Speichere XSL-ID in Spalte 0, UserRole+2 für einfachen Zugriff
xsl_id_str = "_".join(str(x) for x in node.id)
xml_item.setData(1, Qt.ItemDataRole.UserRole, xsl_id_str)
xml_item.setData(0, Qt.ItemDataRole.UserRole + 2, xsl_id_str)
# Setze XML-Icon
xml_icon = QIcon.fromTheme("text-xml")
@@ -736,7 +727,7 @@ class TreeManagerMixin:
# Fallback: Erstelle einfaches Item
fallback_item = QTreeWidgetItem()
fallback_item.setText(0, "Fehler beim Laden")
fallback_item.setText(1, str(e))
fallback_item.setToolTip(0, str(e))
return fallback_item
def _create_centered_progress_bar(self) -> tuple[QWidget, QProgressBar]: