#include "ytv.h"
#include "location.h"
#include "messagetable.h"
+#include "locations.h"
#include <QObject>
#include <QTableWidgetItem>
UiController::UiController( Ui *ui ) :
ui(ui)
{
- Location *homeLocation = new Location();
- Location *workLocation = new Location();
+ Location *homeLocation = new Location( "home" );
+ Location *workLocation = new Location( "work" );
+
+ Locations locations;
+ locations.addLocation( homeLocation );
+ locations.addLocation( workLocation );
connect(
homeLocation, SIGNAL( becomeValid() ),
ui->destinationButtons, SIGNAL( buttonClicked( int ) ),
this, SLOT( changeDestination( int ) )
);
-
}
UiController::~UiController()
bool destinationHasChanged = ( currentDestination != id );
if ( destinationHasChanged ) {
- emit destinationChanged( *(destination[id]) );
+ emit destinationChanged( destination[id] );
}
// always want to emit this so that the gps position is update