Added debug prints to SettingsDialog.
authorJussi Laitinen <jupe@l3l7588.ixonos.local>
Tue, 8 Jun 2010 12:54:43 +0000 (15:54 +0300)
committerJussi Laitinen <jupe@l3l7588.ixonos.local>
Tue, 8 Jun 2010 12:54:43 +0000 (15:54 +0300)
src/engine/engine.cpp
src/src.pro
src/ui/mainwindow.cpp
src/ui/settingsdialog.cpp

index 5507c5a..338a721 100644 (file)
@@ -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
index d48615b..10e7c8a 100644 (file)
@@ -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 \
index 012d5e6..8e938ba 100644 (file)
@@ -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
index 252b05c..9b83eda 100644 (file)
@@ -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 {