Commit 549d095c authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #4704 from DonLakeFlyer/SmallFixes

Number of small bug fixes
parents 25ca15d1 f84a4b9f
...@@ -87,7 +87,7 @@ FlightMap { ...@@ -87,7 +87,7 @@ FlightMap {
buttonVisible: [ true, true, _showZoom, _showZoom ] buttonVisible: [ true, true, _showZoom, _showZoom ]
maxHeight: (_flightVideo.visible ? _flightVideo.y : parent.height) - toolStrip.y // Massive reach across hack maxHeight: (_flightVideo.visible ? _flightVideo.y : parent.height) - toolStrip.y // Massive reach across hack
property bool _showZoom: !ScreenTools.isShortScreen property bool _showZoom: !ScreenTools.isMobile
model: [ model: [
{ {
......
...@@ -250,7 +250,6 @@ QGCView { ...@@ -250,7 +250,6 @@ QGCView {
function setCurrentItem(sequenceNumber) { function setCurrentItem(sequenceNumber) {
if (sequenceNumber !== _currentMissionIndex) { if (sequenceNumber !== _currentMissionIndex) {
console.log("setCurrentItem", sequenceNumber)
_currentMissionItem = undefined _currentMissionItem = undefined
_currentMissionIndex = -1 _currentMissionIndex = -1
for (var i=0; i<_visualItems.count; i++) { for (var i=0; i<_visualItems.count; i++) {
...@@ -712,7 +711,7 @@ QGCView { ...@@ -712,7 +711,7 @@ QGCView {
buttonVisible: [ true, true, true, true, true, _showZoom, _showZoom ] buttonVisible: [ true, true, true, true, true, _showZoom, _showZoom ]
maxHeight: mapScale.y - toolStrip.y maxHeight: mapScale.y - toolStrip.y
property bool _showZoom: !ScreenTools.isShortScreen property bool _showZoom: !ScreenTools.isMobile
model: [ model: [
{ {
......
...@@ -214,6 +214,12 @@ Rectangle { ...@@ -214,6 +214,12 @@ Rectangle {
recalcFromCameraValues() recalcFromCameraValues()
} }
} }
onIsCurrentItemChanged: {
if (!missionItem.isCurrentItem) {
polygonEditor.cancelPolygonEdit()
}
}
} }
Connections { Connections {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
MissionCommandTree::MissionCommandTree(QGCApplication* app, bool unitTest) MissionCommandTree::MissionCommandTree(QGCApplication* app, bool unitTest)
: QGCTool(app) : QGCTool(app)
, _allCommandsCategory(tr("All commands"))
, _settingsManager(NULL) , _settingsManager(NULL)
, _unitTest(unitTest) , _unitTest(unitTest)
{ {
...@@ -168,6 +169,7 @@ void MissionCommandTree::_buildAvailableCommands(Vehicle* vehicle) ...@@ -168,6 +169,7 @@ void MissionCommandTree::_buildAvailableCommands(Vehicle* vehicle)
_availableCategories[baseFirmwareType][baseVehicleType].append(newCategory); _availableCategories[baseFirmwareType][baseVehicleType].append(newCategory);
} }
} }
_availableCategories[baseFirmwareType][baseVehicleType].append(_allCommandsCategory);
} }
QStringList MissionCommandTree::_availableCategoriesForVehicle(Vehicle* vehicle) QStringList MissionCommandTree::_availableCategoriesForVehicle(Vehicle* vehicle)
...@@ -238,7 +240,7 @@ QVariantList MissionCommandTree::getCommandsForCategory(Vehicle* vehicle, const ...@@ -238,7 +240,7 @@ QVariantList MissionCommandTree::getCommandsForCategory(Vehicle* vehicle, const
QMap<MAV_CMD, MissionCommandUIInfo*> commandMap = _availableCommands[baseFirmwareType][baseVehicleType]; QMap<MAV_CMD, MissionCommandUIInfo*> commandMap = _availableCommands[baseFirmwareType][baseVehicleType];
foreach (MAV_CMD command, commandMap.keys()) { foreach (MAV_CMD command, commandMap.keys()) {
MissionCommandUIInfo* uiInfo = commandMap[command]; MissionCommandUIInfo* uiInfo = commandMap[command];
if (uiInfo->category() == category) { if (uiInfo->category() == category || category == _allCommandsCategory) {
list.append(QVariant::fromValue(uiInfo)); list.append(QVariant::fromValue(uiInfo));
} }
} }
......
...@@ -76,11 +76,13 @@ private: ...@@ -76,11 +76,13 @@ private:
void _baseVehicleInfo(Vehicle* vehicle, MAV_AUTOPILOT& baseFirmwareType, MAV_TYPE& baseVehicleType) const; void _baseVehicleInfo(Vehicle* vehicle, MAV_AUTOPILOT& baseFirmwareType, MAV_TYPE& baseVehicleType) const;
private: private:
/// List of all known command ids (not vehicle specific) QString _allCommandsCategory; ///< Category which contains all available commands
QList<int> _allCommandIds; QList<int> _allCommandIds; ///< List of all known command ids (not vehicle specific)
SettingsManager* _settingsManager;
bool _unitTest; ///< true: running in unit test mode
/// Full hierarchy /// Full hierarchy
QMap<MAV_AUTOPILOT, QMap<MAV_TYPE, MissionCommandList*>> _staticCommandTree; QMap<MAV_AUTOPILOT, QMap<MAV_TYPE, MissionCommandList*>> _staticCommandTree;
/// Collapsed hierarchy for specific vehicle type /// Collapsed hierarchy for specific vehicle type
QMap<MAV_AUTOPILOT, QMap<MAV_TYPE, QMap<MAV_CMD, MissionCommandUIInfo*>>> _availableCommands; QMap<MAV_AUTOPILOT, QMap<MAV_TYPE, QMap<MAV_CMD, MissionCommandUIInfo*>>> _availableCommands;
...@@ -88,8 +90,6 @@ private: ...@@ -88,8 +90,6 @@ private:
/// Collapsed hierarchy for specific vehicle type /// Collapsed hierarchy for specific vehicle type
QMap<MAV_AUTOPILOT, QMap<MAV_TYPE, QStringList>> _availableCategories; QMap<MAV_AUTOPILOT, QMap<MAV_TYPE, QStringList>> _availableCategories;
SettingsManager* _settingsManager;
bool _unitTest; ///< true: running in unit test mode
#ifdef UNITTEST_BUILD #ifdef UNITTEST_BUILD
friend class MissionCommandTreeTest; friend class MissionCommandTreeTest;
......
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