Added tooltips and label for distance.

This commit is contained in:
ml 2016-10-12 21:05:24 -07:00 committed by Markus Lampert
parent be40ab79cd
commit f6fb8ede40
2 changed files with 40 additions and 11 deletions

View File

@ -44,6 +44,9 @@
</item>
<item row="0" column="1">
<widget class="QComboBox" name="shape">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select desired shape of the bone dressup:&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600; font-style:italic;&quot;&gt;Dogbone&lt;/span&gt; ... take the shortest path to cover the edge,&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600; font-style:italic;&quot;&gt;T-bone&lt;/span&gt; ... follow a certain direction until corner is covered&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
<string>Dogbone</string>
@ -80,6 +83,9 @@
</item>
<item row="1" column="1">
<widget class="QComboBox" name="side">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;On which side of the profile bones are inserted - this also determines which corners are dressed up. The default value is determined based on the profile being dressed up.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="currentIndex">
<number>1</number>
</property>
@ -104,6 +110,9 @@
</item>
<item row="2" column="1">
<widget class="QComboBox" name="length">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Lenght of the bone to be inserted into the profile.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600; font-style:italic;&quot;&gt;adaptive&lt;/span&gt; ... the lenght is adapted to cover the corner based on the angle of it's edges, taking the current tool radius into account (default)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600; font-style:italic;&quot;&gt;fixed&lt;/span&gt; ... is the same as adaptive for straight angles. For T-bones it's the radius of the tool (R) and for dogbones it's R * (2/√2 - 1).&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600; font-style:italic;&quot;&gt;custom&lt;/span&gt; ... let's you sepcify a custom (fixed) distance below&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="currentIndex">
<number>2</number>
</property>
@ -129,6 +138,9 @@
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enter distance for each bone if &lt;span style=&quot; font-weight:600;&quot;&gt;Lenght&lt;/span&gt; is set to &lt;span style=&quot; font-weight:600;&quot;&gt;custom&lt;/span&gt;, ignored otherwise.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
@ -139,6 +151,19 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;List of bone locations (with all bones at that location) that are part of this dressup. The list is determined by the corners in the profile and the selected &lt;span style=&quot; font-weight:600;&quot;&gt;Side&lt;/span&gt; for the bones. &lt;/p&gt;&lt;p&gt;You can &lt;span style=&quot; font-weight:600;&quot;&gt;un-check&lt;/span&gt; the bones you don't want to be dressed up.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;If a bone is &lt;span style=&quot; font-weight:600;&quot;&gt;grayed out&lt;/span&gt; it means that it is already dressed up by a previous dressup. Or put another way, if you dress up this dogobone dressup again you will only be able to select the bones that are un-checked here.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;If this list is empty it probably means you're trying to create bones on the wrong side of the profile.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="customLabel">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Distance</string>
</property>
</widget>
</item>
</layout>

View File

@ -194,20 +194,20 @@ class Chord (object):
class ObjectDressup:
def __init__(self, obj):
obj.addProperty("App::PropertyLink", "Base","Base", "The base path to modify")
obj.addProperty("App::PropertyEnumeration", "Side", "Dressup", "The side of path to insert bones")
obj.addProperty("App::PropertyLink", "Base","Base", QtCore.QT_TRANSLATE_NOOP("Dogbone_Dressup", "The base path to modify"))
obj.addProperty("App::PropertyEnumeration", "Side", "Dressup", QtCore.QT_TRANSLATE_NOOP("Dogbone_Dressup", "The side of path to insert bones"))
obj.Side = [Side.Left, Side.Right]
obj.Side = Side.Right
obj.addProperty("App::PropertyEnumeration", "Shape", "Dressup", "The shape of boness")
obj.addProperty("App::PropertyEnumeration", "Shape", "Dressup", QtCore.QT_TRANSLATE_NOOP("Dogbone_Dressup", "The shape of boness"))
obj.Shape = Shape.All
obj.Shape = Shape.Dogbone
obj.addProperty("App::PropertyIntegerList", "BoneBlacklist", "Dressup", "Bones that aren't dressed up")
obj.addProperty("App::PropertyIntegerList", "BoneBlacklist", "Dressup", QtCore.QT_TRANSLATE_NOOP("Dogbone_Dressup", "Bones that aren't dressed up"))
obj.BoneBlacklist = []
obj.setEditorMode('BoneBlacklist', 2) # hide this one
obj.addProperty("App::PropertyEnumeration", "Length", "Dressup", "The algorithm to determine the bone length")
obj.addProperty("App::PropertyEnumeration", "Length", "Dressup", QtCore.QT_TRANSLATE_NOOP("Dogbone_Dressup", "The algorithm to determine the bone length"))
obj.Length = Length.All
obj.Length = Length.Fixed
obj.addProperty("App::PropertyFloat", "Custom", "Dressup", "Dressup length if lenght == custom")
obj.Length = Length.Adaptive
obj.addProperty("App::PropertyFloat", "Custom", "Dressup", QtCore.QT_TRANSLATE_NOOP("Dogbone_Dressup", "Dressup length if lenght == custom"))
obj.Custom = 0.0
obj.Proxy = self
@ -576,10 +576,15 @@ class TaskPanel:
for item in sorted(itemList, key=lambda item: item.data(self.DataKey)):
self.form.bones.addItem(item)
def updateUI(self):
customSelected = self.obj.Length == Length.Custom
self.form.custom.setEnabled(customSelected)
self.form.customLabel.setEnabled(customSelected)
self.updateBoneList()
def updateModel(self):
self.getFields()
self.form.custom.setEnabled(self.obj.Length == Length.Custom)
self.updateBoneList()
self.updateUI()
FreeCAD.ActiveDocument.recompute()
def setupCombo(self, combo, text, items):
@ -598,8 +603,7 @@ class TaskPanel:
self.form.custom.setMinimum(0.0)
self.form.custom.setDecimals(3)
self.form.custom.setValue(self.obj.Custom)
self.form.custom.setEnabled(self.obj.Length == Length.Custom)
self.updateBoneList()
self.updateUI()
def open(self):
self.s = SelObserver()