}
bool
-Action::System::perform_action(handle<Action::Base> action)
+Action::System::perform_action(etl::handle<Action::Base> action)
{
+ //// debug actions
+ // synfig::info("%s:%d perform_action: '%s'", __FILE__, __LINE__, action->get_name().c_str());
+
handle<UIInterface> uim(get_ui_interface());
assert(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;
}
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
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
}
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
}
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
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())
{
handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas);
assert(canvas_interface);
- DEBUGPOINT();
//canvas_interface->signal_dirty_preview()();
}
}
}
bool
-synfigapp::Action::System::undo_(handle<UIInterface> uim)
+synfigapp::Action::System::undo_(etl::handle<UIInterface> uim)
{
handle<Action::Undoable> action(undo_action_stack().front());
most_recent_action_=action;
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;
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;
}
{
handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas);
assert(canvas_interface);
- //DEBUGPOINT();
//canvas_interface->signal_dirty_preview()();
}
}
}
bool
-Action::System::redo_(handle<UIInterface> uim)
+Action::System::redo_(etl::handle<UIInterface> uim)
{
handle<Action::Undoable> action(redo_action_stack().front());
most_recent_action_=action;
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;
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;
}
{
handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas);
assert(canvas_interface);
- //DEBUGPOINT();
//canvas_interface->signal_dirty_preview()();
}
}
Canvas::Handle canvas=canvas_specific->get_canvas();
handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas);
assert(canvas_interface);
- //DEBUGPOINT();
//canvas_interface->signal_dirty_preview()();
}
Canvas::Handle canvas=canvas_specific->get_canvas();
handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas);
assert(canvas_interface);
- DEBUGPOINT();
//canvas_interface->signal_dirty_preview()();
}
return false;
}
-Action::PassiveGrouper::PassiveGrouper(etl::loose_handle<Action::System> instance_,synfig::String name_):
+Action::PassiveGrouper::PassiveGrouper(etl::loose_handle<System> instance_,synfig::String name_):
instance_(instance_),
name_(name_),
redraw_requested_(false),
}
void
-Action::PassiveGrouper::request_redraw(handle<CanvasInterface> x)
+Action::PassiveGrouper::request_redraw(etl::handle<CanvasInterface> x)
{
-/* DEBUGPOINT();
- if(instance_->group_stack_.empty())
+/* if(instance_->group_stack_.empty())
{
if(x!=canvas_interface_)
{
- DEBUGPOINT();
x->signal_dirty_preview()();
}
}
else
{
- DEBUGPOINT();
if(instance_->group_stack_.back()==this)
{
- DEBUGPOINT();
redraw_requested_=true;
}
else
{
- DEBUGPOINT();
instance_->group_stack_.back()->request_redraw(x);
redraw_requested_=false;
}
- DEBUGPOINT();
}
- DEBUGPOINT();
*/
if(x)
{
if(instance_->group_stack_.empty())
{
assert(canvas_interface_);
- DEBUGPOINT();
canvas_interface_->signal_dirty_preview()();
}
else