Get the 'Raise Layer' action to list the layer(s) that were raised in the History...
[synfig.git] / synfig-studio / trunk / src / synfigapp / actions / layerraise.cpp
index 3e29bea..c8aba73 100644 (file)
@@ -2,7 +2,7 @@
 /*!    \file layerraise.cpp
 **     \brief Template File
 **
-**     $Id: layerraise.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+**     $Id$
 **
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
@@ -33,6 +33,8 @@
 #include "layermove.h"
 #include <synfigapp/canvasinterface.h>
 
+#include <synfigapp/general.h>
+
 #endif
 
 using namespace std;
@@ -43,14 +45,14 @@ using namespace Action;
 
 /* === M A C R O S ========================================================= */
 
-ACTION_INIT(Action::LayerRaise);
+ACTION_INIT_NO_GET_LOCAL_NAME(Action::LayerRaise);
 ACTION_SET_NAME(Action::LayerRaise,"layer_raise");
-ACTION_SET_LOCAL_NAME(Action::LayerRaise,"Raise Layer");
+ACTION_SET_LOCAL_NAME(Action::LayerRaise,N_("Raise Layer"));
 ACTION_SET_TASK(Action::LayerRaise,"raise");
 ACTION_SET_CATEGORY(Action::LayerRaise,Action::CATEGORY_LAYER);
 ACTION_SET_PRIORITY(Action::LayerRaise,9);
 ACTION_SET_VERSION(Action::LayerRaise,"0.0");
-ACTION_SET_CVS_ID(Action::LayerRaise,"$Id: layerraise.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+ACTION_SET_CVS_ID(Action::LayerRaise,"$Id$");
 
 /* === G L O B A L S ======================================================= */
 
@@ -62,6 +64,25 @@ Action::LayerRaise::LayerRaise()
 {
 }
 
+synfig::String
+Action::LayerRaise::get_local_name()const
+{
+       String ret;
+
+       if (layers.empty())
+               return _("Raise Layer");
+
+       ret = strprintf("%s '%s'",
+                                       (layers.size() == 1
+                                        ? _("Raise Layer")
+                                        : _("Raise Layers")),
+                                       (*layers.begin())->get_non_empty_description().c_str());
+
+       for(std::list<synfig::Layer::Handle>::const_iterator iter=++layers.begin(); iter!=layers.end(); ++iter)
+               ret += strprintf(", '%s'", ((*iter)->get_non_empty_description().c_str()));
+       return ret;
+}
+
 Action::ParamVocab
 Action::LayerRaise::get_param_vocab()
 {