From: dooglus Date: Mon, 7 Jan 2008 18:06:03 +0000 (+0000) Subject: Automatically export the Index parameter of new Duplicate layers. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=d3753994e14338bd5282dfb2a363a61fc865ab16;p=synfig.git Automatically export the Index parameter of new Duplicate layers. git-svn-id: http://svn.voria.com/code@1283 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp b/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp index bc2f180..33b6273 100644 --- a/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp +++ b/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp @@ -193,6 +193,22 @@ CanvasInterface::add_layer_to(synfig::String name, synfig::Canvas::Handle canvas return 0; } + // automatically export the Index parameter of new Duplicate layers + if (name == "duplicate") + for (int i = 1; ; i++) + { + String name = strprintf(_("Index %d"), i); + try + { + canvas->find_value_node(name); + } + catch (Exception::IDNotFound x) + { + add_value_node(layer->dynamic_param_list().find("index")->second, name); + break; + } + } + layer->set_canvas(canvas); // Apply some defaults