projects
/
speedfreak
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
191e117
)
Get category when top dialog started.
author
Toni Jussila
<toni.jussila@fudeco.com>
Fri, 16 Apr 2010 12:01:32 +0000
(15:01 +0300)
committer
Toni Jussila
<toni.jussila@fudeco.com>
Fri, 16 Apr 2010 12:01:32 +0000
(15:01 +0300)
Client/httpclient.cpp
patch
|
blob
|
history
Client/mainwindow.cpp
patch
|
blob
|
history
Client/mainwindow.h
patch
|
blob
|
history
Client/resultdialog.cpp
patch
|
blob
|
history
Client/resultdialog.ui
patch
|
blob
|
history
Client/routesavedialog.h
patch
|
blob
|
history
Client/routesavedialog.ui
patch
|
blob
|
history
Client/topresultdialog.cpp
patch
|
blob
|
history
Client/topresultdialog.ui
patch
|
blob
|
history
diff --git
a/Client/httpclient.cpp
b/Client/httpclient.cpp
index
acda598
..
547f3b8
100644
(file)
--- a/
Client/httpclient.cpp
+++ b/
Client/httpclient.cpp
@@
-115,7
+115,7
@@
void HttpClient::sendRouteXml()
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)));
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->routeDialog->setLabelInfoToUser("Sending route to server");
+ myMainw->routeSaveDialog->routeDialog->setLabelInfoToUser("Sending route to server");
file.close();
}
file.close();
}
@@
-230,7
+230,7
@@
void HttpClient::ackOfRoute()
{
qDebug() << "_ackOfRoute";
{
qDebug() << "_ackOfRoute";
- myMainw->routeDialog->setLabelInfoToUser("");
+ myMainw->routeSaveDialog->routeDialog->setLabelInfoToUser("");
QNetworkReply* reply = qobject_cast<QNetworkReply*>(sender());
QNetworkReply* reply = qobject_cast<QNetworkReply*>(sender());
@@
-238,7
+238,7
@@
void HttpClient::ackOfRoute()
errorcode = reply->error();
if(errorcode != 0) {
qDebug() << "errorcode:" << errorcode << reply->errorString();
errorcode = reply->error();
if(errorcode != 0) {
qDebug() << "errorcode:" << errorcode << reply->errorString();
- QMessageBox::about(myMainw->routeDialog, "Server reply to route sending ",reply->errorString());
+ QMessageBox::about(myMainw->routeSaveDialog->routeDialog, "Server reply to route sending ",reply->errorString());
}
else {
qDebug() << "errorcode:" << errorcode << reply->errorString();
}
else {
qDebug() << "errorcode:" << errorcode << reply->errorString();
@@
-287,11
+287,11
@@
void HttpClient::ackOfCategories()
errorcode = reply->error();
if(errorcode != 0) {
qDebug() << "errorcode:" << errorcode << reply->errorString();
errorcode = reply->error();
if(errorcode != 0) {
qDebug() << "errorcode:" << errorcode << reply->errorString();
- QMessageBox::about(myMainw->topResultDialog, "Server reply to requesting categories",reply->errorString());
+ //QMessageBox::about(myMainw->topResultDialog, "Server reply to requesting categories",reply->errorString());
}
else {
qDebug() << "errorcode:" << errorcode << reply->errorString();
}
else {
qDebug() << "errorcode:" << errorcode << reply->errorString();
- QMessageBox::about(myMainw->topResultDialog, "Server reply to requesting categories ", "OK");
+ //QMessageBox::about(myMainw->topResultDialog, "Server reply to requesting categories ", "OK");
}
}
}
}
@@
-361,7
+361,7
@@
void HttpClient::ackOfToplist()
errorcode = reply->error();
if(errorcode != 0) {
qDebug() << "errorcode:" << errorcode << reply->errorString();
errorcode = reply->error();
if(errorcode != 0) {
qDebug() << "errorcode:" << errorcode << reply->errorString();
- QMessageBox::about(myMainw->topResultDialog, "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();
}
else {
qDebug() << "errorcode:" << errorcode << reply->errorString();
diff --git
a/Client/mainwindow.cpp
b/Client/mainwindow.cpp
index
8179fd7
..
4f32eee
100644
(file)
--- a/
Client/mainwindow.cpp
+++ b/
Client/mainwindow.cpp
@@
-25,25
+25,21
@@
MainWindow::MainWindow(QWidget *parent) :
QCoreApplication::setOrganizationDomain("fudeco.com");
QCoreApplication::setApplicationName("Speed Freak");
QCoreApplication::setOrganizationDomain("fudeco.com");
QCoreApplication::setApplicationName("Speed Freak");
- routeDialog = new RouteDialog;
- connect(routeDialog,SIGNAL(sendroute()),this,SLOT(clientSendRoute()));
+ //routeDialog = new RouteDialog;
+ //connect(routeDialog,SIGNAL(sendroute()),this,SLOT(clientSendRoute()));
helpDialog = NULL;
helpDialog = NULL;
+ accstart = NULL;
routeSaveDialog = NULL;
routeSaveDialog = NULL;
+ topResultDialog = NULL;
settingsDialog = new SettingsDialog;
connect(settingsDialog,SIGNAL(sendregistration()),this,SLOT(clientRegUserToServer()));
connect(settingsDialog,SIGNAL(userNameChanged()),this,SLOT(clientUserLogin()));
settingsDialog = new SettingsDialog;
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)));
-
httpClient = new HttpClient(this);
connect(httpClient->myXmlreader, SIGNAL(receivedCategoryList()), this, SLOT(setCategoryCompoBox()));
httpClient = new HttpClient(this);
connect(httpClient->myXmlreader, SIGNAL(receivedCategoryList()), this, SLOT(setCategoryCompoBox()));
- connect(httpClient->myXmlreader, SIGNAL(receivedTop10List()), this, SLOT(showTop10()));
-
- accstart = NULL;
+ connect(httpClient->myXmlreader, SIGNAL(receivedTop10List()), this, SLOT(showTop10()));
//creditsDialog = new CreditsDialog;
//creditsDialog = new CreditsDialog;
@@
-68,11
+64,27
@@
MainWindow::MainWindow(QWidget *parent) :
MainWindow::~MainWindow()
{
delete ui;
MainWindow::~MainWindow()
{
delete ui;
- delete routeSaveDialog;
- delete routeDialog;
+
+ if(routeSaveDialog)
+ delete routeSaveDialog;
if(accstart)
delete accstart;
if(accstart)
delete accstart;
+
+ if(topResultDialog)
+ delete topResultDialog;
+
+ if(settingsDialog)
+ delete settingsDialog;
+
+ if(welcomeDialog)
+ delete welcomeDialog;
+
+ if(httpClient)
+ delete httpClient;
+
+ if(helpDialog)
+ delete helpDialog;
}
void MainWindow::changeEvent(QEvent *e)
}
void MainWindow::changeEvent(QEvent *e)
@@
-114,6
+126,7
@@
void MainWindow::on_pushButtonRoute_clicked()
if(!routeSaveDialog)
routeSaveDialog = new RouteSaveDialog;
connect(routeSaveDialog, SIGNAL(sendroute()), this, SLOT(clientSendRoute()));
if(!routeSaveDialog)
routeSaveDialog = new RouteSaveDialog;
connect(routeSaveDialog, SIGNAL(sendroute()), this, SLOT(clientSendRoute()));
+ connect(topResultDialog, SIGNAL(rejected()), this, SLOT(killDialog()));
routeSaveDialog->show();
}
routeSaveDialog->show();
}
@@
-133,6
+146,7
@@
void MainWindow::on_pushButtonAccelerate_clicked()
if(!accstart)
accstart = new accelerationstart(this);
connect(accstart, SIGNAL(sendresult(QString, double)), this, SLOT(clientSendResult(QString, double)));
if(!accstart)
accstart = new accelerationstart(this);
connect(accstart, SIGNAL(sendresult(QString, double)), this, SLOT(clientSendResult(QString, double)));
+ connect(topResultDialog, SIGNAL(rejected()), this, SLOT(killDialog()));
accstart->show();
}
accstart->show();
}
@@
-141,6
+155,12
@@
void MainWindow::on_pushButtonAccelerate_clicked()
*/
void MainWindow::on_pushButtonResults_clicked()
{
*/
void MainWindow::on_pushButtonResults_clicked()
{
+ if (!topResultDialog)
+ topResultDialog = new TopResultDialog;
+ clientRequestCategoryList();
+ connect(topResultDialog, SIGNAL(refreshCategoryList()), this, SLOT(clientRequestCategoryList()));
+ connect(topResultDialog, SIGNAL(refreshTopList(int)), this, SLOT(clientRequestTopList(int)));
+ connect(topResultDialog, SIGNAL(rejected()), this, SLOT(killDialog()));
topResultDialog->show();
}
topResultDialog->show();
}
@@
-193,7
+213,7
@@
void MainWindow::setListViewTopList(QString category, int size)
}
/**
}
/**
- * This function
+ * This function register user to server.
*/
void MainWindow::clientRegUserToServer()
{
*/
void MainWindow::clientRegUserToServer()
{
@@
-201,7
+221,7
@@
void MainWindow::clientRegUserToServer()
}
/**
}
/**
- * This function performs login to server
+ * This function performs login to server.
*/
void MainWindow::clientUserLogin()
{
*/
void MainWindow::clientUserLogin()
{
@@
-209,7
+229,7
@@
void MainWindow::clientUserLogin()
}
/**
}
/**
- * This function send route to server
+ * This function send route data to server.
*/
void MainWindow::clientSendRoute()
{
*/
void MainWindow::clientSendRoute()
{
@@
-217,7
+237,7
@@
void MainWindow::clientSendRoute()
}
/**
}
/**
- * This function send acceleration data to server
+ * This function send acceleration data to server.
*/
void MainWindow::clientSendResult(QString category, double result)
{
*/
void MainWindow::clientSendResult(QString category, double result)
{
@@
-227,3
+247,24
@@
void MainWindow::clientSendResult(QString category, double result)
httpClient->sendResultXml(category, result);
}
}
httpClient->sendResultXml(category, result);
}
}
+/**
+ * This slot function called when ever dialog finished.
+ */
+void MainWindow::killDialog()
+{
+ if(topResultDialog)
+ {
+ delete topResultDialog;
+ topResultDialog = NULL;
+ }
+ else if(routeSaveDialog)
+ {
+ delete routeSaveDialog;
+ routeSaveDialog = NULL;
+ }
+ else if(accstart)
+ {
+ delete accstart;
+ accstart = NULL;
+ }
+}
diff --git
a/Client/mainwindow.h
b/Client/mainwindow.h
index
87c603d
..
7619e24
100644
(file)
--- a/
Client/mainwindow.h
+++ b/
Client/mainwindow.h
@@
-40,7
+40,7
@@
public:
//CreditsDialog *creditsDialog;
RouteSaveDialog *routeSaveDialog;
//CreditsDialog *creditsDialog;
RouteSaveDialog *routeSaveDialog;
- RouteDialog *routeDialog;
+ //RouteDialog *routeDialog;
WelcomeDialog *welcomeDialog;
SettingsDialog *settingsDialog;
accelerationstart* accstart;
WelcomeDialog *welcomeDialog;
SettingsDialog *settingsDialog;
accelerationstart* accstart;
@@
-70,6
+70,7
@@
private slots:
void clientSendResult(QString category, double result);
void setCategoryCompoBox();
void showTop10();
void clientSendResult(QString category, double result);
void setCategoryCompoBox();
void showTop10();
+ void killDialog();
};
};
diff --git
a/Client/resultdialog.cpp
b/Client/resultdialog.cpp
index
38af4d2
..
e53db80
100644
(file)
--- a/
Client/resultdialog.cpp
+++ b/
Client/resultdialog.cpp
@@
-77,6
+77,9
@@
ResultDialog::ResultDialog(QWidget *parent) :
{
ui->pushButtonSend->setEnabled(false);
}
{
ui->pushButtonSend->setEnabled(false);
}
+
+ //Clear info label
+ ui->labelInfoToUser->setText("");
}
/**
}
/**
diff --git
a/Client/resultdialog.ui
b/Client/resultdialog.ui
index
6bd68bb
..
444fab4
100644
(file)
--- a/
Client/resultdialog.ui
+++ b/
Client/resultdialog.ui
@@
-7,7
+7,7
@@
<x>0</x>
<y>0</y>
<width>800</width>
<x>0</x>
<y>0</y>
<width>800</width>
- <height>480</height>
+ <height>380</height>
</rect>
</property>
<property name="windowTitle">
</rect>
</property>
<property name="windowTitle">
@@
-185,7
+185,7
@@
</rect>
</property>
<property name="text">
</rect>
</property>
<property name="text">
- <string/>
+ <string>User info label</string>
</property>
</widget>
</widget>
</property>
</widget>
</widget>
diff --git
a/Client/routesavedialog.h
b/Client/routesavedialog.h
index
8a0d539
..
64d1da5
100644
(file)
--- a/
Client/routesavedialog.h
+++ b/
Client/routesavedialog.h
@@
-27,6
+27,7
@@
class RouteSaveDialog : public QDialog {
public:
RouteSaveDialog(QWidget *parent = 0);
~RouteSaveDialog();
public:
RouteSaveDialog(QWidget *parent = 0);
~RouteSaveDialog();
+ RouteDialog *routeDialog;
protected:
void changeEvent(QEvent *e);
protected:
void changeEvent(QEvent *e);
@@
-37,7
+38,6
@@
private:
QTimer *timerRoutePicture;
GPSData *gpsData;
Maemo5Location *location;
QTimer *timerRoutePicture;
GPSData *gpsData;
Maemo5Location *location;
- RouteDialog *routeDialog;
QString gpsSpeed;
QPixmap *pixmapRouteStop;
QPixmap *pixmapRouteStart;
QString gpsSpeed;
QPixmap *pixmapRouteStop;
QPixmap *pixmapRouteStart;
diff --git
a/Client/routesavedialog.ui
b/Client/routesavedialog.ui
index
25d18ed
..
5edc2ff
100644
(file)
--- a/
Client/routesavedialog.ui
+++ b/
Client/routesavedialog.ui
@@
-182,6
+182,19
@@
<pixmap resource="graphics.qrc">:/new/prefix1/Graphics/sf_2.png</pixmap>
</property>
</widget>
<pixmap resource="graphics.qrc">:/new/prefix1/Graphics/sf_2.png</pixmap>
</property>
</widget>
+ <widget class="QLabel" name="label_2">
+ <property name="geometry">
+ <rect>
+ <x>200</x>
+ <y>320</y>
+ <width>501</width>
+ <height>41</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>User info label</string>
+ </property>
+ </widget>
</widget>
<resources>
<include location="graphics.qrc"/>
</widget>
<resources>
<include location="graphics.qrc"/>
diff --git
a/Client/topresultdialog.cpp
b/Client/topresultdialog.cpp
index
b7cfdd4
..
fafff58
100644
(file)
--- a/
Client/topresultdialog.cpp
+++ b/
Client/topresultdialog.cpp
@@
-24,6
+24,10
@@
TopResultDialog::TopResultDialog(QWidget *parent) :
//Button settings
ui->buttonTopRefresh->setAutoFillBackground(true);
ui->buttonTopRefresh->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)");
//Button settings
ui->buttonTopRefresh->setAutoFillBackground(true);
ui->buttonTopRefresh->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)");
+
+ //Clear labels
+ ui->labelInfoToUser->setText("");
+ ui->labelTopList->setText("");
}
TopResultDialog::~TopResultDialog()
}
TopResultDialog::~TopResultDialog()
diff --git
a/Client/topresultdialog.ui
b/Client/topresultdialog.ui
index
01d976c
..
9089f32
100644
(file)
--- a/
Client/topresultdialog.ui
+++ b/
Client/topresultdialog.ui
@@
-47,19
+47,19
@@
<widget class="QLabel" name="labelTopList">
<property name="geometry">
<rect>
<widget class="QLabel" name="labelTopList">
<property name="geometry">
<rect>
- <x>150</x>
+ <x>120</x>
<y>70</y>
<y>70</y>
- <width>471</width>
+ <width>521</width>
<height>251</height>
</rect>
</property>
<property name="font">
<font>
<height>251</height>
</rect>
</property>
<property name="font">
<font>
- <pointsize>9</pointsize>
+ <pointsize>11</pointsize>
</font>
</property>
<property name="text">
</font>
</property>
<property name="text">
- <string/>
+ <string>Top list label</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
@@
-104,7
+104,7
@@
</rect>
</property>
<property name="text">
</rect>
</property>
<property name="text">
- <string/>
+ <string>Info label</string>
</property>
</widget>
<widget class="QLabel" name="label">
</property>
</widget>
<widget class="QLabel" name="label">