#include "routedata.h"
#include "route.h"
-#include "ui_zouba.h"
+#include "ui.h"
#include "uicontroller.h"
#include "location.h"
+#include "gpscontroller.h"
+#include "ytv.h"
+#include "messagehandler.h"
+#include "messagetable.h"
#include <QDebug>
#include <QObject>
-
-namespace {
- Location home( "2549183", "6672570" );
- Location work( "2551042", "6672829" );
- QString homeKey( "taivaanvuohentie%207%2Chelsinki" );
- QString workKey( "it%E4merenkatu%2011%2Chelsinki" );
-}
+#include <QApplication>
+#include <QMainWindow>
int main(int argc, char *argv[] )
{
+ //qInstallMsgHandler( messageHandler );
QApplication app(argc, argv);
- QMainWindow *widget = new QMainWindow;
- Ui::MainWindow ui;
- ui.setupUi(widget);
- UiController *uiController = new UiController( &ui );
+ QMainWindow *mainWindow = new QMainWindow;
+ Ui ui;
+ ui.setupUi(mainWindow);
- Route *route = new Route();
+ UiController *uiController = new UiController( &ui );
+ Route *route = new Route();
+ GpsController *gpsController = new GpsController();
QObject::connect(
- route, SIGNAL( routeReady( RouteData ) ),
- uiController, SLOT( displayRoute( RouteData ) )
+ route, SIGNAL( routeReady( QList<RouteData> ) ),
+ uiController, SLOT( displayRoute( QList<RouteData> ) )
);
- Location *from = new Location();
- Location *to = new Location();
-
QObject::connect(
- from, SIGNAL( becomeValid() ),
- route, SLOT( setFromLocation() )
+ gpsController, SIGNAL( locationChanged( Location* ) ),
+ route, SLOT( setFromLocation( Location* ) )
);
+
QObject::connect(
- to, SIGNAL( becomeValid() ),
- route, SLOT( setToLocation() )
- );
+ uiController, SIGNAL( destinationChanged( Location* ) ),
+ route, SLOT( setToLocation( Location* ) )
+ );
+
+ QObject::connect(
+ uiController, SIGNAL( buttonClicked() ),
+ gpsController, SLOT( getGps() )
+ );
- from->resolveAddress( homeKey );
- to->resolveAddress( workKey );
+ mainWindow->show();
- widget->show();
return app.exec();
}