From a9a049ca2a16d5f4f98a3e3ed1194fb02edc4104 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 22 Oct 2014 20:06:51 +0200 Subject: [PATCH] Fix link status in QGC toolbar --- src/ui/QGCToolBar.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ui/QGCToolBar.cc b/src/ui/QGCToolBar.cc index 38ae649fc..f8dec1b73 100644 --- a/src/ui/QGCToolBar.cc +++ b/src/ui/QGCToolBar.cc @@ -781,11 +781,17 @@ void QGCToolBar::connectLink(bool connect) link->setPortName(portComboBox->itemData(portComboBox->currentIndex()).toString().trimmed()); int baud = baudcomboBox->currentText().toInt(); link->setBaudRate(baud); + QObject::connect(link, SIGNAL(connected(bool)), this, SLOT(updateLinkState(bool))); link->connect(); } } else if (!connect && currentLink) { currentLink->disconnect(); + QObject::disconnect(currentLink, SIGNAL(connected(bool)), this, SLOT(updateLinkState(bool))); + } + + if (currentLink) { + updateLinkState(currentLink->isConnected()); } } -- 2.22.0