From 265c3e565051f58da43ff55280f9c8fa07b605ce Mon Sep 17 00:00:00 2001 From: lampehe-local Date: Wed, 23 Jun 2010 13:57:26 +0300 Subject: [PATCH] Grouped few errors, added error message translations. Fixed userinfo panel's message field. Reviewed by: Katri Kaikkonen --- res/languages/situare_fi.qm | Bin 4978 -> 5331 bytes res/languages/situare_fi.ts | 127 ++++++++++++++++++++++++++++--------------- src/engine/engine.cpp | 19 +++---- src/ui/userinfo.cpp | 26 ++++----- 4 files changed, 101 insertions(+), 71 deletions(-) diff --git a/res/languages/situare_fi.qm b/res/languages/situare_fi.qm index 7161474ea9fd266adae2d7b12ee3cb570ddb09e7..410ef3b391e8b4192698f7498a0774ac103fbf7f 100644 GIT binary patch delta 690 zcmX|+T}TvR6o%jZo7tJ2{Z$hRWz|qB3W>~{tuVVu3Z+fDkf;sE8q%3SBJC8V z>N-FDL*S`s>g+UC%Zgj7nN`iWZrE|wX+!VS^o!1vzuZ|7SDh|@rIQa-I0;d5n!S~U zSN`3?xr1m!j-fNwh_JDYIMT>4Y{o|3s8cX`dI-09)3(@^CpF6=C7w>1sUFoPzRNUv z$iI?NEqeoASPgZ!TI+F|QaZ;~%A}YLR-4k@$nv$D?sVQX0xm(_LX@`amv!T+{@Q@*Tcq195?(Sn?;FMzWyd})Qz|h6iTntplvXVJr$z=uxK5ypl zo~=N73rlD9B?bl_KUULcM}YQBWu2-F)K|~DgUxHw69xwEZR~=|K#hV1>`NvA6|i04 zaIW74H1Is9>|=JI0|hv{wtF!!@NeT>v>7PRv4iuQQxcH2;o{zL6=-28m-xvg3=Hf} zTxEx%feyFiT4(nQ=-{hdTU)mPX-BT@qEi?cxL$Fc{|w|aGxKmizrs+@z_pS`@3kn< zhp9Y80j5BUGI>^304?VK#j~5S7-+B!l)lIF{v6Q9Jhylg*R=p09L)RpWDwB8vwX{^ zngAUf%(o@j9~csw`Gwl~fDX99ueR+D&|GPL?U#x`k1+6OChq}KZv4B#{D3^|OrUQW zZ*E@27|u4ifaCq diff --git a/res/languages/situare_fi.ts b/res/languages/situare_fi.ts index 9cefcee..487c306 100644 --- a/res/languages/situare_fi.ts +++ b/res/languages/situare_fi.ts @@ -4,12 +4,12 @@ FriendListPanel - + Show all Näytä kaikki - + Selected: %1 Valittu: %1 @@ -59,53 +59,53 @@ MainWindow - + Automatic location update Automaattinen paikan päivitys - + Situare Situare - - + + Login Kirjaudu - + Settings Asetukset - + GPS GPS - + Auto centering Automaattinen keskitys - + Main Päävalikko - + Menu Valikko - + GPS timeout GPS pyyntö aikakatkaistiin - + Logout Kirjaudu ulos @@ -146,18 +146,18 @@ Asetukset - + Use automatic location update Sijainnin automaattinen päivitys - - + + Update interval Päivitysväli - + %1 min %1 min @@ -165,112 +165,151 @@ SituareEngine - + Auto centering disabled Automaattinen keskitys pois päältä - + Unable to start GPS GPS käynnistys epäonnistui - + Do you want to enable automatic location update with %1 min update interval? Asetetaanko automaattinen paikan päivitys %1 minuutin välein päälle? - + Automatic location update enabled Automaattinen paikan päivitys päällä - + + Unknown server error + Tuntematon palvelinvirhe + + + Missing argument from request + Pyynnöstä puuttuu parametri + + + + Missing parameter from request + Pyynnöstä puuttuu parametri + + + Connection refused by the server Palvelin ei vastaa pyyntöihin - + Connection closed by the server Palvelin sulki yhteyden - + Remote server not found Palvelinta ei löydy - + Connection timed out Yhteys aikakatkaistiin - + Session expired. Please login again Istunto vanhentunut. Kirjaudu uudelleen - + Invalid E-mail address or password Virheellinen sähköpostiosoite tai salasana - + Update failed, please try again Päivitys epäonnistui. Yritä uudelleen - + Data retrieval failed, please try again Tiedon haku epäonnistui. Yritä uudelleen - + Address retrieval failed Osoitteen haku epäonnistui - + Malformatted reply from server Viallisesti muotoiltu serverin vastaus + + Address server not responding + Osoitepalvelin ei vastaa + + + + Automatic location update + Automaattinen paikan päivitys + + + Geolocation server not responding + Geolokaatio serveri ei vastaa + + + Geolocation request failed, please try again + Geolokaatio pyyntö epäonnistui.Yritä uudelleen + + + Invalid lat/lon value, please try again + Virheellinen lat/lon arvo. Yritä uudelleen + + + Automatic location update. + Automaattinen paikkatiedon päivitys. + + Address retrieval failed, please try again Osoitteen haku epäonnistui. Yritä uudelleen - + Image download failed Kuvan haku epäonnistui - + Map image download failed Karttakuvan lataaminen epäonnistui - + GPS initialization failed GPS alustus epäonnistui - Unknown server response - Tuntematon vastaus palvelimelta + Tuntematon vastaus palvelimelta JSON parsing failed, invalid JSON string Virheellinen JSON, parsiminen epäonnistui - - + + GPS enabled GPS päällä - - + + Auto centering enabled Automaattinen keskitys päällä @@ -283,12 +322,12 @@ Päivitä sijainti - + Publish on Facebook Julkaise Facebookissa - + Send Lähetä @@ -298,7 +337,7 @@ Sijainti: - + Message: Viesti: @@ -313,7 +352,7 @@ Your message is saved to textbox until sending will succeed Sijainnin päivitys epäonnistui\n\nVistisi on tallennettu kunnes pävitys on onnistunut - + Location update failed, please try again Paikkatiedon päivitys epäonnistui, yritä uudelleen diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index 02cec5f..71ce105 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -230,10 +230,10 @@ void SituareEngine::error(const int context, const int error) m_ui->buildInformationBox(tr("Unknown server error"), true); } break; - case SituareError::ERROR_MISSING_ARGUMENT | QNetworkReply::ConnectionRefusedError : + case 1: //errors: SituareError::ERROR_MISSING_ARGUMENT and QNetworkReply::ConnectionRefusedError m_ui->toggleProgressIndicator(false); if(context == ErrorContext::SITUARE) { - m_ui->buildInformationBox(tr("Missing argument from request"), true); + m_ui->buildInformationBox(tr("Missing parameter from request"), true); } else if(context == ErrorContext::NETWORK) { m_ui->buildInformationBox(tr("Connection refused by the server"), true); } @@ -277,6 +277,9 @@ void SituareEngine::error(const int context, const int error) m_ui->buildInformationBox(tr("Data retrieval failed, please try again"), true); break; case SituareError::ADDRESS_RETRIEVAL_FAILED: + case SituareError::ERROR_GEOLOCATION_REQUEST_FAIL: + case SituareError::ERROR_GEOLOCATION_LONLAT_INVALID: + m_ui->toggleProgressIndicator(false); m_ui->buildInformationBox(tr("Address retrieval failed"), true); break; case SituareError::IMAGE_DOWNLOAD_FAILED: @@ -296,15 +299,7 @@ void SituareEngine::error(const int context, const int error) break; case SituareError::ERROR_GEOLOCATION_SERVER_UNAVAILABLE: m_ui->toggleProgressIndicator(false); - m_ui->buildInformationBox(tr("Geolocation server not responding"), true); - break; - case SituareError::ERROR_GEOLOCATION_REQUEST_FAIL: - m_ui->toggleProgressIndicator(false); - m_ui->buildInformationBox(tr("Geolocation request failed, please try again"), true); - break; - case SituareError::ERROR_GEOLOCATION_LONLAT_INVALID: - m_ui->toggleProgressIndicator(false); - m_ui->buildInformationBox(tr("Invalid lat/lon value, please try again"), true); + m_ui->buildInformationBox(tr("Address server not responding"), true); break; default: m_ui->toggleProgressIndicator(false); @@ -453,7 +448,7 @@ void SituareEngine::requestAutomaticUpdateIfMoved(QPointF position) } if (m_automaticUpdateRequest && m_userMoved) { - requestUpdateLocation(tr("Automatic location update.")); + requestUpdateLocation(tr("Automatic location update")); m_automaticUpdateRequest = false; m_userMoved = false; } diff --git a/src/ui/userinfo.cpp b/src/ui/userinfo.cpp index d52780b..1e2a59e 100644 --- a/src/ui/userinfo.cpp +++ b/src/ui/userinfo.cpp @@ -169,23 +169,19 @@ void UserInfo::setMessageText(const QString &text) qDebug() << __PRETTY_FUNCTION__; m_messageText = text; - m_expandedMessageText = text; - int textWidth = fontMetrics().width(m_expandedMessageText); - - if (textWidth > 150){ - QStringList words = m_expandedMessageText.split(" "); - - for (int i = 0; i < words.count();i++){ - QString temp = words.at(i); - - if(temp.length() >= LINE_LENGTH) { - temp.insert(LINE_LENGTH,QString("\n")); - words.replace(i,temp); - } + m_expandedMessageText.clear(); + QString temp = ""; + for(int i=0;i < text.length();i++) { + if(fontMetrics().width(temp.append(text.at(i))) > 170) { + temp.append("\n"); + if(temp.startsWith(QString(" "))) + temp.remove(0, 1); + + m_expandedMessageText.append(temp); + temp.clear(); } - m_expandedMessageText = words.join(" "); } - + m_expandedMessageText.append(temp); setText(false); } -- 1.7.9.5