Route and Results buttons updated.
authorJukka Kurttila <jktla@suomi24.fi>
Tue, 27 Apr 2010 11:57:06 +0000 (14:57 +0300)
committerJukka Kurttila <jktla@suomi24.fi>
Tue, 27 Apr 2010 11:57:06 +0000 (14:57 +0300)
Client/Graphics/route_selected.png [new file with mode: 0644]
Client/Graphics/trophy_gold_selected.png [new file with mode: 0644]
Client/graphics.qrc
Client/mainwindow.cpp
Client/mainwindow.h
Client/mainwindow.ui

diff --git a/Client/Graphics/route_selected.png b/Client/Graphics/route_selected.png
new file mode 100644 (file)
index 0000000..846d193
Binary files /dev/null and b/Client/Graphics/route_selected.png differ
diff --git a/Client/Graphics/trophy_gold_selected.png b/Client/Graphics/trophy_gold_selected.png
new file mode 100644 (file)
index 0000000..d42a7ea
Binary files /dev/null and b/Client/Graphics/trophy_gold_selected.png differ
index 50b60bc..f0c4aa2 100644 (file)
@@ -22,5 +22,7 @@
         <file>Graphics/sf_2.png</file>
         <file>Graphics/measuringDialog.png</file>
         <file>Graphics/settingsDialog.png</file>
         <file>Graphics/sf_2.png</file>
         <file>Graphics/measuringDialog.png</file>
         <file>Graphics/settingsDialog.png</file>
+        <file>Graphics/route_selected.png</file>
+        <file>Graphics/trophy_gold_selected.png</file>
     </qresource>
 </RCC>
     </qresource>
 </RCC>
index 741b179..2341248 100644 (file)
@@ -46,12 +46,6 @@ MainWindow::MainWindow(QWidget *parent) :
     this->setUsernameToMainPanel();
 
     //Button settings
     this->setUsernameToMainPanel();
 
     //Button settings
-    //ui->pushButtonAccelerate->setAutoFillBackground(true);
-    //ui->pushButtonAccelerate->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)");
-    ui->pushButtonRoute->setAutoFillBackground(true);
-    ui->pushButtonRoute->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)");
-    ui->pushButtonResults->setAutoFillBackground(true);
-    ui->pushButtonResults->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)");
     ui->pushButtonSettings->setAutoFillBackground(true);
     ui->pushButtonSettings->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)");
     ui->pushButtonWWW->setAutoFillBackground(true);
     ui->pushButtonSettings->setAutoFillBackground(true);
     ui->pushButtonSettings->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)");
     ui->pushButtonWWW->setAutoFillBackground(true);
@@ -59,19 +53,50 @@ MainWindow::MainWindow(QWidget *parent) :
     ui->pushButtonCredits->setAutoFillBackground(true);
     ui->pushButtonCredits->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)");
 
     ui->pushButtonCredits->setAutoFillBackground(true);
     ui->pushButtonCredits->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)");
 
+    //Create icon for acceleration start button
     QIcon* icon = new QIcon();
     icon->addFile(QString(":/new/prefix1/Graphics/Speedometer.png"), QSize(125,125), QIcon::Normal, QIcon::Off);
     icon->addFile(QString(":/new/prefix1/Graphics/Speedometer2.png"), QSize(125,125), QIcon::Normal, QIcon::On);
 
     QIcon* icon = new QIcon();
     icon->addFile(QString(":/new/prefix1/Graphics/Speedometer.png"), QSize(125,125), QIcon::Normal, QIcon::Off);
     icon->addFile(QString(":/new/prefix1/Graphics/Speedometer2.png"), QSize(125,125), QIcon::Normal, QIcon::On);
 
