summaryrefslogtreecommitdiffstats
path: root/src/gui/ConnectWindow.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-08-29 17:36:37 +0000
committerDavid Robillard <d@drobilla.net>2015-08-29 17:36:37 +0000
commit511d550730be922b64190c6fbbd22c387fe28774 (patch)
treecef0d013e7bfe4e776d1a80d7ce8ebf258d57a7b /src/gui/ConnectWindow.cpp
parentcec7f9f4ac1e601bc0e1b452d260c20a598361dd (diff)
downloadingen-511d550730be922b64190c6fbbd22c387fe28774.tar.gz
ingen-511d550730be922b64190c6fbbd22c387fe28774.tar.bz2
ingen-511d550730be922b64190c6fbbd22c387fe28774.zip
Fix crash when clicking activate before connection.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5716 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/ConnectWindow.cpp')
-rw-r--r--src/gui/ConnectWindow.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp
index cb3012c3..cdf53e16 100644
--- a/src/gui/ConnectWindow.cpp
+++ b/src/gui/ConnectWindow.cpp
@@ -137,6 +137,9 @@ ConnectWindow::set_connected_to(SPtr<Ingen::Interface> engine)
_port_spinbutton->set_sensitive(false);
_launch_radio->set_sensitive(false);
_internal_radio->set_sensitive(false);
+ _activate_button->set_sensitive(true);
+ _deactivate_button->set_sensitive(true);
+
} else {
_icon->set(Gtk::Stock::DISCONNECT, Gtk::ICON_SIZE_LARGE_TOOLBAR);
_progress_bar->set_fraction(0.0);
@@ -145,6 +148,8 @@ ConnectWindow::set_connected_to(SPtr<Ingen::Interface> engine)
_internal_radio->set_sensitive(true);
_server_radio->set_sensitive(true);
_launch_radio->set_sensitive(true);
+ _activate_button->set_sensitive(false);
+ _deactivate_button->set_sensitive(false);
if (_mode == Mode::CONNECT_REMOTE)
_url_entry->set_sensitive(true);
@@ -278,6 +283,10 @@ ConnectWindow::disconnect()
void
ConnectWindow::activate()
{
+ if (!_app->interface()) {
+ return;
+ }
+
_app->interface()->set_property(Raul::URI("ingen:/driver"),
_app->uris().ingen_enabled,
_app->forge().make(true));
@@ -286,6 +295,10 @@ ConnectWindow::activate()
void
ConnectWindow::deactivate()
{
+ if (!_app->interface()) {
+ return;
+ }
+
_app->interface()->set_property(Raul::URI("ingen:/driver"),
_app->uris().ingen_enabled,
_app->forge().make(false));