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.
|
providing the standardized origin interface.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
import FreeCAD
|
import FreeCAD
|
||||||
import FreeCADGui
|
import FreeCADGui
|
||||||
from silo_commands import (
|
from silo_commands import (
|
||||||
@@ -61,8 +63,10 @@ class SiloOrigin:
|
|||||||
return self._nickname
|
return self._nickname
|
||||||
|
|
||||||
def icon(self) -> str:
|
def icon(self) -> str:
|
||||||
"""Return icon name for BitmapFactory."""
|
"""Return icon path for BitmapFactory."""
|
||||||
return "silo"
|
return os.path.join(
|
||||||
|
os.path.dirname(os.path.abspath(__file__)), "resources", "icons", "silo.svg"
|
||||||
|
)
|
||||||
|
|
||||||
def type(self) -> int:
|
def type(self) -> int:
|
||||||
"""Return origin type (OriginType.PLM = 1)."""
|
"""Return origin type (OriginType.PLM = 1)."""
|
||||||
@@ -388,9 +392,7 @@ class SiloOrigin:
|
|||||||
|
|
||||||
# Upload to Silo
|
# Upload to Silo
|
||||||
properties = collect_document_properties(doc)
|
properties = collect_document_properties(doc)
|
||||||
_client._upload_file(
|
_client._upload_file(obj.SiloPartNumber, str(file_path), properties, comment="")
|
||||||
obj.SiloPartNumber, str(file_path), properties, comment=""
|
|
||||||
)
|
|
||||||
|
|
||||||
# Clear modified flag (Modified is on Gui.Document, not App.Document)
|
# Clear modified flag (Modified is on Gui.Document, not App.Document)
|
||||||
gui_doc = FreeCADGui.getDocument(doc.Name)
|
gui_doc = FreeCADGui.getDocument(doc.Name)
|
||||||
|
|||||||
Reference in New Issue
Block a user