The hardcoded string "Do Not Use" was being used in multiple places as the category...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 3 Jan 2008 13:49:11 +0000 (13:49 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 3 Jan 2008 13:49:11 +0000 (13:49 +0000)
git-svn-id: http://svn.voria.com/code@1264 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/modules/example/simplecircle.cpp
synfig-core/trunk/src/synfig/layer.cpp
synfig-core/trunk/src/synfig/layer.h
synfig-core/trunk/src/synfig/module.h
synfig-studio/trunk/src/gtkmm/canvasview.cpp
synfig-studio/trunk/src/gtkmm/dock_layers.cpp

index 4388bdd..dfeeb15 100644 (file)
@@ -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$");
 
index e9572c5..725f118 100644 (file)
@@ -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");
index 1344910..64cd310 100644 (file)
 //! \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 ======================================= */
index 49691cf..6aab53a 100644 (file)
@@ -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 }
index 8e9ec16..8f6c32e 100644 (file)
@@ -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<synfig::String,Gtk::Menu*>* /*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)
index 766f4a2..6cd19a1 100644 (file)
@@ -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(