From 312541920425e9ca481a0218c440f369dd25306f Mon Sep 17 00:00:00 2001 From: dooglus Date: Thu, 10 Jan 2008 23:22:11 +0000 Subject: [PATCH] Made a new ACTION_INIT_NO_GET_LOCAL_NAME macro for actions which want to define their own (changable) local names. git-svn-id: http://svn.voria.com/code@1318 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/synfigapp/action.h | 12 ++++++++---- synfig-studio/trunk/src/synfigapp/actions/layeractivate.cpp | 5 +---- synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp | 5 +---- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/synfig-studio/trunk/src/synfigapp/action.h b/synfig-studio/trunk/src/synfigapp/action.h index e01b48e..4458062 100644 --- a/synfig-studio/trunk/src/synfigapp/action.h +++ b/synfig-studio/trunk/src/synfigapp/action.h @@ -74,10 +74,14 @@ #define ACTION_SET_CVS_ID(class,x) const char class::cvs_id__[]=x -#define ACTION_INIT(class) \ - Action::Base* class::create() { return new class(); } \ - synfig::String class::get_name()const { return name__; } \ - synfig::String class::get_local_name()const { return dgettext("synfigstudio",local_name__); } \ +//! don't define get_local_name() - allow the action code to define its own +#define ACTION_INIT_NO_GET_LOCAL_NAME(class) \ + Action::Base* class::create() { return new class(); } \ + synfig::String class::get_name()const { return name__; } + +#define ACTION_INIT(class) \ + ACTION_INIT_NO_GET_LOCAL_NAME(class) \ + synfig::String class::get_local_name()const { return dgettext("synfigstudio",local_name__); } /* === T Y P E D E F S ===================================================== */ diff --git a/synfig-studio/trunk/src/synfigapp/actions/layeractivate.cpp b/synfig-studio/trunk/src/synfigapp/actions/layeractivate.cpp index a051e01..835fd69 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/layeractivate.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/layeractivate.cpp @@ -43,11 +43,8 @@ using namespace synfigapp; using namespace Action; /* === M A C R O S ========================================================= */ -#define ACTION_INIT2(class) \ - Action::Base* class::create() { return new class(); } \ - synfig::String class::get_name()const { return name__; } -ACTION_INIT2(Action::LayerActivate); +ACTION_INIT_NO_GET_LOCAL_NAME(Action::LayerActivate); ACTION_SET_NAME(Action::LayerActivate,"layer_activate"); ACTION_SET_LOCAL_NAME(Action::LayerActivate,N_("Activate Layer")); ACTION_SET_TASK(Action::LayerActivate,"activate"); diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp index 0c5a1b4..8796b6f 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp @@ -53,11 +53,8 @@ using namespace synfigapp; using namespace Action; /* === M A C R O S ========================================================= */ -#define ACTION_INIT2(class) \ - Action::Base* class::create() { return new class(); } \ - synfig::String class::get_name()const { return name__; } -ACTION_INIT2(Action::ValueDescSet); +ACTION_INIT_NO_GET_LOCAL_NAME(Action::ValueDescSet); ACTION_SET_NAME(Action::ValueDescSet,"value_desc_set"); ACTION_SET_LOCAL_NAME(Action::ValueDescSet,N_("Set ValueDesc")); ACTION_SET_TASK(Action::ValueDescSet,"set"); -- 2.7.4