Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added and connected new pages

  • Loading branch information...
commit 6a5051cc9b78006c49243e8a227830eee9cf6c22 1 parent 7ad8c4c
@Gabriano Gabriano authored
View
2  pages/commentspage.cpp
@@ -10,7 +10,7 @@ CommentsPage::CommentsPage(QWidget *parent):
QPushButton *btnVehicule = new QPushButton(trUtf8("Véhicule"));
QPushButton *btnStation = new QPushButton(trUtf8("Station"));
- QPushButton *btnReservation = new QPushButton(trUtf8("Reservation"));
+ QPushButton *btnReservation = new QPushButton(trUtf8("Réservation"));
QPushButton *btnToUser = new QPushButton(trUtf8("Usager"));
btnVehicule->setIcon(QIcon(":/icones/data/icons/car_add.png"));
View
43 pages/writecommentpage.cpp
@@ -0,0 +1,43 @@
+#include <QtGui>
+#include <QTableView>
+
+#include "page.h"
+#include "writecommentpage.h"
+
+WriteCommentPage::WriteCommentPage(QWidget *parent) :
+ Page(parent)
+{
+ addTitle(trUtf8("Écrire un commentaire"));
+
+ QWidget *subjectsWidget = new QWidget(this);
+ QHBoxLayout *subjectLayout = new QHBoxLayout(this);
+ QLabel *subjectLabel = new QLabel("Sujet:");
+ QComboBox *type = new QComboBox(this);
+ type->addItem(trUtf8("Véhicule"));
+ type->addItem(trUtf8("Station"));
+ type->addItem(trUtf8("Réservation"));
+ subjectLayout->addWidget(subjectLabel);
+ subjectLayout->addWidget(type);
+ subjectsWidget->setLayout(subjectLayout);
+ addWidget(subjectsWidget);
+
+ QWidget *commentWidget = new QWidget(this);
+ QHBoxLayout *commentLayout = new QHBoxLayout(this);
+ QLabel *commentLabel = new QLabel("Commentaire:");
+ QTextEdit *comment = new QTextEdit(this);
+ commentLayout->addWidget(commentLabel);
+ commentLayout->addWidget(comment);
+ commentWidget->setLayout(commentLayout);
+ addWidget(commentWidget);
+
+ QPushButton *btnPrevious = new QPushButton(this);
+ btnPrevious->setIcon(QIcon(":/icones/data/icons/arrow_left.png"));
+ QPushButton *btnSend = new QPushButton(trUtf8("Envoyer"), this);
+ QPushButton *btnMenu = new QPushButton(trUtf8("Menu"), this);
+
+ addBottomButtons(btnPrevious, btnMenu, btnSend);
+
+ connect(btnPrevious, SIGNAL(clicked()), SIGNAL(Previous()));
+ connect(btnMenu, SIGNAL(clicked()), SIGNAL(Menu()));
+ connect(btnSend, SIGNAL(clicked()), SIGNAL(Send()));
+}
View
23 pages/writecommentpage.h
@@ -0,0 +1,23 @@
+#ifndef WRITECOMMENTPAGE_H
+#define WRITECOMMENTPAGE_H
+
+#include <QtGui>
+
+#include "page.h"
+
+class WriteCommentPage : public Page
+{
+ Q_OBJECT
+public:
+ explicit WriteCommentPage(QWidget *parent = 0);
+
+signals:
+ void Previous();
+ void Menu();
+ void Send();
+
+public slots:
+
+};
+
+#endif // WRITECOMMENTPAGE_H
View
6 projet.pro
@@ -49,7 +49,8 @@ HEADERS += geoposition.h \
pages/unexpectedpage.h \
pages/myrsvppage.h \
pages/bookingspage.h \
- pages/mymessagespage.h
+ pages/mymessagespage.h \
+ pages/writecommentpage.h
FORMS += mainwindow.ui \
cartewidget.ui \
userinterface.ui
@@ -87,7 +88,8 @@ SOURCES += geoposition.cpp \
pages/commentspage.cpp \
pages/unexpectedpage.cpp \
pages/bookingspage.cpp \
- pages/mymessagespage.cpp
+ pages/mymessagespage.cpp \
+ pages/writecommentpage.cpp
RESOURCES += \
icones.qrc
View
17 userinterface.cpp
@@ -13,6 +13,7 @@
#include "pages/unexpectedpage.h"
#include "pages/bookingspage.h"
#include "pages/mymessagespage.h"
+#include "pages/writecommentpage.h"
#include "stationmodel.h"
#include "stationsortproxy.h"
@@ -47,7 +48,8 @@ UserInterface::UserInterface(
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_Comments, new CommentsPage(this)); // comments main page
+ pages->insert(Page_WriteComment, new WriteCommentPage(this)); // comment editing
pages->insert(Page_Unexpected, new UnexpectedPage(this));
pages->insert(Page_Email, new MyMessagesPage(this));
@@ -103,6 +105,15 @@ UserInterface::UserInterface(
// Connections for comments
connect(getPage(Page_Comments), SIGNAL(Menu()), this, SLOT(gotoMainMenu()));
+ connect(getPage(Page_Comments), SIGNAL(VehiculeComment()), this, SLOT(gotoWriteComment()));
+ connect(getPage(Page_Comments), SIGNAL(StationComment()), this, SLOT(gotoWriteComment()));
+ connect(getPage(Page_Comments), SIGNAL(ReservationComment()), this, SLOT(gotoWriteComment()));
+ //connect(getPage(Page_Comments), SIGNAL(ToUserComment()), this, SLOT(gotoWriteComment()));
+
+ // Connections for writecomment
+ connect(getPage(Page_WriteComment), SIGNAL(Previous()), this, SLOT(gotoCommentPage()));
+ connect(getPage(Page_WriteComment), SIGNAL(Menu()), this, SLOT(gotoMainMenu()));
+ connect(getPage(Page_WriteComment), SIGNAL(Send()), this, SLOT(gotoMainMenu()));
// Connections for unexpected
connect(getPage(Page_Unexpected), SIGNAL(Menu()), this, SLOT(gotoMainMenu()));
@@ -148,6 +159,10 @@ void UserInterface::gotoCommentPage() {
gotoPage(Page_Comments);
}
+void UserInterface::gotoWriteComment() {
+ gotoPage(Page_WriteComment);
+}
+
void UserInterface::gotoUnexpected() {
gotoPage(Page_Unexpected);
}
View
3  userinterface.h
@@ -12,7 +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
+ Page_Bookings, Page_Comments, Page_Unexpected, Page_Email, Page_WriteComment
};
namespace Ui {
@@ -48,6 +48,7 @@ public slots:
void gotoUnexpected();
void gotoBookings();
void gotoEmailPage();
+ void gotoWriteComment();
};
#endif // USERINTERFACE_H
Please sign in to comment.
Something went wrong with that request. Please try again.