m_userMoved(false),
m_automaticUpdateIntervalTimer(0),
m_lastUpdatedGPSPosition(QPointF())
-{
+{
qDebug() << __PRETTY_FUNCTION__;
m_ui = new MainWindow;
m_ui->updateItemVisibility();
void SituareEngine::error(const int error)
{
- qDebug() << __PRETTY_FUNCTION__;
+ qDebug() << __PRETTY_FUNCTION__;
switch(error)
{
case QNetworkReply::ConnectionRefusedError:
+ m_ui->toggleProgressIndicator(false);
m_ui->buildInformationBox(tr("Connection refused by the server"), true);
break;
case QNetworkReply::RemoteHostClosedError:
+ m_ui->toggleProgressIndicator(false);
m_ui->buildInformationBox(tr("Connection closed by the server"), true);
break;
case QNetworkReply::HostNotFoundError:
+ m_ui->toggleProgressIndicator(false);
m_ui->buildInformationBox(tr("Remote server not found"), true);
break;
case QNetworkReply::TimeoutError:
+ m_ui->toggleProgressIndicator(false);
m_ui->buildInformationBox(tr("Connection timed out"), true);
break;
case SituareError::SESSION_EXPIRED:
m_ui->loginFailed();
break;
case SituareError::LOGIN_FAILED:
+ m_ui->toggleProgressIndicator(false);
m_ui->buildInformationBox(tr("Invalid E-mail address or password"), true);
+ m_ui->loginFailed();
break;
case SituareError::UPDATE_FAILED:
+ m_ui->toggleProgressIndicator(false);
m_ui->buildInformationBox(tr("Update failed, please try again"), true);
break;
case SituareError::DATA_RETRIEVAL_FAILED:
+ m_ui->toggleProgressIndicator(false);
m_ui->buildInformationBox(tr("Data retrieval failed, please try again"), true);
break;
case SituareError::ADDRESS_RETRIEVAL_FAILED:
m_ui->buildInformationBox(tr("GPS initialization failed"), true);
break;
case SituareError::UNKNOWN_REPLY:
+ m_ui->toggleProgressIndicator(false);
m_ui->buildInformationBox(tr("Unknown server response"), true);
break;
case SituareError::INVALID_JSON:
m_facebookAuthenticator->clearAccountInformation(false); // clean all
break;
default:
+ m_ui->toggleProgressIndicator(false);
qCritical() << "QNetworkReply::NetworkError :" << error;
break;
}
Q_UNUSED(latLonCoordinate);
Q_UNUSED(accuracy);
- if (m_autoCenteringEnabled) // autocentering is disabled when map is scrolled
+ if (m_autoCenteringEnabled) // autocentering is disabled when map is scrolled
m_mapEngine->setZoomLevel(DEFAULT_ZOOM_LEVEL_WHEN_GPS_IS_AVAILABLE);
disconnect(m_gps, SIGNAL(position(QPointF,qreal)),
connect(m_facebookAuthenticator, SIGNAL(newLoginRequest()),
m_ui, SLOT(startLoginProcess()));
- connect(m_facebookAuthenticator, SIGNAL(loginFailure()),
- m_ui, SLOT(loginFailed()));
-
connect(m_facebookAuthenticator, SIGNAL(saveCookiesRequest()),
m_ui, SLOT(saveCookies()));
void SituareEngine::signalsFromMainWindow()
{
- qDebug() << __PRETTY_FUNCTION__;
+ qDebug() << __PRETTY_FUNCTION__;
connect(m_ui, SIGNAL(error(int)),
this, SLOT(error(int)));
// signals from map view
connect(m_ui, SIGNAL(mapViewScrolled(QPoint)),
- m_mapEngine, SLOT(setLocation(QPoint)));
+ m_mapEngine, SLOT(setCenterPosition(QPoint)));
connect(m_ui, SIGNAL(mapViewResized(QSize)),
m_mapEngine, SLOT(viewResized(QSize)));
this, SLOT(requestUpdateLocation(QString,bool)));
connect(m_ui, SIGNAL(enableAutomaticLocationUpdate(bool, int)),
- this, SLOT(enableAutomaticLocationUpdate(bool, int)));
+ this, SLOT(enableAutomaticLocationUpdate(bool, int)));
// signals from user info tab
connect(m_ui, SIGNAL(refreshUserData()),
this, SLOT(refreshUserData()));
connect(m_ui, SIGNAL(findUser(QPointF)),
- m_mapEngine, SLOT(setViewLocation(QPointF)));
+ m_mapEngine, SLOT(centerToCoordinates(QPointF)));
// signals from friend list tab
connect(m_ui, SIGNAL(findFriend(QPointF)),
- m_mapEngine, SLOT(setViewLocation(QPointF)));
+ m_mapEngine, SLOT(centerToCoordinates(QPointF)));
}
void SituareEngine::signalsFromMapEngine()
qDebug() << __PRETTY_FUNCTION__;
m_ui->toggleProgressIndicator(false);
+ m_ui->showPanels();
emit userLocationReady(user);
emit friendsLocationsReady(friendsList);