Conflict
authorToni Jussila <toni.jussila@fudeco.com>
Fri, 16 Apr 2010 09:45:07 +0000 (12:45 +0300)
committerToni Jussila <toni.jussila@fudeco.com>
Fri, 16 Apr 2010 09:45:07 +0000 (12:45 +0300)
13 files changed:
Client/accelerationstart.cpp
Client/accelerationstart.h
Client/accrealtimedialog.cpp
Client/accrealtimedialog.h
Client/httpclient.cpp
Client/mainwindow.cpp
Client/mainwindow.h
Client/resultdialog.cpp
Client/resultdialog.h
Client/routedialog.cpp
Client/routedialog.h
Client/routesavedialog.cpp
Client/routesavedialog.h

index ab9198f..6214897 100644 (file)
@@ -2,6 +2,7 @@
  * Acceleration start dialog
  *
  * @author      Jukka Kurttila <jukka.kurttila@fudeco.com>
+ * @author      Toni Jussila   <toni.jussila@fudeco.com>
  * @copyright   (c) 2010 Speed Freak team
  * @license     http://opensource.org/licenses/gpl-license.php GNU Public License
  */
index d403df7..1a0aec6 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * Acceleration start dialog
  *
- * @author      Jukka Kurttila <jukka.kurttila@fudeco.com>
+ * @author      Jukka Kurttila  <jukka.kurttila@fudeco.com>
+ * @author      Toni Jussila   <toni.jussila@fudeco.com>
  * @copyright   (c) 2010 Speed Freak team
  * @license     http://opensource.org/licenses/gpl-license.php GNU Public License
  */
@@ -20,6 +21,7 @@ class accelerationstart : public QDialog {
 public:
     accelerationstart(QWidget *parent = 0);
     ~accelerationstart();
+    AccRealTimeDialog* accRealTimeDialog;
     QString getMeasureCategory();
 
 protected:
@@ -27,7 +29,6 @@ protected:
 
 private:
     Ui::accelerationstart *ui;
-    AccRealTimeDialog* accRealTimeDialog;
 
     double stopMeasureSpeed;
     QString measureCategory;
index be150c2..bf34104 100644 (file)
@@ -2,6 +2,7 @@
  * Acceleration info in real time dialog
  *
  * @author      Jukka Kurttila <jukka.kurttila@fudeco.com>
+ * @author      Toni Jussila   <toni.jussila@fudeco.com>
  * @copyright   (c) 2010 Speed Freak team
  * @license     http://opensource.org/licenses/gpl-license.php GNU Public License
  */
index ec9a0d5..c4dff1f 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * Acceleration info in real time dialog
  *
- * @author      Jukka Kurttila <jukka.kurttila@fudeco.com>
+ * @author      Jukka Kurttila  <jukka.kurttila@fudeco.com>
+ * @author      Toni Jussila   <toni.jussila@fudeco.com>
  * @copyright   (c) 2010 Speed Freak team
  * @license     http://opensource.org/licenses/gpl-license.php GNU Public License
  */
@@ -24,6 +25,7 @@ class AccRealTimeDialog : public QDialog {
 public:
     AccRealTimeDialog(QWidget *parent = 0);
     ~AccRealTimeDialog();
+    ResultDialog* resultDialog;
     void Calibrate();
     void startAccelerationMeasure();
     void SetStopMeasureSpeed(double speed);
@@ -31,18 +33,9 @@ public:
 protected:
     void changeEvent(QEvent *e);
 
-private slots:
-    void on_buttonAbort_clicked();
-    void readAccelerometerData();
-    void sendResult(double);
-
-signals:
-    void sendresult(double);
-
 private:
     Ui::AccRealTimeDialog *ui;
     void resetAccelerometerMeasurements();
-    ResultDialog* resultDialog;
 
     QTimer *accelerometerTimer;
     QTime elapsedTime;
@@ -63,6 +56,14 @@ private:
 
     QString currentSpeed;
     QString totalTime;
+
+private slots:
+    void on_buttonAbort_clicked();
+    void readAccelerometerData();
+    void sendResult(double);
+
+signals:
+    void sendresult(double);
 };
 
 #endif // ACCREALTIMEDIALOG_H
index 2d1cb54..acda598 100644 (file)
@@ -80,7 +80,9 @@ void HttpClient::sendResultXml(QString category, double result)
     currentDownload = netManager->post(request, ("xml=" + xmlbuffer->data()));
     connect(currentDownload,SIGNAL(finished()),this,SLOT(ackOfResult()));
     //connect(currentDownload,SIGNAL(error(QNetworkReply::NetworkError)),myMainw,SLOT(errorFromServer(QNetworkReply::NetworkError)));
-    myMainw->resultDialog->setLabelInfoToUser("Sending result to server");
+
+    //Indicating user
+    myMainw->accstart->accRealTimeDialog->resultDialog->setLabelInfoToUser("Sending result to server");
 
     xmlbuffer->close();
 }
