BIM: Fixed more wrong resource loading - #14210

This commit is contained in:
Yorik van Havre
2024-05-23 09:20:33 +02:00
committed by Chris Hennes
parent b7fb03fadd
commit 458e2727d2
8 changed files with 13 additions and 66 deletions

View File

@@ -74,9 +74,7 @@ def setStatusIcons(show=True):
utext = action.text().replace("&", "")
if utext == nudgeLabelsM[0]:
# load dialog
form = FreeCADGui.PySideUic.loadUi(
os.path.join(os.path.dirname(__file__), "dialogNudgeValue.ui")
)
form = FreeCADGui.PySideUic.loadUi(":/ui/dialogNudgeValue.ui")
# center the dialog over FreeCAD window
mw = FreeCADGui.getMainWindow()
form.move(

View File

@@ -178,7 +178,6 @@ SET(nativeifc_SRCS
nativeifc/ifc_objects.py
nativeifc/ifc_observer.py
nativeifc/ifc_performance_test.py
nativeifc/ifc_preferences.py
nativeifc/ifc_psets.py
nativeifc/ifc_selftest.py
nativeifc/ifc_status.py

View File

@@ -399,23 +399,9 @@ class BIM_Library_TaskPanel:
if f.endswith(".fcstd"):
it.setIcon(QtGui.QIcon(":icons/freecad-doc.png"))
elif f.endswith(".ifc"):
it.setIcon(
QtGui.QIcon(
os.path.join(
os.path.dirname(__file__), "icons", "IFC.svg"
)
)
)
it.setIcon(QtGui.QIcon(":/icons/IFC.svg"))
else:
it.setIcon(
QtGui.QIcon(
os.path.join(
os.path.dirname(__file__),
"icons",
"Part_document.svg",
)
)
)
it.setIcon(QtGui.QIcon(":/icons/Part_document.svg"))
self.modelmode = 0
def getFilters(self):

View File

@@ -341,9 +341,7 @@ class BIM_Material:
if item:
oldmat = FreeCAD.ActiveDocument.getObject(item.toolTip())
# load dialog
form = FreeCADGui.PySideUic.loadUi(
os.path.join(os.path.dirname(__file__), "dialogListWidget.ui")
)
form = FreeCADGui.PySideUic.loadUi(":/ui/dialogListWidget.ui")
# center the dialog over FreeCAD window
mw = FreeCADGui.getMainWindow()
form.move(

View File

@@ -205,9 +205,7 @@ class BIM_Preflight_TaskPanel:
for c in self.culprits[test]:
FreeCADGui.Selection.addSelection(c)
if not self.rform:
self.rform = FreeCADGui.PySideUic.loadUi(
os.path.join(os.path.dirname(__file__), "dialogPreflightResults.ui")
)
self.rform = FreeCADGui.PySideUic.loadUi(":/ui/dialogPreflightResults.ui")
# center the dialog over FreeCAD window
mw = FreeCADGui.getMainWindow()
self.rform.move(

View File

@@ -130,14 +130,16 @@ class BIM_ProjectManager:
).Value
human = None
if self.form.addHumanFigure.isChecked():
humanshape = Part.Shape()
# TODO ; fix loading of human shape
humanpath = os.path.join(
os.path.dirname(__file__), "geometry", "human figure.brep"
)
humanshape.importBrep(humanpath)
human = FreeCAD.ActiveDocument.addObject("Part::Feature", "Human")
human.Shape = humanshape
human.Placement.move(FreeCAD.Vector(500, 500, 0))
if os.path.exists(humanpath):
humanshape = Part.Shape()
humanshape.importBrep(humanpath)
human = FreeCAD.ActiveDocument.addObject("Part::Feature", "Human")
human.Shape = humanshape
human.Placement.move(FreeCAD.Vector(500, 500, 0))
if self.form.groupBuilding.isChecked():
building = Arch.makeBuilding()
if site:

View File

@@ -75,7 +75,7 @@ FreeCADGui.addCommand("BIM_Trash", BIM_Trash())
class BIM_EmptyTrash:
def GetResources(self):
return {
"Pixmap": os.path.join(os.path.dirname(__file__), "icons", "BIM_Trash.svg"),
"Pixmap": "BIM_Trash",
"MenuText": QT_TRANSLATE_NOOP("BIM_EmptyTrash", "Clean Trash"),
"ToolTip": QT_TRANSLATE_NOOP(
"BIM_EmptyTrash",

View File

@@ -1,34 +0,0 @@
# ***************************************************************************
# * *
# * Copyright (c) 2022 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU General Public License (GPL) *
# * as published by the Free Software Foundation; either version 3 of *
# * the License, or (at your option) any later version. *
# * for detail see the LICENCE text file. *
# * *
# * This program is distributed in the hope that it will be useful, *
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
# * GNU General Public License for more details. *
# * *
# * You should have received a copy of the GNU Library General Public *
# * License along with this program; if not, write to the Free Software *
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
# * USA *
# * *
# ***************************************************************************
import os
import FreeCADGui
from PySide.QtCore import QT_TRANSLATE_NOOP
"""Helper for InitGui"""
def add_preferences_page():
"""Adds the NativeIFC preferences page"""
page = os.path.join(os.path.dirname(__file__), "ui", "preferencesNativeIFC.ui")
category = QT_TRANSLATE_NOOP("NativeIFC", "Import-Export")
FreeCADGui.addPreferencePage(page, category)