Delete duplicate toolbars

Duplicate toolbars can be added by customize dialog (reported by @DeepSOIC):

https://forum.freecadweb.org/viewtopic.php?f=10&t=25945&start=10#p205190
This commit is contained in:
triplus 2017-12-21 18:01:03 +01:00 committed by GitHub
parent 9c7b3d46a5
commit 3ac692a452
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,19 @@ p = FreeCAD.ParamGet("User parameter:BaseApp/SelectorToolbar")
if p.GetBool("Enabled", 1):
# Delete duplicate toolbars (can be added by customize dialog).
pathTB = "User parameter:BaseApp/Workbench/Global/Toolbar"
pTB = FreeCAD.ParamGet(pathTB)
n = 1
while n and n < 999:
group = "Custom_" + str(n)
if pTB.HasGroup(group):
if pTB.GetGroup(group).GetString("Name") == "Selector":
pTB.RemGroup(group)
n += 1
else:
n = None
# Create toolbar.
pathTB = "User parameter:BaseApp/Workbench/Global/Toolbar/Selector"
pTB = FreeCAD.ParamGet(pathTB)