@@ -200,7 +202,8 @@ void HttpClient::ackOfResult()
 {
     qDebug() << "_ackOfResult";
 
-    myMainw->resultDialog->setLabelInfoToUser("");
+    //Indicating user
+    myMainw->accstart->accRealTimeDialog->resultDialog->setLabelInfoToUser("");
 
     QNetworkReply* reply = qobject_cast<QNetworkReply*>(sender());
 
@@ -208,11 +211,15 @@ void HttpClient::ackOfResult()
     errorcode = reply->error();
     if(errorcode != 0) {
         qDebug() <<  "errorcode:" << errorcode << reply->errorString();
-        QMessageBox::about(myMainw->resultDialog, "Server reply to result sending ",reply->errorString());
+
+        //Indicating user
+        QMessageBox::about(myMainw->accstart->accRealTimeDialog->resultDialog, "Server reply to result sending ",reply->errorString());
     }
     else {
         qDebug() << "errorcode:" << errorcode << reply->errorString();
-        QMessageBox::about(myMainw->resultDialog, "Server reply to result sending", "Result received " + reply->readAll());
+
+        //Indicating user
+        QMessageBox::about(myMainw->accstart->accRealTimeDialog->resultDialog, "Server reply to result sending", "Result received " + reply->readAll());
     }
 }
 
index 75171e6..8179fd7 100644 (file)
@@ -28,8 +28,8 @@ MainWindow::MainWindow(QWidget *parent) :
     routeDialog = new RouteDialog;
     connect(routeDialog,SIGNAL(sendroute()),this,SLOT(clientSendRoute()));
 
-    routeSaveDialog = new RouteSaveDialog;
     helpDialog = NULL;
+    routeSaveDialog = NULL;
 
     settingsDialog = new SettingsDialog;
     connect(settingsDialog,SIGNAL(sendregistration()),this,SLOT(clientRegUserToServer()));
@@ -43,8 +43,6 @@ MainWindow::MainWindow(QWidget *parent) :
     connect(httpClient->myXmlreader, SIGNAL(receivedCategoryList()), this, SLOT(setCategoryCompoBox()));
     connect(httpClient->myXmlreader, SIGNAL(receivedTop10List()), this, SLOT(showTop10()));
 
-    resultDialog = new ResultDialog;
-
     accstart = NULL;
 
     //creditsDialog = new CreditsDialog;
@@ -113,6 +111,9 @@ void MainWindow::on_pushButtonCredits_clicked()
   */
 void MainWindow::on_pushButtonRoute_clicked()
 {
+    if(!routeSaveDialog)
+        routeSaveDialog = new RouteSaveDialog;
+    connect(routeSaveDialog, SIGNAL(sendroute()), this, SLOT(clientSendRoute()));
     routeSaveDialog->show();
 }
 
@@ -191,6 +192,9 @@ void MainWindow::setListViewTopList(QString category, int size)
     topResultDialog->showTopList(topList);
 }
 
