|
|
|
@ -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
|
|
|
|
|
/// constructor.
|
|
|
|
|
MainWindow::MainWindow() |
|
|
|
|
: _autoReconnect(false) |
|
|
|
|
, _lowPowerMode(false) |
|
|
|
|
: _lowPowerMode(false) |
|
|
|
|
, _showStatusBar(false) |
|
|
|
|
, _mainQmlWidgetHolder(NULL) |
|
|
|
|
{ |
|
|
|
@ -208,12 +207,6 @@ MainWindow::MainWindow()
@@ -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()
@@ -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()
@@ -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()
@@ -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)
@@ -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) |
|
|
|
|
{ |
|
|
|
|