X-Git-Url: http://git.maemo.org/git/?p=speedfreak;a=blobdiff_plain;f=Client%2Fresultdialog.cpp;h=37cf348f2f3fe1ea03817cb595493a7232e2f762;hp=68eb7cfb2a1ced582c215f56953f8c1b593739fc;hb=aa40ce55230787b7a57cc0588cd7e56d30a89dd2;hpb=f155ddf96ed8f2fdefeb1280e6e5381b93d29db1 diff --git a/Client/resultdialog.cpp b/Client/resultdialog.cpp index 68eb7cf..37cf348 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 */ @@ -68,6 +69,9 @@ ResultDialog::ResultDialog(QWidget *parent) : timeArray[i] = 0; } + //Clear info label + ui->labelInfoToUser->setText(""); + if (loginSaved()) { ui->pushButtonSend->setEnabled(true); @@ -75,6 +79,7 @@ ResultDialog::ResultDialog(QWidget *parent) : else { ui->pushButtonSend->setEnabled(false); + ui->labelInfoToUser->setText("You're not logged! Please register or log in and accelerate again."); } } @@ -310,17 +315,25 @@ void ResultDialog::on_pushButtonNew_clicked() } resultString = ""; this->close(); + emit rejected(); } /** * This slot function emits sendresult signal for sending results to server when * send results -button has been clicked. + * Emit accrealtimedialog sendresult. */ void ResultDialog::on_pushButtonSend_clicked() { + ui->pushButtonSend->setEnabled(false); emit sendresult(timeArray[this->getTargetChoice()]); } +double ResultDialog::getResult() +{ + return timeArray[this->getTargetChoice()]; +} + /** * This public function sets diagram's stem gap * @param pValue is the speed value which determines diagram gap's value @@ -742,3 +755,16 @@ int ResultDialog::getTargetChoice() } return targetChoice; } + +void ResultDialog::setLabelInfoToUser(QString infoText) +{ + this->ui->labelInfoToUser->setText(infoText); +} + +/** + * This function enable send server button. + */ +void ResultDialog::setSendServerButtonEnabled() +{ + ui->pushButtonSend->setEnabled(true); +}