#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>
+#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 );
-
- Route *route = new Route();
- QObject::connect(
- route, SIGNAL( routeReady( RouteData ) ),
- uiController, SLOT( displayRoute( RouteData ) )
- );
+ QMainWindow *mainWindow = new QMainWindow;
+ Ui ui;
+ ui.setupUi(mainWindow);
+ UiController *uiController = new UiController( &ui );
+ Route *route = new Route();
GpsController *gpsController = new GpsController();
- Location *to = new Location();
QObject::connect(
- gpsController, SIGNAL( locationChanged( Location ) ),
- route, SLOT( setFromLocation( Location ) )
+ route, SIGNAL( routeReady( QList<RouteData> ) ),
+ uiController, SLOT( displayRoute( QList<RouteData> ) )
);
+
QObject::connect(
- to, SIGNAL( becomeValid() ),
- route, SLOT( setToLocation() )
+ gpsController, SIGNAL( locationChanged( Location* ) ),
+ route, SLOT( setFromLocation( Location* ) )
);
- ui.homeaddress->setText( "GPS" );
- ui.workaddress->setText( work );
-
- gpsController->startGps();
- to->resolveAddress( work );
+ QObject::connect(
+ uiController, SIGNAL( destinationChanged( Location* ) ),
+ route, SLOT( setToLocation( Location* ) )
+ );
QObject::connect(
- uiController, SIGNAL( workAddressChanged( QString ) ),
- to, SLOT( resolveAddress( QString ) )
+ uiController, SIGNAL( buttonClicked() ),
+ gpsController, SLOT( getGps() )
);
- widget->show();
+ mainWindow->show();
+
return app.exec();
}