summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/PropertiesWindow.cpp22
-rw-r--r--src/gui/PropertiesWindow.hpp1
2 files changed, 17 insertions, 6 deletions
diff --git a/src/gui/PropertiesWindow.cpp b/src/gui/PropertiesWindow.cpp
index 8890770a..44c1c774 100644
--- a/src/gui/PropertiesWindow.cpp
+++ b/src/gui/PropertiesWindow.cpp
@@ -64,17 +64,27 @@ PropertiesWindow::PropertiesWindow(BaseObjectType* cobject, const Glib::RefPtr<G
}
-/** Set the node this window is associated with.
- * This function MUST be called before using this object in any way.
- */
void
-PropertiesWindow::set_object(SharedPtr<ObjectModel> model)
+PropertiesWindow::reset()
{
_table->children().clear();
_table->resize(1, 3);
_table->property_n_rows() = 1;
+ _records.clear();
+
_property_connection.disconnect();
+ _model.reset();
+}
+
+
+/** Set the node this window is associated with.
+ * This function MUST be called before using this object in any way.
+ */
+void
+PropertiesWindow::set_object(SharedPtr<ObjectModel> model)
+{
+ reset();
_model = model;
set_title(model->path().chop_scheme() + " Properties - Ingen");
@@ -264,7 +274,7 @@ bad_type:
void
PropertiesWindow::cancel_clicked()
{
- set_object(_model); // reset
+ reset();
Gtk::Window::hide();
}
@@ -295,7 +305,7 @@ void
PropertiesWindow::ok_clicked()
{
apply_clicked();
- Gtk::Window::hide();
+ cancel_clicked();
}
diff --git a/src/gui/PropertiesWindow.hpp b/src/gui/PropertiesWindow.hpp
index e4c7b962..079fa81b 100644
--- a/src/gui/PropertiesWindow.hpp
+++ b/src/gui/PropertiesWindow.hpp
@@ -67,6 +67,7 @@ private:
Gtk::Widget* create_value_widget(const Raul::URI& uri, const Raul::Atom& value);
+ void reset();
void on_show();
void property_changed(const Raul::URI& predicate, const Raul::Atom& value);