diff options
author | Carl Hetherington <carl@carlh.net> | 2011-11-04 15:05:49 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-11-04 15:05:49 +0000 |
commit | b02673adb47e578284d91445b108ee256149ce1f (patch) | |
tree | 06cc8de69e7b668e1034a027838656ca4c15e466 /gtk2_ardour/option_editor.cc | |
parent | 07159a6709a8fd307ed4ab2fd3128a121ede47a2 (diff) |
Add option to set default-session-parent-dir (#4438).
git-svn-id: svn://localhost/ardour2/branches/3.0@10435 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/option_editor.cc')
-rw-r--r-- | gtk2_ardour/option_editor.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gtk2_ardour/option_editor.cc b/gtk2_ardour/option_editor.cc index 33f8a8dc43..770df4d37d 100644 --- a/gtk2_ardour/option_editor.cc +++ b/gtk2_ardour/option_editor.cc @@ -320,4 +320,30 @@ OptionEditor::set_current_page (string const & p) } +DirectoryOption::DirectoryOption (string const & i, string const & n, sigc::slot<string> g, sigc::slot<bool, string> s) + : Option (i, n) + , _get (g) + , _set (s) +{ + _file_chooser.set_action (Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER); + _file_chooser.signal_file_set().connect (sigc::mem_fun (*this, &DirectoryOption::file_set)); +} + +void +DirectoryOption::set_state_from_config () +{ + _file_chooser.set_filename (_get ()); +} + +void +DirectoryOption::add_to_page (OptionEditorPage* p) +{ + add_widgets_to_page (p, manage (new Label (_name)), &_file_chooser); +} + +void +DirectoryOption::file_set () +{ + _set (_file_chooser.get_filename ()); +} |