#include "Keyboard.h"
#include "traces.h"
+#include <navigation.h>
+
+#define NAVI_CONFIG_FILEPATH "/etc/naviconfig.ini"
+
#define DEFAULT_TEXT "Select your destination with Yelp !"
#define URL_AUTH "https://api.yelp.com/oauth2/token"
#define URL_AUTOCOMPLETE "https://api.yelp.com/v3/autocomplete"
networkManager(this),searchBtn(QIcon(tr(":/images/loupe-90.png")), tr(""), this),
lineEdit(this),keyboard(QRect(0, 688, COMPLETE_W_WITH_KB, 720), this),
mutex(QMutex::Recursive),token(""),currentSearchingText(""),currentSearchedText(""),
- pSearchReply(NULL),pInfoPanel(NULL),pResultList(NULL),currentLatitude(0.0),currentLongitude(0.0),
+ pSearchReply(NULL),pInfoPanel(NULL),pResultList(NULL),currentLatitude(36.136261),currentLongitude(-115.151254),
navicoreSession(0),currentIndex(0),fontId(-1),isInfoScreen(false),
isInputDisplayed(false),isKeyboard(false),isAglNavi(false)
{
lineEdit.setGeometry(QRect(LEFT_OFFSET + searchBtn.width() + SPACER, 0, lineEdit.width(), lineEdit.height()));
lineEdit.setVisible(false);
+
+ QFile file(NAVI_CONFIG_FILEPATH);
+ if (file.open(QIODevice::ReadOnly | QIODevice::Text))
+ {
+ QByteArray data = file.readAll();
+ QJsonDocument jsonDoc(QJsonDocument::fromJson(data));
+ QJsonObject jsonObj(jsonDoc.object());
+
+ if (jsonObj.contains("latitude"))
+ currentLatitude = jsonObj["latitude"].toDouble();
+
+ if (jsonObj.contains("longitude"))
+ currentLongitude = jsonObj["longitude"].toDouble();
+ }
+
/* We might need a Japanese font: */
QFile fontFile(":/fonts/DroidSansJapanese.ttf");
if (!fontFile.open(QIODevice::ReadOnly))