Browse Source

Merge pull request #3597 from DonLakeFlyer/3.0Fixes

3.0 fixes
QGC4.4
Don Gagne 9 years ago committed by GitHub
parent
commit
5166854967
  1. 15
      src/FlightDisplay/FlightDisplayViewWidgets.qml
  2. 29
      src/QGCApplication.cc
  3. 13
      src/QGCApplication.h

15
src/FlightDisplay/FlightDisplayViewWidgets.qml

@ -162,10 +162,11 @@ Item {
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
QGCCheckBox { QGCCheckBox {
id: followVehicleCheckBox id: followVehicleCheckBox
text: qsTr("Follow Vehicle") text: qsTr("Follow Vehicle")
checked: _flightMap ? _flightMap._followVehicle : false checked: _flightMap ? _flightMap._followVehicle : false
anchors.baseline: centerMapButton.baseline anchors.verticalCenter: parent.verticalCenter
//anchors.baseline: centerMapButton.baseline - This doesn't work correctly on mobile for some strange reason, so we center instead
onClicked: { onClicked: {
_dropButtonsExclusiveGroup.current = null _dropButtonsExclusiveGroup.current = null
@ -407,7 +408,7 @@ Item {
break; break;
case confirmTakeoff: case confirmTakeoff:
altitudeSlider.visible = true altitudeSlider.visible = true
altitudeSlider.setInitialValueMeters(10) altitudeSlider.setInitialValueMeters(2)
guidedModeConfirm.confirmText = qsTr("takeoff") guidedModeConfirm.confirmText = qsTr("takeoff")
break; break;
case confirmLand: case confirmLand:
@ -581,8 +582,8 @@ Item {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
orientation: Qt.Vertical orientation: Qt.Vertical
minimumValue: QGroundControl.metersToAppSettingsDistanceUnits((_activeVehicle && _activeVehicle.flying) ? -15 : 0) minimumValue: QGroundControl.metersToAppSettingsDistanceUnits(2)
maximumValue: QGroundControl.metersToAppSettingsDistanceUnits((_activeVehicle && _activeVehicle.flying) ? 15 : 60) maximumValue: QGroundControl.metersToAppSettingsDistanceUnits((_activeVehicle && _activeVehicle.flying) ? 100 : 10)
} }
} }
} }

29
src/QGCApplication.cc

@ -180,6 +180,7 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
, _styleIsDark(true) , _styleIsDark(true)
#endif #endif
, _fakeMobile(false) , _fakeMobile(false)
, _settingsUpgraded(false)
#ifdef QT_DEBUG #ifdef QT_DEBUG
, _testHighDPI(false) , _testHighDPI(false)
#endif #endif
@ -306,6 +307,19 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
QDir paramDir(ParameterLoader::parameterCacheDir()); QDir paramDir(ParameterLoader::parameterCacheDir());
paramDir.removeRecursively(); paramDir.removeRecursively();
paramDir.mkpath(paramDir.absolutePath()); paramDir.mkpath(paramDir.absolutePath());
} else {
// Determine if upgrade message for settings version bump is required. Check must happen before toolbox is started since
// that will write some settings.
if (settings.contains(_settingsVersionKey)) {
if (settings.value(_settingsVersionKey).toInt() != QGC_SETTINGS_VERSION) {
_settingsUpgraded = true;
}
} else if (settings.allKeys().count()) {
// Settings version key is missing and there are settings. This is an upgrade scenario.
_settingsUpgraded = true;
} else {
settings.setValue(_settingsVersionKey, QGC_SETTINGS_VERSION);
}
} }
// Set up our logging filters // Set up our logging filters
@ -427,20 +441,7 @@ bool QGCApplication::_initForNormalAppBoot(void)
// Load known link configurations // Load known link configurations
toolbox()->linkManager()->loadLinkConfigurationList(); toolbox()->linkManager()->loadLinkConfigurationList();
// Show user an upgrade message if the settings version has been bumped up if (_settingsUpgraded) {
bool settingsUpgraded = false;
if (settings.contains(_settingsVersionKey)) {
if (settings.value(_settingsVersionKey).toInt() != QGC_SETTINGS_VERSION) {
settingsUpgraded = true;
}
} else if (settings.allKeys().count()) {
// Settings version key is missing and there are settings. This is an upgrade scenario.
settingsUpgraded = true;
} else {
settings.setValue(_settingsVersionKey, QGC_SETTINGS_VERSION);
}
if (settingsUpgraded) {
settings.clear(); settings.clear();
settings.setValue(_settingsVersionKey, QGC_SETTINGS_VERSION); settings.setValue(_settingsVersionKey, QGC_SETTINGS_VERSION);
showMessage("The format for QGroundControl saved settings has been modified. " showMessage("The format for QGroundControl saved settings has been modified. "

13
src/QGCApplication.h

@ -183,13 +183,12 @@ private:
static const char* _darkStyleFile; static const char* _darkStyleFile;
static const char* _lightStyleFile; static const char* _lightStyleFile;
bool _styleIsDark; ///< true: dark style, false: light style bool _styleIsDark; ///< true: dark style, false: light style
static const int _missingParamsDelayedDisplayTimerTimeout = 1000; ///< Timeout to wait for next missing fact to come in before display
static const int _missingParamsDelayedDisplayTimerTimeout = 1000; ///< Timeout to wait for next missing fact to come in before display QTimer _missingParamsDelayedDisplayTimer; ///< Timer use to delay missing fact display
QTimer _missingParamsDelayedDisplayTimer; ///< Timer use to delay missing fact display QStringList _missingParams; ///< List of missing facts to be displayed
QStringList _missingParams; ///< List of missing facts to be displayed bool _fakeMobile; ///< true: Fake ui into displaying mobile interface
bool _settingsUpgraded; ///< true: Settings format has been upgrade to new version
bool _fakeMobile; ///< true: Fake ui into displaying mobile interface
#ifdef QT_DEBUG #ifdef QT_DEBUG
bool _testHighDPI; ///< true: double fonts sizes for simulating high dpi devices bool _testHighDPI; ///< true: double fonts sizes for simulating high dpi devices

Loading…
Cancel
Save