diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-09-20 16:01:03 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-09-20 16:01:03 +0000 |
commit | 59343255616fe7182a9fdd0e1b574f2c915e945d (patch) | |
tree | e69fb39ffba83db4a43cbf43678692649b3e86c1 /gtk2_ardour/engine_dialog.cc | |
parent | f33a9218e00c8d1ab65b5d17f56bc5f12274402f (diff) |
don't use non-existent JACK server paths
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2474 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/engine_dialog.cc')
-rw-r--r-- | gtk2_ardour/engine_dialog.cc | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc index 02b7bf67c4..c8f4ec2550 100644 --- a/gtk2_ardour/engine_dialog.cc +++ b/gtk2_ardour/engine_dialog.cc @@ -271,19 +271,17 @@ EngineControl::EngineControl () ++row; #endif - strings.clear (); - - find_jack_servers (strings); + find_jack_servers (server_strings); - if (strings.empty()) { + if (server_strings.empty()) { fatal << _("No JACK server found anywhere on this system. Please install JACK and restart") << endmsg; /*NOTREACHED*/ } - set_popdown_strings (serverpath_combo, strings); - serverpath_combo.set_active_text (strings.front()); + set_popdown_strings (serverpath_combo, server_strings); + serverpath_combo.set_active_text (server_strings.front()); - if (strings.size() > 1) { + if (server_strings.size() > 1) { label = manage (new Label (_("Server:"))); options_packer.attach (*label, 0, 1, row, row + 1, FILL|EXPAND, (AttachOptions) 0); label->set_alignment (0.0, 0.5); @@ -1109,7 +1107,24 @@ EngineControl::set_state (const XMLNode& root) } else if (child->name() == "periodsize") { period_size_combo.set_active_text(strval); } else if (child->name() == "serverpath") { - serverpath_combo.set_active_text(strval); + /* do not allow us to use a server path that doesn't + exist on this system. this handles cases where + the user has an RC file listing a serverpath + from some other machine. + */ + vector<string>::iterator x; + for (x = server_strings.begin(); x != server_strings.end(); ++x) { + if (*x == strval) { + break; + } + } + if (x != server_strings.end()) { + serverpath_combo.set_active_text (strval); + } else { + warning << string_compose (_("configuration files contain a JACK server path that doesn't exist (%1)"), + strval) + << endmsg; + } } else if (child->name() == "driver") { driver_combo.set_active_text(strval); } else if (child->name() == "interface") { |