Merge branch 'development/GPS'
[speedfreak] / Client / carmainwindow.cpp
index 4218139..68ecd57 100644 (file)
@@ -46,6 +46,7 @@ CarMainWindow::CarMainWindow(QWidget *parent):QMainWindow(parent), ui(new Ui::Ca
     location = new Maemo5Location(this);
     gpsData = new GPSData(location);
     connect(location,SIGNAL(agnss()),this,SLOT(gpsStatus()));
+    gpsTime = new QDateTime();
 
     time = 0;
     speed = 0;
@@ -102,6 +103,8 @@ CarMainWindow::~CarMainWindow()
     myRoute = NULL;
     delete gpsData;
     gpsData = NULL;
+    delete gpsTime;
+    gpsTime = NULL;
 }
 
 /**
@@ -758,7 +761,16 @@ void CarMainWindow::gpsStatus()
     {
         if (location->getSatellitesInUse() >= 4)
         {
+            //Set status
             ui->labelRouteTabGPSStatus->setText("GPS ready");
+
+            //Set time
+            gpsTime->setTime_t(location->getTime());
+            ui->labelRouteTabGPSTime->setText(gpsTime->toString());
+
+            //Set latitude & longitude
+            ui->labelRouteTabLatitude->setText("Lat: " + QString::number(location->getLatitude()));
+            ui->labelRouteTabLongitude->setText("Lon: " + QString::number(location->getLongitude()));
         }
 
         else