+/**
+  * This function
+  */
 void MainWindow::clientRegUserToServer()
 {
     httpClient->requestRegistration();
@@ -217,16 +221,9 @@ void MainWindow::clientSendRoute()
   */
 void MainWindow::clientSendResult(QString category, double result)
 {
-    /*QMessageBox msgBox;
-    msgBox.setWindowTitle("client send result!");
-    msgBox.setText("client send result!");
-    msgBox.setDefaultButton(QMessageBox::Ok);
-    msgBox.exec();*/
-
     qDebug() << "__clientSendResult";
     if(accstart) {
         qDebug() << "_clientSendResult, calling server";
         httpClient->sendResultXml(category, result);
-        //httpClient->sendResultXml(accstart->getMeasureCategory(), resultDialog->getResult());
     }
 }
index d09cc51..87c603d 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * Mainwindow for speedFreak project
  *
- * @author      Rikhard Kuutti <rikhard.kuutti@fudeco.com>
+ * @author      Rikhard Kuutti  <rikhard.kuutti@fudeco.com>
+ * @author      Toni Jussila   <toni.jussila@fudeco.com>
  * @copyright   (c) 2010 Speed Freak team
  * @license     http://opensource.org/licenses/gpl-license.php GNU Public License
  */
@@ -45,7 +46,6 @@ public:
     accelerationstart* accstart;
     TopResultDialog *topResultDialog;
     HttpClient *httpClient;
-    ResultDialog *resultDialog;
     HelpDialog *helpDialog;
 
 protected:
@@ -67,7 +67,7 @@ private slots:
     void clientSendRoute();
     void clientRegUserToServer();
     void clientUserLogin();
-    void clientSendResult(QString, double);
+    void clientSendResult(QString category, double result);
     void setCategoryCompoBox();
     void showTop10();
 
index c7a8f10..38af4d2 100644 (file)
@@ -2,6 +2,7 @@
  * CarMainWindow main class
  *
  * @author     Janne Änäkkälä <janne.anakkala@fudeco.com>
+ * @author      Toni Jussila   <toni.jussila@fudeco.com>
  * @copyright  (c) 2010 Speed Freak team
  * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  */
index 3dacc82..09c4174 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * CarMainWindow main class
  *
- * @author     Janne Änäkkälä <janne.anakkala@fudeco.com>
+ * @author     Janne Änäkkälä   <janne.anakkala@fudeco.com>
+ * @author      Toni Jussila   <toni.jussila@fudeco.com>
  * @copyright  (c) 2010 Speed Freak team
  * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  */
index 6edb716..6b5e468 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * RouteDialog class
  *
- * @author     Olavi Pulkkinen <olavi.pulkkinen@fudeco.com>
+ * @author      Olavi Pulkkinen <olavi.pulkkinen@fudeco.com>
+ * @author      Toni Jussila   <toni.jussila@fudeco.com>
  * @copyright  (c) 2010 Speed Freak team
  * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  */
index 708e74a..1d70aaa 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * RouteDialog class
  *
- * @author     Olavi Pulkkinen <olavi.pulkkinen@fudeco.com>
+ * @author      Olavi Pulkkinen <olavi.pulkkinen@fudeco.com>
+ * @author      Toni Jussila   <toni.jussila@fudeco.com>
  * @copyright  (c) 2010 Speed Freak team
  * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  */
index e0bfe7b..506c1e5 100644 (file)
   *@param QWidget pointer to parent object. By default the value is NULL.
   */
 RouteSaveDialog::RouteSaveDialog(QWidget *parent) :
-    QDialog(parent),
-    ui(new Ui::RouteSaveDialog)
-{
+    QDialog(parent), ui(new Ui::RouteSaveDialog){
+
     ui->setupUi(this);
     this->setWindowTitle("Tracking");
 
-    routeDialog = new RouteDialog;
+    routeDialog = NULL;
 
     //Button settings
     buttonStatus = true;
@@ -75,6 +74,9 @@ RouteSaveDialog::~RouteSaveDialog()
     delete iconRouteStart;
 }
 
+/**
+  *
+  */
 void RouteSaveDialog::changeEvent(QEvent *e)
 {
     QDialog::changeEvent(e);
@@ -118,8 +120,11 @@ void RouteSaveDialog::on_buttonRouteStartStop_clicked()
         location->stopPollingGPS();
 
         QString routeFile = QString("routetemp.xml");
-        if (routeDialog->readRouteFromFile( routeFile) == true)
+        if (routeDialog->readRouteFromFile( routeFile ) == true)
         {
+            if(!routeDialog)
+                routeDialog = new RouteDialog;
+            connect(routeDialog, SIGNAL(sendroute()), this, SLOT(sendRoute()));
             routeDialog->show();
         }
 
@@ -169,6 +174,9 @@ void RouteSaveDialog::timerRoutePictureTimeout()
     timerRoutePicture->start();
 }
 
+/**
+  *
+  */
 void RouteSaveDialog::gpsStatus()
 {
     //IF GPS start button clicked
@@ -233,3 +241,11 @@ void RouteSaveDialog::gpsStatus()
         ui->labelGpsSpeed->setVisible(0);
     }
 }
+
+/**
+  * This slot function is called when routeDialog emit sendroute (sendPushButton).
+  */
+void RouteSaveDialog::sendRoute()
+{
+    emit sendroute(); //Emit mainwindow clientSendRoute
+}
index 6906bdd..8a0d539 100644 (file)
@@ -50,6 +50,11 @@ private slots:
     void timerSatellitePictureTimeout();
     void timerRoutePictureTimeout();
     void gpsStatus();
+    void sendRoute();
+
+signals:
+    void sendroute();
+
 };
 
 #endif // ROUTESAVEDIALOG_H