]> git.tdb.fi Git - r2c2.git/blobdiff - source/designer/designer.cpp
Clean up old clutter from Designer
[r2c2.git] / source / designer / designer.cpp
index 292d5a9cb12a3e43c6b952b9306d8588644987b2..7c100db390172cdbfe76cd90e84844725d3b40c8 100644 (file)
@@ -398,14 +398,9 @@ void Designer::key_press(unsigned key)
                use_tool_with_selected_objects<ElevateTool>();
        else if(key==Msp::Input::KEY_ESC)
        {
-               if(cur_tool)
-               {
-                       delete cur_tool;
-                       cur_tool = 0;
-               }
-               else if(mode==CATALOGUE)
+               if(mode==CATALOGUE)
                        mode = SELECT;
-               else
+               else if(mode==SELECT)
                        selection.clear();
        }
        else if(key==Msp::Input::KEY_X)
@@ -449,7 +444,7 @@ void Designer::key_press(unsigned key)
 template<typename T>
 T *Designer::use_tool_with_selected_objects()
 {
-       T *tool = new T(*this, mouse, selection.get_objects());
+       T *tool = new T(*this, keyboard, mouse, selection.get_objects());
        use_tool(tool);
        return tool;
 }
@@ -457,7 +452,7 @@ T *Designer::use_tool_with_selected_objects()
 template<typename T>
 T *Designer::use_tool()
 {
-       T *tool = new T(*this, mouse);
+       T *tool = new T(*this, keyboard, mouse);
        use_tool(tool);
        return tool;
 }
@@ -471,8 +466,8 @@ void Designer::use_tool(Tool *tool)
        }
 
        cur_tool = tool;
-       cur_tool->signal_status.connect(sigc::mem_fun(this, &Designer::manipulation_status));
-       manipulation_status(cur_tool->get_status());
+       cur_tool->signal_status.connect(sigc::mem_fun(this, &Designer::tool_status));
+       tool_status(cur_tool->get_status());
        mode = TOOL;
 }
 
@@ -572,17 +567,11 @@ void Designer::selection_changed()
        }
 }
 
-void Designer::manipulation_status(const string &status)
+void Designer::tool_status(const string &status)
 {
        lbl_status->set_text(status);
 }
 
-void Designer::measure_done()
-{
-       mode = SELECT;
-       selection_changed();
-}
-
 void Designer::track_properties_response(int)
 {
        const set<Track *> &tracks = selection.get_objects<Track>();