summaryrefslogtreecommitdiffstats
path: root/src/gui/ConnectWindow.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-12-16 17:57:49 +0100
committerDavid Robillard <d@drobilla.net>2017-12-16 18:05:19 +0100
commit7513e0b53a36e96b9e1fa1884b78077a95da3081 (patch)
treefc96befa9b2c2f5255ada0d589c524e22626c16d /src/gui/ConnectWindow.cpp
parent2b88ebdcb7a438a8419ab6a815742b115b2dce03 (diff)
downloadingen-7513e0b53a36e96b9e1fa1884b78077a95da3081.tar.gz
ingen-7513e0b53a36e96b9e1fa1884b78077a95da3081.tar.bz2
ingen-7513e0b53a36e96b9e1fa1884b78077a95da3081.zip
Add Message struct and remove tons of interface boilerplate
Diffstat (limited to 'src/gui/ConnectWindow.cpp')
-rw-r--r--src/gui/ConnectWindow.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp
index 0b4ea298..635df134 100644
--- a/src/gui/ConnectWindow.cpp
+++ b/src/gui/ConnectWindow.cpp
@@ -19,6 +19,7 @@
#include <sstream>
#include <string>
+#include <boost/variant.hpp>
#include <gtkmm/stock.h>
#include "raul/Process.hpp"
@@ -74,6 +75,16 @@ ConnectWindow::ConnectWindow(BaseObjectType* cobject,
}
void
+ConnectWindow::message(const Message& msg)
+{
+ if (const Response* const r = boost::get<Response>(&msg)) {
+ ingen_response(r->id, r->status, r->subject);
+ } else if (const Error* const e = boost::get<Error>(&msg)) {
+ error(e->message);
+ }
+}
+
+void
ConnectWindow::error(const std::string& msg)
{
if (!is_visible()) {
@@ -477,8 +488,8 @@ ConnectWindow::gtk_callback()
}
} else if (_connect_stage == 1) {
_attached = false;
- _app->client()->signal_response().connect(
- sigc::mem_fun(this, &ConnectWindow::ingen_response));
+ _app->client()->signal_message().connect(
+ sigc::mem_fun(this, &ConnectWindow::message));
_ping_id = g_random_int_range(1, std::numeric_limits<int32_t>::max());
_app->interface()->set_response_id(_ping_id);