diff options
author | David Robillard <d@drobilla.net> | 2015-10-02 00:03:48 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2015-10-02 00:03:48 +0000 |
commit | 736546bfd97580e31297e8e000f188366a8afc09 (patch) | |
tree | e26b5f57d055eab7b57dc71e11570c0e548dee93 /src | |
parent | dc6bde36430e1e2da21b3b81f691ea6f31d672be (diff) | |
download | ingen-736546bfd97580e31297e8e000f188366a8afc09.tar.gz ingen-736546bfd97580e31297e8e000f188366a8afc09.tar.bz2 ingen-736546bfd97580e31297e8e000f188366a8afc09.zip |
Don't connect twice to server on initial load.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5734 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/ConnectWindow.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp index cdf53e16..9b735dd9 100644 --- a/src/gui/ConnectWindow.cpp +++ b/src/gui/ConnectWindow.cpp @@ -32,6 +32,7 @@ #include "ingen/World.hpp" #include "ingen/client/ClientStore.hpp" #include "ingen/client/GraphModel.hpp" +#include "ingen/client/SocketClient.hpp" #include "ingen/client/ThreadedSigClientInterface.hpp" #include "ingen_config.h" @@ -207,6 +208,7 @@ ConnectWindow::connect(bool existing) } set_connecting_widget_states(); + _connect_stage = 0; Ingen::World* world = _app->world(); @@ -214,6 +216,15 @@ ConnectWindow::connect(bool existing) std::string uri_str = world->conf().option("connect").ptr<char>(); if (existing) { uri_str = world->interface()->uri(); + _connect_stage = 1; + SPtr<Client::SocketClient> client = dynamic_ptr_cast<Client::SocketClient>(world->interface()); + if (client) { + _app->attach(dynamic_ptr_cast<Client::SigClientInterface>(client->respondee())); + _app->register_callbacks(); + } else { + error("Connected with invalid client interface type"); + return; + } } else if (_widgets_loaded) { uri_str = _url_entry->get_text(); } @@ -252,7 +263,6 @@ ConnectWindow::connect(bool existing) } set_connecting_widget_states(); - _connect_stage = 0; if (_widgets_loaded) { _progress_label->set_text("Connecting..."); } |