From ad671f0e8e7bc34c0ceaf78c58a99921cab199e6 Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Wed, 13 Jan 2010 22:55:00 +0100 Subject: [PATCH] Enable Stop button and ESC key to change to Normal Tool for the Circle, Draw, Eyedrop, Fill, Gradient, Rectangle, Sketch, Star, Text, Width and Zoom tools --- synfig-studio/src/gtkmm/state_circle.cpp | 4 +++- synfig-studio/src/gtkmm/state_draw.cpp | 4 +++- synfig-studio/src/gtkmm/state_eyedrop.cpp | 6 ++++-- synfig-studio/src/gtkmm/state_fill.cpp | 4 +++- synfig-studio/src/gtkmm/state_gradient.cpp | 4 +++- synfig-studio/src/gtkmm/state_rectangle.cpp | 4 +++- synfig-studio/src/gtkmm/state_sketch.cpp | 4 +++- synfig-studio/src/gtkmm/state_star.cpp | 4 +++- synfig-studio/src/gtkmm/state_text.cpp | 4 +++- synfig-studio/src/gtkmm/state_width.cpp | 4 +++- synfig-studio/src/gtkmm/state_zoom.cpp | 4 +++- 11 files changed, 34 insertions(+), 12 deletions(-) diff --git a/synfig-studio/src/gtkmm/state_circle.cpp b/synfig-studio/src/gtkmm/state_circle.cpp index 865ea81..de0c6e3 100644 --- a/synfig-studio/src/gtkmm/state_circle.cpp +++ b/synfig-studio/src/gtkmm/state_circle.cpp @@ -532,7 +532,9 @@ StateCircle_Context::~StateCircle_Context() Smach::event_result StateCircle_Context::event_stop_handler(const Smach::event& /*x*/) { - throw Smach::egress_exception(); + //throw Smach::egress_exception(); + throw &state_normal; + return Smach::RESULT_OK; } Smach::event_result diff --git a/synfig-studio/src/gtkmm/state_draw.cpp b/synfig-studio/src/gtkmm/state_draw.cpp index 4d058f2..3fc459b 100644 --- a/synfig-studio/src/gtkmm/state_draw.cpp +++ b/synfig-studio/src/gtkmm/state_draw.cpp @@ -567,7 +567,9 @@ StateDraw_Context::~StateDraw_Context() Smach::event_result StateDraw_Context::event_stop_handler(const Smach::event& /*x*/) { - throw Smach::egress_exception(); + //throw Smach::egress_exception(); + throw &state_normal; + return Smach::RESULT_OK; } Smach::event_result diff --git a/synfig-studio/src/gtkmm/state_eyedrop.cpp b/synfig-studio/src/gtkmm/state_eyedrop.cpp index 6fb940d..749399a 100644 --- a/synfig-studio/src/gtkmm/state_eyedrop.cpp +++ b/synfig-studio/src/gtkmm/state_eyedrop.cpp @@ -113,8 +113,10 @@ StateEyedrop_Context::~StateEyedrop_Context() Smach::event_result StateEyedrop_Context::event_stop_handler(const Smach::event& /*x*/) { - synfig::info("STATE EYEDROP: Received Stop Event"); - throw Smach::egress_exception(); + //synfig::info("STATE EYEDROP: Received Stop Event"); + //throw Smach::egress_exception(); + throw &state_normal; + return Smach::RESULT_OK; // canvas_view->get_smach().pop_state(); // return Smach::RESULT_ACCEPT; } diff --git a/synfig-studio/src/gtkmm/state_fill.cpp b/synfig-studio/src/gtkmm/state_fill.cpp index 60c929a..26eb646 100644 --- a/synfig-studio/src/gtkmm/state_fill.cpp +++ b/synfig-studio/src/gtkmm/state_fill.cpp @@ -121,7 +121,9 @@ Smach::event_result StateFill_Context::event_stop_handler(const Smach::event& /*x*/) { synfig::info("STATE FILL: Received Stop Event"); - throw Smach::egress_exception(); + //throw Smach::egress_exception(); + throw &state_normal; + return Smach::RESULT_OK; // canvas_view->get_smach().pop_state(); // return Smach::RESULT_ACCEPT; } diff --git a/synfig-studio/src/gtkmm/state_gradient.cpp b/synfig-studio/src/gtkmm/state_gradient.cpp index c0fd022..bc6c3ad 100644 --- a/synfig-studio/src/gtkmm/state_gradient.cpp +++ b/synfig-studio/src/gtkmm/state_gradient.cpp @@ -368,7 +368,9 @@ StateGradient_Context::~StateGradient_Context() Smach::event_result StateGradient_Context::event_stop_handler(const Smach::event& /*x*/) { - throw Smach::egress_exception(); + //throw Smach::egress_exception(); + throw &state_normal; + return Smach::RESULT_OK; } Smach::event_result diff --git a/synfig-studio/src/gtkmm/state_rectangle.cpp b/synfig-studio/src/gtkmm/state_rectangle.cpp index 29fe0a9..5f09681 100644 --- a/synfig-studio/src/gtkmm/state_rectangle.cpp +++ b/synfig-studio/src/gtkmm/state_rectangle.cpp @@ -445,7 +445,9 @@ StateRectangle_Context::~StateRectangle_Context() Smach::event_result StateRectangle_Context::event_stop_handler(const Smach::event& /*x*/) { - throw Smach::egress_exception(); + //throw Smach::egress_exception(); + throw &state_normal; + return Smach::RESULT_OK; } Smach::event_result diff --git a/synfig-studio/src/gtkmm/state_sketch.cpp b/synfig-studio/src/gtkmm/state_sketch.cpp index b0d78f0..5db2044 100644 --- a/synfig-studio/src/gtkmm/state_sketch.cpp +++ b/synfig-studio/src/gtkmm/state_sketch.cpp @@ -465,7 +465,9 @@ StateSketch_Context::event_yield_tool_options(const Smach::event& /*x*/) Smach::event_result StateSketch_Context::event_stop_handler(const Smach::event& /*x*/) { - throw Smach::egress_exception(); + //throw Smach::egress_exception(); + throw &state_normal; + return Smach::RESULT_OK; } Smach::event_result diff --git a/synfig-studio/src/gtkmm/state_star.cpp b/synfig-studio/src/gtkmm/state_star.cpp index ed71e7f..dff6c4b 100644 --- a/synfig-studio/src/gtkmm/state_star.cpp +++ b/synfig-studio/src/gtkmm/state_star.cpp @@ -559,7 +559,9 @@ StateStar_Context::~StateStar_Context() Smach::event_result StateStar_Context::event_stop_handler(const Smach::event& /*x*/) { - throw Smach::egress_exception(); + //throw Smach::egress_exception(); + throw &state_normal; + return Smach::RESULT_OK; } Smach::event_result diff --git a/synfig-studio/src/gtkmm/state_text.cpp b/synfig-studio/src/gtkmm/state_text.cpp index 0ee03ac..68508ea 100644 --- a/synfig-studio/src/gtkmm/state_text.cpp +++ b/synfig-studio/src/gtkmm/state_text.cpp @@ -358,7 +358,9 @@ StateText_Context::~StateText_Context() Smach::event_result StateText_Context::event_stop_handler(const Smach::event& /*x*/) { - throw Smach::egress_exception(); + //throw Smach::egress_exception(); + throw &state_normal; + return Smach::RESULT_OK; } Smach::event_result diff --git a/synfig-studio/src/gtkmm/state_width.cpp b/synfig-studio/src/gtkmm/state_width.cpp index 1c7ef4f..37aca27 100644 --- a/synfig-studio/src/gtkmm/state_width.cpp +++ b/synfig-studio/src/gtkmm/state_width.cpp @@ -356,7 +356,9 @@ StateWidth_Context::~StateWidth_Context() Smach::event_result StateWidth_Context::event_stop_handler(const Smach::event& /*x*/) { - throw Smach::egress_exception(); + //throw Smach::egress_exception(); + throw &state_normal; + return Smach::RESULT_OK; } Smach::event_result diff --git a/synfig-studio/src/gtkmm/state_zoom.cpp b/synfig-studio/src/gtkmm/state_zoom.cpp index 57a2522..a4ea442 100644 --- a/synfig-studio/src/gtkmm/state_zoom.cpp +++ b/synfig-studio/src/gtkmm/state_zoom.cpp @@ -164,7 +164,9 @@ StateZoom_Context::~StateZoom_Context() Smach::event_result StateZoom_Context::event_stop_handler(const Smach::event& /*x*/) { - throw Smach::egress_exception(); + //throw Smach::egress_exception(); + throw &state_normal; + return Smach::RESULT_OK; } Smach::event_result -- 2.7.4