Skip to content

Commit

Permalink
Fixed inconsistent highlight of active leg after flight plan change.
Browse files Browse the repository at this point in the history
  • Loading branch information
albar965 committed May 30, 2017
1 parent 90cc22b commit 449cfa5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/route/routecontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -702,8 +702,8 @@ bool RouteController::appendFlightplan(const QString& filename)
route.updateAll();
updateAirwaysAndAltitude();

updateTableModel();
route.updateActiveLegAndPos(true /* force update */);
updateTableModel();

postChange(undoCommand);
NavApp::updateWindowTitle();
Expand Down Expand Up @@ -1118,8 +1118,8 @@ bool RouteController::calculateRouteInternal(RouteFinder *routeFinder, atools::f
route.updateAll();
updateAirwaysAndAltitude(!useSetAltitude /* adjustRouteAltitude */);

updateTableModel();
route.updateActiveLegAndPos(true /* force update */);
updateTableModel();

postChange(undoCommand);
NavApp::updateWindowTitle();
Expand Down Expand Up @@ -1252,8 +1252,8 @@ void RouteController::reverseRoute()
updateAirwaysAndAltitude();
updateStartPositionBestRunway(true /* force */, false /* undo */);

updateTableModel();
route.updateActiveLegAndPos(true /* force update */);
updateTableModel();

postChange(undoCommand);
NavApp::updateWindowTitle();
Expand Down Expand Up @@ -1336,8 +1336,8 @@ void RouteController::postDatabaseLoad()
flightplan.getDepartureParkingName().isEmpty())
updateStartPositionBestRunway(false, true);

updateTableModel();
route.updateActiveLegAndPos(true /* force update */);
updateTableModel();

NavApp::updateWindowTitle();
routeAltDelayTimer.start(ROUTE_ALT_CHANGE_DELAY_MS);
Expand Down Expand Up @@ -1882,6 +1882,7 @@ void RouteController::moveSelectedLegsInternal(MoveDirection direction)
// Get type and cruise altitude from widgets
updateFlightplanFromWidgets();

route.updateActiveLegAndPos(true /* force update */);
updateTableModel();

// Restore current position at new moved position
Expand All @@ -1890,7 +1891,6 @@ void RouteController::moveSelectedLegsInternal(MoveDirection direction)
select(rows, direction);

updateMoveAndDeleteActions();
route.updateActiveLegAndPos(true /* force update */);

postChange(undoCommand);
NavApp::updateWindowTitle();
Expand Down Expand Up @@ -1947,12 +1947,12 @@ void RouteController::deleteSelectedLegs()
// Get type and cruise altitude from widgets
updateFlightplanFromWidgets();

route.updateActiveLegAndPos(true /* force update */);
updateTableModel();

// Update current position at the beginning of the former selection
view->setCurrentIndex(model->index(firstRow, 0));
updateMoveAndDeleteActions();
route.updateActiveLegAndPos(true /* force update */);

postChange(undoCommand);
NavApp::updateWindowTitle();
Expand Down Expand Up @@ -2083,8 +2083,8 @@ void RouteController::routeSetDeparture(map::MapAirport airport)
// Get type and cruise altitude from widgets
updateFlightplanFromWidgets();

updateTableModel();
route.updateActiveLegAndPos(true /* force update */);
updateTableModel();

postChange(undoCommand);
NavApp::updateWindowTitle();
Expand Down Expand Up @@ -2135,8 +2135,8 @@ void RouteController::routeSetDestination(map::MapAirport airport)
// Get type and cruise altitude from widgets
updateFlightplanFromWidgets();

updateTableModel();
route.updateActiveLegAndPos(true /* force update */);
updateTableModel();

postChange(undoCommand);
NavApp::updateWindowTitle();
Expand Down Expand Up @@ -2223,8 +2223,8 @@ void RouteController::routeAttachProcedure(const proc::MapProcedureLegs& legs)
// Get type and cruise altitude from widgets
updateFlightplanFromWidgets();

updateTableModel();
route.updateActiveLegAndPos(true /* force update */);
updateTableModel();

postChange(undoCommand);
NavApp::updateWindowTitle();
Expand Down Expand Up @@ -2280,8 +2280,8 @@ void RouteController::routeAddInternal(const FlightplanEntry& entry, int insertI
// Get type and cruise altitude from widgets
updateFlightplanFromWidgets();

updateTableModel();
route.updateActiveLegAndPos(true /* force update */);
updateTableModel();

postChange(undoCommand);
NavApp::updateWindowTitle();
Expand Down Expand Up @@ -2395,8 +2395,8 @@ void RouteController::routeReplace(int id, atools::geo::Pos userPos, map::MapObj
// Get type and cruise altitude from widgets
updateFlightplanFromWidgets();

updateTableModel();
route.updateActiveLegAndPos(true /* force update */);
updateTableModel();

postChange(undoCommand);
NavApp::updateWindowTitle();
Expand Down

0 comments on commit 449cfa5

Please sign in to comment.