From: Janne Änäkkälä Date: Tue, 2 Mar 2010 07:30:47 +0000 (+0200) Subject: Changes in measuredialog.cpp, .h and carmainwindow.cpp and .h X-Git-Tag: v0.1~96 X-Git-Url: http://git.maemo.org/git/?p=speedfreak;a=commitdiff_plain;h=87caacddd53a392c4b747dc586fb91484fc394ae Changes in measuredialog.cpp, .h and carmainwindow.cpp and .h 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 --- 87caacddd53a392c4b747dc586fb91484fc394ae diff --cc Client/UI.pro index c48d029,6c55c45..97de2a2 --- a/Client/UI.pro +++ b/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 diff --cc Client/carmainwindow.cpp index 50a24e0,60b80e6..b8af9fe --- a/Client/carmainwindow.cpp +++ b/Client/carmainwindow.cpp @@@ -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(); + }