summaryrefslogtreecommitdiffstats
path: root/MainApp.h
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2020-01-03 17:41:32 -0500
committerScott Murray <scott.murray@konsulko.com>2020-01-03 17:52:48 -0500
commita9790cc158955cb6774e662432bddcbd66274130 (patch)
tree0d2fcc56d2b8f2270948249f69c4f11e9318e03c /MainApp.h
parent15a79164e5bb3dd51185371a17d9ae8b48b40a85 (diff)
Rework to raise navigation app and improve behavioricefish_8.99.5icefish/8.99.58.99.5
Add callback to raise navigation app via homescreen and hook it up to the "Go" button handling. Additionally, testing of this addition revealed that the result list and information panel state is fragile and easily gotten into a bad state with respect to repaints when raising the navigation app. To fix this, the code has been reworked to change InfoPanel into an actual widget and keep it and the result list widget around; manipulating their visibilty rather than recreating them and forcing whole-window repaints. As well, a slight delay is used before raising the navigation app to let all repaints finish. Ideally this would not be required, but the app likely needs a more significant rewrite to fix it. Bug-AGL: SPEC-3079 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: Id8dce33e2a2135179644305a88b340ecd1d7d3c5
Diffstat (limited to 'MainApp.h')
-rw-r--r--MainApp.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/MainApp.h b/MainApp.h
index 7d0b9de..909f68c 100644
--- a/MainApp.h
+++ b/MainApp.h
@@ -14,6 +14,8 @@
#include <navigation.h>
+typedef void (*NavWinRaiseCb_t)(void);
+
class MainApp: public QMainWindow
{
Q_OBJECT
@@ -25,6 +27,7 @@ class MainApp: public QMainWindow
int StartMonitoringUserInput();
void setInfoScreen(bool val) { isInfoScreen = val; }
void setKeyboard(bool val) { isKeyboard = val; }
+ void setNavWindowRaiseCallback(NavWinRaiseCb_t val) { navWinRaiseCb = val; }
private:
void ParseJsonBusinessList(const char* buf, std::vector<Business> & Output);
@@ -33,12 +36,13 @@ class MainApp: public QMainWindow
void SetDestination(int index = 0);
bool IsCoordinatesConsistent(Business & business);
void DisplayLineEdit(bool display = true);
- void DisplayResultList(bool display, bool RefreshDisplay = true);
- void DisplayInformation(bool display, bool RefreshDisplay = true);
+ void DisplayResultList(bool display);
+ void DisplayInformation(bool display);
int FillResultList(std::vector<Business> & list, int focusIndex = 0);
void SetWayPoints(uint32_t myRoute);
Navigation *naviapi;
+ NavWinRaiseCb_t navWinRaiseCb = nullptr;
QNetworkAccessManager networkManager;
QPushButton searchBtn;
QLineEdit lineEdit;
@@ -81,6 +85,10 @@ class MainApp: public QMainWindow
void UpdateAglSurfaces();
void goClicked();
void cancelClicked();
+ void callNavWinRaiseCb() {
+ if(navWinRaiseCb)
+ navWinRaiseCb();
+ }
void positionGot();