summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-12-15 07:59:29 +0000
committerDavid Robillard <d@drobilla.net>2010-12-15 07:59:29 +0000
commit20f264bf8dbc568e218edb9c03c6ee00769d7ceb (patch)
tree74a928a3f52b805708b4ae7f21fce0c2beaff429
parentfab5b6794bd156389009a05d10981a265278477e (diff)
downloadingen-20f264bf8dbc568e218edb9c03c6ee00769d7ceb.tar.gz
ingen-20f264bf8dbc568e218edb9c03c6ee00769d7ceb.tar.bz2
ingen-20f264bf8dbc568e218edb9c03c6ee00769d7ceb.zip
Fix broken disabling of rename window OK button (fix ticket #502).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2708 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/gui/RenameWindow.cpp23
-rw-r--r--src/gui/RenameWindow.hpp3
2 files changed, 6 insertions, 20 deletions
diff --git a/src/gui/RenameWindow.cpp b/src/gui/RenameWindow.cpp
index 5a25c6a2..bafa23b6 100644
--- a/src/gui/RenameWindow.cpp
+++ b/src/gui/RenameWindow.cpp
@@ -40,8 +40,8 @@ RenameWindow::RenameWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Gl
glade_xml->get_widget("rename_cancel_button", _cancel_button);
glade_xml->get_widget("rename_ok_button", _ok_button);
- _symbol_entry->signal_changed().connect(sigc::mem_fun(this, &RenameWindow::symbol_changed));
- _label_entry->signal_changed().connect(sigc::mem_fun(this, &RenameWindow::label_changed));
+ _symbol_entry->signal_changed().connect(sigc::mem_fun(this, &RenameWindow::values_changed));
+ _label_entry->signal_changed().connect(sigc::mem_fun(this, &RenameWindow::values_changed));
_cancel_button->signal_clicked().connect(sigc::mem_fun(this, &RenameWindow::cancel_clicked));
_ok_button->signal_clicked().connect(sigc::mem_fun(this, &RenameWindow::ok_clicked));
@@ -72,13 +72,11 @@ RenameWindow::present(SharedPtr<ObjectModel> object)
}
-/** Called every time the user types into the name input box.
- * Used to display warning messages, and enable/disable the rename button.
- */
void
-RenameWindow::symbol_changed()
+RenameWindow::values_changed()
{
const string& symbol = _symbol_entry->get_text();
+ const string& label = _label_entry->get_text();
if (symbol.length() == 0) {
_message_label->set_text("Symbol must be at least 1 character");
_ok_button->property_sensitive() = false;
@@ -88,18 +86,7 @@ RenameWindow::symbol_changed()
} else if (App::instance().store()->object(_object->parent()->path().base() + symbol)) {
_message_label->set_text("An object already exists with that path");
_ok_button->property_sensitive() = false;
- } else {
- _message_label->set_text("");
- _ok_button->property_sensitive() = true;
- }
-}
-
-
-void
-RenameWindow::label_changed()
-{
- const string& label = _label_entry->get_text();
- if (label.empty()) {
+ } else if (label.empty()) {
_message_label->set_text("Label must be at least 1 character");
_ok_button->property_sensitive() = false;
} else {
diff --git a/src/gui/RenameWindow.hpp b/src/gui/RenameWindow.hpp
index 23521a06..e0454c52 100644
--- a/src/gui/RenameWindow.hpp
+++ b/src/gui/RenameWindow.hpp
@@ -44,8 +44,7 @@ public:
private:
void set_object(SharedPtr<ObjectModel> object);
- void symbol_changed();
- void label_changed();
+ void values_changed();
void cancel_clicked();
void ok_clicked();