+/**
+ *This slot function is called when registrate button is clicked.
+ */
+void CarMainWindow::on_registratePushButton_clicked()
+{
+ myRegistration->show();
+}
+
+/**
+ *This slot function is called when ever refresh button clicked. Top-tab view.
+ */
+void CarMainWindow::on_buttonTopRefresh_clicked()
+{
+ myHttpClient->requestCategories();
+}
+
+/**
+ *This slot function is called when ever category combobox current index changed. Top-tab view.
+ *@param QString category.
+ *@todo Check where limitNr is taken, fixed or user input, see showTop10.
+ */
+void CarMainWindow::on_comboBoxTopCategory_currentIndexChanged(QString category)
+{
+ qDebug() << "_on_comboBoxTopCategory_currentIndexChanged: " << category;
+ recentCategory = category; //for showTop10()
+ int limitNr = 5;
+ QString limit = QString::number(limitNr);
+ myHttpClient->requestTopList(category, limit);
+}
+
+/**
+ *This slot function is called when set/change user button is clicked.
+ */
+void CarMainWindow::on_setUserPushButton_clicked()
+{
+ myLogin->show();
+}
+
+/**
+ *@brief Just for development, for the real button is not shown until
+ *measurin started and there are results.
+ *@todo Implement with real code and yet leave sendXml in the bottom in use.
+ */
+void CarMainWindow::on_manualStartButton_clicked()
+{
+
+}
+
+/**
+ * This slot function is called when timer gives timeout signal. Checks current speed
+ * and stores times in measure class.
+ */
+void CarMainWindow::after_timeout()
+{
+ QString timeString, speedString;
+ //time++;
+ //speed = speed +10;
+ timeString.setNum(time);
+ speedString.setNum(speed);
+ ui->labelMeasureTabTime->setText(timeString);
+ ui->labelMeasureTabSpeed->setText(speedString);
+
+ //handleCheckPoint(time, speed);
+}
+
+/**
+ * Initializes measures class's member variables.
+ */
+void CarMainWindow::initializeMeasures()
+{
+ measures->setTime10kmh(0);
+ measures->setTime20kmh(0);
+ measures->setTime30kmh(0);
+ measures->setTime40kmh(0);
+ measures->setTime50kmh(0);
+ measures->setTime60kmh(0);
+ measures->setTime70kmh(0);
+ measures->setTime80kmh(0);
+ measures->setTime90kmh(0);
+ measures->setTime100kmh(0);
+}
+
+/**
+ * This slot function is called when Abort button is clicked.
+ */
+void CarMainWindow::on_pushButtonMeasureTabAbort_clicked()
+{
+ ui->pushButtonSendResult->setEnabled(false);
+ ui->pushButtonShowResultDialog->setEnabled(false);
+ ui->labelMeasureTabResult->hide();
+ ui->labelMeasureTabTime->setText("");
+ ui->labelMeasureTabSpeed->setText("");
+ measures->setTime10kmh(0);
+ measures->setTime20kmh(0);
+ measures->setTime30kmh(0);
+ measures->setTime40kmh(0);
+ measures->setTime50kmh(0);
+ measures->setTime60kmh(0);
+ measures->setTime70kmh(0);
+ measures->setTime80kmh(0);
+ measures->setTime90kmh(0);
+ measures->setTime100kmh(0);
+ this->accelerometerTimer->stop();
+ this->timer->stop();
+ this->time = 0;
+ this->speed = 0;
+ ui->tabWidget->setCurrentWidget(this->ui->StartTab);
+ //this->close();
+}
+
+/**
+ *This slot function is called when pushButtonSendResult is clicked.
+ *@todo Use real category value.
+ */
+void CarMainWindow::on_pushButtonSendResult_clicked()
+{
+ myHttpClient->sendResultXml("acceleration-0-100");
+ ui->pushButtonSendResult->setEnabled(false);
+}
+
+void CarMainWindow::updateUserName()
+{
+ QString newUserName;
+
+ newUserName = myLogin->getUserName();
+ ui->userNameLabel->setText( "User: " + newUserName);
+
+ if (newUserName.length())