X-Git-Url: http://git.maemo.org/git/?p=speedfreak;a=blobdiff_plain;f=Client%2Froutedialog.cpp;h=0fc2dcf42eca2508b45a65854aa3a9225a5ddff5;hp=07357530e287e2237c0134ed1b2f07686213e24c;hb=f31a65d2249d6ddf024f9427e2036e2565ed747b;hpb=711ece5e3a718c47646650e163d45ed1418664c0 diff --git a/Client/routedialog.cpp b/Client/routedialog.cpp index 0735753..0fc2dcf 100644 --- a/Client/routedialog.cpp +++ b/Client/routedialog.cpp @@ -1,7 +1,8 @@ /* * RouteDialog class * - * @author Olavi Pulkkinen + * @author Olavi Pulkkinen + * @author Toni Jussila * @copyright (c) 2010 Speed Freak team * @license http://opensource.org/licenses/gpl-license.php GNU Public License */ @@ -171,6 +172,12 @@ RouteDialog::RouteDialog(QWidget *parent) : this->setWindowTitle("Route"); left = 5; top = 5; right = 495; bottom = 295; // Limits in screen coordinates + //Button settings + ui->sendPushButton->setAutoFillBackground(true); + ui->sendPushButton->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)"); + ui->newPushButton->setAutoFillBackground(true); + ui->newPushButton->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)"); + // Send rout to server button disable/enable. ui->sendPushButton->setEnabled(false); if (loginSaved()) @@ -356,7 +363,8 @@ void RouteDialog::paintEvent(QPaintEvent *) painter.drawEllipse( x1Screen-5, y1Screen-5, 10, 10); QString jono; - jono = QString("%1 m/s").arg(maxv); + //jono = QString("%1 km/h").arg(maxv); + jono.sprintf("%.1f km/h", maxv); ui->speedValueLabel->setText(jono); } } @@ -412,7 +420,7 @@ bool RouteDialog::readRouteFromFile( QString &routeFile) x = str2.toDouble();// latitude y-value y = str1.toDouble();// longitude x-value z = str3.toDouble();// altitude z-value - v = str4.toDouble();// speed m/s + v = str4.toDouble();// speed km/h // QString str = QString("%1 %2 %3 %4").arg(x).arg(y).arg(z).arg(v); // QMessageBox::about(0, "LUKEE", str); temp.setX( x); // Longitude @@ -437,7 +445,7 @@ bool RouteDialog::readRouteFromFile( QString &routeFile) str1 = rivi.section(" ", 2, 2); // latitude y-value str2 = rivi.section(" ", 4, 4); // longitude x-value str3 = rivi.section(" ", 6, 6); // altitude z-value - str4 = rivi.section(" ", 8, 8); // speed m/s + str4 = rivi.section(" ", 8, 8); // speed km/h //QString str = QString("la: %1 lo: %2 al: %3").arg(str1).arg(str2).arg(str3); //QMessageBox::about(0, "LUKEE", str); @@ -737,5 +745,10 @@ void RouteDialog::on_newPushButton_clicked() void RouteDialog::on_sendPushButton_clicked() { - // Send route points file to server + emit sendroute(); +} + +void RouteDialog::setLabelInfoToUser(QString infoText) +{ + this->ui->labelInfoToUser->setText(infoText); }