Initial version
[gpssportsniffer] / settingsWindow.cpp
index cd059ca..d37fb58 100755 (executable)
@@ -1,3 +1,22 @@
+/****************************************************************************
+**
+**  Copyright (C) 2011  Tito Eritja Real <jtitoo@gmail.com>
+**
+**  This program is free software: you can redistribute it and/or modify
+**  it under the terms of the GNU General Public License as published by
+**  the Free Software Foundation, either version 3 of the License, or
+**  (at your option) any later version.
+**
+**  This program is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+**  GNU General Public License for more details.
+**
+**  You should have received a copy of the GNU General Public License
+**  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+**
+****************************************************************************/
+
 #include "settingsWindow.h"
 #include "windowMap.h"
 #include "ui_settingsWindow.h"
@@ -212,6 +231,9 @@ void SettingsWindow::accept(){
         log->debug(QString("---- ONLINE:%1").arg(ui->onlineButton->isChecked()));
         activitySettings->setIsOnline(ui->onlineButton->isChecked());
 
+        activitySettings->setIsCache(ui->tileCacheOn->isChecked());
+        activityMap->setIsCacheEnabled(ui->tileCacheOn->isChecked());
+
         activitySettings->setXmlFile(ui->fileCombo->currentText());
 
         activitySettings->setMapType((MapType)ui->mapsType->currentIndex());
@@ -221,9 +243,11 @@ void SettingsWindow::accept(){
 
         activityMap->setTrack(activitySettings->getXmlFile(),activitySettings->getActivity());
 
+
         activitySettings->setIsConfigured(true);
         log->debug("starting services");
         activityMap->startServices();
+        activityMap->changeMapType(activitySettings->getMapType());
         log->debug("done");
 
         //activityMap->startSPositioningTimer();
@@ -269,6 +293,10 @@ void SettingsWindow::accept(){
                 activityMap->startNetworking();
             }
         }
+        if(activitySettings->getIsCache()!=ui->tileCacheOn->isChecked()){
+            activitySettings->setIsCache(ui->tileCacheOn->isChecked());
+            activityMap->setIsCacheEnabled(activitySettings->getIsCache());
+        }
 
         if(activitySettings->getMapType()!=(MapType)ui->mapsType->currentIndex()){
             activitySettings->setMapType((MapType)ui->mapsType->currentIndex());