Added address resolution, and moved everything up one directory.
[ptas] / zouba / main.cpp
1 #include "routedata.h"
2 #include "route.h"
3 #include "ui_zouba.h"
4 #include "uicontroller.h"
5 #include "location.h"
6
7 #include <QDebug>
8 #include <QObject>
9
10 namespace {
11   Location home( "2549183", "6672570" );
12   Location work( "2551042", "6672829" );
13   QString homeKey( "taivaanvuohentie%207%2Chelsinki" );
14   QString workKey( "it%E4merenkatu%2011%2Chelsinki" );
15 }
16
17 int main(int argc, char *argv[] )
18 {
19   QApplication app(argc, argv);
20   QMainWindow *widget = new QMainWindow;
21   Ui::MainWindow ui;
22   ui.setupUi(widget);
23
24   UiController *uiController = new UiController( &ui );
25
26   Route *route = new Route();
27
28   QObject::connect(
29       route, SIGNAL( routeReady( RouteData ) ),
30       uiController, SLOT( displayRoute( RouteData ) )
31       );
32
33   Location *from = new Location();
34   Location *to   = new Location();
35
36   QObject::connect(
37       from, SIGNAL( becomeValid() ),
38       route, SLOT( setFromLocation() )
39       );
40   QObject::connect(
41       to, SIGNAL( becomeValid() ),
42       route, SLOT( setToLocation() )
43       );
44
45   from->resolveAddress( homeKey );
46   to->resolveAddress( workKey );
47
48   widget->show();
49   return app.exec();
50 }