+    //Acceleration start button
+
     customButtonAccelerate = new CustomButton(this,icon);
     delete icon;
 
     int buttons_x = 50,buttons_y = 165;
     customButtonAccelerate->setGeometry(buttons_x,buttons_y,130,130);
     connect(customButtonAccelerate, SIGNAL(OpenDialog()), this, SLOT(OpenAccStartDialog()));
     customButtonAccelerate = new CustomButton(this,icon);
     delete icon;
 
     int buttons_x = 50,buttons_y = 165;
     customButtonAccelerate->setGeometry(buttons_x,buttons_y,130,130);
     connect(customButtonAccelerate, SIGNAL(OpenDialog()), this, SLOT(OpenAccStartDialog()));
-
     customButtonAccelerate->show();
 
     customButtonAccelerate->show();
 
+    //Create icon for route dialog button
+    icon = new QIcon();
+    icon->addFile(QString(":/new/prefix1/Graphics/route.png"), QSize(125,125), QIcon::Normal, QIcon::Off);
+    icon->addFile(QString(":/new/prefix1/Graphics/route_selected.png"), QSize(125,125), QIcon::Normal, QIcon::On);
+
+    //Route dialog button
+
+    customButtonRoute = new CustomButton(this,icon);
+    delete icon;
+
+    buttons_x += 140;
+    customButtonRoute->setGeometry(buttons_x,buttons_y,130,130);
+    connect(customButtonRoute, SIGNAL(OpenDialog()), this, SLOT(OpenRouteDialog()));
+    customButtonRoute->show();
+
+    //Create icon for results dialog button
+    icon = new QIcon();
+    icon->addFile(QString(":/new/prefix1/Graphics/trophy_gold.png"), QSize(125,125), QIcon::Normal, QIcon::Off);
+    icon->addFile(QString(":/new/prefix1/Graphics/trophy_gold_selected.png"), QSize(125,125), QIcon::Normal, QIcon::On);
+
+    //Results dialog button
+
+    customButtonResults = new CustomButton(this,icon);
+    delete icon;
+
+    buttons_x += 140;
+    customButtonResults->setGeometry(buttons_x,buttons_y,130,130);
+    connect(customButtonResults, SIGNAL(OpenDialog()), this, SLOT(OpenResultDialog()));
+    customButtonResults->show();
 }
 
 MainWindow::~MainWindow()
 }
 
 MainWindow::~MainWindow()
@@ -101,6 +126,10 @@ MainWindow::~MainWindow()
 
     if(customButtonAccelerate)
         delete customButtonAccelerate;
 
     if(customButtonAccelerate)
         delete customButtonAccelerate;
+    if(customButtonRoute)
+        delete customButtonRoute;
+    if(customButtonResults)
+        delete customButtonResults;
 
 }
 
 
 }
 
@@ -137,19 +166,6 @@ void MainWindow::on_pushButtonCredits_clicked()
 }
 
 /**
 }
 
 /**
-  * This slot function opens the route save dialog
-  */
-void MainWindow::on_pushButtonRoute_clicked()
-{
-    if(!routeSaveDialog)
-        routeSaveDialog = new RouteSaveDialog;
-
-    connect(routeSaveDialog, SIGNAL(sendroute()), this, SLOT(clientSendRoute()));
-    connect(routeSaveDialog, SIGNAL(rejected()), this, SLOT(killDialog()));
-    routeSaveDialog->show();
-}
-
-/**
   * This slot function opens the settings dialog
   */
 void MainWindow::on_pushButtonSettings_clicked()
   * This slot function opens the settings dialog
   */
 void MainWindow::on_pushButtonSettings_clicked()
@@ -158,21 +174,6 @@ void MainWindow::on_pushButtonSettings_clicked()
 }
 
 /**
 }
 
 /**
-  * This slot function opens the top results dialog
-  */
-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();
-}
-
-/**
   *This slot function is called when ever mytTopResultDialog emits signal refreshCategoryList button clicked.
   */
 void MainWindow::clientRequestCategoryList()
   *This slot function is called when ever mytTopResultDialog emits signal refreshCategoryList button clicked.
   */
 void MainWindow::clientRequestCategoryList()
