Yep exaclty, i want to retrieve the old value of a valuenode to display it in
the dialog,
T his case also happen for renaming layer (maybe elsewhere i am not sure)
So i wanted to implement something kind of generic, it's why i have thinked of
adding "value_provided" member .
(during that short time i have finished to implement my roadmap, it's succesful
, at least for renaming value node :-)
http://pix.toile-libre.org/upload/original/1391080937.png
But for sure, if you prefer i can (tryto) do the way you explain ...
If I understand correctly, you want to retrieve the old value node name and
place it on the dialog before it is shown to the user to be changed.
The Instance::process_action member function receives a Action::ParamList
that is the list of the value nodes with the name in a list.
Later, on Instance::process_action you can look up the "value_node"
parameter on that param list, and get its id (value_node->get_id();) then
use that string to place it on the dialog.
Since the dialog from Instance::process_action is for any action type you
have to check whether the action is a Rename_ValueNode one to fill up the
dialog with the string.
I think that everything you need is inside the Instance class and no new
parameters are needed to add to the action.
I hope I've explained correctly.
Cheers!
----- Mail original -----
Hello,
i am taking a look around Enhancement #335 - UI : Renaming a value node,
display old name
http://www.synfig.org/issues/thebuggenie/synfig/issues/335
from what i understand of the action and paramvocab this is my roadmap:
1- add to ParamDesc a "value_provided" member who indicate for a param that a
value is provided or not
https://github.com/synfig/synfig/blob/master/synfig-studio/src/synfigapp/action_param.h#L189
2- add to actionS paramvocab "name" parameter that value_provided
https://github.com/synfig/synfig/blob/master/synfig-studio/src/synfigapp/actions/valuenoderename.cpp#L85
3- add a virtual bool action:canvas_specific::get_param(const synfig::String&
name, Param & param) {return false;}
https://github.com/synfig/synfig/blob/master/synfig-studio/src/synfigapp/action.h#L281
4- implement get_param in actionS
5- invoke get_param when get_user_supplied in Instance::process_action to fill
str /
https://github.com/synfig/synfig/blob/master/synfig-studio/src/gui/instance.cpp#L887
where actionS are taking in set / canvas / layer / value node renaming
actions...
--------------------
does that make sense ?
------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable
security intelligence. It gives you real-time visual feedback on key
security issues and trends. Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl