From 736546bfd97580e31297e8e000f188366a8afc09 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 2 Oct 2015 00:03:48 +0000 Subject: 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 --- src/gui/ConnectWindow.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/gui') 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(); if (existing) { uri_str = world->interface()->uri(); + _connect_stage = 1; + SPtr client = dynamic_ptr_cast(world->interface()); + if (client) { + _app->attach(dynamic_ptr_cast(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..."); } -- cgit v1.2.1