Merge branch 'feature/XMLreader'
[speedfreak] / Client / carmainwindow.cpp
index b730a69..d340d19 100644 (file)
@@ -13,6 +13,16 @@ CarMainWindow::CarMainWindow(QWidget *parent):QMainWindow(parent), ui(new Ui::Ca
 
     initUnitCompoBox();
     initSpeedListView();
+<<<<<<< HEAD:Client/carmainwindow.cpp
+    initCategoryCompoBox();
+
+    myLogin = new LoginWindow(this);
+    myRegistration = new Registration(this);
+    manager = new QNetworkAccessManager(this);
+    connect(manager,SIGNAL(finished(QNetworkReply*)),this,SLOT(networkResponse(QNetworkReply*)));
+
+=======
+>>>>>>> feature/XMLreader:Client/carmainwindow.cpp
 }
 
 /**
@@ -61,15 +71,12 @@ void CarMainWindow::on_listView_clicked(QModelIndex index)
   */
 void CarMainWindow::on_autoStartButton_clicked()
 {
-    if(measure)
-    {
-        delete measure;
-        measure = NULL;
-        measure = new MeasureDialog();
-    }
 
-    connect(measure, SIGNAL(speedAchieved()), this, SLOT(openResultView()));
+    delete measure;
+    measure = NULL;
+    measure = new MeasureDialog();
 
+    connect(measure, SIGNAL(speedAchieved()), this, SLOT(openResultView()));
     // Show measure dialog.
     measure->show();
 }
@@ -106,7 +113,11 @@ void CarMainWindow::setUnitCompoBox(QStringList units)
   */
 void CarMainWindow::initSpeedListView()
 {
+<<<<<<< HEAD:Client/carmainwindow.cpp
+    numbers << "0-40 km/h" << "0-1/4 mil" << "0-50 km" << "50-100 mil" << "0-100 m" << "0-50 ft" << "0-50 yrd" << "0-500 in";
+=======
     numbers << "0-40 km/h" << "0-1/4 Mile" << "0-1/8 Mile" << "0-50 km" << "50-100 Mile" << "0-60 Mph" << "0-100 m" << "0-50 ft" << "0-50 yrd" << "0-500 in";
+>>>>>>> feature/XMLreader:Client/carmainwindow.cpp
     QAbstractItemModel *model = new StringListModel(numbers);
     ui->listView->setModel(model);
 }
@@ -160,11 +171,48 @@ void CarMainWindow::setListViewTopList(QString category)
   */
 void CarMainWindow::openResultView()
 {
+    result->saveMeasuresToArray(measure->measures);
     // Show result dialog.
     result->show();
 }
 
 /**
+<<<<<<< HEAD:Client/carmainwindow.cpp
+  *This slot function is called when the server has finished guery.
+  */
+void CarMainWindow::networkResponse(QNetworkReply *reply)
+{
+}
+
+/**
+  *This slot function is called when the user will to send data to server.
+  */
+void CarMainWindow::on_pushButton_clicked()
+{
+     QNetworkRequest postData;
+     postData.setUrl(QString("http://weather.yahooapis.com/forecastrss?p=FIXX0013&u=c"));
+     manager->get(postData);
+
+}
+
+/**
+  *This slot function is called when login/logout button is clicked.
+  */
+void CarMainWindow::on_loginLogoutButton_clicked()
+{
+    //LoginWindow myLogin;
+
+    myLogin->show();
+    //ui->loginLogoutButton->setText("logout");
+}
+
+/**
+  *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()
@@ -179,4 +227,5 @@ void CarMainWindow::on_buttonTopRefresh_clicked()
 void CarMainWindow::on_comboBoxTopCategory_currentIndexChanged(QString category)
 {
     setListViewTopList(category);
+>>>>>>> feature/XMLreader:Client/carmainwindow.cpp
 }