Attempting to fix 1823053 - renaming an exported valuenode causes a crash.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 8 Nov 2007 22:50:11 +0000 (22:50 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 8 Nov 2007 22:50:11 +0000 (22:50 +0000)
git-svn-id: http://svn.voria.com/code@1119 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/synfig/canvas.h
synfig-studio/trunk/src/gtkmm/childrentreestore.cpp
synfig-studio/trunk/src/gtkmm/childrentreestore.h
synfig-studio/trunk/src/gtkmm/layerparamtreestore.cpp
synfig-studio/trunk/src/gtkmm/layerparamtreestore.h
synfig-studio/trunk/src/synfigapp/actions/valuenoderename.cpp
synfig-studio/trunk/src/synfigapp/canvasinterface.h

index 8c91385..af168f9 100644 (file)
@@ -189,6 +189,8 @@ private:
        //!     ValueBasenode Changed
        sigc::signal<void, etl::handle<ValueNode> > signal_value_node_changed_;
 
+       sigc::signal<void, etl::handle<ValueNode> > signal_value_node_renamed_;
+
        sigc::signal<void, etl::handle<ValueNode>, etl::handle<ValueNode> > signal_value_node_child_added_;
 
        sigc::signal<void, etl::handle<ValueNode>, etl::handle<ValueNode> > signal_value_node_child_removed_;
@@ -232,6 +234,8 @@ public:
 
        sigc::signal<void, etl::handle<ValueNode> >& signal_value_node_changed() { return signal_value_node_changed_; }
 
+       sigc::signal<void, etl::handle<ValueNode> >& signal_value_node_renamed() { return signal_value_node_renamed_; }
+
        //!     Dirty
        sigc::signal<void>& signal_dirty() { return signal_changed();   }
 
index 52f47d7..0e7e133 100644 (file)
@@ -84,6 +84,7 @@ ChildrenTreeStore::ChildrenTreeStore(etl::loose_handle<synfigapp::CanvasInterfac
 
        // Connect all the signals
        canvas_interface()->signal_value_node_changed().connect(sigc::mem_fun(*this,&studio::ChildrenTreeStore::on_value_node_changed));
+       canvas_interface()->signal_value_node_renamed().connect(sigc::mem_fun(*this,&studio::ChildrenTreeStore::on_value_node_renamed));
        canvas_interface()->signal_value_node_added().connect(sigc::mem_fun(*this,&studio::ChildrenTreeStore::on_value_node_added));
        canvas_interface()->signal_value_node_deleted().connect(sigc::mem_fun(*this,&studio::ChildrenTreeStore::on_value_node_deleted));
        canvas_interface()->signal_value_node_replaced().connect(sigc::mem_fun(*this,&studio::ChildrenTreeStore::on_value_node_replaced));
@@ -330,6 +331,12 @@ ChildrenTreeStore::on_value_node_changed(etl::handle<ValueNode> value_node)
 }
 
 void
+ChildrenTreeStore::on_value_node_renamed(etl::handle<ValueNode> value_node)
+{
+       rebuild_value_nodes();
+}
+
+void
 ChildrenTreeStore::on_value_node_replaced(synfig::ValueNode::Handle replaced_value_node,synfig::ValueNode::Handle /*new_value_node*/)
 {
        changed_connection.disconnect();
index 382ca03..287ad1b 100644 (file)
@@ -92,6 +92,7 @@ private:
        void on_value_node_added(synfig::ValueNode::Handle value_node);
        void on_value_node_deleted(synfig::ValueNode::Handle value_node);
        void on_value_node_changed(synfig::ValueNode::Handle value_node);
+       void on_value_node_renamed(synfig::ValueNode::Handle value_node);
        void on_value_node_replaced(synfig::ValueNode::Handle replaced_value_node,synfig::ValueNode::Handle new_value_node);
        void on_canvas_added(synfig::Canvas::Handle canvas);
        void on_canvas_removed(synfig::Canvas::Handle canvas);
index 0d4e920..d583be8 100644 (file)
@@ -79,6 +79,7 @@ LayerParamTreeStore::LayerParamTreeStore(etl::loose_handle<synfigapp::CanvasInte
        queued=false;
        // Connect all the signals
        canvas_interface()->signal_value_node_changed().connect(sigc::mem_fun(*this,&studio::LayerParamTreeStore::on_value_node_changed));
+       canvas_interface()->signal_value_node_renamed().connect(sigc::mem_fun(*this,&studio::LayerParamTreeStore::on_value_node_renamed));
        canvas_interface()->signal_value_node_added().connect(sigc::mem_fun(*this,&studio::LayerParamTreeStore::on_value_node_added));
        canvas_interface()->signal_value_node_deleted().connect(sigc::mem_fun(*this,&studio::LayerParamTreeStore::on_value_node_deleted));
        canvas_interface()->signal_value_node_replaced().connect(sigc::mem_fun(*this,&studio::LayerParamTreeStore::on_value_node_replaced));
@@ -549,6 +550,12 @@ LayerParamTreeStore::on_value_node_changed(etl::handle<ValueNode> /*value_node*/
 }
 
 void
+LayerParamTreeStore::on_value_node_renamed(synfig::ValueNode::Handle /*value_node*/)
+{
+       rebuild();
+}
+
+void
 LayerParamTreeStore::on_value_node_replaced(synfig::ValueNode::Handle /*replaced_value_node*/,synfig::ValueNode::Handle /*new_value_node*/)
 {
        queue_rebuild();
index 8e9f910..ea3af61 100644 (file)
@@ -121,6 +121,7 @@ private:
        void on_value_node_added(synfig::ValueNode::Handle value_node);
        void on_value_node_deleted(synfig::ValueNode::Handle value_node);
        virtual void on_value_node_changed(synfig::ValueNode::Handle value_node);
+       virtual void on_value_node_renamed(synfig::ValueNode::Handle value_node);
        void on_value_node_replaced(synfig::ValueNode::Handle replaced_value_node,synfig::ValueNode::Handle new_value_node);
        void on_layer_param_changed(synfig::Layer::Handle handle,synfig::String param_name);
 
index e13ca5b..d917143 100644 (file)
@@ -144,7 +144,7 @@ Action::ValueNodeRename::perform()
 
        if(get_canvas_interface())
        {
-               get_canvas_interface()->signal_value_node_changed()(value_node);
+               get_canvas_interface()->signal_value_node_renamed()(value_node);
        }
 }
 
@@ -160,6 +160,6 @@ Action::ValueNodeRename::undo()
 
        if(get_canvas_interface())
        {
-               get_canvas_interface()->signal_value_node_changed()(value_node);
+               get_canvas_interface()->signal_value_node_renamed()(value_node);
        }
 }
index 84828bd..a088852 100644 (file)
@@ -85,7 +85,6 @@ private:
 
        sigc::signal<void,synfig::ValueNode::Handle> signal_value_node_added_;
        sigc::signal<void,synfig::ValueNode::Handle> signal_value_node_deleted_;
-       sigc::signal<void,synfig::ValueNode::Handle> signal_value_node_changed_;
        sigc::signal<void,synfig::ValueNode::Handle,synfig::ValueNode::Handle> signal_value_node_replaced_;
 
        sigc::signal<void,synfig::Keyframe> signal_keyframe_added_;
@@ -151,7 +150,9 @@ public:     // Signal Interface
 
        //! Signal called when a ValueNode has been changed
        sigc::signal<void,etl::handle<synfig::ValueNode> >& signal_value_node_changed() { return get_canvas()->signal_value_node_changed(); }
-       //sigc::signal<void,etl::handle<synfig::ValueNode> >& signal_value_node_changed() { return signal_value_node_changed_; }
+
+       //! Signal called when a ValueNode has been renamed
+       sigc::signal<void,etl::handle<synfig::ValueNode> >& signal_value_node_renamed() { return get_canvas()->signal_value_node_renamed(); }
 
        //! Signal called when the mode has changed
        sigc::signal<void,Mode> signal_mode_changed() { return signal_mode_changed_; }