diff options
author | David Robillard <d@drobilla.net> | 2006-09-13 06:11:25 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-09-13 06:11:25 +0000 |
commit | e5675ebfeb93175e16762d0a078bd51d15d05f63 (patch) | |
tree | 189249ed9014e4c482cfaed0d6af28ced68570ca /src/progs/ingenuity/PatchPropertiesWindow.cpp | |
parent | 23b7568ab7a87a79c186b8ddf3d3db4f1f934b06 (diff) | |
download | ingen-e5675ebfeb93175e16762d0a078bd51d15d05f63.tar.gz ingen-e5675ebfeb93175e16762d0a078bd51d15d05f63.tar.bz2 ingen-e5675ebfeb93175e16762d0a078bd51d15d05f63.zip |
Heavy-duty redesign of client library and GUI (now fully signal driven with clean Model/View separation).
Smarter, centralized window creation/management (should make window unification easy (panes?)).
Typed metadata system, no more fugly string conversion of floats. Supports OSC fundamental
types string, int, float, blob for now (though blob isn't working over the wire yet).
git-svn-id: http://svn.drobilla.net/lad/ingen@131 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/progs/ingenuity/PatchPropertiesWindow.cpp')
-rw-r--r-- | src/progs/ingenuity/PatchPropertiesWindow.cpp | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/src/progs/ingenuity/PatchPropertiesWindow.cpp b/src/progs/ingenuity/PatchPropertiesWindow.cpp index 2271cc21..b6dd5e7f 100644 --- a/src/progs/ingenuity/PatchPropertiesWindow.cpp +++ b/src/progs/ingenuity/PatchPropertiesWindow.cpp @@ -41,20 +41,32 @@ PatchPropertiesWindow::PatchPropertiesWindow(BaseObjectType* cobject, const Glib * the window in any way. */ void -PatchPropertiesWindow::patch_model(CountedPtr<PatchModel> patch_model) +PatchPropertiesWindow::set_patch(CountedPtr<PatchModel> patch_model) { property_title() = patch_model->path() + " Properties"; m_patch_model = patch_model; - m_author_entry->set_text(m_patch_model->get_metadata("author")); - m_textview->get_buffer()->set_text(m_patch_model->get_metadata("description")); + + const Atom& author_atom = m_patch_model->get_metadata("author"); + m_author_entry->set_text( + (author_atom.type() == Atom::STRING) ? author_atom.get_string() : "" ); + + const Atom& desc_atom = m_patch_model->get_metadata("description"); + m_textview->get_buffer()->set_text( + (desc_atom.type() == Atom::STRING) ? desc_atom.get_string() : "" ); } void PatchPropertiesWindow::cancel_clicked() { - m_author_entry->set_text(m_patch_model->get_metadata("author")); - m_textview->get_buffer()->set_text(m_patch_model->get_metadata("description")); + const Atom& author_atom = m_patch_model->get_metadata("author"); + m_author_entry->set_text( + (author_atom.type() == Atom::STRING) ? author_atom.get_string() : "" ); + + const Atom& desc_atom = m_patch_model->get_metadata("description"); + m_textview->get_buffer()->set_text( + (desc_atom.type() == Atom::STRING) ? desc_atom.get_string() : "" ); + hide(); } @@ -62,8 +74,8 @@ PatchPropertiesWindow::cancel_clicked() void PatchPropertiesWindow::ok_clicked() { - m_patch_model->set_metadata("author", m_author_entry->get_text()); - m_patch_model->set_metadata("description", m_textview->get_buffer()->get_text()); + m_patch_model->set_metadata("author", Atom(m_author_entry->get_text().c_str())); + m_patch_model->set_metadata("description", Atom(m_textview->get_buffer()->get_text().c_str())); hide(); } |