+ disconnect(m_gps, SIGNAL(position(GeoCoordinate, qreal)),
+ this, SLOT(setFirstStartZoomLevel()));
+}
+
+void SituareEngine::setGPS(bool enabled)
+{
+ qDebug() << __PRETTY_FUNCTION__ << enabled;
+
+ if (m_gps->isInitialized()) {
+ m_ui->setGPSButtonEnabled(enabled);
+ m_mapEngine->setGPSEnabled(enabled);
+
+ if (enabled && !m_gps->isRunning()) {
+ m_gps->start();
+ m_gps->requestLastPosition();
+
+ if(m_facebookAuthenticator->isLoggedIn())
+ m_ui->readAutomaticLocationUpdateSettings();
+ }
+ else if (!enabled && m_gps->isRunning()) {
+ m_gps->stop();
+ changeAutoCenteringSetting(false);
+ enableAutomaticLocationUpdate(false);
+ }
+ }
+ else {
+ if (enabled)
+ m_ui->buildInformationBox(tr("Unable to start GPS"));
+ m_ui->setGPSButtonEnabled(false);
+ m_mapEngine->setGPSEnabled(false);
+ }
+}
+
+void SituareEngine::setPowerSaving(bool enabled)
+{
+ qDebug() << __PRETTY_FUNCTION__ << enabled;
+
+ m_gps->enablePowerSave(enabled);
+
+ if(m_autoCenteringEnabled)
+ m_mapEngine->setAutoCentering(!enabled);
+}
+
+void SituareEngine::showContactDialog(const QString &facebookId)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ QString guid = m_contactManager->contactGuid(facebookId);
+
+ if (!guid.isEmpty())
+ m_ui->showContactDialog(guid);
+ else
+ m_ui->buildInformationBox(tr("Unable to find contact.\nAdd Facebook IM "
+ "account from Conversations to use this feature."), true);