Changes in measuredialog.cpp, .h and carmainwindow.cpp and .h
authorJanne Änäkkälä <Janne_anakkala@hotmail.com>
Tue, 2 Mar 2010 07:30:47 +0000 (09:30 +0200)
committerJanne Änäkkälä <Janne_anakkala@hotmail.com>
Tue, 2 Mar 2010 07:30:47 +0000 (09:30 +0200)
Added timer in measure dialog which makes timeout every second and updates
speed and time to the UI. When target speed is achieved emits signal
speedAchieved() and then carmainwindow opens result dialog.

Merge branch 'testiBranch'

Conflicts:
Client/UI.pro
Client/carmainwindow.cpp

1  2 
Client/UI.pro
Client/carmainwindow.cpp
Client/carmainwindow.h

diff --cc Client/UI.pro
@@@ -10,14 -10,14 +10,16 @@@ SOURCES += main.cpp 
      resultdialog.cpp \
      stringlistmodel.cpp \
      measuredialog.cpp \
 -    accelerometer.cpp \
 -    calculate.cpp
 +    calculate.cpp \
 +    accelerometer.cpp
++
  HEADERS += carmainwindow.h \
      resultdialog.h \
      stringlistmodel.h \
      measuredialog.h \
-     calculate.h \
-     accelerometer.h
+     accelerometer.h \
+     calculate.h
++
  FORMS += carmainwindow.ui \
      resultdialog.ui \
      measuredialog.ui
@@@ -107,44 -105,10 +117,54 @@@ void CarMainWindow::initSpeedListView(
  }
  
  /**
++<<<<<<< HEAD:Client/carmainwindow.cpp
 +  *This function is used to set items to speed listview.
 +  *@param QStringlist numbers
 +  */
 +void CarMainWindow::setSpeedListView(QStringList numbers)
 +{
 +    QAbstractItemModel *model = new StringListModel(numbers);
 +    ui->listView->setModel(model);
 +}
 +
 +/**
 +  *This function is used to init category combobox.
 +  */
 +void CarMainWindow::initCategoryCompoBox()
 +{
 +    categories << "Top 10 1/4 mile" << "Top 10 0-100 km/h" << "Top 10 car";
 +    ui->comboBoxTopCategory->addItems(categories);
 +}
 +
 +/**
 +  *This function is used to set items to category combobox.
 +  *@param QStringlist categories
 +  */
 +void CarMainWindow::setCategoryCompoBox(QStringList categories)
 +{
 +    ui->comboBoxTopCategory->addItems(categories);
 +}
 +
 +/**
 +  *This slot function is called when ever categories combobox is update.
 +  *@param QString category
 +  */
 +void CarMainWindow::on_comboBoxTopCategory_activated(QString category)
 +{
 +    //TODO: get top list
 +
 +    QStringList topList;
 +    topList << "1. Pertti 7,5s" << "2. Ville 10,2s";
 +
 +    QAbstractItemModel *model = new StringListModel(topList);
 +    ui->listViewTopList->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();
+ }
Simple merge