From 191e117d32d1e3e4865f51c84b3a2bbc565a49b3 Mon Sep 17 00:00:00 2001 From: Toni Jussila Date: Fri, 16 Apr 2010 12:45:07 +0300 Subject: [PATCH] Conflict --- Client/accelerationstart.cpp | 1 + Client/accelerationstart.h | 5 +++-- Client/accrealtimedialog.cpp | 1 + Client/accrealtimedialog.h | 21 +++++++++++---------- Client/httpclient.cpp | 15 +++++++++++---- Client/mainwindow.cpp | 17 +++++++---------- Client/mainwindow.h | 6 +++--- Client/resultdialog.cpp | 1 + Client/resultdialog.h | 3 ++- Client/routedialog.cpp | 3 ++- Client/routedialog.h | 3 ++- Client/routesavedialog.cpp | 26 +++++++++++++++++++++----- Client/routesavedialog.h | 5 +++++ 13 files changed, 70 insertions(+), 37 deletions(-) diff --git a/Client/accelerationstart.cpp b/Client/accelerationstart.cpp index ab9198f..6214897 100644 --- a/Client/accelerationstart.cpp +++ b/Client/accelerationstart.cpp @@ -2,6 +2,7 @@ * Acceleration start dialog * * @author Jukka Kurttila + * @author Toni Jussila * @copyright (c) 2010 Speed Freak team * @license http://opensource.org/licenses/gpl-license.php GNU Public License */ diff --git a/Client/accelerationstart.h b/Client/accelerationstart.h index d403df7..1a0aec6 100644 --- a/Client/accelerationstart.h +++ b/Client/accelerationstart.h @@ -1,7 +1,8 @@ /* * Acceleration start dialog * - * @author Jukka Kurttila + * @author Jukka Kurttila + * @author Toni Jussila * @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; diff --git a/Client/accrealtimedialog.cpp b/Client/accrealtimedialog.cpp index be150c2..bf34104 100644 --- a/Client/accrealtimedialog.cpp +++ b/Client/accrealtimedialog.cpp @@ -2,6 +2,7 @@ * Acceleration info in real time dialog * * @author Jukka Kurttila + * @author Toni Jussila * @copyright (c) 2010 Speed Freak team * @license http://opensource.org/licenses/gpl-license.php GNU Public License */ diff --git a/Client/accrealtimedialog.h b/Client/accrealtimedialog.h index ec9a0d5..c4dff1f 100644 --- a/Client/accrealtimedialog.h +++ b/Client/accrealtimedialog.h @@ -1,7 +1,8 @@ /* * Acceleration info in real time dialog * - * @author Jukka Kurttila + * @author Jukka Kurttila + * @author Toni Jussila * @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 diff --git a/Client/httpclient.cpp b/Client/httpclient.cpp index 2d1cb54..acda598 100644 --- a/Client/httpclient.cpp +++ b/Client/httpclient.cpp @@ -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(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()); } } diff --git a/Client/mainwindow.cpp b/Client/mainwindow.cpp index 75171e6..8179fd7 100644 --- a/Client/mainwindow.cpp +++ b/Client/mainwindow.cpp @@ -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()); } } diff --git a/Client/mainwindow.h b/Client/mainwindow.h index d09cc51..87c603d 100644 --- a/Client/mainwindow.h +++ b/Client/mainwindow.h @@ -1,7 +1,8 @@ /* * Mainwindow for speedFreak project * - * @author Rikhard Kuutti + * @author Rikhard Kuutti + * @author Toni Jussila * @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(); diff --git a/Client/resultdialog.cpp b/Client/resultdialog.cpp index c7a8f10..38af4d2 100644 --- a/Client/resultdialog.cpp +++ b/Client/resultdialog.cpp @@ -2,6 +2,7 @@ * CarMainWindow main class * * @author Janne Änäkkälä + * @author Toni Jussila * @copyright (c) 2010 Speed Freak team * @license http://opensource.org/licenses/gpl-license.php GNU Public License */ diff --git a/Client/resultdialog.h b/Client/resultdialog.h index 3dacc82..09c4174 100644 --- a/Client/resultdialog.h +++ b/Client/resultdialog.h @@ -1,7 +1,8 @@ /* * CarMainWindow main class * - * @author Janne Änäkkälä + * @author Janne Änäkkälä + * @author Toni Jussila * @copyright (c) 2010 Speed Freak team * @license http://opensource.org/licenses/gpl-license.php GNU Public License */ diff --git a/Client/routedialog.cpp b/Client/routedialog.cpp index 6edb716..6b5e468 100644 --- a/Client/routedialog.cpp +++ b/Client/routedialog.cpp @@ -1,7 +1,8 @@ /* * RouteDialog class * - * @author Olavi Pulkkinen + * @author Olavi Pulkkinen + * @author Toni Jussila * @copyright (c) 2010 Speed Freak team * @license http://opensource.org/licenses/gpl-license.php GNU Public License */ diff --git a/Client/routedialog.h b/Client/routedialog.h index 708e74a..1d70aaa 100644 --- a/Client/routedialog.h +++ b/Client/routedialog.h @@ -1,7 +1,8 @@ /* * RouteDialog class * - * @author Olavi Pulkkinen + * @author Olavi Pulkkinen + * @author Toni Jussila * @copyright (c) 2010 Speed Freak team * @license http://opensource.org/licenses/gpl-license.php GNU Public License */ diff --git a/Client/routesavedialog.cpp b/Client/routesavedialog.cpp index e0bfe7b..506c1e5 100644 --- a/Client/routesavedialog.cpp +++ b/Client/routesavedialog.cpp @@ -14,13 +14,12 @@ *@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 +} diff --git a/Client/routesavedialog.h b/Client/routesavedialog.h index 6906bdd..8a0d539 100644 --- a/Client/routesavedialog.h +++ b/Client/routesavedialog.h @@ -50,6 +50,11 @@ private slots: void timerSatellitePictureTimeout(); void timerRoutePictureTimeout(); void gpsStatus(); + void sendRoute(); + +signals: + void sendroute(); + }; #endif // ROUTESAVEDIALOG_H -- 1.7.9.5