From: dooglus Date: Thu, 3 Jan 2008 13:49:11 +0000 (+0000) Subject: The hardcoded string "Do Not Use" was being used in multiple places as the category... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=48bbcdc963c394122d294519d43330e046433129;p=synfig.git The hardcoded string "Do Not Use" was being used in multiple places as the category for layers that shouldn't show up in the GUI menus. Replaced it with a single #define'd string constant. Also, there's no need to translate it, since the string is never displayed to the user. Previously we were dependent upon the same translation for the string existing in both core and studio. git-svn-id: http://svn.voria.com/code@1264 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/modules/example/simplecircle.cpp b/synfig-core/trunk/src/modules/example/simplecircle.cpp index 4388bdd..dfeeb15 100644 --- a/synfig-core/trunk/src/modules/example/simplecircle.cpp +++ b/synfig-core/trunk/src/modules/example/simplecircle.cpp @@ -53,7 +53,7 @@ using namespace synfig; SYNFIG_LAYER_INIT(SimpleCircle); SYNFIG_LAYER_SET_NAME(SimpleCircle,"simple_circle"); SYNFIG_LAYER_SET_LOCAL_NAME(SimpleCircle,N_("Simple Circle")); -SYNFIG_LAYER_SET_CATEGORY(SimpleCircle,N_("Do Not Use")); +SYNFIG_LAYER_SET_CATEGORY(SimpleCircle,CATEGORY_DO_NOT_USE); SYNFIG_LAYER_SET_VERSION(SimpleCircle,"0.1"); SYNFIG_LAYER_SET_CVS_ID(SimpleCircle,"$Id$"); diff --git a/synfig-core/trunk/src/synfig/layer.cpp b/synfig-core/trunk/src/synfig/layer.cpp index e9572c5..725f118 100644 --- a/synfig-core/trunk/src/synfig/layer.cpp +++ b/synfig-core/trunk/src/synfig/layer.cpp @@ -97,7 +97,7 @@ Layer::subsys_init() _layer_book=new Book(); #define INCLUDE_LAYER(class) synfig::Layer::book()[synfig::String(class::name__)]=BookEntry(class::create,class::name__,dgettext("synfig",class::local_name__),dgettext("synfig",class::category__),class::cvs_id__,class::version__) -#define LAYER_ALIAS(class,alias) synfig::Layer::book()[synfig::String(alias)]=synfig::Layer::BookEntry(class::create,alias,alias,_("Do Not Use"),class::cvs_id__,class::version__); +#define LAYER_ALIAS(class,alias) synfig::Layer::book()[synfig::String(alias)]=synfig::Layer::BookEntry(class::create,alias,alias,CATEGORY_DO_NOT_USE,class::cvs_id__,class::version__); INCLUDE_LAYER(Layer_SolidColor); LAYER_ALIAS(Layer_SolidColor, "solid_color"); INCLUDE_LAYER(Layer_PasteCanvas); LAYER_ALIAS(Layer_PasteCanvas, "paste_canvas"); diff --git a/synfig-core/trunk/src/synfig/layer.h b/synfig-core/trunk/src/synfig/layer.h index 1344910..64cd310 100644 --- a/synfig-core/trunk/src/synfig/layer.h +++ b/synfig-core/trunk/src/synfig/layer.h @@ -82,6 +82,10 @@ //! \writeme #define EXPORT_VERSION() if(param=="Version" || param=="version" || param=="version__") { return version__; } +//! This is used as the category for layer book entries which represent aliases of layers. +//! It prevents these layers showing up in the menu. +#define CATEGORY_DO_NOT_USE "Do Not Use" + /* === T Y P E D E F S ===================================================== */ /* === C L A S S E S & S T R U C T S ======================================= */ diff --git a/synfig-core/trunk/src/synfig/module.h b/synfig-core/trunk/src/synfig/module.h index 49691cf..6aab53a 100644 --- a/synfig-core/trunk/src/synfig/module.h +++ b/synfig-core/trunk/src/synfig/module.h @@ -91,7 +91,7 @@ //! DEPRECATED - use #INCLUDE_LAYER(class) #define LAYER(class) synfig::Layer::register_in_book(synfig::Layer::BookEntry(class::create,class::name__,dgettext("synfig",class::local_name__),dgettext("synfig",class::category__),class::cvs_id__,class::version__)); //#define LAYER(x) synfig::Layer::book()[synfig::String(x::name__)]=x::create; -#define LAYER_ALIAS(class,alias) synfig::Layer::register_in_book(synfig::Layer::BookEntry(class::create,alias,alias,_("Do Not Use"),class::cvs_id__,class::version__)); +#define LAYER_ALIAS(class,alias) synfig::Layer::register_in_book(synfig::Layer::BookEntry(class::create,alias,alias,CATEGORY_DO_NOT_USE,class::cvs_id__,class::version__)); //! Marks the end of the layers in the module's inventory #define END_LAYERS } diff --git a/synfig-studio/trunk/src/gtkmm/canvasview.cpp b/synfig-studio/trunk/src/gtkmm/canvasview.cpp index 8e9ec16..8f6c32e 100644 --- a/synfig-studio/trunk/src/gtkmm/canvasview.cpp +++ b/synfig-studio/trunk/src/gtkmm/canvasview.cpp @@ -1770,7 +1770,7 @@ CanvasView::popup_layer_menu(synfig::Layer::Handle layer) void CanvasView::register_layer_type(synfig::Layer::Book::value_type &/*lyr*/,std::map* /*category_map*/) { -/* if(lyr.second.category==_("Do Not Use")) +/* if(lyr.second.category==CATEGORY_DO_NOT_USE) return; if(category_map->count(lyr.second.category)==0) diff --git a/synfig-studio/trunk/src/gtkmm/dock_layers.cpp b/synfig-studio/trunk/src/gtkmm/dock_layers.cpp index 766f4a2..6cd19a1 100644 --- a/synfig-studio/trunk/src/gtkmm/dock_layers.cpp +++ b/synfig-studio/trunk/src/gtkmm/dock_layers.cpp @@ -88,7 +88,7 @@ Dock_Layers::Dock_Layers(): { synfig::Layer::Book::value_type lyr(*iter); - if(lyr.second.category==_("Do Not Use")) + if(lyr.second.category==CATEGORY_DO_NOT_USE) continue; action_group_new_layers->add(Gtk::Action::create(