Permalink
Browse files

Added pages

  • Loading branch information...
1 parent 892474d commit e12733e4122f10377dab6df6fa248a353ba6c58a @Gabriano Gabriano committed Apr 25, 2011
Showing with 84 additions and 16 deletions.
  1. +1 −0 cartescene.cpp
  2. +5 −5 pages/mainmenupage.cpp
  3. +1 −1 pages/mainmenupage.h
  4. +11 −2 projet.pro
  5. +8 −5 ui_userinterface.h
  6. +44 −2 userinterface.cpp
  7. +5 −0 userinterface.h
  8. +9 −1 userinterface.ui
View
@@ -186,6 +186,7 @@ CarteScene* CarteScene::readSceneFile(const QString &file)
}
} else if (f.error() != QFile::NoError) {
qDebug() << QString(trUtf8("Erreur: Impossible de lire le fichier %1 : %2")).arg(file,f.errorString()); {
+
f.close();
delete scene;
return 0;
View
@@ -8,18 +8,18 @@ MainMenuPage::MainMenuPage(QWidget *parent):
{
QPushButton *btnBookCar = new QPushButton(trUtf8("Réserver une voiture"));
QPushButton *btnBookings = new QPushButton(trUtf8("Voir mes réservations"));
- QPushButton *btnLeaveComment = new QPushButton(trUtf8("Laisser une commentaire"));
- QPushButton *btnReportProblem = new QPushButton(trUtf8("Rapporter un imprévu"));
+ QPushButton *btnLeaveComment = new QPushButton(trUtf8("Laisser un commentaire"));
+ QPushButton *btnReportUnexpected = new QPushButton(trUtf8("Rapporter un imprévu"));
btnBookCar->setIcon(QIcon(":/icones/data/icons/car_add.png"));
btnBookings->setIcon(QIcon(":/icones/data/icons/table_multiple.png"));
btnLeaveComment->setIcon(QIcon(":/icones/data/icons/pencil.png"));
- btnReportProblem->setIcon(QIcon(":/icones/data/icons/error.png"));
+ btnReportUnexpected->setIcon(QIcon(":/icones/data/icons/error.png"));
addWidget(btnBookCar);
addWidget(btnBookings);
addWidget(btnLeaveComment);
- addWidget(btnReportProblem);
+ addWidget(btnReportUnexpected);
QPushButton *btnQuit = new QPushButton(trUtf8("Quitter"));
addBottomButtons(0, btnQuit, 0);
@@ -28,5 +28,5 @@ MainMenuPage::MainMenuPage(QWidget *parent):
connect(btnBookCar, SIGNAL(clicked()), SIGNAL(BookCar()));
connect(btnBookings, SIGNAL(clicked()), SIGNAL(ViewBookings()));
connect(btnLeaveComment, SIGNAL(clicked()), SIGNAL(LeaveComment()));
- connect(btnReportProblem, SIGNAL(clicked()), SIGNAL(ReportProblem()));
+ connect(btnReportUnexpected, SIGNAL(clicked()), SIGNAL(ReportUnexpected()));
}
View
@@ -17,7 +17,7 @@ public slots:
void BookCar();
void ViewBookings();
void LeaveComment();
- void ReportProblem();
+ void ReportUnexpected();
};
#endif // MAINMENUPAGE_H
View
@@ -44,7 +44,12 @@ HEADERS += geoposition.h \
pages/selecttimepage.h \
pages/selectcarpage.h \
pages/confirmpage.h \
- stationsortproxy.h
+ stationsortproxy.h \
+ pages/commentspage.h \
+ pages/unexpectedpage.h \
+ pages/myrsvppage.h \
+ pages/bookingspage.h \
+ pages/mymessagespage.h
FORMS += mainwindow.ui \
cartewidget.ui \
userinterface.ui
@@ -78,7 +83,11 @@ SOURCES += geoposition.cpp \
pages/selecttimepage.cpp \
pages/selectcarpage.cpp \
pages/confirmpage.cpp \
- stationsortproxy.cpp
+ stationsortproxy.cpp \
+ pages/commentspage.cpp \
+ pages/unexpectedpage.cpp \
+ pages/bookingspage.cpp \
+ pages/mymessagespage.cpp
RESOURCES += \
icones.qrc
View
@@ -17,6 +17,7 @@
#include <QtGui/QHBoxLayout>
#include <QtGui/QHeaderView>
#include <QtGui/QLabel>
+#include <QtGui/QPushButton>
#include <QtGui/QMainWindow>
#include <QtGui/QSpacerItem>
#include <QtGui/QStackedWidget>
@@ -31,7 +32,7 @@ class Ui_UserInterface
QWidget *centralwidget;
QVBoxLayout *verticalLayout;
QHBoxLayout *horizontalLayout;
- QLabel *lblEnveloppe;
+ QPushButton *btnEnveloppe;
QSpacerItem *horizontalSpacer;
QLabel *label_2;
QSpacerItem *horizontalSpacer_2;
@@ -51,10 +52,12 @@ class Ui_UserInterface
verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
horizontalLayout = new QHBoxLayout();
horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
- lblEnveloppe = new QLabel(centralwidget);
- lblEnveloppe->setObjectName(QString::fromUtf8("lblEnveloppe"));
+ btnEnveloppe = new QPushButton(centralwidget);
+ btnEnveloppe->setFlat(1);
+ btnEnveloppe->setIcon(QIcon(":/icones/data/icons/email.png"));
- horizontalLayout->addWidget(lblEnveloppe);
+
+ horizontalLayout->addWidget(btnEnveloppe);
horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
@@ -107,7 +110,7 @@ class Ui_UserInterface
void retranslateUi(QMainWindow *UserInterface)
{
UserInterface->setWindowTitle(QApplication::translate("UserInterface", "Auto-Partage", 0, QApplication::UnicodeUTF8));
- lblEnveloppe->setText(QString());
+ //lblEnveloppe->setText(QString());
label_2->setText(QApplication::translate("UserInterface", "Auto-Partage", 0, QApplication::UnicodeUTF8));
lblUserName->setText(QApplication::translate("UserInterface", "Tania", 0, QApplication::UnicodeUTF8));
} // retranslateUi
View
@@ -9,6 +9,10 @@
#include "pages/selecttimepage.h"
#include "pages/selectcarpage.h"
#include "pages/confirmpage.h"
+#include "pages/commentspage.h"
+#include "pages/unexpectedpage.h"
+#include "pages/bookingspage.h"
+#include "pages/mymessagespage.h"
#include "stationmodel.h"
#include "stationsortproxy.h"
@@ -26,8 +30,8 @@ UserInterface::UserInterface(
ui(new Ui::UserInterface)
{
ui->setupUi(this);
- ui->lblEnveloppe->setPixmap(QPixmap(":/icones/data/icons/email.png"));
- ui->lblEnveloppe->setCursor(QCursor(Qt::PointingHandCursor));
+ //ui->lblEnveloppe->setPixmap(QPixmap(":/icones/data/icons/email.png"));
+ //ui->lblEnveloppe->setCursor(QCursor(Qt::PointingHandCursor));
StationSortProxy *stationProxy = new StationSortProxy(this);
stationProxy->setSourceModel(stationModel);
@@ -42,6 +46,10 @@ UserInterface::UserInterface(
pages->insert(Page_SelectTime, new SelectTimePage(this));
pages->insert(Page_SelectCar, new SelectCarPage(this));
pages->insert(Page_Confirm, new ConfirmPage(this));
+ pages->insert(Page_Bookings, new BookingsPage(this));
+ pages->insert(Page_Comments, new CommentsPage(this));
+ pages->insert(Page_Unexpected, new UnexpectedPage(this));
+ pages->insert(Page_Email, new MyMessagesPage(this));
QMapIterator<PageName, Page*> iter(*pages);
while (iter.hasNext()) {
@@ -51,8 +59,14 @@ UserInterface::UserInterface(
ui->stackedWidget->setCurrentIndex(ui->stackedWidget->indexOf(getPage(DEFAULT_PAGE)));
+ // Connections for email
+ connect(ui->btnEnveloppe, SIGNAL(clicked()), this, SLOT(gotoEmailPage()));
+
// Connections for main menu
connect(getPage(Page_MainMenu), SIGNAL(BookCar()), this, SLOT(gotoFindStationPage()));
+ connect(getPage(Page_MainMenu), SIGNAL(ViewBookings()), this, SLOT(gotoBookings()));
+ connect(getPage(Page_MainMenu), SIGNAL(LeaveComment()), this, SLOT(gotoCommentPage()));
+ connect(getPage(Page_MainMenu), SIGNAL(ReportUnexpected()), this, SLOT(gotoUnexpected()));
// Connections for find station
connect(getPage(Page_FindStation), SIGNAL(Menu()), this, SLOT(gotoMainMenu()));
@@ -83,6 +97,18 @@ UserInterface::UserInterface(
connect(getPage(Page_Confirm), SIGNAL(Menu()), this, SLOT(gotoMainMenu()));
connect(getPage(Page_Confirm), SIGNAL(Previous()), this, SLOT(gotoSelectCar()));
connect(getPage(Page_Confirm), SIGNAL(Confirm()), this, SLOT(gotoMainMenu()));
+
+ // Connections for bookings
+ connect(getPage(Page_Bookings), SIGNAL(Menu()), this, SLOT(gotoMainMenu()));
+
+ // Connections for comments
+ connect(getPage(Page_Comments), SIGNAL(Menu()), this, SLOT(gotoMainMenu()));
+
+ // Connections for unexpected
+ connect(getPage(Page_Unexpected), SIGNAL(Menu()), this, SLOT(gotoMainMenu()));
+
+ // Connections for email
+ connect(getPage(Page_Email), SIGNAL(Menu()), this, SLOT(gotoMainMenu()));
}
UserInterface::~UserInterface()
@@ -102,6 +128,10 @@ void UserInterface::gotoPage(PageName name) {
}
+void UserInterface::gotoEmailPage() {
+ gotoPage(Page_Email);
+}
+
void UserInterface::gotoMainMenu() {
gotoPage(Page_MainMenu);
}
@@ -110,6 +140,18 @@ void UserInterface::gotoFindStationPage() {
gotoPage(Page_FindStation);
}
+void UserInterface::gotoBookings() {
+ gotoPage(Page_Bookings);
+}
+
+void UserInterface::gotoCommentPage() {
+ gotoPage(Page_Comments);
+}
+
+void UserInterface::gotoUnexpected() {
+ gotoPage(Page_Unexpected);
+}
+
void UserInterface::gotoSelectStation() {
gotoPage(Page_SelectStation);
}
View
@@ -12,6 +12,7 @@
enum PageName { Page_MainMenu,
Page_FindStation, Page_SelectPosition, Page_SelectStation, Page_SelectTime, Page_SelectCar, Page_Confirm,
+ Page_Bookings, Page_Comments, Page_Unexpected, Page_Email
};
namespace Ui {
@@ -43,6 +44,10 @@ public slots:
void gotoSelectTime();
void gotoSelectCar();
void gotoConfirm();
+ void gotoCommentPage();
+ void gotoUnexpected();
+ void gotoBookings();
+ void gotoEmailPage();
};
#endif // USERINTERFACE_H
View
@@ -18,10 +18,18 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
- <widget class="QLabel" name="lblEnveloppe">
+ <widget class="QPushButton" name="btnEnveloppe">
<property name="text">
<string/>
</property>
+ <property name="icon">
+ <iconset>
+ <normalon>:/icones/data/icons/email.png</normalon>
+ </iconset>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
</widget>
</item>
<item>

0 comments on commit e12733e

Please sign in to comment.