summaryrefslogtreecommitdiff
path: root/gtk2_ardour/search_path_option.cc
diff options
context:
space:
mode:
authorThomas Brand <tom@trellis.ch>2017-07-01 18:42:24 +0200
committerRobin Gareus <robin@gareus.org>2017-07-01 19:28:26 +0200
commit63ea7b6516dbd7554d1eff6c98de50cf61fc9a72 (patch)
tree82fa339e009bc082dd8023916990800bea437081 /gtk2_ardour/search_path_option.cc
parentf413b83cb9fa50954969a3d849999e1890ce6690 (diff)
NO-OP whitespace (updated GH PR #357)
Diffstat (limited to 'gtk2_ardour/search_path_option.cc')
-rw-r--r--gtk2_ardour/search_path_option.cc130
1 files changed, 65 insertions, 65 deletions
diff --git a/gtk2_ardour/search_path_option.cc b/gtk2_ardour/search_path_option.cc
index 925b9834cb..6f51511e44 100644
--- a/gtk2_ardour/search_path_option.cc
+++ b/gtk2_ardour/search_path_option.cc
@@ -29,30 +29,30 @@ using namespace Gtk;
SearchPathOption::SearchPathOption (const string& pathname, const string& label,
const string& default_path,
sigc::slot<std::string> get, sigc::slot<bool, std::string> set)
- : Option (pathname, label)
- , _get (get)
- , _set (set)
- , add_chooser (_("Select folder to search for media"), FILE_CHOOSER_ACTION_SELECT_FOLDER)
+ : Option (pathname, label)
+ , _get (get)
+ , _set (set)
+ , add_chooser (_("Select folder to search for media"), FILE_CHOOSER_ACTION_SELECT_FOLDER)
{
- add_chooser.signal_file_set().connect (sigc::mem_fun (*this, &SearchPathOption::path_chosen));
+ add_chooser.signal_file_set().connect (sigc::mem_fun (*this, &SearchPathOption::path_chosen));
- HBox* hbox = manage (new HBox);
+ HBox* hbox = manage (new HBox);
- hbox->set_border_width (12);
- hbox->set_spacing (6);
- hbox->pack_end (add_chooser, true, true);
- hbox->pack_end (*manage (new Label (_("Click to add a new location"))), false, false);
- hbox->show_all ();
+ hbox->set_border_width (12);
+ hbox->set_spacing (6);
+ hbox->pack_end (add_chooser, true, true);
+ hbox->pack_end (*manage (new Label (_("Click to add a new location"))), false, false);
+ hbox->show_all ();
- vbox.pack_start (path_box);
- vbox.pack_end (*hbox);
+ vbox.pack_start (path_box);
+ vbox.pack_end (*hbox);
- session_label.set_use_markup (true);
- session_label.set_markup (string_compose ("<i>%1 (%2)</i>", _("the session folder"), short_path (default_path, 32)));
- session_label.set_alignment (0.0, 0.5);
- session_label.show ();
+ session_label.set_use_markup (true);
+ session_label.set_markup (string_compose ("<i>%1 (%2)</i>", _("the session folder"), short_path (default_path, 32)));
+ session_label.set_alignment (0.0, 0.5);
+ session_label.show ();
- path_box.pack_start (session_label);
+ path_box.pack_start (session_label);
}
SearchPathOption::~SearchPathOption()
@@ -64,9 +64,9 @@ SearchPathOption::~SearchPathOption()
void
SearchPathOption::path_chosen ()
{
- string path = add_chooser.get_filename ();
- add_path (path);
- changed ();
+ string path = add_chooser.get_filename ();
+ add_path (path);
+ changed ();
}
void
@@ -75,9 +75,9 @@ SearchPathOption::add_to_page (OptionEditorPage* p)
int const n = p->table.property_n_rows();
p->table.resize (n + 1, 3);
- Label* label = manage (new Label);
- label->set_alignment (0.0, 0.0);
- label->set_text (string_compose ("%1", _name));
+ Label* label = manage (new Label);
+ label->set_alignment (0.0, 0.0);
+ label->set_text (string_compose ("%1", _name));
p->table.attach (*label, 1, 2, n, n + 1, FILL | EXPAND);
p->table.attach (vbox, 2, 3, n, n + 1, FILL | EXPAND);
@@ -86,78 +86,78 @@ SearchPathOption::add_to_page (OptionEditorPage* p)
void
SearchPathOption::clear ()
{
- path_box.remove (session_label);
- for (list<PathEntry*>::iterator p = paths.begin(); p != paths.end(); ++p) {
- path_box.remove ((*p)->box);
- delete *p;
- }
- paths.clear ();
+ path_box.remove (session_label);
+ for (list<PathEntry*>::iterator p = paths.begin(); p != paths.end(); ++p) {
+ path_box.remove ((*p)->box);
+ delete *p;
+ }
+ paths.clear ();
}
void
SearchPathOption::set_state_from_config ()
{
- string str = _get ();
- vector<string> dirs;
+ string str = _get ();
+ vector<string> dirs;
- clear ();
- path_box.pack_start (session_label);
+ clear ();
+ path_box.pack_start (session_label);
- split (str, dirs, G_SEARCHPATH_SEPARATOR);
+ split (str, dirs, G_SEARCHPATH_SEPARATOR);
- for (vector<string>::iterator d = dirs.begin(); d != dirs.end(); ++d) {
- add_path (*d);
- }
+ for (vector<string>::iterator d = dirs.begin(); d != dirs.end(); ++d) {
+ add_path (*d);
+ }
}
void
SearchPathOption::changed ()
{
- string str;
+ string str;
- for (list<PathEntry*>::iterator p = paths.begin(); p != paths.end(); ++p) {
+ for (list<PathEntry*>::iterator p = paths.begin(); p != paths.end(); ++p) {
- if (!str.empty()) {
- str += G_SEARCHPATH_SEPARATOR;
- }
- str += (*p)->entry.get_text ();
- }
+ if (!str.empty()) {
+ str += G_SEARCHPATH_SEPARATOR;
+ }
+ str += (*p)->entry.get_text ();
+ }
- _set (str);
+ _set (str);
}
void
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));
+ 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 (PathEntry* pe)
{
- path_box.remove (pe->box);
- paths.remove (pe);
- delete pe;
- changed ();
+ path_box.remove (pe->box);
+ paths.remove (pe);
+ delete pe;
+ changed ();
}
SearchPathOption::PathEntry::PathEntry (const std::string& path, bool removable)
- : remove_button (Stock::REMOVE)
+ : remove_button (Stock::REMOVE)
{
- entry.set_text (path);
- entry.show ();
+ entry.set_text (path);
+ entry.show ();
- box.set_spacing (6);
- box.set_homogeneous (false);
- box.pack_start (entry, true, true);
+ box.set_spacing (6);
+ box.set_homogeneous (false);
+ box.pack_start (entry, true, true);
- if (removable) {
- box.pack_start (remove_button, false, false);
- remove_button.show ();
- }
+ if (removable) {
+ box.pack_start (remove_button, false, false);
+ remove_button.show ();
+ }
- box.show ();
+ box.show ();
}