Fix 1924592: Editing the name, description, or id of a canvas should mark the canvas...
[synfig.git] / synfig-studio / trunk / src / gtkmm / canvasproperties.cpp
index 63e5dae..a6792ed 100644 (file)
@@ -6,6 +6,7 @@
 **
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+**     Copyright (c) 2007, 2008 Chris Moore
 **
 **     This package is free software; you can redistribute it and/or
 **     modify it under the terms of the GNU General Public License as
@@ -59,7 +60,7 @@ using namespace studio;
 
 /* === M E T H O D S ======================================================= */
 
-CanvasProperties::CanvasProperties(Gtk::Window& parent,handle<synfigapp::CanvasInterface> canvas_interface):
+CanvasProperties::CanvasProperties(Gtk::Window& parent,etl::handle<synfigapp::CanvasInterface> canvas_interface):
        Gtk::Dialog(_("Canvas Properties"),parent,false,true),
        canvas_interface_(canvas_interface)
 {
@@ -111,6 +112,7 @@ CanvasProperties::CanvasProperties(Gtk::Window& parent,handle<synfigapp::CanvasI
        dialogBox->pack_start(widget_rend_desc, false, false, 0);
 
        canvas_interface_->signal_rend_desc_changed().connect(sigc::mem_fun(*this,&studio::CanvasProperties::refresh));
+       canvas_interface_->signal_id_changed().connect(sigc::mem_fun(*this,&studio::CanvasProperties::refresh));
 
        Gtk::Button *ok_button(manage(new class Gtk::Button(Gtk::StockID("gtk-ok"))));
        ok_button->show();
@@ -221,7 +223,7 @@ CanvasProperties::on_rend_desc_changed()
 void
 CanvasProperties::on_apply_pressed()
 {
-       if(entry_id.get_text()!=canvas_interface_->get_canvas()->get_id())
+       if(entry_id.get_text()!=canvas_interface_->get_canvas()->get_id() && !entry_id.get_text().empty())
                canvas_interface_->set_id(entry_id.get_text());
        if(entry_name.get_text()!=canvas_interface_->get_canvas()->get_name())
                canvas_interface_->set_name(entry_name.get_text());