Ardour  9.0-pre0-582-g084a23a80d
search_path_option.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010-2012 Paul Davis <paul@linuxaudiosystems.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #pragma once
20 
21 #include <string>
22 
24 #include <gtkmm/entry.h>
25 #include <gtkmm/button.h>
26 #include <gtkmm/box.h>
27 
28 #include "option_editor.h"
29 
30 class SearchPathOption : public Option
31 {
32 public:
33  SearchPathOption (const std::string& pathname, const std::string& label,
34  const std::string& default_path,
35  sigc::slot<std::string>, sigc::slot<bool, std::string>);
37 
40  void clear ();
41 
43 
44 protected:
45  sigc::slot<std::string> _get;
46  sigc::slot<bool, std::string> _set;
47 
48  struct PathEntry
49  {
50  PathEntry (const std::string& path, bool removable=true);
51 
55 
56  std::string path;
57  };
58 
59  std::list<PathEntry*> paths;
64 
65  void add_path (const std::string& path, bool removable=true);
67  void changed ();
68  void path_chosen ();
69 };
70 
void add_to_page(OptionEditorPage *)
Gtk::Widget & tip_widget()
Gtk::FileChooserButton add_chooser
sigc::slot< bool, std::string > _set
slot to set the configuration variable's value
Gtk::Label session_label
SearchPathOption(const std::string &pathname, const std::string &label, const std::string &default_path, sigc::slot< std::string >, sigc::slot< bool, std::string >)
void remove_path(PathEntry *)
std::list< PathEntry * > paths
void add_path(const std::string &path, bool removable=true)
void set_state_from_config()
sigc::slot< std::string > _get
slot to get the configuration variable's value
Base class for option editing dialog boxes.
PathEntry(const std::string &path, bool removable=true)