X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fsynfigapp%2Factions%2Fvaluedescexport.cpp;h=64614704ec1751f405554c4e6fc10e6e34c563fa;hb=6989d1403b14b5b27dbf81b2c1cf6889511adf97;hp=b0e839a6a4cab3cf0bd73d73c4cb72119a1f2dfc;hpb=837b63e9fb829d66d43f4f169861f8979f76820d;p=synfig.git diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuedescexport.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuedescexport.cpp index b0e839a..6461470 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/valuedescexport.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/valuedescexport.cpp @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2008 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -38,6 +39,8 @@ #include #include +#include + #endif using namespace std; @@ -48,9 +51,9 @@ using namespace Action; /* === M A C R O S ========================================================= */ -ACTION_INIT(Action::ValueDescExport); -ACTION_SET_NAME(Action::ValueDescExport,"value_desc_export"); -ACTION_SET_LOCAL_NAME(Action::ValueDescExport,"Export"); +ACTION_INIT_NO_GET_LOCAL_NAME(Action::ValueDescExport); +ACTION_SET_NAME(Action::ValueDescExport,"ValueDescExport"); +ACTION_SET_LOCAL_NAME(Action::ValueDescExport,N_("Export")); ACTION_SET_TASK(Action::ValueDescExport,"export"); ACTION_SET_CATEGORY(Action::ValueDescExport,Action::CATEGORY_VALUEDESC); ACTION_SET_PRIORITY(Action::ValueDescExport,0); @@ -67,6 +70,15 @@ Action::ValueDescExport::ValueDescExport() { } +synfig::String +Action::ValueDescExport::get_local_name()const +{ + // TRANSLATORS: This is used in the 'history' dialog when a ValueNode is exported. The first %s is what is exported, the 2nd is the name it is given. + return strprintf(_("Export '%s' as '%s'"), + value_desc.get_description(false).c_str(), + name.c_str()); +} + Action::ParamVocab Action::ValueDescExport::get_param_vocab() { @@ -135,6 +147,7 @@ Action::ValueDescExport::prepare() if(value_desc.get_value_type()==ValueBase::TYPE_CANVAS) { + // action: CanvasAdd if(!value_desc.is_const()) throw Error(_("Can only export Canvas when used as constant parameter")); Canvas::Handle canvas(value_desc.get_value().get(Canvas::Handle())); @@ -155,7 +168,6 @@ Action::ValueDescExport::prepare() return; } - if(value_desc.is_value_node()) { if(value_desc.get_value_node()->is_exported()) @@ -165,6 +177,7 @@ Action::ValueDescExport::prepare() } else { + // action: LayerParamConnect if(!value_desc.parent_is_layer_param()) throw Error(_("Unable to export parameter. (Bug?)")); @@ -185,6 +198,7 @@ Action::ValueDescExport::prepare() add_action_front(action); } + // action: ValueNodeAdd Action::Handle action(ValueNodeAdd::create()); action->set_param("canvas",get_canvas());