From 29e8fe16987548d44b6376a38c81da7737efde28 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 16 May 2009 01:22:43 +0000 Subject: Add session preferences dialog. git-svn-id: svn://localhost/ardour2/branches/3.0@5082 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/option_editor.cc | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'gtk2_ardour/option_editor.cc') 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 g, slot 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) { -- cgit v1.2.3