Addede route dialog to view stored route.
authorOlavi Pulkkinen <olavi.pulkkinen@fudeco.com>
Wed, 17 Mar 2010 08:25:31 +0000 (10:25 +0200)
committerToni Jussila <toni.jussila@fudeco.com>
Wed, 17 Mar 2010 09:48:17 +0000 (11:48 +0200)
Client/carmainwindow.cpp
Client/carmainwindow.h
Client/carmainwindow.ui
Client/routedialog.cpp [new file with mode: 0644]
Client/routedialog.h [new file with mode: 0644]
Client/routedialog.ui [new file with mode: 0644]

index aa873c4..e5f35f8 100644 (file)
@@ -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();
+}
index f7ee50e..6e6582b 100644 (file)
@@ -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();
index 817c55c..f619f55 100644 (file)
     <property name="currentIndex">
      <number>4</number>
     </property>
+    <widget class="QWidget" name="tabTop">
+     <attribute name="title">
+      <string>Top</string>
+     </attribute>
+     <widget class="QPushButton" name="buttonTopRefresh">
+      <property name="geometry">
+       <rect>
+        <x>10</x>
+        <y>210</y>
+        <width>221</width>
+        <height>71</height>
+       </rect>
+      </property>
+      <property name="font">
+       <font>
+        <family>Bitstream Charter</family>
+        <pointsize>16</pointsize>
+        <weight>75</weight>
+        <bold>true</bold>
+       </font>
+      </property>
+      <property name="text">
+       <string>Refresh list</string>
+      </property>
+     </widget>
+     <widget class="QListView" name="listViewTopList">
+      <property name="geometry">
+       <rect>
+        <x>360</x>
+        <y>10</y>
+        <width>411</width>
+        <height>311</height>
+       </rect>
+      </property>
+      <property name="font">
+       <font>
+        <family>Bitstream Charter</family>
+        <pointsize>10</pointsize>
+       </font>
+      </property>
+      <property name="flow">
+       <enum>QListView::LeftToRight</enum>
+      </property>
+     </widget>
+     <widget class="QWidget" name="layoutWidget">
+      <property name="geometry">
+       <rect>
+        <x>10</x>
+        <y>10</y>
+        <width>341</width>
+        <height>141</height>
+       </rect>
+      </property>
+      <layout class="QVBoxLayout" name="verticalLayout_3">
+       <item>
+        <widget class="QLabel" name="labelCategory">
+         <property name="font">
+          <font>
+           <family>Bitstream Charter</family>
+           <pointsize>16</pointsize>
+          </font>
+         </property>
+         <property name="text">
+          <string>Category:</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QComboBox" name="comboBoxTopCategory"/>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QLabel" name="labelTopList">
+      <property name="geometry">
+       <rect>
+        <x>380</x>
+        <y>10</y>
+        <width>371</width>
+        <height>311</height>
+       </rect>
+      </property>
+      <property name="font">
+       <font>
+        <pointsize>9</pointsize>
+       </font>
+      </property>
+      <property name="text">
+       <string>TopList</string>
+      </property>
+      <property name="alignment">
+       <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+      </property>
+     </widget>
+    </widget>
     <widget class="QWidget" name="StartTab">
      <attribute name="title">
       <string>Start</string>
       </property>
      </widget>
     </widget>
-    <widget class="QWidget" name="tabTop">
-     <attribute name="title">
-      <string>Top</string>
-     </attribute>
-     <widget class="QPushButton" name="buttonTopRefresh">
-      <property name="geometry">
-       <rect>
-        <x>10</x>
-        <y>210</y>
-        <width>221</width>
-        <height>71</height>
-       </rect>
-      </property>
-      <property name="font">
-       <font>
-        <family>Bitstream Charter</family>
-        <pointsize>16</pointsize>
-        <weight>75</weight>
-        <bold>true</bold>
-       </font>
-      </property>
-      <property name="text">
-       <string>Refresh list</string>
-      </property>
-     </widget>
-     <widget class="QListView" name="listViewTopList">
-      <property name="geometry">
-       <rect>
-        <x>360</x>
-        <y>10</y>
-        <width>411</width>
-        <height>311</height>
-       </rect>
-      </property>
-      <property name="font">
-       <font>
-        <family>Bitstream Charter</family>
-        <pointsize>10</pointsize>
-       </font>
-      </property>
-      <property name="flow">
-       <enum>QListView::LeftToRight</enum>
-      </property>
-     </widget>
-     <widget class="QWidget" name="layoutWidget">
-      <property name="geometry">
-       <rect>
-        <x>10</x>
-        <y>10</y>
-        <width>341</width>
-        <height>141</height>
-       </rect>
-      </property>
-      <layout class="QVBoxLayout" name="verticalLayout_3">
-       <item>
-        <widget class="QLabel" name="labelCategory">
-         <property name="font">
-          <font>
-           <family>Bitstream Charter</family>
-           <pointsize>16</pointsize>
-          </font>
-         </property>
-         <property name="text">
-          <string>Category:</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QComboBox" name="comboBoxTopCategory"/>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QLabel" name="labelTopList">
-      <property name="geometry">
-       <rect>
-        <x>380</x>
-        <y>10</y>
-        <width>371</width>
-        <height>311</height>
-       </rect>
-      </property>
-      <property name="font">
-       <font>
-        <pointsize>9</pointsize>
-       </font>
-      </property>
-      <property name="text">
-       <string>TopList</string>
-      </property>
-      <property name="alignment">
-       <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
-      </property>
-     </widget>
-    </widget>
     <widget class="QWidget" name="settingsTab">
      <attribute name="title">
       <string>Settings</string>
diff --git a/Client/routedialog.cpp b/Client/routedialog.cpp
new file mode 100644 (file)
index 0000000..6290174
--- /dev/null
@@ -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 (file)
index 0000000..333b097
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef ROUTEDIALOG_H
+#define ROUTEDIALOG_H
+
+#include <QDialog>
+
+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 (file)
index 0000000..c2e3424
--- /dev/null
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>RouteDialog</class>
+ <widget class="QDialog" name="RouteDialog">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>400</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Dialog</string>
+  </property>
+  <widget class="QPushButton" name="closePushButton">
+   <property name="geometry">
+    <rect>
+     <x>140</x>
+     <y>226</y>
+     <width>121</width>
+     <height>41</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Close</string>
+   </property>
+  </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>