Hi Melchior,
you can find the patch with, I hope, the correct improvement you asked.
I wanted to add that I really agree your point of view: "To make
listeners work as expected the solution is to make *listeners*
work as expected, not to change dialog-apply in a way that makes them
not work as expected.".
Be sure that I'll be aware and will recall you of this change if one day
we run into problems, and no-one remembers about it before ;)
thanks for the interest you had about my suggestion.
Now I'm going to continue my tries about failures scenarii. I think I've
got some nice ideas about it to make them generic but adaptable (using
xml) and improving flight experience. I'll expose you them later as it
needs more thinking, and a lot more work. :D
best regards
seb
Melchior FRANZ wrote :
* Sébastien MARQUE -- 2/20/2009 1:23 AM:
This is not new, it was the case with the precedent gui dialog, and I
used a Nasal workaround but not really useful as it disallows to come
back to a previous state.
I've written a lot of dialogs, the most complicated ones among them,
and I don't remember that I ever had to work around this sort of issue.
That's one of the reasons why I hesitate when someone asks for a change
to make his first(?) dialog work. :-P
But anyway. I withdraw my objection and don't mind if someone commits
this patch with one improvement: the node value shall not be read twice!
That's not so much because of the saved nanoseconds, but mostly because
of --trace-read (and style).
dialog-apply does then no longer mean copy widget data to the tree,
but sync tree with the internal widget state. (dialog-update does still
mean *copy*, though ... which is another reason why I'm not thrilled
by the change. One more inconsistency to remember ...)
But be warned: if we run into problems with this modification, I'll be
less hesitant before throwing it out again. ;-)
m.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Index: src/GUI/dialog.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/GUI/dialog.cxx,v
retrieving revision 1.115
diff -u -r1.115 dialog.cxx
--- src/GUI/dialog.cxx 10 Feb 2009 22:14:13 -0000 1.115
+++ src/GUI/dialog.cxx 23 Feb 2009 21:26:32 -0000
@@ -437,11 +437,17 @@
case SGPropertyNode::BOOL:
case SGPropertyNode::INT:
case SGPropertyNode::LONG:
- node->setIntValue(object->getIntegerValue());
+ int objectintvalue;
+ objectintvalue = object->getIntegerValue();
+ if (node->getIntValue() != objectintvalue)
+ node->setIntValue(objectintvalue);
break;
case SGPropertyNode::FLOAT:
case SGPropertyNode::DOUBLE:
- node->setFloatValue(object->getFloatValue());
+ float objectfloatvalue;
+ objectfloatvalue = object->getFloatValue();
+ if (node->getFloatValue() != objectfloatvalue)
+ node->setFloatValue(objectfloatvalue);
break;
default:
const char *s = object->getStringValue();
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel