diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index 592d37eb518c1425b9adf237ba55aba964280fb2..d08fe5c16a1916b4e3fe700a78eecc1656b819db 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -129,8 +129,7 @@ void MainWindow::deleteInstance(void) /// by MainWindow::_create method. Hence no other code should have access to /// constructor. MainWindow::MainWindow() - : _autoReconnect(false) - , _lowPowerMode(false) + : _lowPowerMode(false) , _showStatusBar(false) , _mainQmlWidgetHolder(NULL) { @@ -208,12 +207,6 @@ MainWindow::MainWindow() connect(this, SIGNAL(x11EventOccured(XEvent*)), mouse, SLOT(handleX11Event(XEvent*))); #endif //QGC_MOUSE_ENABLED_LINUX - // Connect link - if (_autoReconnect) - { - restoreLastUsedConnection(); - } - // Set low power mode enableLowPowerMode(_lowPowerMode); emit initStatusChanged(tr("Restoring last view state"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141)); @@ -496,7 +489,6 @@ void MainWindow::loadSettings() // Why the screaming? QSettings settings; settings.beginGroup(MAIN_SETTINGS_GROUP); - _autoReconnect = settings.value("AUTO_RECONNECT", _autoReconnect).toBool(); _lowPowerMode = settings.value("LOW_POWER_MODE", _lowPowerMode).toBool(); _showStatusBar = settings.value("SHOW_STATUSBAR", _showStatusBar).toBool(); settings.endGroup(); @@ -506,7 +498,6 @@ void MainWindow::storeSettings() { QSettings settings; settings.beginGroup(MAIN_SETTINGS_GROUP); - settings.setValue("AUTO_RECONNECT", _autoReconnect); settings.setValue("LOW_POWER_MODE", _lowPowerMode); settings.setValue("SHOW_STATUSBAR", _showStatusBar); settings.endGroup(); @@ -543,11 +534,6 @@ void MainWindow::configureWindowName() setWindowTitle(windowname); } -void MainWindow::enableAutoReconnect(bool enabled) -{ - _autoReconnect = enabled; -} - /** * @brief Create all actions associated to the main window * @@ -634,23 +620,6 @@ void MainWindow::saveLastUsedConnection(const QString connection) settings.setValue(key, connection); } -/// @brief Restore (and connects) the last used connection (if any) -void MainWindow::restoreLastUsedConnection() -{ - // TODO This should check and see of the port/whatever is present - // first. That is, if the last connection was to a PX4 on some serial - // port, it should check and see if the port is present before making - // the connection. - QSettings settings; - QString key(MAIN_SETTINGS_GROUP); - key += "/LAST_CONNECTION"; - if(settings.contains(key)) { - QString connection = settings.value(key).toString(); - // Create a link for it - qgcApp()->toolbox()->linkManager()->createConnectedLink(connection); - } -} - #ifdef QGC_MOUSE_ENABLED_LINUX bool MainWindow::x11Event(XEvent *event) { diff --git a/src/ui/MainWindow.h b/src/ui/MainWindow.h index 0772df024a91feb4770d0bc3a733253ff95e5329..ae81bb06543819acd18024f80cc8f82b317a38dd 100644 --- a/src/ui/MainWindow.h +++ b/src/ui/MainWindow.h @@ -80,12 +80,6 @@ public: ~MainWindow(); - /** @brief Get auto link reconnect setting */ - bool autoReconnectEnabled() const - { - return _autoReconnect; - } - /** @brief Get low power mode setting */ bool lowPowerModeEnabled() const { @@ -95,18 +89,12 @@ public: /// @brief Saves the last used connection void saveLastUsedConnection(const QString connection); - /// @brief Restore (and connects) the last used connection (if any) - void restoreLastUsedConnection(); - public slots: /** @brief Show the application settings */ void showSettings(); void manageLinks(); - /** @brief Automatically reconnect last link */ - void enableAutoReconnect(bool enabled); - /** @brief Save power by reducing update rates */ void enableLowPowerMode(bool enabled) { _lowPowerMode = enabled; } @@ -251,7 +239,6 @@ private: void _storeVisibleWidgetsSettings(void); #endif - bool _autoReconnect; bool _lowPowerMode; ///< If enabled, QGC reduces the update rates of all widgets bool _showStatusBar; QVBoxLayout* _centralLayout;