* [ArchSketchObject / Window] Links of Window to support Individual Hosts Currently, Links of Window's Hosts property (and in generall all properties other than e.g. Placement) is shared with its Linked Window object, i.e. all Windows Links instances can only has a common Host(s) which is not flexible for the purpose of Links. AND, at the same time, Links in linked document suffer from the 'scope' of the original Linked Window, which is in the external Document. This commit adds feature to support: 1/ each Links instance of Windows has their own individual setting of Hosts, and 2/ it see the 'scope' of the Links in its document (rather than the Linked Window in the external document) FreeCAD Forum: - https://forum.freecad.org/viewtopic.php?p=808569#p808569 FreeCAD GitHub: - https://github.com/FreeCAD/FreeCAD/issues/19361 * [ArchSketchObject] Fix indentation
50 lines
2.4 KiB
Python
50 lines
2.4 KiB
Python
#***************************************************************************
|
|
#* *
|
|
#* Copyright (c) 2018-25 Paul Lee <paullee0@gmail.com> *
|
|
#* *
|
|
#* This program is free software; you can redistribute it and/or modify *
|
|
#* it under the terms of the GNU Lesser General Public License (LGPL) *
|
|
#* as published by the Free Software Foundation; either version 2 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 Library 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 ArchWindow
|
|
from PySide.QtCore import QT_TRANSLATE_NOOP
|
|
|
|
class ArchSketchObject:
|
|
def __init__(self, obj):
|
|
pass
|
|
|
|
class ArchSketch(ArchSketchObject):
|
|
def __init__(self, obj):
|
|
pass
|
|
|
|
def setPropertiesLinkCommon(self, orgFp, linkFp=None, mode=None):
|
|
if linkFp:
|
|
fp = linkFp
|
|
else:
|
|
fp = orgFp
|
|
prop = fp.PropertiesList
|
|
if not isinstance(fp.getLinkedObject().Proxy, ArchWindow._Window):
|
|
pass
|
|
else:
|
|
if "Hosts" not in prop:
|
|
fp.addProperty("App::PropertyLinkList","Hosts","Window",
|
|
QT_TRANSLATE_NOOP("App::Property",
|
|
"The objects that host this window"))
|
|
# Arch Window's code
|
|
|
|
#from ArchSketchObjectExt import ArchSketch # Doesn't work
|