Changes in measuredialog.cpp, .h and carmainwindow.cpp, .h.
[speedfreak] / Client / carmainwindow.cpp
index ace503b..60b80e6 100644 (file)
@@ -63,7 +63,17 @@ void CarMainWindow::on_listView_clicked(QModelIndex index)
   */
 void CarMainWindow::on_autoStartButton_clicked()
 {
-   result->show();
+    if(measure)
+    {
+        delete measure;
+        measure = NULL;
+        measure = new MeasureDialog();
+    }
+
+    connect(measure, SIGNAL(speedAchieved()), this, SLOT(openResultView()));
+
+    // Show measure dialog.
+    measure->show();
 }
 
 /**
@@ -93,3 +103,12 @@ void CarMainWindow::initSpeedListView()
     QAbstractItemModel *model = new StringListModel(numbers);
     ui->listView->setModel(model);
 }
+
+/**
+  *This slot function is called when speed is achieved in measure dialog. Opens result dialog.
+  */
+void CarMainWindow::openResultView()
+{
+    // Show result dialog.
+    result->show();
+}