Commit fe562f80 authored by Don Gagne's avatar Don Gagne

Remove old reconnect on boot option

parent 18dc3d04
...@@ -129,8 +129,7 @@ void MainWindow::deleteInstance(void) ...@@ -129,8 +129,7 @@ void MainWindow::deleteInstance(void)
/// by MainWindow::_create method. Hence no other code should have access to /// by MainWindow::_create method. Hence no other code should have access to
/// constructor. /// constructor.
MainWindow::MainWindow() MainWindow::MainWindow()
: _autoReconnect(false) : _lowPowerMode(false)
, _lowPowerMode(false)
, _showStatusBar(false) , _showStatusBar(false)
, _mainQmlWidgetHolder(NULL) , _mainQmlWidgetHolder(NULL)
{ {
...@@ -208,12 +207,6 @@ MainWindow::MainWindow() ...@@ -208,12 +207,6 @@ MainWindow::MainWindow()
connect(this, SIGNAL(x11EventOccured(XEvent*)), mouse, SLOT(handleX11Event(XEvent*))); connect(this, SIGNAL(x11EventOccured(XEvent*)), mouse, SLOT(handleX11Event(XEvent*)));
#endif //QGC_MOUSE_ENABLED_LINUX #endif //QGC_MOUSE_ENABLED_LINUX
// Connect link
if (_autoReconnect)
{
restoreLastUsedConnection();
}
// Set low power mode // Set low power mode
enableLowPowerMode(_lowPowerMode); enableLowPowerMode(_lowPowerMode);
emit initStatusChanged(tr("Restoring last view state"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141)); emit initStatusChanged(tr("Restoring last view state"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141));
...@@ -496,7 +489,6 @@ void MainWindow::loadSettings() ...@@ -496,7 +489,6 @@ void MainWindow::loadSettings()
// Why the screaming? // Why the screaming?
QSettings settings; QSettings settings;
settings.beginGroup(MAIN_SETTINGS_GROUP); settings.beginGroup(MAIN_SETTINGS_GROUP);
_autoReconnect = settings.value("AUTO_RECONNECT", _autoReconnect).toBool();
_lowPowerMode = settings.value("LOW_POWER_MODE", _lowPowerMode).toBool(); _lowPowerMode = settings.value("LOW_POWER_MODE", _lowPowerMode).toBool();
_showStatusBar = settings.value("SHOW_STATUSBAR", _showStatusBar).toBool(); _showStatusBar = settings.value("SHOW_STATUSBAR", _showStatusBar).toBool();
settings.endGroup(); settings.endGroup();
...@@ -506,7 +498,6 @@ void MainWindow::storeSettings() ...@@ -506,7 +498,6 @@ void MainWindow::storeSettings()
{ {
QSettings settings; QSettings settings;
settings.beginGroup(MAIN_SETTINGS_GROUP); settings.beginGroup(MAIN_SETTINGS_GROUP);
settings.setValue("AUTO_RECONNECT", _autoReconnect);
settings.setValue("LOW_POWER_MODE", _lowPowerMode); settings.setValue("LOW_POWER_MODE", _lowPowerMode);
settings.setValue("SHOW_STATUSBAR", _showStatusBar); settings.setValue("SHOW_STATUSBAR", _showStatusBar);
settings.endGroup(); settings.endGroup();
...@@ -543,11 +534,6 @@ void MainWindow::configureWindowName() ...@@ -543,11 +534,6 @@ void MainWindow::configureWindowName()
setWindowTitle(windowname); setWindowTitle(windowname);
} }
void MainWindow::enableAutoReconnect(bool enabled)
{
_autoReconnect = enabled;
}
/** /**
* @brief Create all actions associated to the main window * @brief Create all actions associated to the main window
* *
...@@ -634,23 +620,6 @@ void MainWindow::saveLastUsedConnection(const QString connection) ...@@ -634,23 +620,6 @@ void MainWindow::saveLastUsedConnection(const QString connection)
settings.setValue(key, 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 #ifdef QGC_MOUSE_ENABLED_LINUX
bool MainWindow::x11Event(XEvent *event) bool MainWindow::x11Event(XEvent *event)
{ {
......
...@@ -80,12 +80,6 @@ public: ...@@ -80,12 +80,6 @@ public:
~MainWindow(); ~MainWindow();
/** @brief Get auto link reconnect setting */
bool autoReconnectEnabled() const
{
return _autoReconnect;
}
/** @brief Get low power mode setting */ /** @brief Get low power mode setting */
bool lowPowerModeEnabled() const bool lowPowerModeEnabled() const
{ {
...@@ -95,18 +89,12 @@ public: ...@@ -95,18 +89,12 @@ public:
/// @brief Saves the last used connection /// @brief Saves the last used connection
void saveLastUsedConnection(const QString connection); void saveLastUsedConnection(const QString connection);
/// @brief Restore (and connects) the last used connection (if any)
void restoreLastUsedConnection();
public slots: public slots:
/** @brief Show the application settings */ /** @brief Show the application settings */
void showSettings(); void showSettings();
void manageLinks(); void manageLinks();
/** @brief Automatically reconnect last link */
void enableAutoReconnect(bool enabled);
/** @brief Save power by reducing update rates */ /** @brief Save power by reducing update rates */
void enableLowPowerMode(bool enabled) { _lowPowerMode = enabled; } void enableLowPowerMode(bool enabled) { _lowPowerMode = enabled; }
...@@ -251,7 +239,6 @@ private: ...@@ -251,7 +239,6 @@ private:
void _storeVisibleWidgetsSettings(void); void _storeVisibleWidgetsSettings(void);
#endif #endif
bool _autoReconnect;
bool _lowPowerMode; ///< If enabled, QGC reduces the update rates of all widgets bool _lowPowerMode; ///< If enabled, QGC reduces the update rates of all widgets
bool _showStatusBar; bool _showStatusBar;
QVBoxLayout* _centralLayout; QVBoxLayout* _centralLayout;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment