Bugfix: Help dialog should kill sub help dialogs (e.g. acceleration help dialog)...
[speedfreak] / Client / resultdialog.cpp
index c7a8f10..774390b 100644 (file)
@@ -1,7 +1,8 @@
 /*
- * CarMainWindow main class
+ * Result dialog
  *
  * @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
  */
@@ -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,6 +315,7 @@ void ResultDialog::on_pushButtonNew_clicked()
     }
     resultString = "";
     this->close();
+    emit rejected();
 }
 
 /**
@@ -319,7 +325,7 @@ void ResultDialog::on_pushButtonNew_clicked()
   */
 void ResultDialog::on_pushButtonSend_clicked()
 {
-    //emit sendresult();
+    ui->pushButtonSend->setEnabled(false);
     emit sendresult(timeArray[this->getTargetChoice()]);
 }
 
@@ -754,3 +760,11 @@ void ResultDialog::setLabelInfoToUser(QString infoText)
 {
     this->ui->labelInfoToUser->setText(infoText);
 }
+
+/**
+  * This function enable send server button.
+  */
+void ResultDialog::setSendServerButtonEnabled()
+{
+    ui->pushButtonSend->setEnabled(true);
+}