From f9de3402dbb64a6033c7340020a3e6457c2177ef Mon Sep 17 00:00:00 2001 From: dooglus Date: Fri, 28 Nov 2008 12:25:21 +0000 Subject: [PATCH] Use localized text when showing action names. git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2295 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/synfigapp/action.cpp | 2 +- .../trunk/src/synfigapp/action_system.cpp | 30 +++++++++++----------- .../src/synfigapp/actions/valuenodereplace.cpp | 4 ++- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/synfig-studio/trunk/src/synfigapp/action.cpp b/synfig-studio/trunk/src/synfigapp/action.cpp index 7f9e347..7379d33 100644 --- a/synfig-studio/trunk/src/synfigapp/action.cpp +++ b/synfig-studio/trunk/src/synfigapp/action.cpp @@ -409,7 +409,7 @@ Super::perform() catch(Error x) { //synfig::info("%s:%d caught exception", __FILE__, __LINE__); - throw Error(x.get_type(),((*iter)->get_name()+": "+x.get_desc()).c_str()); + throw Error(x.get_type(),((*iter)->get_local_name()+": "+x.get_desc()).c_str()); } //synfig::info("%s:%d finished action: '%s'", __FILE__, __LINE__, (*iter)->get_name().c_str()); } diff --git a/synfig-studio/trunk/src/synfigapp/action_system.cpp b/synfig-studio/trunk/src/synfigapp/action_system.cpp index cc20a2b..844c52c 100644 --- a/synfig-studio/trunk/src/synfigapp/action_system.cpp +++ b/synfig-studio/trunk/src/synfigapp/action_system.cpp @@ -74,7 +74,7 @@ Action::System::perform_action(etl::handle action) if(!action->is_ready()) { - uim->error(action->get_name()+": "+_("Action is not ready.")); + uim->error(action->get_local_name()+": "+_("Action is not ready.")); return false; } @@ -105,7 +105,7 @@ Action::System::perform_action(etl::handle action) if(!undoable_action) { if(uim->yes_no( - action->get_name(), + action->get_local_name(), _("This action cannot be undone! Are you sure you want to continue?"), UIInterface::RESPONSE_NO ) == UIInterface::RESPONSE_NO @@ -125,15 +125,15 @@ Action::System::perform_action(etl::handle action) try { action->perform(); } catch(Action::Error err) { - uim->task(action->get_name()+' '+_("Failed")); + uim->task(action->get_local_name()+' '+_("Failed")); inuse=false; if(err.get_type()!=Action::Error::TYPE_UNABLE) { if(err.get_desc().empty()) - uim->error(action->get_name()+": "+strprintf("%d",err.get_type())); + uim->error(action->get_local_name()+": "+strprintf("%d",err.get_type())); else - uim->error(action->get_name()+": "+err.get_desc()); + uim->error(action->get_local_name()+": "+err.get_desc()); } // If action failed for whatever reason, just return false and do @@ -142,10 +142,10 @@ Action::System::perform_action(etl::handle action) } catch(std::exception err) { - uim->task(action->get_name()+' '+_("Failed")); + uim->task(action->get_local_name()+' '+_("Failed")); inuse=false; - uim->error(action->get_name()+": "+err.what()); + uim->error(action->get_local_name()+": "+err.what()); // If action failed for whatever reason, just return false and do // not add the action onto the list @@ -153,7 +153,7 @@ Action::System::perform_action(etl::handle action) } catch(...) { - uim->task(action->get_name()+' '+_("Failed")); + uim->task(action->get_local_name()+' '+_("Failed")); inuse=false; // If action failed for whatever reason, just return false and do @@ -186,7 +186,7 @@ Action::System::perform_action(etl::handle action) inuse=false; - uim->task(action->get_name()+' '+_("Successful")); + uim->task(action->get_local_name()+' '+_("Successful")); // If the action has "dirtied" the preview, signal it. if(0)if(canvas_specific && canvas_specific->is_dirty()) @@ -219,9 +219,9 @@ synfigapp::Action::System::undo_(etl::handle uim) if(err.get_type()!=Action::Error::TYPE_UNABLE) { if(err.get_desc().empty()) - uim->error(action->get_name()+_(" (Undo): ")+strprintf("%d",err.get_type())); + uim->error(action->get_local_name()+_(" (Undo): ")+strprintf("%d",err.get_type())); else - uim->error(action->get_name()+_(" (Undo): ")+err.get_desc()); + uim->error(action->get_local_name()+_(" (Undo): ")+err.get_desc()); } return false; @@ -281,7 +281,7 @@ synfigapp::Action::System::undo() if(!undo_(uim)) { - uim->error(undo_action_stack_.front()->get_name()+": "+_("Failed to undo.")); + uim->error(undo_action_stack_.front()->get_local_name()+": "+_("Failed to undo.")); inuse=false; return false; } @@ -317,9 +317,9 @@ Action::System::redo_(etl::handle uim) if(err.get_type()!=Action::Error::TYPE_UNABLE) { if(err.get_desc().empty()) - uim->error(action->get_name()+_(" (Redo): ")+strprintf("%d",err.get_type())); + uim->error(action->get_local_name()+_(" (Redo): ")+strprintf("%d",err.get_type())); else - uim->error(action->get_name()+_(" (Redo): ")+err.get_desc()); + uim->error(action->get_local_name()+_(" (Redo): ")+err.get_desc()); } return false; @@ -379,7 +379,7 @@ Action::System::redo() if(!redo_(uim)) { - uim->error(redo_action_stack_.front()->get_name()+": "+_("Failed to redo.")); + uim->error(redo_action_stack_.front()->get_local_name()+": "+_("Failed to redo.")); inuse=false; return false; } diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodereplace.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuenodereplace.cpp index 92ac51a..28eb71e 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/valuenodereplace.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/valuenodereplace.cpp @@ -172,6 +172,8 @@ Action::ValueNodeReplace::perform() //src_value_node->parent_set.swap(dest_value_node->parent_set); + synfig::info(get_local_name()+_(": ")+strprintf(_("Replaced %d ValueNode instances"),replacements)); + // Signal that a layer has been inserted if(get_canvas_interface()) { @@ -210,7 +212,7 @@ Action::ValueNodeReplace::undo() //src_value_node->parent_set.swap(dest_value_node->parent_set); - synfig::info(get_name()+_(": (Undo) ")+strprintf("Replaced %d ValueNode instances",replacements)); + synfig::info(get_local_name()+_(": (Undo) ")+strprintf(_("Replaced %d ValueNode instances"),replacements)); src_value_node->set_id(String()); src_value_node->set_parent_canvas(0); -- 2.7.4