From 2209923153d4bef375b15e777c2f47db955648f0 Mon Sep 17 00:00:00 2001 From: Liran BN Date: Mon, 13 Oct 2014 17:11:57 +0300 Subject: [PATCH] locale, statusbar locale: english as default statusbar: progressbar dissappear at 100% --- main/jceWidgets/jcestatusbar.cpp | 2 +- main/main.cpp | 13 +++++++------ src/appDatabase/savedata.cpp | 6 +++--- src/jceSettings/jcelogin.cpp | 3 --- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/main/jceWidgets/jcestatusbar.cpp b/main/jceWidgets/jcestatusbar.cpp index e4f060b..4c7a741 100644 --- a/main/jceWidgets/jcestatusbar.cpp +++ b/main/jceWidgets/jcestatusbar.cpp @@ -111,7 +111,7 @@ void jceStatusBar::setIconConnectionStatus(jceProgressStatus update) */ void jceStatusBar::setProgressValue(int value) { - if (value == 0) + if (value == 0 || value == 100) { progressBar->setVisible(false); progressBar->setValue(0); diff --git a/main/main.cpp b/main/main.cpp index 8901e01..7e82ce7 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -7,6 +7,7 @@ //TODO: Project todo list //update translation, update site spelling, release notes, update help +//BUG: fix locale on windows int main(int argc, char *argv[]) { #ifdef QT_DEBUG // Incase QtCreator is in Debug mode all qDebug messages will go to terminal @@ -24,17 +25,17 @@ int main(int argc, char *argv[]) SaveData data; loco = data.getLocal(); //Loading Local (From Settings file (SaveData.cpp) - if(loco == "default") + if(loco == "en") { - QString locale = QLocale::system().name(); - translator.load("jce_"+locale , a.applicationDirPath()); - qDebug() << Q_FUNC_INFO << "Local : Default Local Loaded"; + translator.load("jce_" + loco , a.applicationDirPath()); + qDebug() << Q_FUNC_INFO << "Locale : English Local Loaded"; }else if(loco == "he"){ - translator.load("jce_he" , a.applicationDirPath()); + translator.load("jce_" + loco , a.applicationDirPath()); qDebug() << Q_FUNC_INFO << "Local : Hebrew Local Loaded"; }else{ translator.load("jce_en" , a.applicationDirPath()); - qDebug() << Q_FUNC_INFO << "Local : English Local Loaded"; + data.reset(); + qCritical() << Q_FUNC_INFO << "save data corrupted, rested file."; } a.installTranslator(&translator); //Setting local a.setApplicationVersion(APP_VERSION); diff --git a/src/appDatabase/savedata.cpp b/src/appDatabase/savedata.cpp index bb0e439..dee5476 100644 --- a/src/appDatabase/savedata.cpp +++ b/src/appDatabase/savedata.cpp @@ -88,7 +88,7 @@ void SaveData::setCal(QString cal) */ void SaveData::setLocal(QString local) { - DB.insert("local", local); + DB.insert("locale", local); save(); } @@ -116,7 +116,7 @@ QString SaveData::getPassword() */ QString SaveData::getLocal() { - return DB.value("local"); + return DB.value("locale"); } /** @@ -160,7 +160,7 @@ void SaveData::createDB() { DB.insert("username", ""); DB.insert("password", ""); - DB.insert("local", "default"); + DB.insert("locale", "en"); DB.insert("calendar", ""); } diff --git a/src/jceSettings/jcelogin.cpp b/src/jceSettings/jcelogin.cpp index 8bdad6f..7819b46 100644 --- a/src/jceSettings/jcelogin.cpp +++ b/src/jceSettings/jcelogin.cpp @@ -152,9 +152,6 @@ void jceLogin::reMakeConnection() */ int jceLogin::makeFirstVisit() { - QString usr = jceA->getUsername(); - QString psw = jceA->getPassword(); - if (JceConnector->sendData(jceLoginHtmlScripts::makeRequest(jceLoginHtmlScripts::getFirstValidationStep(*jceA)))) { if (!JceConnector->recieveData(recieverPage))