Initial version
[gpssportsniffer] / windowMap.h
index acb42c6..350630d 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/>.
+**
+****************************************************************************/
+
 #ifndef ACTIVITYMAP_H
 #define ACTIVITYMAP_H
 
@@ -27,7 +46,7 @@
 
 class Settings;
 class ConnectivityHelper;
-class SatelliteDialog;
+//class SatelliteDialog;
 
 
 // Use the QtMobility namespace
@@ -54,6 +73,7 @@ private:
     bool pressed;
     bool snapped;
     bool possitionPaint;
+    bool isDisplayInit;
 
     int tilesToDownload;
 
@@ -75,7 +95,7 @@ private:
 
     QAction *startNetworkAction;
     QAction *loadTrackAction;
-    QAction *downloadMapsAction;
+    QAction *downloadMapsTrackAction;
     QAction *newActivityAction;
     QAction *simulatedActivityAction;
     QAction *quitAction;
@@ -84,7 +104,7 @@ private:
     QAction *stopAction;
     QAction *startAction;
     QAction *tracksAction;
-    QAction *satelliteAction;
+    //QAction *satelliteAction;
     QAction *infoAction;
 
     // Dialogs
@@ -96,8 +116,8 @@ private:
 
     DownloadingStatus* downloadingStatus;
 
-    QGeoSatelliteInfoSource *satelliteInfo;
-    SatelliteDialog *satelliteDialog;
+    //QGeoSatelliteInfoSource *satelliteInfo;
+    //SatelliteDialog *satelliteDialog;
 
 
     Log *log;
@@ -107,7 +127,7 @@ private:
 
     QList<GpsPoint*> trackToSimulate;
 
-    bool waitingForFix;
+    //bool waitingForFix;
     int validPositions;
     int invalidPositions;
 
@@ -126,6 +146,7 @@ private:
     void mouseReleaseEvent(QMouseEvent *event);
     void resizeEvent(QResizeEvent * );
 
+    void chooseDisplay();
 public:
 
     QToolButton *zoomInButton;
@@ -142,6 +163,8 @@ public:
     explicit WindowMap(QWidget *parent = 0,Settings* settings=0, Log *log=0);
     virtual ~WindowMap();
 
+    void displayInit(QPainter *p);
+
     void fixZoomButtons();
     void updateSummary();
     void clearAllMaps();
@@ -158,7 +181,7 @@ public:
     void startGPS();
     void startMaps();
 
-    void showSatelliteInfo();
+    //void showSatelliteInfo();
     void startNetworking();
     void stopNetworking();
     void setOrientation(ScreenOrientation orientation);
@@ -167,7 +190,7 @@ public:
     inline Track* getTrack(){return track;}
     inline Track* getTrackToSniff(){return trackToSniff;}
     inline void setTrackToSimulate(QList<GpsPoint*> toDo){trackToSimulate=toDo;}
-    inline bool hasTrackToSimulate(){(trackToSimulate.size()>0);}
+    inline bool hasTrackToSimulate(){return (trackToSimulate.size()>0);}
     inline void startAutosaveTimer(int milliseconds){autosaveTimer->start(milliseconds);}
     inline void startSimulatePossitioning(int milliseconds){simulatePossitioningTimer->start(milliseconds);}
     inline void startSimulatePossitioning(){simulatePossitioningTimer->start();}
@@ -179,6 +202,11 @@ public:
     inline bool simulatingGPS(){return simulateGPS;}
     inline void setSimulateGPS(bool value){simulateGPS=value;}
     inline int getTilesToDownload(){return tilesToDownload;}
+    inline void setIsCacheEnabled(bool value){
+        if(slippyMap)
+            slippyMap->setIsCacheEnabled(value);
+    }
+    inline bool isCacheEnabled(){return slippyMap->isCacheEnabled();}
 
     void setTrack(QString filename,QString activity);
     void setCenter(qreal lat, qreal lng);
@@ -208,7 +236,7 @@ public:
 
 
     void quit();
-    void satellite();
+    //void satellite();
 
     void onZoomIn();
     void onZoomOut();
@@ -217,7 +245,7 @@ public:
 
 
     //void networkSessionOpened();
-    void waitForFix();
+    //void waitForFix();
     void updateMap(const QRect &r);