Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

working on reservation viewing

  • Loading branch information...
commit 473552889038565f51b5567ca6cfbf9e18075af9 1 parent 9e588f1
@Gabriano Gabriano authored
Showing with 12 additions and 3 deletions.
  1. +1 −3 mainwindow.cpp
  2. +7 −0 userinterface.cpp
  3. +4 −0 userinterface.h
View
4 mainwindow.cpp
@@ -153,7 +153,7 @@ MainWindow::MainWindow(QWidget *parent) :
//important tout le monde partage la scène !
CarteWidget::setScene(scene);
- UserInterface *userInterface = new UserInterface(smodel, vmodel, umodel, this);
+ UserInterface *userInterface = new UserInterface(smodel, vmodel, umodel, rmodel, this);
connect(this, SIGNAL(interfaceUsagerId(qint64)), userInterface, SLOT(setUser(qint64)));
userInterface->show();
}
@@ -286,8 +286,6 @@ void MainWindow::changeInterfaceUsagerId(qint64 id)
if (!u) {
//normalement u est valide mais bon ..
QMessageBox::warning(this, trUtf8("Usager invalide"), trUtf8("L'usager que vous avez sélectionné n'existe pas"),QMessageBox::Ok);
- } else {
- QMessageBox::information(this, trUtf8("Changement d'interface usager"), trUtf8("Lorsque vous recevez le signal MainWindow::interfaceUsagerId(qint64 id), vous devez afficher l'interface de l'usager correspondant.\n\nPar exemple, ceci est l'interface de l'usager %1 qui a l'id %2 ! Cette interface est minimaliste, mais elle est là :). La votre devrait être plus conséquente !").arg(u->getNom()).arg(id), QMessageBox::Ok);
}
}
View
7 userinterface.cpp
@@ -19,6 +19,7 @@
#include "station.h"
#include "stationmodel.h"
#include "stationsortproxy.h"
+#include "reservationproxymodel.h"
#include <QDebug>
@@ -29,11 +30,13 @@ UserInterface::UserInterface(
StationModel *smodel,
VehiculeModel *vmodel,
UsagerModel *umodel,
+ ReservationModel *rmodel,
QWidget *parent) :
QMainWindow(parent),
stationModel(smodel),
vehiculeModel(vmodel),
usagerModel(umodel),
+ reservationModel(rmodel),
ui(new Ui::UserInterface)
{
ui->setupUi(this);
@@ -51,6 +54,10 @@ UserInterface::UserInterface(
vehiculeProxy->setSourceModel(vehiculeModel);
vehiculeProxy->setDynamicSortFilter(true);
+
+ reservationProxy = new ReservationProxyModel(this);
+ reservationProxy->setSourceModel(reservationModel);
+
pages = new QMap<PageName, Page*>;
createPages();
View
4 userinterface.h
@@ -13,6 +13,7 @@
#include "vehiculemodel.h"
#include "usagermodel.h"
#include "vehiculefilterproxy.h"
+#include "reservationproxymodel.h"
#include "geoposition.h"
enum PageName { Page_MainMenu,
@@ -33,6 +34,7 @@ class UserInterface : public QMainWindow
StationModel *smodel,
VehiculeModel *vmodel,
UsagerModel *umodel,
+ ReservationModel *rmodel,
QWidget *parent = 0);
~UserInterface();
@@ -47,6 +49,8 @@ class UserInterface : public QMainWindow
VehiculeModel *vehiculeModel;
VehiculeFilterProxy *vehiculeProxy;
UsagerModel *usagerModel;
+ ReservationModel *reservationModel;
+ ReservationProxyModel *reservationProxy;
GeoPosition *currentPosition;
Please sign in to comment.
Something went wrong with that request. Please try again.