From 284bb8041270ff735c18606ffa3a023b49298a4c Mon Sep 17 00:00:00 2001 From: Roy-043 <70520633+Roy-043@users.noreply.github.com> Date: Tue, 3 Dec 2024 15:18:06 +0100 Subject: [PATCH] BIM: import ToDo from correct file (#18221) * BIM: import ToDo from correct file * Oops, forgot to save some files. --- src/Mod/BIM/Arch.py | 8 ++++---- src/Mod/BIM/ArchBuilding.py | 4 ++-- src/Mod/BIM/ArchFloor.py | 4 ++-- src/Mod/BIM/ArchReference.py | 8 ++++---- src/Mod/BIM/InitGui.py | 10 +++++----- src/Mod/BIM/bimcommands/BimConvert.py | 4 ++-- src/Mod/BIM/bimcommands/BimLibrary.py | 8 ++++---- src/Mod/BIM/bimcommands/BimMaterial.py | 4 ++-- src/Mod/BIM/bimcommands/BimPreflight.py | 6 +++--- src/Mod/BIM/bimcommands/BimTutorial.py | 4 ++-- src/Mod/BIM/bimcommands/BimUnclone.py | 1 - 11 files changed, 30 insertions(+), 31 deletions(-) diff --git a/src/Mod/BIM/Arch.py b/src/Mod/BIM/Arch.py index dbc4085ebb..818b860d2e 100644 --- a/src/Mod/BIM/Arch.py +++ b/src/Mod/BIM/Arch.py @@ -187,8 +187,8 @@ def convertFloors(floor=None): obj.Label = obj.Label+" to delete" nobj.Label = label for n in todel: - from DraftGui import todo - todo.delay(FreeCAD.ActiveDocument.removeObject,n) + from draftutils import todo + todo.ToDo.delay(FreeCAD.ActiveDocument.removeObject,n) def makeCurtainWall(baseobj=None,name=None): @@ -1090,7 +1090,7 @@ def makeWindow(baseobj=None,width=None,height=None,parts=None,name=None): import ArchWindow import Draft - from DraftGui import todo + from draftutils import todo if not FreeCAD.ActiveDocument: FreeCAD.Console.PrintError("No active document. Aborting\n") return @@ -1141,5 +1141,5 @@ def makeWindow(baseobj=None,width=None,height=None,parts=None,name=None): if obj.Base and FreeCAD.GuiUp: obj.Base.ViewObject.DisplayMode = "Wireframe" obj.Base.ViewObject.hide() - todo.delay(ArchWindow.recolorize,[obj.Document.Name,obj.Name]) + todo.ToDo.delay(ArchWindow.recolorize,[obj.Document.Name,obj.Name]) return obj diff --git a/src/Mod/BIM/ArchBuilding.py b/src/Mod/BIM/ArchBuilding.py index 64bba1ebb2..652f958594 100644 --- a/src/Mod/BIM/ArchBuilding.py +++ b/src/Mod/BIM/ArchBuilding.py @@ -314,8 +314,8 @@ class _ViewProviderBuilding(ArchFloor._ViewProviderFloor): def convertToBuildingPart(self): if hasattr(self,"Object"): import ArchBuildingPart - from DraftGui import todo - todo.delay(ArchBuildingPart.convertFloors,self.Object) + from draftutils import todo + todo.ToDo.delay(ArchBuildingPart.convertFloors,self.Object) if FreeCAD.GuiUp: diff --git a/src/Mod/BIM/ArchFloor.py b/src/Mod/BIM/ArchFloor.py index 70d2c9a673..cbde18279c 100644 --- a/src/Mod/BIM/ArchFloor.py +++ b/src/Mod/BIM/ArchFloor.py @@ -413,8 +413,8 @@ class _ViewProviderFloor: if hasattr(self,"Object"): import ArchBuildingPart - from DraftGui import todo - todo.delay(ArchBuildingPart.convertFloors,self.Object) + from draftutils import todo + todo.ToDo.delay(ArchBuildingPart.convertFloors,self.Object) if FreeCAD.GuiUp: diff --git a/src/Mod/BIM/ArchReference.py b/src/Mod/BIM/ArchReference.py index f09b8fd101..23f60bfd9d 100644 --- a/src/Mod/BIM/ArchReference.py +++ b/src/Mod/BIM/ArchReference.py @@ -564,8 +564,8 @@ class ViewProviderArchReference: colors = obj.Proxy.getColors(obj) if colors: obj.ViewObject.DiffuseColor = colors - from DraftGui import todo - todo.delay(self.recolorize,obj.ViewObject) + from draftutils import todo + todo.ToDo.delay(self.recolorize,obj.ViewObject) def recolorize(self,vobj): @@ -642,8 +642,8 @@ class ViewProviderArchReference: return None FreeCADGui.Control.closeDialog() - from DraftGui import todo - todo.delay(vobj.Proxy.recolorize,vobj) + from draftutils import todo + todo.ToDo.delay(vobj.Proxy.recolorize,vobj) return True diff --git a/src/Mod/BIM/InitGui.py b/src/Mod/BIM/InitGui.py index cdd3117e39..ce80711699 100644 --- a/src/Mod/BIM/InitGui.py +++ b/src/Mod/BIM/InitGui.py @@ -474,7 +474,7 @@ class BIMWorkbench(Workbench): def Activated(self): import WorkingPlane - from DraftGui import todo + from draftutils import todo import BimStatus from nativeifc import ifc_observer from draftutils import grid_observer @@ -489,8 +489,8 @@ class BIMWorkbench(Workbench): grid_observer._view_observer_setup() if PARAMS.GetBool("FirstTime", True) and (not hasattr(FreeCAD, "TestEnvironment")): - todo.delay(FreeCADGui.runCommand, "BIM_Welcome") - todo.delay(BimStatus.setStatusIcons, True) + todo.ToDo.delay(FreeCADGui.runCommand, "BIM_Welcome") + todo.ToDo.delay(BimStatus.setStatusIcons, True) FreeCADGui.Control.clearTaskWatcher() class BimWatcher: @@ -552,7 +552,7 @@ class BIMWorkbench(Workbench): def Deactivated(self): - from DraftGui import todo + from draftutils import todo import BimStatus from bimcommands import BimViews import WorkingPlane @@ -573,7 +573,7 @@ class BIMWorkbench(Workbench): grid_observer._view_observer_setup() # print("Deactivating status icon") - todo.delay(BimStatus.setStatusIcons, False) + todo.ToDo.delay(BimStatus.setStatusIcons, False) FreeCADGui.Control.clearTaskWatcher() # store views widget state and vertical size diff --git a/src/Mod/BIM/bimcommands/BimConvert.py b/src/Mod/BIM/bimcommands/BimConvert.py index 86732c11cf..79377e2c30 100644 --- a/src/Mod/BIM/bimcommands/BimConvert.py +++ b/src/Mod/BIM/bimcommands/BimConvert.py @@ -93,9 +93,9 @@ class BIM_Convert_TaskPanel: FreeCAD.ActiveDocument.commitTransaction() FreeCAD.ActiveDocument.recompute() if idx: - from DraftGui import todo + from draftutils import todo - todo.delay(FreeCADGui.Control.closeDialog, None) + todo.ToDo.delay(FreeCADGui.Control.closeDialog, None) return True diff --git a/src/Mod/BIM/bimcommands/BimLibrary.py b/src/Mod/BIM/bimcommands/BimLibrary.py index ae969bde9e..40c9607ee9 100644 --- a/src/Mod/BIM/bimcommands/BimLibrary.py +++ b/src/Mod/BIM/bimcommands/BimLibrary.py @@ -584,17 +584,17 @@ class BIM_Library_TaskPanel: self.place(path) elif ext == ".fcstd": FreeCADGui.ActiveDocument.mergeProject(path) - from DraftGui import todo + from draftutils import todo - todo.delay(self.reject, None) + todo.ToDo.delay(self.reject, None) elif ext == ".ifc": from importers import importIFC importIFC.ZOOMOUT = False importIFC.insert(path, FreeCAD.ActiveDocument.Name) - from DraftGui import todo + from draftutils import todo - todo.delay(self.reject, None) + todo.ToDo.delay(self.reject, None) elif ext in [".sat", ".sab"]: try: # InventorLoader addon diff --git a/src/Mod/BIM/bimcommands/BimMaterial.py b/src/Mod/BIM/bimcommands/BimMaterial.py index 017d6a1cdd..50ddbcdb56 100644 --- a/src/Mod/BIM/bimcommands/BimMaterial.py +++ b/src/Mod/BIM/bimcommands/BimMaterial.py @@ -444,9 +444,9 @@ class BIM_Material: p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") p.SetInt("BimMaterialDialogWidth", self.dlg.width()) p.SetInt("BimMaterialDialogHeight", self.dlg.height()) - from DraftGui import todo + from draftutils import todo - todo.delay(self.dlg.hide, None) + todo.ToDo.delay(self.dlg.hide, None) def onReject(self): if self.dlg: diff --git a/src/Mod/BIM/bimcommands/BimPreflight.py b/src/Mod/BIM/bimcommands/BimPreflight.py index 8c7e0c0756..11fc0acdf7 100644 --- a/src/Mod/BIM/bimcommands/BimPreflight.py +++ b/src/Mod/BIM/bimcommands/BimPreflight.py @@ -294,16 +294,16 @@ class BIM_Preflight_TaskPanel: "runs all tests" from PySide import QtCore, QtGui - from DraftGui import todo + from draftutils import todo for test in tests: if test != "testAll": QtGui.QApplication.processEvents() self.reset(test) if hasattr(self, test): - todo.delay(getattr(self, test), None) + todo.ToDo.delay(getattr(self, test), None) for customTest in self.customTests.keys(): - todo.delay(self.testCustom, customTest) + todo.ToDo.delay(self.testCustom, customTest) FreeCADGui.BIMPreflightDone = True def testIFC4(self): diff --git a/src/Mod/BIM/bimcommands/BimTutorial.py b/src/Mod/BIM/bimcommands/BimTutorial.py index 43fd1a5c64..7f04a459f1 100644 --- a/src/Mod/BIM/bimcommands/BimTutorial.py +++ b/src/Mod/BIM/bimcommands/BimTutorial.py @@ -84,10 +84,10 @@ class BIM_Tutorial: self.pixempty = QtGui.QPixmap() # fire the loading after displaying the widget - from DraftGui import todo + from draftutils import todo # self.load() - # todo.delay(self.load,None) + # todo.ToDo.delay(self.load,None) QtCore.QTimer.singleShot(1000, self.load) def load(self, arg=None): diff --git a/src/Mod/BIM/bimcommands/BimUnclone.py b/src/Mod/BIM/bimcommands/BimUnclone.py index c1a2b5a8f1..c6c7c78f6a 100644 --- a/src/Mod/BIM/bimcommands/BimUnclone.py +++ b/src/Mod/BIM/bimcommands/BimUnclone.py @@ -120,7 +120,6 @@ class BIM_Unclone: if newobj != obj: name = obj.Name label = obj.Label - from DraftGui import todo FreeCAD.ActiveDocument.removeObject(name) newobj.Label = label