{
case SituareError::ERROR_GENERAL:
if(context == ErrorContext::SITUARE) {
- m_ui->toggleProgressIndicator(false);
+ //m_ui->toggleProgressIndicator(false);
m_ui->buildInformationBox(tr("Unknown server error"), true);
}
break;
case 1: //errors: SituareError::ERROR_MISSING_ARGUMENT and QNetworkReply::ConnectionRefusedError
- m_ui->toggleProgressIndicator(false);
+ //m_ui->toggleProgressIndicator(false);
if(context == ErrorContext::SITUARE) {
m_ui->buildInformationBox(tr("Missing parameter from request"), true);
} else if(context == ErrorContext::NETWORK) {
break;
case QNetworkReply::RemoteHostClosedError:
if(context == ErrorContext::NETWORK) {
- m_ui->toggleProgressIndicator(false);
+ //m_ui->toggleProgressIndicator(false);
m_ui->buildInformationBox(tr("Connection closed by the server"), true);
}
break;
case QNetworkReply::HostNotFoundError:
if(context == ErrorContext::NETWORK) {
- m_ui->toggleProgressIndicator(false);
+ //m_ui->toggleProgressIndicator(false);
m_ui->buildInformationBox(tr("Remote server not found"), true);
}
break;
case QNetworkReply::TimeoutError:
if(context == ErrorContext::NETWORK) {
- m_ui->toggleProgressIndicator(false);
+ //m_ui->toggleProgressIndicator(false);
m_ui->buildInformationBox(tr("Connection timed out"), true);
}
break;
case QNetworkReply::UnknownNetworkError:
if(context == ErrorContext::NETWORK) {
- m_ui->toggleProgressIndicator(false);
+ //m_ui->toggleProgressIndicator(false);
m_ui->buildInformationBox(tr("No network connection"), true);
}
break;
m_ui->loginFailed();
break;
case SituareError::LOGIN_FAILED:
- m_ui->toggleProgressIndicator(false);
+ //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->toggleProgressIndicator(false);
m_ui->buildInformationBox(tr("Update failed, please try again"), true);
break;
case SituareError::DATA_RETRIEVAL_FAILED:
- m_ui->toggleProgressIndicator(false);
+ //m_ui->toggleProgressIndicator(false);
m_ui->buildInformationBox(tr("Data retrieval failed, please try again"), true);
break;
case SituareError::ADDRESS_RETRIEVAL_FAILED:
- m_ui->toggleProgressIndicator(false);
+ //m_ui->toggleProgressIndicator(false);
m_ui->buildInformationBox(tr("Address retrieval failed"), true);
break;
case SituareError::IMAGE_DOWNLOAD_FAILED:
m_facebookAuthenticator->clearAccountInformation(false); // clean all
break;
case SituareError::ERROR_ROUTING_FAILED:
- m_ui->toggleProgressIndicator(false);
+ //m_ui->toggleProgressIndicator(false);
m_ui->buildInformationBox(tr("Routing failed"), true);
break;
case SituareError::ERROR_LOCATION_SEARCH_FAILED:
m_ui->buildInformationBox(tr("No results found"), true);
break;
default:
- m_ui->toggleProgressIndicator(false);
+ //m_ui->toggleProgressIndicator(false);
if(context == ErrorContext::NETWORK)
qCritical() << __PRETTY_FUNCTION__ << "QNetworkReply::NetworkError: " << error;
else
qDebug() << __PRETTY_FUNCTION__;
if (m_networkAccessManager->isConnected()) {
- m_ui->toggleProgressIndicator(true);
m_situareService->fetchLocations();
}
else {
qDebug() << __PRETTY_FUNCTION__;
if (m_networkAccessManager->isConnected()) {
- m_ui->toggleProgressIndicator(true);
if (m_gps->isRunning())
m_situareService->updateLocation(m_gps->lastPosition(), status, publish);
qDebug() << __PRETTY_FUNCTION__;
Q_UNUSED(route);
-
- m_ui->toggleProgressIndicator(false);
}
void SituareEngine::routeTo(const GeoCoordinate &endPointCoordinates)
{
qDebug() << __PRETTY_FUNCTION__;
- m_ui->toggleProgressIndicator(true);
-
if (m_gps->isRunning())
m_routingService->requestRoute(m_gps->lastPosition(), endPointCoordinates);
else
m_mapEngine->setAutoCentering(!enabled);
}
+void SituareEngine::setProgressIndicatorDisabled()
+{
+ m_ui->toggleProgressIndicator(false);
+}
+
+void SituareEngine::setProgressIndicatorEnabled()
+{
+ m_ui->toggleProgressIndicator(true);
+}
+
void SituareEngine::showContactDialog(const QString &facebookId)
{
qDebug() << __PRETTY_FUNCTION__;
this, SLOT(requestAddress()));
connect(m_ui, SIGNAL(statusUpdate(QString,bool)),
+ this, SLOT(setProgressIndicatorEnabled()));
+
+ connect(m_ui, SIGNAL(statusUpdate(QString,bool)),
this, SLOT(requestUpdateLocation(QString,bool)));
connect(m_ui, SIGNAL(enableAutomaticLocationUpdate(bool, int)),
this, SLOT(enableAutomaticLocationUpdate(bool, int)));
connect(m_ui, SIGNAL(addTags(QStringList)),
+ this, SLOT(setProgressIndicatorEnabled()));
+
+ connect(m_ui, SIGNAL(addTags(QStringList)),
m_situareService, SLOT(addTags(QStringList)));
connect(m_ui, SIGNAL(removeTags(QStringList)),
+ this, SLOT(setProgressIndicatorEnabled()));
+
+ connect(m_ui, SIGNAL(removeTags(QStringList)),
m_situareService, SLOT(removeTags(QStringList)));
// signals from user info tab
connect(m_ui, SIGNAL(refreshUserData()),
+ this, SLOT(setProgressIndicatorEnabled()));
+
+ connect(m_ui, SIGNAL(refreshUserData()),
this, SLOT(refreshUserData()));
connect(m_ui, SIGNAL(centerToCoordinates(GeoCoordinate)),
m_mapEngine, SLOT(centerToCoordinates(GeoCoordinate)));
connect(m_ui, SIGNAL(requestPopularTags()),
+ this, SLOT(setProgressIndicatorEnabled()));
+
+ connect(m_ui, SIGNAL(requestPopularTags()),
m_situareService, SLOT(fetchPopularTags()));
// routing signal from friend list tab & search location tab
+ connect(m_ui, SIGNAL(routeTo(GeoCoordinate)),
+ this, SLOT(setProgressIndicatorEnabled()));
+
connect(m_ui, SIGNAL(routeTo(const GeoCoordinate&)),
this, SLOT(routeTo(const GeoCoordinate&)));
this, SLOT(locationSearch(QString)));
connect(m_ui, SIGNAL(requestSearchPeopleByTag(QString)),
+ this, SLOT(setProgressIndicatorEnabled()));
+
+ connect(m_ui, SIGNAL(requestSearchPeopleByTag(QString)),
m_situareService, SLOT(searchPeopleByTag(QString)));
// signals from meet people panel
connect(m_ui, SIGNAL(requestInterestingPeople()),
+ this, SLOT(setProgressIndicatorEnabled()));
+
+ connect(m_ui, SIGNAL(requestInterestingPeople()),
this, SLOT(requestInterestingPeople()));
connect(m_ui, SIGNAL(requestMessageDialog(QPair<QString, QString>)),
this, SLOT(showMessageDialog(QPair<QString, QString>)));
connect(m_ui, SIGNAL(sendMessage(QString,QString,bool)),
+ this, SLOT(setProgressIndicatorEnabled()));
+
+ connect(m_ui, SIGNAL(sendMessage(QString,QString,bool)),
this, SLOT(requestSendMessage(QString,QString,bool)));
// signals from message panel
connect(m_ui, SIGNAL(requestMessages()),
+ this, SLOT(setProgressIndicatorEnabled()));
+
+ connect(m_ui, SIGNAL(requestMessages()),
m_situareService, SLOT(fetchMessages()));
connect(m_ui, SIGNAL(requestRemoveMessage(QString)),
+ this, SLOT(setProgressIndicatorEnabled()));
+
+ connect(m_ui, SIGNAL(requestRemoveMessage(QString)),
m_situareService, SLOT(removeMessage(QString)));
}
qDebug() << __PRETTY_FUNCTION__;
connect(m_routingService, SIGNAL(routeParsed(Route&)),
- this, SLOT(routeParsed(Route&)));
+ this, SLOT(setProgressIndicatorDisabled()));
connect(m_routingService, SIGNAL(routeParsed(Route&)),
m_mapEngine, SLOT(setRoute(Route&)));
connect(m_situareService, SIGNAL(reverseGeoReady(QString)),
m_ui, SIGNAL(reverseGeoReady(QString)));
+ connect(m_situareService, SIGNAL(userDataChanged(User*,QList<User*>&)),
+ this, SLOT(setProgressIndicatorDisabled()));
+
connect(m_situareService, SIGNAL(userDataChanged(User*, QList<User*>&)),
this, SLOT(userDataChanged(User*, QList<User*>&)));
connect(m_situareService, SIGNAL(updateWasSuccessful(SituareService::SuccessfulMethod)),
- this, SLOT(updateWasSuccessful(SituareService::SuccessfulMethod)));
+ m_ui, SIGNAL(clearUpdateLocationDialogData()));
connect(m_situareService, SIGNAL(updateWasSuccessful(SituareService::SuccessfulMethod)),
- m_ui, SIGNAL(clearUpdateLocationDialogData()));
+ this, SLOT(updateWasSuccessful(SituareService::SuccessfulMethod)));
connect(m_situareService, SIGNAL(interestingPeopleReceived(QList<User>&,QList<User>&)),
m_ui, SIGNAL(interestingPeopleReceived(QList<User>&,QList<User>&)));
+ connect(m_situareService, SIGNAL(interestingPeopleReceived(QList<User>&,QList<User>&)),
+ this, SLOT(setProgressIndicatorDisabled()));
+
+ connect(m_situareService, SIGNAL(messagesReceived(QList<Message>&, QList<Message> &)),
+ this, SLOT(setProgressIndicatorDisabled()));
+
+
connect(m_situareService, SIGNAL(messagesReceived(QList<Message>&, QList<Message> &)),
m_ui, SIGNAL(messagesReceived(QList<Message>&, QList<Message>&)));
connect(m_situareService, SIGNAL(popularTagsReceived(QHash<QString,QString>&)),
+ this, SLOT(setProgressIndicatorDisabled()));
+
+ connect(m_situareService, SIGNAL(popularTagsReceived(QHash<QString,QString>&)),
m_ui, SIGNAL(popularTagsReceived(QHash<QString,QString>&)));
}
void SituareEngine::updateWasSuccessful(SituareService::SuccessfulMethod successfulMethod)
{
- qWarning() << __PRETTY_FUNCTION__;
+ qDebug() << __PRETTY_FUNCTION__;
if (m_networkAccessManager->isConnected()) {
if (successfulMethod == SituareService::SuccessfulUpdateLocation)
{
qDebug() << __PRETTY_FUNCTION__;
- m_ui->toggleProgressIndicator(false);
-
emit userLocationReady(user);
emit friendsLocationsReady(friendsList);
}