Some changes.
authorTiina Kivilinna-Korhola <tiina.kivilinna-korhola@fudeco.com>
Wed, 31 Mar 2010 11:55:42 +0000 (14:55 +0300)
committerTiina Kivilinna-Korhola <tiina.kivilinna-korhola@fudeco.com>
Wed, 31 Mar 2010 11:55:42 +0000 (14:55 +0300)
Client/accelerationstart.cpp
Client/httpclient.cpp
Client/mainwindow.cpp
Client/mainwindow.h
Client/resultdialog.cpp
Client/resultdialog.h

index 9315f6b..0a67211 100644 (file)
@@ -74,8 +74,8 @@ void accelerationstart::on_categorComboBox_currentIndexChanged( int index )
 {
     stopMeasureSpeed = 0;
     if( index == 1 ) {
-        stopMeasureSpeed = 10;
-        measureCategory = "acceleration-0-10";
+        stopMeasureSpeed = 20;
+        measureCategory = "acceleration-0-20";
     }
     else if( index == 2 ) {
         stopMeasureSpeed = 40;
index 69f932e..2d1cb54 100644 (file)
@@ -212,7 +212,7 @@ void HttpClient::ackOfResult()
     }
     else {
         qDebug() << "errorcode:" << errorcode << reply->errorString();
-        //QMessageBox::about(myMainw->resultDialog, "Server reply to result sending", "Result received " + reply->readAll());
+        QMessageBox::about(myMainw->resultDialog, "Server reply to result sending", "Result received " + reply->readAll());
     }
 }
 
@@ -235,7 +235,7 @@ void HttpClient::ackOfRoute()
     }
     else {
         qDebug() << "errorcode:" << errorcode << reply->errorString();
-        //QMessageBox::about(myMainw, "Server reply to route sending", "Route received " + reply->readAll());
+        QMessageBox::about(myMainw, "Server reply to route sending", "Route received " + reply->readAll());
     }
 }
 
@@ -259,7 +259,7 @@ void HttpClient::ackOfRegistration()
     }
     else {
         qDebug() << "errorcode=0" << errorcode << reply->errorString();
-        //QMessageBox::about(myMainw->settingsDialog, "Server reply to registration", "User registration " + reply->readAll());
+        QMessageBox::about(myMainw->settingsDialog, "Server reply to registration", "User registration " + reply->readAll());
     }
 }
 
@@ -284,7 +284,7 @@ void HttpClient::ackOfCategories()
     }
     else {
         qDebug() <<  "errorcode:" << errorcode << reply->errorString();
-        //QMessageBox::about(myMainw->topResultDialog, "Server reply to requesting categories ", "OK");
+        QMessageBox::about(myMainw->topResultDialog, "Server reply to requesting categories ", "OK");
     }
 }
 
@@ -308,7 +308,7 @@ void HttpClient::ackOfLogin()
     }
     else {
         qDebug() <<  "errorcode:" << errorcode << reply->errorString();
-        //QMessageBox::about(myMainw->settingsDialog, "Server reply to login", "User login " + reply->readAll());
+        QMessageBox::about(myMainw->settingsDialog, "Server reply to login", "User login " + reply->readAll());
     }
 
     myMainw->settingsDialog->close();
index bb1e671..d495074 100644 (file)
@@ -42,7 +42,7 @@ MainWindow::MainWindow(QWidget *parent) :
     connect(httpClient->myXmlreader, SIGNAL(receivedCategoryList()), this, SLOT(setCategoryCompoBox()));
     connect(httpClient->myXmlreader, SIGNAL(receivedTop10List()), this, SLOT(showTop10()));
     resultDialog = new ResultDialog;
-    connect(resultDialog, SIGNAL(sendResult(double)), this, SLOT(clientSendResult(double)));
+    connect(resultDialog, SIGNAL(sendresult()), this, SLOT(clientSendResult()));
 
     welcomeDialog = new WelcomeDialog;
     welcomeDialog->show();
@@ -200,9 +200,11 @@ void MainWindow::clientSendRoute()
     httpClient->sendRouteXml();
 }
 
-void MainWindow::clientSendResult(double result)
+void MainWindow::clientSendResult()
 {
+    qDebug() << "_clientSendResult";
     if(accstart) {
-        httpClient->sendResultXml(accstart->getMeasureCategory(), result);
+        qDebug() << "_clientSendResult, calling server";
+        httpClient->sendResultXml(accstart->getMeasureCategory(), resultDialog->getResult());
     }
 }
index 58975a4..23a6c17 100644 (file)
@@ -65,9 +65,10 @@ private slots:
     void clientSendRoute();
     void clientRegUserToServer();
     void clientUserLogin();
-    void clientSendResult(double result);
+    void clientSendResult();
     void setCategoryCompoBox();
     void showTop10();
+
 };
 
 #endif // MAINWINDOW_H
index f505348..a01a168 100644 (file)
@@ -318,7 +318,13 @@ void ResultDialog::on_pushButtonNew_clicked()
   */
 void ResultDialog::on_pushButtonSend_clicked()
 {
-    emit sendresult(timeArray[this->getTargetChoice()]);
+    emit sendresult();
+    //emit sendresult(timeArray[this->getTargetChoice()]);
+}
+
+double ResultDialog::getResult()
+{
+    return timeArray[this->getTargetChoice()];
 }
 
 /**
index e8828c7..9126822 100644 (file)
@@ -10,7 +10,7 @@
 #define RESULTDIALOG_H
 
 #include <QDialog>
-//#include "measures.h"
+
 
 namespace Ui {
     class ResultDialog;
@@ -25,9 +25,10 @@ public:
     void setEnd(int pValue);
     void setValue(int pSpeed, double pTime);
     void setLabelInfoToUser(QString infoText);
+    double getResult();
 
 signals:
-    void sendresult(double);
+    void sendresult();
 
 protected:
     void changeEvent(QEvent *e);