initial pass at a missing file dialog and "relocatable" source files. lots more to...
[ardour.git] / gtk2_ardour / search_path_option.h
1 #ifndef __gtk_ardour_search_path_option_h__
2 #define __gtk_ardour_search_path_option_h__
3
4 #include <string>
5
6 #include <gtkmm/filechooserbutton.h>
7 #include <gtkmm/entry.h>
8 #include <gtkmm/button.h>
9 #include <gtkmm/box.h>
10
11 #include "option_editor.h"
12
13 class SearchPathOption : public Option
14 {
15   public:
16         SearchPathOption (const std::string& pathname, const std::string& label,
17                           sigc::slot<std::string>, sigc::slot<bool, std::string>);
18         ~SearchPathOption ();
19
20         void set_state_from_config ();
21         void add_to_page (OptionEditorPage*);
22         void clear ();
23
24   protected:
25         sigc::slot<std::string> _get; ///< slot to get the configuration variable's value
26         sigc::slot<bool, std::string> _set;  ///< slot to set the configuration variable's value
27
28         struct PathEntry {
29             PathEntry (const std::string& path, bool removable=true);
30
31             Gtk::Entry entry;
32             Gtk::Button remove_button;
33             Gtk::HBox box;
34
35             std::string path;
36         };
37
38         std::list<PathEntry*> paths;
39         Gtk::FileChooserButton add_chooser;
40         Gtk::VBox vbox;
41         Gtk::VBox path_box;
42         Gtk::Label session_label;
43
44         void add_path (const std::string& path, bool removable=true);
45         void remove_path (const std::string& path);
46         void changed ();
47         void path_chosen ();
48 };
49
50 #endif /* __gtk_ardour_search_path_option_h__ */