@@ -341,3 +342,29 @@ void MainWindow::OpenAccStartDialog()
     connect(accstart, SIGNAL(rejected()), this, SLOT(killDialog()));
     accstart->show();
 }
     connect(accstart, SIGNAL(rejected()), this, SLOT(killDialog()));
     accstart->show();
 }
+/**
+  * This slot function opens the route save dialog
+  */
+void MainWindow::OpenRouteDialog()
+{
+    if(!routeSaveDialog)
+        routeSaveDialog = new RouteSaveDialog;
+
+    connect(routeSaveDialog, SIGNAL(sendroute()), this, SLOT(clientSendRoute()));
+    connect(routeSaveDialog, SIGNAL(rejected()), this, SLOT(killDialog()));
+    routeSaveDialog->show();
+}
+/**
+  * This slot function opens the top results dialog
+  */
+void MainWindow::OpenResultDialog()
+{
+    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();
+}
index 9fe56f7..4fbdb0d 100644 (file)
@@ -57,11 +57,11 @@ private:
     void setListViewTopList(QString category, int size);
 
     CustomButton* customButtonAccelerate;
     void setListViewTopList(QString category, int size);
 
     CustomButton* customButtonAccelerate;
+    CustomButton* customButtonRoute;
+    CustomButton* customButtonResults;
 
 private slots:
 
 private slots:
-    void on_pushButtonResults_clicked();
     void on_pushButtonSettings_clicked();
     void on_pushButtonSettings_clicked();
-    void on_pushButtonRoute_clicked();
     void on_pushButtonCredits_clicked();
     void on_pushButtonWWW_clicked();
     void clientRequestCategoryList();
     void on_pushButtonCredits_clicked();
     void on_pushButtonWWW_clicked();
     void clientRequestCategoryList();
@@ -75,6 +75,8 @@ private slots:
     void killDialog();
     void setUsernameToMainPanel();
     void OpenAccStartDialog();
     void killDialog();
     void setUsernameToMainPanel();
     void OpenAccStartDialog();
+    void OpenRouteDialog();
+    void OpenResultDialog();
 
 };
 
 
 };
 
index 0580f42..562ec58 100644 (file)
    <string>SpeedFreak</string>
   </property>
   <widget class="QWidget" name="centralWidget">
    <string>SpeedFreak</string>
   </property>
   <widget class="QWidget" name="centralWidget">
-   <widget class="QPushButton" name="pushButtonRoute">
-    <property name="geometry">
-     <rect>
-      <x>190</x>
-      <y>150</y>
-      <width>130</width>
-      <height>130</height>
-     </rect>
-    </property>
-    <property name="text">
-     <string/>
-    </property>
-    <property name="icon">
-     <iconset resource="graphics.qrc">
-      <normaloff>:/new/prefix1/Graphics/route.png</normaloff>:/new/prefix1/Graphics/route.png</iconset>
-    </property>
-    <property name="iconSize">
-     <size>
-      <width>125</width>
-      <height>125</height>
-     </size>
-    </property>
-   </widget>
-   <widget class="QPushButton" name="pushButtonResults">
-    <property name="geometry">
-     <rect>
-      <x>330</x>
-      <y>150</y>
-      <width>130</width>
-      <height>130</height>
-     </rect>
-    </property>
-    <property name="text">
-     <string/>
-    </property>
-    <property name="icon">
-     <iconset resource="graphics.qrc">
-      <normaloff>:/new/prefix1/Graphics/trophy_gold.png</normaloff>:/new/prefix1/Graphics/trophy_gold.png</iconset>
-    </property>
-    <property name="iconSize">
-     <size>
-      <width>125</width>
-      <height>125</height>
-     </size>
-    </property>
-   </widget>
    <widget class="QPushButton" name="pushButtonSettings">
     <property name="geometry">
      <rect>
    <widget class="QPushButton" name="pushButtonSettings">
     <property name="geometry">
      <rect>