void accelerationstart::on_categorComboBox_currentIndexChanged( int index )
{
stopMeasureSpeed = 0;
- if( index == 1 )
- stopMeasureSpeed = 20;
- else if( index == 2 )
+ if( index == 1 ) {
+ stopMeasureSpeed = 10;
+ measureCategory = "acceleration-0-10";
+ }
+ else if( index == 2 ) {
stopMeasureSpeed = 40;
- else if( index == 3 )
+ measureCategory = "acceleration-0-40";
+ }
+ else if( index == 3 ) {
stopMeasureSpeed = 100;
+ measureCategory = "acceleration-0-100";
+ }
+}
+
+
+QString accelerationstart::getMeasureCategory()
+{
+ return measureCategory;
}
+
public:
accelerationstart(QWidget *parent = 0);
~accelerationstart();
+ QString getMeasureCategory();
protected:
void changeEvent(QEvent *e);
Ui::accelerationstart *ui;
AccRealTimeDialog* accRealTimeDialog;
double stopMeasureSpeed;
+ QString measureCategory;
private slots:
void on_categorComboBox_currentIndexChanged(int index);
*This function is used to get items to top list of the category that is chosen from combobox.
*@param QString category
*@param int size
+ *@todo Now there is only one (the latest top10List). Later picking up the requested category.
*/
QString CategoryList::getTopList( QString category, int size)
{
<RCC>
<qresource prefix="/new/prefix1">
<file>Graphics/meter.png</file>
- <file>Graphics/route.png</file>
<file>Graphics/satellite_vista.png</file>
+ <file>Graphics/route.png</file>
<file>Graphics/route_play.png</file>
<file>Graphics/route_stop.png</file>
+ <file>Graphics/route_new.png</file>
+ <file>Graphics/route_save.png</file>
<file>Graphics/settings.png</file>
<file>Graphics/trophy_gold.png</file>
<file>Graphics/applications_internet.png</file>
<file>Graphics/Speedometer.png</file>
<file>Graphics/Speedometer2.png</file>
<file>Graphics/info.png</file>
- <file>Graphics/route_new.png</file>
- <file>Graphics/route_save.png</file>
+ <file>Graphics/speedfreak.png</file>
+
</qresource>
</RCC>
currentDownload = netManager->post(request, ("xml=" + regbuffer->data()));
connect(currentDownload,SIGNAL(finished()),this,SLOT(ackOfRegistration()));
//connect(currentDownload,SIGNAL(error(QNetworkReply::NetworkError)),myMainw,SLOT(errorFromServer(QNetworkReply::NetworkError)));
- //myMainw->setLabelInfoToUser("Reguesting registration from server");
+ myMainw->settingsDialog->setLabelInfoToUser("Reguesting registration from server");
regbuffer->close();
}
currentDownload = netManager->post(request, ("xml=" + xmlbuffer->data()));
connect(currentDownload,SIGNAL(finished()),this,SLOT(ackOfResult()));
//connect(currentDownload,SIGNAL(error(QNetworkReply::NetworkError)),myMainw,SLOT(errorFromServer(QNetworkReply::NetworkError)));
- //myMainw->setLabelInfoToUser("Sending result to server");
+ myMainw->resultDialog->setLabelInfoToUser("Sending result to server");
xmlbuffer->close();
}
currentDownload = netManager->post(request, ("xml=" + file.readAll()));
connect(currentDownload,SIGNAL(finished()),this,SLOT(ackOfRoute()));
//connect(currentDownload,SIGNAL(error(QNetworkReply::NetworkError)),myMainw,SLOT(errorFromServer(QNetworkReply::NetworkError)));
- //myMainw->setLabelInfoToUser("Sending route to server");
+ myMainw->routeDialog->setLabelInfoToUser("Sending route to server");
file.close();
}
currentDownload = netManager->post(request, ("data=" ));
connect(currentDownload,SIGNAL(finished()),this,SLOT(ackOfToplist()));
//connect(currentDownload,SIGNAL(error(QNetworkReply::NetworkError)),myMainw,SLOT(errorFromServer(QNetworkReply::NetworkError)));
- //myMainw->setLabelInfoToUser("Reguesting top10 list from server");
+ myMainw->topResultDialog->setLabelInfoToUser("Reguesting top10 list from server");
}
currentDownload = netManager->post(request, ("data=" ));
connect(currentDownload,SIGNAL(finished()),this,SLOT(ackOfCategories()));
//connect(currentDownload,SIGNAL(error(QNetworkReply::NetworkError)),myMainw,SLOT(errorFromServer(QNetworkReply::NetworkError)));
- //myMainw->setLabelInfoToUser("Reguesting categories from server");
+ myMainw->topResultDialog->setLabelInfoToUser("Reguesting categories from server");
}
currentDownload = netManager->post(request, ("data=" ));
connect(currentDownload,SIGNAL(finished()),this,SLOT(ackOfLogin()));
//connect(currentDownload,SIGNAL(error(QNetworkReply::NetworkError)),myMainw,SLOT(errorFromServer(QNetworkReply::NetworkError)));
- //myMainw->setLabelInfoToUser("Checking login validity from server");
+ myMainw->settingsDialog->setLabelInfoToUser("Checking login validity from server");
}
{
qDebug() << "_ackOfResult";
- //myMainw->setLabelInfoToUser("");
+ myMainw->resultDialog->setLabelInfoToUser("");
QNetworkReply* reply = qobject_cast<QNetworkReply*>(sender());
errorcode = reply->error();
if(errorcode != 0) {
qDebug() << "errorcode:" << errorcode << reply->errorString();
- //QMessageBox::about(myMainw, "Server reply to result sending ",reply->errorString());
+ QMessageBox::about(myMainw->resultDialog, "Server reply to result sending ",reply->errorString());
}
else {
qDebug() << "errorcode:" << errorcode << reply->errorString();
- //QMessageBox::about(myMainw, "Server reply to result sending", "Result received " + reply->readAll());
+ //QMessageBox::about(myMainw->resultDialog, "Server reply to result sending", "Result received " + reply->readAll());
}
}
{
qDebug() << "_ackOfRoute";
- //myMainw->setLabelInfoToUser("");
+ myMainw->routeDialog->setLabelInfoToUser("");
QNetworkReply* reply = qobject_cast<QNetworkReply*>(sender());
errorcode = reply->error();
if(errorcode != 0) {
qDebug() << "errorcode:" << errorcode << reply->errorString();
- //QMessageBox::about(myMainw, "Server reply to route sending ",reply->errorString());
+ QMessageBox::about(myMainw->routeDialog, "Server reply to route sending ",reply->errorString());
}
else {
qDebug() << "errorcode:" << errorcode << reply->errorString();
{
qDebug() << "_ackOfRegistration";
- //myMainw->setLabelInfoToUser("");
+ myMainw->settingsDialog->setLabelInfoToUser("");
QNetworkReply* reply = qobject_cast<QNetworkReply*>(sender());
errorcode = reply->error();
if(errorcode != 0) {
qDebug() << "errorcode:" << errorcode << reply->errorString();
- //QMessageBox::about(myMainw, "Server reply to registration",reply->readAll());
+ QMessageBox::about(myMainw->settingsDialog, "Server reply to registration",reply->readAll());
}
else {
qDebug() << "errorcode=0" << errorcode << reply->errorString();
- //QMessageBox::about(myMainw, "Server reply to registration", "User registration " + reply->readAll());
+ //QMessageBox::about(myMainw->settingsDialog, "Server reply to registration", "User registration " + reply->readAll());
}
}
{
qDebug() << "_ackOfCategories";
- //myMainw->setLabelInfoToUser("");
+ myMainw->topResultDialog->setLabelInfoToUser("");
QNetworkReply* reply = qobject_cast<QNetworkReply*>(sender());
myXmlreader->xmlReadCategories(reply);
errorcode = reply->error();
if(errorcode != 0) {
qDebug() << "errorcode:" << errorcode << reply->errorString();
- //QMessageBox::about(myMainw, "Server reply to requesting categories",reply->errorString());
+ QMessageBox::about(myMainw->topResultDialog, "Server reply to requesting categories",reply->errorString());
}
else {
qDebug() << "errorcode:" << errorcode << reply->errorString();
- //QMessageBox::about(myMainw, "Server reply to requesting categories ", "OK");
+ //QMessageBox::about(myMainw->topResultDialog, "Server reply to requesting categories ", "OK");
}
}
{
qDebug() << "_ackOffLogin";
- //myMainw->setLabelInfoToUser("");
+ myMainw->settingsDialog->setLabelInfoToUser("");
QNetworkReply* reply = qobject_cast<QNetworkReply*>(sender());
errorcode = reply->error();
if(errorcode != 0) {
qDebug() << "errorcode:" << errorcode << reply->errorString();
- //QMessageBox::about(myMainw, "Server does not recognize your username. Please registrate.",reply->errorString());
+ QMessageBox::about(myMainw->settingsDialog, "Server does not recognize your username. Please registrate.",reply->errorString());
}
else {
qDebug() << "errorcode:" << errorcode << reply->errorString();
- //QMessageBox::about(myMainw, "Server reply to login", "User login " + reply->readAll());
+ //QMessageBox::about(myMainw->settingsDialog, "Server reply to login", "User login " + reply->readAll());
}
+
+ myMainw->settingsDialog->close();
}
errorcode = reply->error();
if(errorcode != 0) {
qDebug() << "errorcode:" << errorcode << reply->errorString();
- //QMessageBox::about(myMainw, "Server reply to requesting top 10 list",reply->errorString());
+ QMessageBox::about(myMainw->topResultDialog, "Server reply to requesting top 10 list",reply->errorString());
}
else {
qDebug() << "errorcode:" << errorcode << reply->errorString();
- //QMessageBox::about(myMainw, "Server reply to requesting top 10 list", "OK " + reply->readAll());
+ //QMessageBox::about(myMainw->topResultDialog, "Server reply to requesting top 10 list", "OK " + reply->readAll());
}
}
QCoreApplication::setOrganizationDomain("fudeco.com");
QCoreApplication::setApplicationName("Speed Freak");
+ routeDialog = new RouteDialog;
+ accstart = NULL;
+
creditsDialog = new CreditsDialog;
routeSaveDialog = new RouteSaveDialog;
+ routeDialog = new RouteDialog;
+ connect(routeDialog,SIGNAL(sendroute()),this,SLOT(clientSendRoute()));
settingsDialog = new SettingsDialog;
- connect(settingsDialog,SIGNAL(sendregistration()),this,SLOT(regUserToServer()));
- connect(settingsDialog,SIGNAL(userNameChanged()),this,SLOT(userLogin()));
+ connect(settingsDialog,SIGNAL(sendregistration()),this,SLOT(clientRegUserToServer()));
+ connect(settingsDialog,SIGNAL(userNameChanged()),this,SLOT(clientUserLogin()));
topResultDialog = new TopResultDialog;
connect(topResultDialog, SIGNAL(refreshCategoryList()), this, SLOT(clientRequestCategoryList()));
connect(topResultDialog, SIGNAL(refreshTopList(int)), this, SLOT(clientRequestTopList(int)));
- accstart = NULL;
-
httpClient = new HttpClient(this);
connect(httpClient->myXmlreader, SIGNAL(receivedCategoryList()), this, SLOT(setCategoryCompoBox()));
connect(httpClient->myXmlreader, SIGNAL(receivedTop10List()), this, SLOT(showTop10()));
+ resultDialog = new ResultDialog;
+ connect(resultDialog, SIGNAL(sendResult(double)), this, SLOT(clientSendResult(double)));
welcomeDialog = new WelcomeDialog;
welcomeDialog->show();
{
delete ui;
delete routeSaveDialog;
+ delete routeDialog;
if(accstart)
delete accstart;
}
}
+/**
+ * This slot function opens browser to project www page.
+ */
void MainWindow::on_pushButtonWWW_clicked()
{
QDesktopServices::openUrl(QUrl("http://garage.maemo.org/projects/speedfreak/"));
}
+/**
+ * This slot function opens the credits dialog
+ */
void MainWindow::on_pushButtonCredits_clicked()
{
creditsDialog->show();
}
+/**
+ * This slot function opens the route save dialog
+ */
void MainWindow::on_pushButtonRoute_clicked()
{
routeSaveDialog->show();
}
+/**
+ * This slot function opens the settings dialog
+ */
void MainWindow::on_pushButtonSettings_clicked()
{
settingsDialog->show();
}
+/**
+ * This slot function opens the acceleration dialog
+ */
void MainWindow::on_pushButtonAccelerate_clicked()
{
if(!accstart)
accstart->show();
}
+/**
+ * This slot function opens the top results dialog
+ */
void MainWindow::on_pushButtonResults_clicked()
{
topResultDialog->show();
*/
void MainWindow::clientRequestTopList(int index)
{
- qDebug() << "index" << index << httpClient->myXmlreader->myCategoryList->getRecentCategory(index);
QString limit = QString::number(topResultDialog->getLimitNr());
httpClient->requestTopList(httpClient->myXmlreader->myCategoryList->getRecentCategory(index), limit);
}
*/
void MainWindow::setCategoryCompoBox()
{
- qDebug() << "_setCategoryCompoBox";
topResultDialog->setCompoBoxCategories(httpClient->myXmlreader->myCategoryList->getCategoryList());
}
*/
void MainWindow::showTop10()
{
- qDebug() << "_showTop10";
int ind = topResultDialog->getRecentCategoryIndex();
setListViewTopList(httpClient->myXmlreader->myCategoryList->getRecentCategory(ind), topResultDialog->getLimitNr());
}
*/
void MainWindow::setListViewTopList(QString category, int size)
{
- qDebug() << "_setListViewTopList" << category;
QString topList;
topList.append(httpClient->myXmlreader->myCategoryList->getTopList(category, size));
topResultDialog->showTopList(topList);
}
-void MainWindow::regUserToServer()
+void MainWindow::clientRegUserToServer()
{
httpClient->requestRegistration();
}
-void MainWindow::userLogin()
+/**
+ * This function performs login to server
+ */
+void MainWindow::clientUserLogin()
{
httpClient->checkLogin();
}
+
+void MainWindow::clientSendRoute()
+{
+ httpClient->sendRouteXml();
+}
+
+void MainWindow::clientSendResult(double result)
+{
+ if(accstart) {
+ httpClient->sendResultXml(accstart->getMeasureCategory(), result);
+ }
+}
#include <QMessageBox>
#include "creditsdialog.h"
#include "routesavedialog.h"
+#include "routedialog.h"
#include "welcomedialog.h"
#include "settingsdialog.h"
#include "accelerationstart.h"
#include "topresultdialog.h"
#include "httpclient.h"
+#include "routedialog.h"
+#include "resultdialog.h"
+
namespace Ui {
class MainWindow;
CreditsDialog *creditsDialog;
RouteSaveDialog *routeSaveDialog;
+ RouteDialog *routeDialog;
WelcomeDialog *welcomeDialog;
SettingsDialog *settingsDialog;
accelerationstart* accstart;
TopResultDialog *topResultDialog;
HttpClient *httpClient;
+ ResultDialog *resultDialog;
protected:
void changeEvent(QEvent *e);
void on_pushButtonWWW_clicked();
void clientRequestCategoryList();
void clientRequestTopList(int index);
+ void clientSendRoute();
+ void clientRegUserToServer();
+ void clientUserLogin();
+ void clientSendResult(double result);
void setCategoryCompoBox();
void showTop10();
- void regUserToServer();
- void userLogin();
};
#endif // MAINWINDOW_H
</size>
</property>
</widget>
+ <widget class="QLabel" name="label">
+ <property name="geometry">
+ <rect>
+ <x>270</x>
+ <y>280</y>
+ <width>461</width>
+ <height>121</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="pixmap">
+ <pixmap resource="graphics.qrc">:/new/prefix1/Graphics/speedfreak.png</pixmap>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ </widget>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<x>0</x>
<y>0</y>
<width>800</width>
- <height>27</height>
+ <height>25</height>
</rect>
</property>
</widget>
const int DIAGRAMGAP5S = 80;
const int DIAGRAMGAP10S = 40;
+const int DIAGRAMGAP16S = 25;
const int DIAGRAMGAP20S = 20;
const QPoint diagramStemStart(70, 330);
painter.setPen(QPen((Qt::darkCyan),2));
painter.drawLine(diagramStemStart, diagramStemEnd);
painter.drawLine(diagramHorizontalStart, diagramHorizontalEnd);
+ painter.drawText(diagramStemStart.x() - 50, diagramStemEnd.y() + 100, "S");
+ painter.drawText(diagramStemStart.x() - 50, diagramStemEnd.y() + 115, "P");
+ painter.drawText(diagramStemStart.x() - 50, diagramStemEnd.y() + 130, "E");
+ painter.drawText(diagramStemStart.x() - 50, diagramStemEnd.y() + 145, "E");
+ painter.drawText(diagramStemStart.x() - 50, diagramStemEnd.y() + 160, "D");
+ painter.drawText(diagramStemStart.x() - 65, diagramStemEnd.y() + 180, "(km/h)");
+
+ painter.drawText(diagramStemStart.x() + 140, diagramStemStart.y() + 40, "T");
+ painter.drawText(diagramStemStart.x() + 150, diagramStemStart.y() + 40, "I");
+ painter.drawText(diagramStemStart.x() + 155, diagramStemStart.y() + 40, "M");
+ painter.drawText(diagramStemStart.x() + 165, diagramStemStart.y() + 40, "E");
+ painter.drawText(diagramStemStart.x() + 180, diagramStemStart.y() + 40, "(s)");
int currentX = 0;
int currentY = diagramStemStart.y();
*/
void ResultDialog::setEnd(int pValue)
{
+ for (int i = 0; i < 11; i++)
+ {
+ timeArray[i] = 0;
+ }
+ resultString = "";
+
switch (pValue)
{
case 10:
void ResultDialog::setValue(int pSpeed, double pTime)
{
//timeArray[0] = 0;
- if (floor(pTime) <= 5)
+ if (pTime <= 5.0)
{
this->diagramGapHorizontal = DIAGRAMGAP5S;
}
- else if (floor(pTime) <= 10)
+ else if (pTime <= 10.0)
{
this->diagramGapHorizontal = DIAGRAMGAP10S;
}
+ else if (pTime <= 16.0)
+ {
+ this->diagramGapHorizontal = DIAGRAMGAP16S;
+ }
+
else
{
this->diagramGapHorizontal = DIAGRAMGAP20S;
//QString resultString;
resultString.append("Time was ");
+ QString time;
+
if (this->diagramGapStem == DIAGRAMGAP100KMH)
{
- resultString.append(QString::number(timeArray[10]));
+ time.sprintf("%.2f", timeArray[10]);
+ resultString.append(time);
this->setWindowTitle("Result for accelerating 100 km/h");
}
else if (this->diagramGapStem == DIAGRAMGAP90KMH)
{
- resultString.append(QString::number(timeArray[9]));
+ time.sprintf("%.2f", timeArray[9]);
+ resultString.append(time);
this->setWindowTitle("Result for accelerating 90 km/h");
}
else if (this->diagramGapStem == DIAGRAMGAP80KMH)
{
- resultString.append(QString::number(timeArray[8]));
+ time.sprintf("%.2f", timeArray[8]);
+ resultString.append(time);
this->setWindowTitle("Result for accelerating 80 km/h");
}
else if (this->diagramGapStem == DIAGRAMGAP70KMH)
{
- resultString.append(QString::number(timeArray[7]));
+ time.sprintf("%.2f", timeArray[7]);
+ resultString.append(time);
this->setWindowTitle("Result for accelerating 70 km/h");
}
else if (this->diagramGapStem == DIAGRAMGAP60KMH)
{
- resultString.append(QString::number(timeArray[6]));
+ time.sprintf("%.2f", timeArray[6]);
+ resultString.append(time);
this->setWindowTitle("Result for accelerating 60 km/h");
}
else if (this->diagramGapStem == DIAGRAMGAP50KMH)
{
- resultString.append(QString::number(timeArray[5]));
+ time.sprintf("%.2f", timeArray[5]);
+ resultString.append(time);
this->setWindowTitle("Result for accelerating 50 km/h");
}
else if (this->diagramGapStem == DIAGRAMGAP40KMH)
{
- resultString.append(QString::number(timeArray[4]));
+ time.sprintf("%.2f", timeArray[4]);
+ resultString.append(time);
this->setWindowTitle("Result for accelerating 40 km/h");
}
else if (this->diagramGapStem == DIAGRAMGAP30KMH)
{
- resultString.append(QString::number(timeArray[3]));
+ time.sprintf("%.2f", timeArray[3]);
+ resultString.append(time);
this->setWindowTitle("Result for accelerating 30 km/h");
}
else if (this->diagramGapStem == DIAGRAMGAP20KMH)
{
- resultString.append(QString::number(timeArray[2]));
+ time.sprintf("%.2f", timeArray[2]);
+ resultString.append(time);
this->setWindowTitle("Result for accelerating 20 km/h");
}
else
{
- resultString.append(QString::number(timeArray[1]));
+ time.sprintf("%.2f", timeArray[1]);
+ resultString.append(time);
this->setWindowTitle("Result for accelerating 10 km/h");
}
}
}
return targetChoice;
}
+
+void ResultDialog::setLabelInfoToUser(QString infoText)
+{
+ this->ui->labelInfoToUser->setText(infoText);
+}
+
void setEnd(int pValue);
void setValue(int pSpeed, double pTime);
+ void setLabelInfoToUser(QString infoText);
signals:
- void sendresult(double result);
+ void sendresult(double);
protected:
void changeEvent(QEvent *e);
<string>New run</string>
</property>
</widget>
+ <widget class="QLabel" name="labelInfoToUser">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>310</y>
+ <width>471</width>
+ <height>51</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
</widget>
<resources/>
<connections/>
painter.drawEllipse( x1Screen-5, y1Screen-5, 10, 10);
QString jono;
- jono = QString("%1 m/s").arg(maxv);
+ jono = QString("%1 km/h").arg(maxv);
ui->speedValueLabel->setText(jono);
}
}
QString rivi;
QFile file;
- QString fileName = QFileDialog::getOpenFileName(this,
- tr("Read Route"), "./", tr("Route Files (*.txt)"));
+ //QString fileName = QFileDialog::getOpenFileName(this,
+ // tr("Read Route"), "./", tr("Route Files (*.txt)"));
- file.setFileName( fileName);
+ //file.setFileName( fileName);
+ file.setFileName( "routetemp.xml");
if (!file.open(QIODevice::ReadOnly))
{
QMessageBox::about(0, "Error", "File not found");
}
vertexList.clear();
+
while(!file.atEnd())
{
+ int count;
+ bool allRead;
+ QString astr1, astr2, astr3, astr4;
QString str1, str2, str3, str4;
rivi = file.readLine();
+ allRead = false;
+ count = 0;
+ while( !allRead)
+ {
+ astr1 = rivi.section(" ", count*4+1, count*4+1); // latitude=""
+ astr2 = rivi.section(" ", count*4+2, count*4+2); // longitude=""
+ astr3 = rivi.section(" ", count*4+3, count*4+3); // altitude=""
+ astr4 = rivi.section(" ", count*4+4, count*4+4); // speed=""
+
+ {
+ double x, y, z, v;
+ str1 = astr1.section('"',1,1);
+ str2 = astr2.section('"',1,1);
+ str3 = astr3.section('"',1,1);
+ str4 = astr4.section('"',1,1);
+ //QString str = QString("%1 %2 %3 %4").arg(str1).arg(str2).arg(str3).arg(str4);
+ //QMessageBox::about(0, "LUKEE", str);
+ /* */
+
+ if (str1.length() > 0)
+ {
+ x = str2.toDouble();// latitude y-value
+ y = str1.toDouble();// longitude x-value
+ z = str3.toDouble();// altitude z-value
+ 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
+ temp.setY( y); // Latitude
+ temp.setZ( z); // altitude
+ temp.setV( v);
+
+ vertexList.append(temp);
+ count++;
+ }
+ else
+ {
+ allRead = true;
+ }
+ }
+ }
+ // Older version
+ /*
str1 = rivi.section(" ", 0, 0);
if (str1.compare("Start:") != 0 && str1.compare("Stop:") != 0)
{
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);
vertexList.append(temp);
}
}
+ */
}
file.close();
void RouteDialog::on_sendPushButton_clicked()
{
- // Send route points file to server
+ emit sendroute();
+}
+
+void RouteDialog::setLabelInfoToUser(QString infoText)
+{
+ this->ui->labelInfoToUser->setText(infoText);
}
int getTop();
int getRight();
int getBottom();
+ void setLabelInfoToUser(QString infoText);
+
+signals:
+ void sendroute();
protected:
void changeEvent(QEvent *e);
</item>
</layout>
</widget>
+ <widget class="QLabel" name="labelInfoToUser">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>310</y>
+ <width>521</width>
+ <height>51</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
</widget>
<resources>
<include location="graphics.qrc"/>
ui->labelRoutePicture->setVisible(0);
timerRoutePicture->stop();
location->stopPollingGPS();
- routeDialog->show();
+
+ QString routeFile = QString("routetemp.xml");
+ if (routeDialog->readRouteFromFile( routeFile) == true)
+ {
+ routeDialog->show();
+ }
//GPS speed label
ui->labelGpsSpeed->setVisible(0);
{
ui->setupUi(this);
this->setWindowTitle("Settings");
- this->ui->regEMailLineEdit->setText("@meili.fi");
+ this->ui->regEMailLineEdit->setText("@");
instructionsDialog = new InstructionsDialog;
if (loginSaved())
emit sendregistration();
- close();
+ //close(); //using close() hides popup-window which reports error from server
}
// Next 6 functions can be removed if Settingsdialog is implemented without
}
emit userNameChanged();
- close();
+
+ //close(); //using close() hides popup-window which reports error from server
}
// Next 4 functions can be removed if Settingsdialog is implemented without
return this->password;
}
+void SettingsDialog::setLabelInfoToUser(QString infoText)
+{
+ this->ui->labelInfoToUser->setText(infoText);
+}
void setPassword(QString password);
QString getUserName();
QString getPassword();
+ void setLabelInfoToUser(QString infoText);
signals:
void sendregistration();
<widget class="QPushButton" name="pushButtonHelp">
<property name="geometry">
<rect>
- <x>280</x>
- <y>300</y>
- <width>241</width>
+ <x>520</x>
+ <y>310</y>
+ <width>221</width>
<height>51</height>
</rect>
</property>
<widget class="QPushButton" name="setUserPushButton">
<property name="geometry">
<rect>
- <x>550</x>
- <y>240</y>
- <width>191</width>
+ <x>520</x>
+ <y>220</y>
+ <width>221</width>
<height>51</height>
</rect>
</property>
<widget class="QPushButton" name="registratePushButton">
<property name="geometry">
<rect>
- <x>550</x>
- <y>120</y>
- <width>191</width>
+ <x>520</x>
+ <y>60</y>
+ <width>221</width>
<height>51</height>
</rect>
</property>
<string>Register</string>
</property>
</widget>
- <widget class="QWidget" name="">
+ <widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>10</x>
<y>50</y>
- <width>531</width>
+ <width>491</width>
<height>121</height>
</rect>
</property>
</item>
</layout>
</widget>
- <widget class="QWidget" name="">
+ <widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>10</x>
<y>210</y>
- <width>531</width>
+ <width>491</width>
<height>81</height>
</rect>
</property>
</item>
</layout>
</widget>
+ <widget class="QLabel" name="labelInfoToUser">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>310</y>
+ <width>521</width>
+ <height>51</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
</widget>
<resources/>
<connections/>
emit refreshCategoryList();
}
-void TopResultDialog::on_pushButton_debclose_clicked()
-{
- close();
-}
-
void TopResultDialog::setCompoBoxCategories(QStringList list)
{
ui->comboBoxTopCategory->addItems(list);
recentCategoryIndex = index;
emit refreshTopList(index);
}
+
+void TopResultDialog::setLabelInfoToUser(QString infoText)
+{
+ this->ui->labelInfoToUser->setText(infoText);
+}
int getRecentCategoryIndex();
int getLimitNr();
void setLimitNr(int number);
+ void setLabelInfoToUser(QString infoText);
protected:
void changeEvent(QEvent *e);
private slots:
void on_comboBoxTopCategory_currentIndexChanged(int index);
- void on_pushButton_debclose_clicked();
void on_buttonTopRefresh_clicked();
};
<widget class="QListView" name="listViewTopList">
<property name="geometry">
<rect>
- <x>300</x>
+ <x>280</x>
<y>0</y>
- <width>471</width>
- <height>261</height>
+ <width>491</width>
+ <height>251</height>
</rect>
</property>
<property name="font">
<widget class="QLabel" name="labelTopList">
<property name="geometry">
<rect>
- <x>320</x>
+ <x>300</x>
<y>0</y>
- <width>431</width>
- <height>261</height>
+ <width>451</width>
+ <height>251</height>
</rect>
</property>
<property name="font">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
- <widget class="QPushButton" name="pushButton_debclose">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>20</y>
- <width>91</width>
- <height>27</height>
- </rect>
- </property>
- <property name="text">
- <string>PushButtondebclose</string>
- </property>
- </widget>
<widget class="QLabel" name="labelCategory">
<property name="geometry">
<rect>
<x>10</x>
- <y>210</y>
+ <y>200</y>
<width>221</width>
<height>51</height>
</rect>
<property name="geometry">
<rect>
<x>10</x>
- <y>269</y>
+ <y>260</y>
<width>601</width>
<height>41</height>
</rect>
</property>
</widget>
+ <widget class="QLabel" name="labelInfoToUser">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>310</y>
+ <width>521</width>
+ <height>51</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
</widget>
<resources/>
<connections/>