Don't set values on "live" text objects to prevent confusion when a
dialog-apply happens.
This commit is contained in:
parent
e590737451
commit
4c2f5ce59e
1 changed files with 11 additions and 5 deletions
|
@ -93,6 +93,13 @@ action_callback (puObject * object)
|
||||||
static void
|
static void
|
||||||
copy_to_pui (SGPropertyNode * node, puObject * object)
|
copy_to_pui (SGPropertyNode * node, puObject * object)
|
||||||
{
|
{
|
||||||
|
// Treat puText objects specially, so their "values" can be set
|
||||||
|
// from properties.
|
||||||
|
if(object->getType() & PUCLASS_TEXT) {
|
||||||
|
object->setLabel(node->getStringValue());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (node->getType()) {
|
switch (node->getType()) {
|
||||||
case SGPropertyNode::BOOL:
|
case SGPropertyNode::BOOL:
|
||||||
case SGPropertyNode::INT:
|
case SGPropertyNode::INT:
|
||||||
|
@ -107,17 +114,16 @@ copy_to_pui (SGPropertyNode * node, puObject * object)
|
||||||
object->setValue(node->getStringValue());
|
object->setValue(node->getStringValue());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Treat puText objects specially, so their "values" can be set
|
|
||||||
// from properties.
|
|
||||||
if(object->getType() & PUCLASS_TEXT)
|
|
||||||
object->setLabel(node->getStringValue());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
copy_from_pui (puObject * object, SGPropertyNode * node)
|
copy_from_pui (puObject * object, SGPropertyNode * node)
|
||||||
{
|
{
|
||||||
|
// puText objects are immutable, so should not be copied out
|
||||||
|
if(object->getType() & PUCLASS_TEXT)
|
||||||
|
return;
|
||||||
|
|
||||||
switch (node->getType()) {
|
switch (node->getType()) {
|
||||||
case SGPropertyNode::BOOL:
|
case SGPropertyNode::BOOL:
|
||||||
case SGPropertyNode::INT:
|
case SGPropertyNode::INT:
|
||||||
|
|
Loading…
Reference in a new issue