diff --git a/src/Mod/Arch/ArchBuilding.py b/src/Mod/Arch/ArchBuilding.py index 59e731259..13547cb71 100644 --- a/src/Mod/Arch/ArchBuilding.py +++ b/src/Mod/Arch/ArchBuilding.py @@ -1,3 +1,5 @@ +# -*- coding: utf8 -*- + #*************************************************************************** #* * #* Copyright (c) 2011 * @@ -214,15 +216,15 @@ class _CommandBuilding: else: warning = True if warning : - message = "You can put anything but Site and Building object in a Building object.\n\ + message = translate( "Arch" , "You can put anything but Site and Building object in a Building object.\n\ Building object are not allowed to accept Site and Building object.\n\ Site and Building objects will be removed from the selection.\n\ -You can change that in the preferences.\n" - self.printMessage( message ) +You can change that in the preferences.\n" ) + ArchCommands.printMessage( message ) if sel and len(buildingobj) == 0: - message = "There is no valid object in the selection.\n\ -Building creation aborted.\n" - self.printMessage( message ) + message = translate( "Arch" , "There is no valid object in the selection.\n\ +Building creation aborted.\n" ) + ArchCommands.printMessage( message ) else : ss = "[ " for o in buildingobj: @@ -234,11 +236,6 @@ Building creation aborted.\n" FreeCAD.ActiveDocument.commitTransaction() FreeCAD.ActiveDocument.recompute() - def printMessage(self, message): - FreeCAD.Console.PrintMessage(translate("Arch", message)) - if FreeCAD.GuiUp : - reply = QtGui.QMessageBox.information(None,"", message) - class _Building(ArchFloor._Floor): "The Building object" def __init__(self,obj): diff --git a/src/Mod/Arch/ArchCommands.py b/src/Mod/Arch/ArchCommands.py index 6b31bead5..77c5f3f04 100644 --- a/src/Mod/Arch/ArchCommands.py +++ b/src/Mod/Arch/ArchCommands.py @@ -937,6 +937,16 @@ def getExtrusionData(shape): return [faces[p[0]][0],faces[p[1]][0].CenterOfMass.sub(faces[p[0]][0].CenterOfMass)] return None +def printMessage( message ): + FreeCAD.Console.PrintMessage( message ) + if FreeCAD.GuiUp : + reply = QtGui.QMessageBox.information( None , "" , message.decode('utf8') ) + +def printWarning( message ): + FreeCAD.Console.PrintMessage( message ) + if FreeCAD.GuiUp : + reply = QtGui.QMessageBox.warning( None , "" , message.decode('utf8') ) + # command definitions ############################################### diff --git a/src/Mod/Arch/ArchFloor.py b/src/Mod/Arch/ArchFloor.py index 1c41b59eb..156f44084 100644 --- a/src/Mod/Arch/ArchFloor.py +++ b/src/Mod/Arch/ArchFloor.py @@ -1,3 +1,5 @@ +# -*- coding: utf8 -*- + #*************************************************************************** #* * #* Copyright (c) 2011 * @@ -72,15 +74,15 @@ class _CommandFloor: else: warning = True if warning : - message = "You can put anything but Site, Building, Floor object in a Floor object.\n\ + message = translate( "Arch" , "You can put anything but Site, Building, Floor object in a Floor object.\n\ Floor object are not allowed to accept Site or Building object.\n\ Site, Building and Floor objects will be removed from the selection.\n\ -You can change that in the preferences.\n" - self.printMessage( message ) +You can change that in the preferences.\n" ) + ArchCommands.printMessage( message ) if sel and len(floorobj) == 0: - message = "There is no valid object in the selection.\n\ -Floor creation aborted.\n" - self.printMessage( message ) + message = translate( "Arch" , "There is no valid object in the selection.\n\ +Floor creation aborted.\n" ) + ArchCommands.printMessage( message ) else : ss = "[ " for o in floorobj: @@ -92,11 +94,6 @@ Floor creation aborted.\n" FreeCAD.ActiveDocument.commitTransaction() FreeCAD.ActiveDocument.recompute() - def printMessage(self, message): - FreeCAD.Console.PrintMessage(translate("Arch", message)) - if FreeCAD.GuiUp : - reply = QtGui.QMessageBox.information(None,"", message) - class _Floor: "The Floor object" def __init__(self,obj): diff --git a/src/Mod/Arch/ArchSite.py b/src/Mod/Arch/ArchSite.py index e6a673732..1c1312a48 100644 --- a/src/Mod/Arch/ArchSite.py +++ b/src/Mod/Arch/ArchSite.py @@ -1,3 +1,5 @@ +# -*- coding: utf8 -*- + #*************************************************************************** #* * #* Copyright (c) 2011 * @@ -74,15 +76,15 @@ class _CommandSite: else: warning = True if warning : - message = "Please select only Building objects or nothing!\n\ + message = translate( "Arch" , "Please select only Building objects or nothing!\n\ Site are not allowed to accept other object than Building.\n\ Other objects will be removed from the selection.\n\ -You can change that in the preferences." - self.printMessage( message ) +You can change that in the preferences." ) + ArchCommands.printMessage( message ) if sel and len(siteobj) == 0: - message = "There is no valid object in the selection.\n\ -Site creation aborted." - self.printMessage( message ) + message = translate( "Arch" , "There is no valid object in the selection.\n\ +Site creation aborted." ) + ArchCommands.printMessage( message ) else : ss = "[ " for o in siteobj: @@ -94,11 +96,6 @@ Site creation aborted." FreeCAD.ActiveDocument.commitTransaction() FreeCAD.ActiveDocument.recompute() - def printMessage(self, message): - FreeCAD.Console.PrintMessage(translate("Arch", message)) - if FreeCAD.GuiUp : - reply = QtGui.QMessageBox.information(None,"", message) - class _Site(ArchFloor._Floor): "The Site object" def __init__(self,obj):