1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-30 15:52:12 +01:00

GCS ConnectionManager: When polling is disabled don't automatically connect to boards either.

This commit is contained in:
James Cotton 2012-09-08 19:06:03 -05:00
parent 2ec8434941
commit 82f752685a
2 changed files with 8 additions and 4 deletions

View File

@ -246,6 +246,7 @@ void ConnectionManager::suspendPolling()
m_connectBtn->setEnabled(false); m_connectBtn->setEnabled(false);
m_availableDevList->setEnabled(false); m_availableDevList->setEnabled(false);
polling = false;
} }
/** /**
@ -261,6 +262,7 @@ void ConnectionManager::resumePolling()
m_connectBtn->setEnabled(true); m_connectBtn->setEnabled(true);
m_availableDevList->setEnabled(true); m_availableDevList->setEnabled(true);
polling = true;
} }
/** /**
@ -357,8 +359,9 @@ void ConnectionManager::updateConnectionDropdown()
{ {
if(m_mainWindow->generalSettings()->autoConnect() || m_mainWindow->generalSettings()->autoSelect()) if(m_mainWindow->generalSettings()->autoConnect() || m_mainWindow->generalSettings()->autoSelect())
m_availableDevList->setCurrentIndex(m_availableDevList->count()-1); m_availableDevList->setCurrentIndex(m_availableDevList->count()-1);
if(m_mainWindow->generalSettings()->autoConnect()) if(m_mainWindow->generalSettings()->autoConnect() && polling)
{ {
qDebug() << "Automatically opening device";
connectDevice(); connectDevice();
qDebug()<<"ConnectionManager::devChanged autoconnected USB device"; qDebug()<<"ConnectionManager::devChanged autoconnected USB device";
} }

View File

@ -113,7 +113,7 @@ private slots:
void devChanged(IConnection *connection); void devChanged(IConnection *connection);
void onConnectionDestroyed(QObject *obj); void onConnectionDestroyed(QObject *obj);
void connectionsCallBack(); //used to call devChange after all the plugins are loaded void connectionsCallBack(); //used to call devChange after all the plugins are loaded
protected: protected:
QComboBox *m_availableDevList; QComboBox *m_availableDevList;
QPushButton *m_connectBtn; QPushButton *m_connectBtn;
@ -128,8 +128,9 @@ protected:
private: private:
bool connectDevice(); bool connectDevice();
Internal::MainWindow *m_mainWindow; bool polling;
QList <IConnection *> connectionBackup; Internal::MainWindow *m_mainWindow;
QList <IConnection *> connectionBackup;
}; };