X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=zouba%2Fsrc%2Fui.cpp;fp=zouba%2Fsrc%2Fui.cpp;h=98aac09347b6ee5465dca0be86b0305dcaf6a0db;hb=93c6dfe0c9a31745192d99e329acf791feb0b706;hp=b6a029b9d9eb3b87e56e33d94ae07d930643284a;hpb=7a612dc57f023d1b4ad931692efc4f52822abf4b;p=ptas diff --git a/zouba/src/ui.cpp b/zouba/src/ui.cpp index b6a029b..98aac09 100644 --- a/zouba/src/ui.cpp +++ b/zouba/src/ui.cpp @@ -40,9 +40,12 @@ void Ui::setupUi( QMainWindow *mainWindow ) QAction *setWorkAddressAction = new QAction("Set work address", this); hideMessagesAction = new QAction("Hide messages", this); showMessagesAction = new QAction("Show messages", this); + useFakeGpsAction = new QAction("Use fake GPS", this); + useLiveGpsAction = new QAction("Use live GPS", this); menu->addAction(setHomeAddressAction); menu->addAction(setWorkAddressAction); menu->addAction(showMessagesAction); + menu->addAction(useFakeGpsAction); connect( setHomeAddressAction, SIGNAL(triggered()), @@ -60,6 +63,14 @@ void Ui::setupUi( QMainWindow *mainWindow ) showMessagesAction, SIGNAL(triggered()), this, SLOT(showMessages()) ); + connect( + useFakeGpsAction, SIGNAL(triggered()), + this, SLOT(useFakeGps()) + ); + connect( + useLiveGpsAction, SIGNAL(triggered()), + this, SLOT(useLiveGps()) + ); centralWidget = new QWidget( mainWindow ); mainWindow->setCentralWidget(centralWidget); @@ -130,6 +141,24 @@ void Ui::showMessages() menu->addAction( hideMessagesAction ); } +void Ui::useFakeGps() +{ + // really want a dialog here + Locations *locations = Locations::instance(); + Location *fakeLocation = locations->location( "work" ); + + emit fakeGpsPressed( fakeLocation ); + menu->removeAction( useFakeGpsAction ); + menu->addAction( useLiveGpsAction ); +} + +void Ui::useLiveGps() +{ + emit liveGpsPressed(); + menu->removeAction( useLiveGpsAction ); + menu->addAction( useFakeGpsAction ); +} + void Ui::setAddress( const QString &label ) { Locations *locations=Locations::instance();