fix(origin): return absolute icon path from SiloOrigin.icon()
The icon() method returned bare 'silo' which BitmapFactory could not resolve. Return the absolute path to silo.svg so the C++ side can load the icon directly.
This commit is contained in:
@@ -9,6 +9,8 @@ delegating operations to the established Silo infrastructure while
|
||||
providing the standardized origin interface.
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
import FreeCAD
|
||||
import FreeCADGui
|
||||
from silo_commands import (
|
||||
@@ -61,8 +63,10 @@ class SiloOrigin:
|
||||
return self._nickname
|
||||
|
||||
def icon(self) -> str:
|
||||
"""Return icon name for BitmapFactory."""
|
||||
return "silo"
|
||||
"""Return icon path for BitmapFactory."""
|
||||
return os.path.join(
|
||||
os.path.dirname(os.path.abspath(__file__)), "resources", "icons", "silo.svg"
|
||||
)
|
||||
|
||||
def type(self) -> int:
|
||||
"""Return origin type (OriginType.PLM = 1)."""
|
||||
@@ -388,9 +392,7 @@ class SiloOrigin:
|
||||
|
||||
# Upload to Silo
|
||||
properties = collect_document_properties(doc)
|
||||
_client._upload_file(
|
||||
obj.SiloPartNumber, str(file_path), properties, comment=""
|
||||
)
|
||||
_client._upload_file(obj.SiloPartNumber, str(file_path), properties, comment="")
|
||||
|
||||
# Clear modified flag (Modified is on Gui.Document, not App.Document)
|
||||
gui_doc = FreeCADGui.getDocument(doc.Name)
|
||||
|
||||
Reference in New Issue
Block a user