From 36a3c5c99da3986bc93860bf453f9771ee8930ce Mon Sep 17 00:00:00 2001 From: Jussi Laitinen Date: Tue, 8 Jun 2010 15:54:43 +0300 Subject: [PATCH] Added debug prints to SettingsDialog. --- src/engine/engine.cpp | 10 +++++----- src/src.pro | 2 +- src/ui/mainwindow.cpp | 5 +++-- src/ui/settingsdialog.cpp | 8 +++++--- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index 5507c5a..338a721 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -176,8 +176,8 @@ void SituareEngine::enableAutomaticLocationUpdate(bool enabled, int updateInterv bool accepted = false; if (m_automaticUpdateFirstStart && enabled) { - m_automaticUpdateFirstStart = false; accepted = m_ui->showEnableAutomaticUpdateLocationDialog(); + m_automaticUpdateFirstStart = false; m_ui->automaticLocationUpdateEnabled(accepted); } else { @@ -190,10 +190,10 @@ void SituareEngine::enableAutomaticLocationUpdate(bool enabled, int updateInterv if (m_automaticUpdateIntervalTimer) { if (enabled && m_gps->isRunning()) { - if (updateIntervalMsecs < MIN_UPDATE_INTERVAL_MSECS) - m_automaticUpdateIntervalTimer->setInterval(MIN_UPDATE_INTERVAL_MSECS); - else - m_automaticUpdateIntervalTimer->setInterval(updateIntervalMsecs); +// if (updateIntervalMsecs < MIN_UPDATE_INTERVAL_MSECS) +// m_automaticUpdateIntervalTimer->setInterval(MIN_UPDATE_INTERVAL_MSECS); +// else + m_automaticUpdateIntervalTimer->setInterval(updateIntervalMsecs / 60); m_automaticUpdateIntervalTimer->start(); } else diff --git a/src/src.pro b/src/src.pro index d48615b..10e7c8a 100644 --- a/src/src.pro +++ b/src/src.pro @@ -98,7 +98,7 @@ HEADERS += ui/mainwindow.h \ QT += network \ webkit -#DEFINES += QT_NO_DEBUG_OUTPUT +DEFINES += QT_NO_DEBUG_OUTPUT simulator { SOURCES += network/networkhandlerprivatestub.cpp \ diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 012d5e6..8e938ba 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -757,12 +757,13 @@ void MainWindow::setViewPortSize(int width, int height) bool MainWindow::showEnableAutomaticUpdateLocationDialog() { - QMessageBox msgBox(QMessageBox::Warning, tr("Automatic location update"), + QMessageBox msgBox(QMessageBox::Question, tr("Automatic location update"), tr("Are you sure you want to enable automatic location update?"), QMessageBox::Ok | QMessageBox::Cancel, 0); msgBox.button(QMessageBox::Ok)->setText(tr("Ok")); + qWarning() << __PRETTY_FUNCTION__; int ret = msgBox.exec(); - + qWarning() << __PRETTY_FUNCTION__; if (ret == QMessageBox::Ok) return true; else diff --git a/src/ui/settingsdialog.cpp b/src/ui/settingsdialog.cpp index 252b05c..9b83eda 100644 --- a/src/ui/settingsdialog.cpp +++ b/src/ui/settingsdialog.cpp @@ -100,6 +100,7 @@ SettingsDialog::SettingsDialog(QWidget *parent) scrollArea->show(); + setTime(QTime(0, LIST_MINUTES_STEP)); readSettings(); } @@ -114,7 +115,7 @@ SettingsDialog::~SettingsDialog() void SettingsDialog::setAutomaticLocationUpdateSettings(bool checked) { - qDebug() << __PRETTY_FUNCTION__; + qWarning() << __PRETTY_FUNCTION__; m_automaticLocationUpdate->setChecked(checked); m_automaticLocationUpdateOldValue = checked; @@ -129,7 +130,7 @@ void SettingsDialog::enableSituareSettings(bool enabled) void SettingsDialog::readSettings() { - qDebug() << __PRETTY_FUNCTION__; + qWarning() << __PRETTY_FUNCTION__; QSettings settings(DIRECTORY_NAME, FILE_NAME); bool automaticUpdateEnabled = settings.value(SETTINGS_AUTOMATIC_UPDATE_ENABLED, false).toBool(); @@ -144,10 +145,11 @@ void SettingsDialog::readSettings() void SettingsDialog::emitAutomaticLocationUpdateSettings() { - qDebug() << __PRETTY_FUNCTION__; + qWarning() << __PRETTY_FUNCTION__; if (m_automaticLocationUpdate->isChecked()) { QTime emptyTime = QTime(); + qDebug() << emptyTime.msecsTo(time()); emit enableAutomaticLocationUpdate(true, emptyTime.msecsTo(time())); } else { -- 1.7.9.5