From: dooglus Date: Thu, 8 Nov 2007 22:50:11 +0000 (+0000) Subject: Attempting to fix 1823053 - renaming an exported valuenode causes a crash. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=a11a35f647a3a6e61518ddfd61c9e199e25da3ef;p=synfig.git Attempting to fix 1823053 - renaming an exported valuenode causes a crash. git-svn-id: http://svn.voria.com/code@1119 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/synfig/canvas.h b/synfig-core/trunk/src/synfig/canvas.h index 8c91385..af168f9 100644 --- a/synfig-core/trunk/src/synfig/canvas.h +++ b/synfig-core/trunk/src/synfig/canvas.h @@ -189,6 +189,8 @@ private: //! ValueBasenode Changed sigc::signal > signal_value_node_changed_; + sigc::signal > signal_value_node_renamed_; + sigc::signal, etl::handle > signal_value_node_child_added_; sigc::signal, etl::handle > signal_value_node_child_removed_; @@ -232,6 +234,8 @@ public: sigc::signal >& signal_value_node_changed() { return signal_value_node_changed_; } + sigc::signal >& signal_value_node_renamed() { return signal_value_node_renamed_; } + //! Dirty sigc::signal& signal_dirty() { return signal_changed(); } diff --git a/synfig-studio/trunk/src/gtkmm/childrentreestore.cpp b/synfig-studio/trunk/src/gtkmm/childrentreestore.cpp index 52f47d7..0e7e133 100644 --- a/synfig-studio/trunk/src/gtkmm/childrentreestore.cpp +++ b/synfig-studio/trunk/src/gtkmm/childrentreestore.cpp @@ -84,6 +84,7 @@ ChildrenTreeStore::ChildrenTreeStore(etl::loose_handlesignal_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 value_node) } void +ChildrenTreeStore::on_value_node_renamed(etl::handle 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(); diff --git a/synfig-studio/trunk/src/gtkmm/childrentreestore.h b/synfig-studio/trunk/src/gtkmm/childrentreestore.h index 382ca03..287ad1b 100644 --- a/synfig-studio/trunk/src/gtkmm/childrentreestore.h +++ b/synfig-studio/trunk/src/gtkmm/childrentreestore.h @@ -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); diff --git a/synfig-studio/trunk/src/gtkmm/layerparamtreestore.cpp b/synfig-studio/trunk/src/gtkmm/layerparamtreestore.cpp index 0d4e920..d583be8 100644 --- a/synfig-studio/trunk/src/gtkmm/layerparamtreestore.cpp +++ b/synfig-studio/trunk/src/gtkmm/layerparamtreestore.cpp @@ -79,6 +79,7 @@ LayerParamTreeStore::LayerParamTreeStore(etl::loose_handlesignal_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 /*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(); diff --git a/synfig-studio/trunk/src/gtkmm/layerparamtreestore.h b/synfig-studio/trunk/src/gtkmm/layerparamtreestore.h index 8e9f910..ea3af61 100644 --- a/synfig-studio/trunk/src/gtkmm/layerparamtreestore.h +++ b/synfig-studio/trunk/src/gtkmm/layerparamtreestore.h @@ -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); diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenoderename.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuenoderename.cpp index e13ca5b..d917143 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/valuenoderename.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/valuenoderename.cpp @@ -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); } } diff --git a/synfig-studio/trunk/src/synfigapp/canvasinterface.h b/synfig-studio/trunk/src/synfigapp/canvasinterface.h index 84828bd..a088852 100644 --- a/synfig-studio/trunk/src/synfigapp/canvasinterface.h +++ b/synfig-studio/trunk/src/synfigapp/canvasinterface.h @@ -85,7 +85,6 @@ private: sigc::signal signal_value_node_added_; sigc::signal signal_value_node_deleted_; - sigc::signal signal_value_node_changed_; sigc::signal signal_value_node_replaced_; sigc::signal signal_keyframe_added_; @@ -151,7 +150,9 @@ public: // Signal Interface //! Signal called when a ValueNode has been changed sigc::signal >& signal_value_node_changed() { return get_canvas()->signal_value_node_changed(); } - //sigc::signal >& signal_value_node_changed() { return signal_value_node_changed_; } + + //! Signal called when a ValueNode has been renamed + sigc::signal >& signal_value_node_renamed() { return get_canvas()->signal_value_node_renamed(); } //! Signal called when the mode has changed sigc::signal signal_mode_changed() { return signal_mode_changed_; }