m_automaticUpdateIntervalTimer = new QTimer(this);
connect(m_automaticUpdateIntervalTimer, SIGNAL(timeout()),
- this, SLOT(automaticUpdateIntervalTimerTimeout()));
+ this, SLOT(startAutomaticUpdate()));
// signals connected, now it's time to show the main window
// but init the MapEngine before so starting location is set
initializeGpsAndAutocentering();
m_mce = new MCE(this);
- connect(m_mce, SIGNAL(displayOn(bool)), this, SLOT(displayOn(bool)));
+ connect(m_mce, SIGNAL(displayStateChanged(bool)), this, SLOT(displayStateChanged(bool)));
}
SituareEngine::~SituareEngine()
settings.setValue(SETTINGS_AUTO_CENTERING_ENABLED, m_autoCenteringEnabled);
}
-void SituareEngine::automaticUpdateIntervalTimerTimeout()
-{
- qDebug() << __PRETTY_FUNCTION__;
-
- m_gps->requestUpdate();
- m_automaticUpdateRequest = true;
-}
-
void SituareEngine::changeAutoCenteringSetting(bool enabled)
{
qDebug() << __PRETTY_FUNCTION__;
m_ui->buildInformationBox(tr("Auto centering disabled"));
}
-void SituareEngine::displayOn(bool on)
+void SituareEngine::displayStateChanged(bool enabled)
{
qDebug() << __PRETTY_FUNCTION__;
- m_gps->enablePowerSave(!on);
+ m_gps->enablePowerSave(!enabled);
if (m_autoCenteringEnabled)
- enableAutoCentering(on);
+ enableAutoCentering(enabled);
}
void SituareEngine::enableAutoCentering(bool enabled)
m_automaticUpdateIntervalTimer->setInterval(updateIntervalMsecs);
connect(m_gps, SIGNAL(position(QPointF,qreal)),
- this, SLOT(saveGPSPosition(QPointF)));
+ this, SLOT(requestAutomaticUpdateIfMoved(QPointF)));
m_automaticUpdateIntervalTimer->start();
} else {
disconnect(m_gps, SIGNAL(position(QPointF,qreal)),
- this, SLOT(saveGPSPosition(QPointF)));
+ this, SLOT(requestAutomaticUpdateIfMoved(QPointF)));
m_automaticUpdateIntervalTimer->stop();
}
m_situareService->updateLocation(m_mapEngine->centerGeoCoordinate(), status, publish);
}
-void SituareEngine::saveGPSPosition(QPointF position)
+void SituareEngine::requestAutomaticUpdateIfMoved(QPointF position)
{
qDebug() << __PRETTY_FUNCTION__;
}
if (m_automaticUpdateRequest && m_userMoved) {
- requestUpdateLocation(tr("Automatic location update"));
+ requestUpdateLocation(tr("Automatic location update."));
m_automaticUpdateRequest = false;
m_userMoved = false;
}
m_ui, SIGNAL(clearUpdateLocationDialogData()));
}
+void SituareEngine::startAutomaticUpdate()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ m_gps->requestUpdate();
+ m_automaticUpdateRequest = true;
+}
+
void SituareEngine::updateWasSuccessful()
{
qDebug() << __PRETTY_FUNCTION__;