summaryrefslogtreecommitdiff
path: root/gtk2_ardour/search_path_option.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-11-09 22:18:52 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-11-09 22:18:52 +0000
commit84ddf22169c3aee19d3420b20c0e2f1b9bbdf02f (patch)
treebd0ea7e57c143d4d88abc957bafc3941a343d8a4 /gtk2_ardour/search_path_option.cc
parent2575a3907b665e0ff3f151221e5c753c84d512ee (diff)
handle multiple imports of the same file better (via better source naming); make session properties editor pretty much work for search paths
git-svn-id: svn://localhost/ardour2/branches/3.0@7989 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/search_path_option.cc')
-rw-r--r--gtk2_ardour/search_path_option.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/gtk2_ardour/search_path_option.cc b/gtk2_ardour/search_path_option.cc
index be01b9b1aa..eff991081b 100644
--- a/gtk2_ardour/search_path_option.cc
+++ b/gtk2_ardour/search_path_option.cc
@@ -46,6 +46,8 @@ SearchPathOption::SearchPathOption (const string& pathname, const string& label,
session_label.set_markup (string_compose ("<i>%1</i>", _("the session folder")));
session_label.set_alignment (0.0, 0.5);
session_label.show ();
+
+ path_box.pack_start (session_label);
}
SearchPathOption::~SearchPathOption()
@@ -59,6 +61,7 @@ SearchPathOption::path_chosen ()
{
string path = add_chooser.get_filename ();
add_path (path);
+ changed ();
}
void
@@ -109,12 +112,6 @@ SearchPathOption::changed ()
for (list<PathEntry*>::iterator p = paths.begin(); p != paths.end(); ++p) {
- if (p == paths.begin()) {
- /* skip first entry, its always "the session"
- */
- continue;
- }
-
if (!str.empty()) {
str += ':';
}
@@ -130,11 +127,16 @@ SearchPathOption::add_path (const string& path, bool removable)
PathEntry* pe = new PathEntry (path, removable);
paths.push_back (pe);
path_box.pack_start (pe->box, false, false);
+ pe->remove_button.signal_clicked().connect (sigc::bind (sigc::mem_fun (*this, &SearchPathOption::remove_path), pe));
}
void
-SearchPathOption::remove_path (const string& path)
+SearchPathOption::remove_path (PathEntry* pe)
{
+ path_box.remove (pe->box);
+ paths.remove (pe);
+ delete pe;
+ changed ();
}
SearchPathOption::PathEntry::PathEntry (const std::string& path, bool removable)