X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=Client%2Fcarmainwindow.cpp;h=4fc04f3950e036c743bb019e0e9c037018c92bde;hb=e555ac29de66892f09396ee7d6cd2a92374629b0;hp=b730a696ac20f9f6694711f5e34c9342ba05aa60;hpb=ec2e343485c22d0c34a63e0d0512dbb642a8a4c4;p=speedfreak diff --git a/Client/carmainwindow.cpp b/Client/carmainwindow.cpp index b730a69..4fc04f3 100644 --- a/Client/carmainwindow.cpp +++ b/Client/carmainwindow.cpp @@ -13,6 +13,11 @@ CarMainWindow::CarMainWindow(QWidget *parent):QMainWindow(parent), ui(new Ui::Ca initUnitCompoBox(); initSpeedListView(); + + myLogin = new LoginWindow(this); + myRegistration = new Registration(this); + manager = new QNetworkAccessManager(this); + connect(manager,SIGNAL(finished(QNetworkReply*)),this,SLOT(networkResponse(QNetworkReply*))); } /** @@ -61,15 +66,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(); } @@ -160,11 +162,49 @@ void CarMainWindow::setListViewTopList(QString category) */ void CarMainWindow::openResultView() { + result->saveMeasuresToArray(measure->measures); // Show result dialog. result->show(); } /** + *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() @@ -180,3 +220,12 @@ void CarMainWindow::on_comboBoxTopCategory_currentIndexChanged(QString category) { setListViewTopList(category); } + +/** + *This slot function is called when ever category combobox activated. Top-tab view. + *@param QString category + */ +void CarMainWindow::on_comboBoxTopCategory_activated(QString category) +{ + setListViewTopList(category); +}