#include "messagetable.h"
#include "locations.h"
+#include "ytv.h"
#include <QMainWindow>
#include <QRadioButton>
#include <QMenuBar>
#include <QHBoxLayout>
#include <QVBoxLayout>
+#include <QGridLayout>
#include <QSizePolicy>
#include <QInputDialog>
#include <QDebug>
Ui::Ui() :
centralWidget(0),
destinationButtons(0),
- routeTable(0),
+ routeStack(0),
usingFakeGps( false ),
messagesShown( false ),
- fakeLocation()
+ fakeLocationLabel( "work" )
{
- Locations *locations = Locations::instance();
- Location *workLocation = locations->location( "work" );
- fakeLocation = new Location();
- *fakeLocation = *workLocation;
- fakeLocation->setLabel( "fakegps" );
}
Ui::~Ui()
homeButton->setObjectName( QString::fromUtf8("homeButton") );
homeButton->setText( "GPS->HOME" );
homeButton->setEnabled(false);
- homeButton->setFixedSize( QSize( ButtonWidth, ButtonHeight ) );
QRadioButton *workButton = new QRadioButton();
workButton->setObjectName( QString::fromUtf8("workButton") );
destinationButtons->addButton( workButton, WorkButtonId );
destinationButtons->setExclusive( true );
- buttonLayout = new QVBoxLayout();
- buttonLayout->addWidget( homeButton );
- buttonLayout->addWidget( workButton );
- buttonLayout->addStretch();
+ routeStack = new QVBoxLayout();
+ for ( int i=0; i<Ytv::ShowFiveResults; ++i ) {
+ QRadioButton *button = new QRadioButton();
+ button->setObjectName( "routeButton"+i );
+ button->setEnabled( false );
- routeTable = new QTableWidget( 1, 2 );
- QStringList columnHeaders;
- columnHeaders << "Time" << "Bus";
- routeTable->setHorizontalHeaderLabels( columnHeaders );
- routeTable->verticalHeader()->hide();
+ routeStack->addWidget( button, i );
+ }
+ routeStack->addStretch();
QHBoxLayout *topLayout = new QHBoxLayout();
- topLayout->addLayout( buttonLayout );
- topLayout->addWidget( routeTable );
+ topLayout->addLayout( routeStack );
+ topLayout->addStretch();
+
+ buttonLayout = new QGridLayout();
+ buttonLayout->addWidget( homeButton, 0, 0 );
+ buttonLayout->addWidget( workButton, 0, 1 );
messageTable = new MessageTable();
messageTable->setObjectName( QString::fromUtf8("messageTable") );
QVBoxLayout *mainLayout = new QVBoxLayout();
mainLayout->addLayout( topLayout );
mainLayout->addWidget( messageTable );
+ mainLayout->addLayout( buttonLayout );
centralWidget->setLayout( mainLayout );
}
void Ui::useFakeGps()
{
- emit fakeGpsPressed( fakeLocation );
+ emit fakeGpsPressed( fakeLocationLabel );
toggleFakeGpsAction->setText( "Use Live GPS" );
}