From e5596c8e8492c120bb15c404d3e0142061ad09ab Mon Sep 17 00:00:00 2001 From: Olavi Pulkkinen Date: Wed, 17 Mar 2010 10:25:31 +0200 Subject: [PATCH] Addede route dialog to view stored route. --- Client/carmainwindow.cpp | 8 ++ Client/carmainwindow.h | 3 + Client/carmainwindow.ui | 188 +++++++++++++++++++++++----------------------- Client/routedialog.cpp | 31 ++++++++ Client/routedialog.h | 26 +++++++ Client/routedialog.ui | 32 ++++++++ 6 files changed, 194 insertions(+), 94 deletions(-) create mode 100644 Client/routedialog.cpp create mode 100644 Client/routedialog.h create mode 100644 Client/routedialog.ui diff --git a/Client/carmainwindow.cpp b/Client/carmainwindow.cpp index aa873c4..e5f35f8 100644 --- a/Client/carmainwindow.cpp +++ b/Client/carmainwindow.cpp @@ -34,6 +34,8 @@ CarMainWindow::CarMainWindow(QWidget *parent):QMainWindow(parent), ui(new Ui::Ca myRegistration = new Registration(this); connect(myRegistration,SIGNAL(sendregistration()),this,SLOT(regUserToServer())); + myRoute = new RouteDialog( this); + time = 0; speed = 0; timer = new QTimer(); @@ -65,6 +67,7 @@ CarMainWindow::~CarMainWindow() //delete measure; delete categorylist; delete welcomeDialog; + delete myRoute; } /** @@ -420,3 +423,8 @@ void CarMainWindow::regUserToServer() { myHttpClient->requestRegistration(); } + +void CarMainWindow::on_drawRoutePushButton_clicked() +{ + myRoute->show(); +} diff --git a/Client/carmainwindow.h b/Client/carmainwindow.h index f7ee50e..6e6582b 100644 --- a/Client/carmainwindow.h +++ b/Client/carmainwindow.h @@ -38,6 +38,7 @@ #include "accelerometer.h" #include "categorylist.h" #include "httpclient.h" +#include "routedialog.h" namespace Ui { class CarMainWindow; @@ -67,6 +68,7 @@ private: CategoryList *categorylist; HttpClient *myHttpClient; LoginWindow *myLogin; + RouteDialog *myRoute; //void initCategoryCompoBox(); void initComboBoxStartTabUnits(); //Start-tab view void initListViewStartTabAccelerationCategories(); //Start-tab view @@ -88,6 +90,7 @@ signals: void userNameChanged(); private slots: + void on_drawRoutePushButton_clicked(); void on_pushButtonSendResult_clicked(); void on_pushButtonMeasureTabAbort_clicked(); void on_manualStartButton_clicked(); diff --git a/Client/carmainwindow.ui b/Client/carmainwindow.ui index 817c55c..f619f55 100644 --- a/Client/carmainwindow.ui +++ b/Client/carmainwindow.ui @@ -26,6 +26,100 @@ 4 + + + Top + + + + + 10 + 210 + 221 + 71 + + + + + Bitstream Charter + 16 + 75 + true + + + + Refresh list + + + + + + 360 + 10 + 411 + 311 + + + + + Bitstream Charter + 10 + + + + QListView::LeftToRight + + + + + + 10 + 10 + 341 + 141 + + + + + + + + Bitstream Charter + 16 + + + + Category: + + + + + + + + + + + + 380 + 10 + 371 + 311 + + + + + 9 + + + + TopList + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + Start @@ -125,100 +219,6 @@ - - - Top - - - - - 10 - 210 - 221 - 71 - - - - - Bitstream Charter - 16 - 75 - true - - - - Refresh list - - - - - - 360 - 10 - 411 - 311 - - - - - Bitstream Charter - 10 - - - - QListView::LeftToRight - - - - - - 10 - 10 - 341 - 141 - - - - - - - - Bitstream Charter - 16 - - - - Category: - - - - - - - - - - - - 380 - 10 - 371 - 311 - - - - - 9 - - - - TopList - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - Settings diff --git a/Client/routedialog.cpp b/Client/routedialog.cpp new file mode 100644 index 0000000..6290174 --- /dev/null +++ b/Client/routedialog.cpp @@ -0,0 +1,31 @@ +#include "routedialog.h" +#include "ui_routedialog.h" + +RouteDialog::RouteDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::RouteDialog) +{ + ui->setupUi(this); +} + +RouteDialog::~RouteDialog() +{ + delete ui; +} + +void RouteDialog::changeEvent(QEvent *e) +{ + QDialog::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: + break; + } +} + +void RouteDialog::on_closePushButton_clicked() +{ + close(); +} diff --git a/Client/routedialog.h b/Client/routedialog.h new file mode 100644 index 0000000..333b097 --- /dev/null +++ b/Client/routedialog.h @@ -0,0 +1,26 @@ +#ifndef ROUTEDIALOG_H +#define ROUTEDIALOG_H + +#include + +namespace Ui { + class RouteDialog; +} + +class RouteDialog : public QDialog { + Q_OBJECT +public: + RouteDialog(QWidget *parent = 0); + ~RouteDialog(); + +protected: + void changeEvent(QEvent *e); + +private: + Ui::RouteDialog *ui; + +private slots: + void on_closePushButton_clicked(); +}; + +#endif // ROUTEDIALOG_H diff --git a/Client/routedialog.ui b/Client/routedialog.ui new file mode 100644 index 0000000..c2e3424 --- /dev/null +++ b/Client/routedialog.ui @@ -0,0 +1,32 @@ + + + RouteDialog + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + 140 + 226 + 121 + 41 + + + + Close + + + + + + -- 1.7.9.5