Changes: display route legs in table; removed message table/button
[ptas] / zouba / src / main.cpp
1 #include "routedata.h"
2 #include "route.h"
3 #include "ui.h"
4 #include "uicontroller.h"
5 #include "location.h"
6 #include "gpscontroller.h"
7 #include "ytv.h"
8
9 #include <QDebug>
10 #include <QObject>
11 #include <QApplication>
12 #include <QMainWindow>
13
14 int main(int argc, char *argv[] )
15 {
16   QApplication app(argc, argv);
17
18   QMainWindow *mainWindow = new QMainWindow;
19   Ui *ui = new Ui;;
20   ui->setupUi(mainWindow);
21
22   UiController  *uiController  = new UiController( ui );
23   Route         *route         = new Route();
24   GpsController *gpsController = new GpsController();
25
26   QObject::connect(
27       route, SIGNAL( routeReady( QList<RouteData> ) ),
28       uiController, SLOT( displayRoute( QList<RouteData> ) )
29       );
30
31   QObject::connect(
32       gpsController, SIGNAL( locationChanged( Location* ) ),
33       route, SLOT( setFromLocation( Location* ) )
34       );
35
36   QObject::connect(
37       uiController, SIGNAL( destinationChanged( Location* ) ),
38       route, SLOT( setToLocation( Location* ) )
39     );
40
41   QObject::connect(
42       uiController, SIGNAL( buttonClicked() ),
43       gpsController, SLOT( getGps() )
44     );
45
46   QObject::connect(
47       ui, SIGNAL( fakeGpsPressed( const QString & ) ),
48       gpsController, SLOT( useFakeGps( const QString & ) )
49     );
50
51   QObject::connect(
52       ui, SIGNAL( liveGpsPressed() ),
53       gpsController, SLOT( useLiveGps() )
54     );
55
56   QObject::connect(
57       route, SIGNAL( busy( bool ) ),
58       ui, SLOT( setBusy( bool ) )
59     );
60
61   mainWindow->show();
62
63   return app.exec();
64 }