From 8bc16dde57946bf3d217401e01061327867da370 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Janne=20=C3=84n=C3=A4kk=C3=A4l=C3=A4?= Date: Thu, 22 Apr 2010 14:32:19 +0300 Subject: [PATCH] Bug fixed: If you are logged in and result is sent in result dialog. If you want take new run and send new result to server it can't be done. --- Client/accrealtimedialog.cpp | 36 ++++++++++++++++++++++++++---------- Client/accrealtimedialog.h | 1 + Client/mainwindow.cpp | 1 + Client/resultdialog.cpp | 1 + 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/Client/accrealtimedialog.cpp b/Client/accrealtimedialog.cpp index bf34104..fd5100f 100644 --- a/Client/accrealtimedialog.cpp +++ b/Client/accrealtimedialog.cpp @@ -143,19 +143,22 @@ void AccRealTimeDialog::readAccelerometerData() if(!resultDialog) { resultDialog = new ResultDialog(this); + connect(resultDialog, SIGNAL(rejected()), this, SLOT(killResultDialog())); + connect(resultDialog, SIGNAL(sendresult(double)), this, SLOT(sendResult(double))); } - connect(resultDialog, SIGNAL(sendresult(double)), this, SLOT(sendResult(double))); - resultDialog->setEnd(stopMeasureSpeed); - - //Put all times from all speeds - QMap tempMap = calculate->getValuesMap(); - - for( int i = 1 ; i <= tempMap.count() ; i++ ) + if(resultDialog) { - resultDialog->setValue(i*10,tempMap[i*10]); + resultDialog->setEnd(stopMeasureSpeed); + //Put all times from all speeds + QMap tempMap = calculate->getValuesMap(); + + for( int i = 1 ; i <= tempMap.count() ; i++ ) + { + resultDialog->setValue(i*10,tempMap[i*10]); + } + resultDialog->show(); + this->hide(); } - resultDialog->show(); - this->hide(); } } @@ -210,3 +213,16 @@ void AccRealTimeDialog::sendResult(double result) { emit sendresult(result); } + +/** + *This slot function kills resultDialog. + * + **/ +void AccRealTimeDialog::killResultDialog() +{ + if(resultDialog) + { + delete resultDialog; + resultDialog = NULL; + } +} diff --git a/Client/accrealtimedialog.h b/Client/accrealtimedialog.h index c4dff1f..cc59593 100644 --- a/Client/accrealtimedialog.h +++ b/Client/accrealtimedialog.h @@ -61,6 +61,7 @@ private slots: void on_buttonAbort_clicked(); void readAccelerometerData(); void sendResult(double); + void killResultDialog(); signals: void sendresult(double); diff --git a/Client/mainwindow.cpp b/Client/mainwindow.cpp index 52f7efe..9d9984d 100644 --- a/Client/mainwindow.cpp +++ b/Client/mainwindow.cpp @@ -114,6 +114,7 @@ void MainWindow::on_pushButtonCredits_clicked() if(!helpDialog) helpDialog = new HelpDialog; + connect(helpDialog, SIGNAL(rejected()), this, SLOT(killDialog())); helpDialog->show(); } diff --git a/Client/resultdialog.cpp b/Client/resultdialog.cpp index 88171ab..37cf348 100644 --- a/Client/resultdialog.cpp +++ b/Client/resultdialog.cpp @@ -315,6 +315,7 @@ void ResultDialog::on_pushButtonNew_clicked() } resultString = ""; this->close(); + emit rejected(); } /** -- 1.7.9.5