summaryrefslogtreecommitdiff
path: root/gtk2_ardour/option_editor.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-05-16 01:22:43 +0000
committerCarl Hetherington <carl@carlh.net>2009-05-16 01:22:43 +0000
commit29e8fe16987548d44b6376a38c81da7737efde28 (patch)
tree492c7b25e94f6d531699bb31b5786657276296bf /gtk2_ardour/option_editor.cc
parentf4e6f8fec5c4ed705b2f0124666d632c392dbbc3 (diff)
Add session preferences dialog.
git-svn-id: svn://localhost/ardour2/branches/3.0@5082 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/option_editor.cc')
-rw-r--r--gtk2_ardour/option_editor.cc29
1 files changed, 29 insertions, 0 deletions
diff --git a/gtk2_ardour/option_editor.cc b/gtk2_ardour/option_editor.cc
index 4072a362b0..bc3691dff4 100644
--- a/gtk2_ardour/option_editor.cc
+++ b/gtk2_ardour/option_editor.cc
@@ -99,6 +99,35 @@ BoolOption::toggled ()
_set (_button->get_active ());
}
+EntryOption::EntryOption (string const & i, string const & n, slot<string> g, slot<bool, string> s)
+ : Option (i, n),
+ _get (g),
+ _set (s)
+{
+ _label = manage (new Label (n + ":"));
+ _label->set_alignment (1, 0.5);
+ _entry = manage (new Entry);
+ _entry->signal_activate().connect (mem_fun (*this, &EntryOption::activated));
+}
+
+void
+EntryOption::add_to_page (OptionEditorPage* p)
+{
+ add_widgets_to_page (p, _label, _entry);
+}
+
+void
+EntryOption::set_state_from_config ()
+{
+ _entry->set_text (_get ());
+}
+
+void
+EntryOption::activated ()
+{
+ _set (_entry->get_text ());
+}
+
OptionEditorPage::OptionEditorPage (Gtk::Notebook& n, std::string const & t)
: table (1, 3)
{