Package: zouba
Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libqtm-location (>=1.0.0-beta1-maemo4), libqtm-bearer (>=1.0.0-beta1-maemo4), libqt4-maemo5-core (>=4.6.2~git20100212-0maemo1) | libqt4-core (>=4.6.2~git20100212-0maemo1), libqt4-maemo5-gui (>=4.6.2~git20100212-0maemo1) | libqt4-gui (>=4.6.2~git20100212-0maemo1), libqt4-maemo5-xml (>=4.6.2~git20100212-0maemo1) | libqt4-xml (>=4.6.2~git20100212-0maemo1), libqt4-maemo5-network (>=4.6.2~git20100212-0maemo1) | libqt4-network (>=4.6.2~git20100212-0maemo1)
+Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Tells you which bus is next.
Allows you to easily find how to get the bus home. Uses HSL Journey Planner API <http://developer.reittiopas.fi/pages/en/home.php>. Uses GPS for current location. Uses Qt and QtMobility.
# XB-Maemo-Icon-26 field contains the application icon file encoded in
dh_gencontrol
dh_md5sums
dh_builddeb
+dh_installdirs
+dh_installchangelogs
+dh_installdocs
+dh_installexamples
+dh_installman
+dh_link
+dh_strip
+dh_compress
+dh_fixperms
+dh_installdeb
+dh_gencontrol
+dh_md5sums
+dh_builddeb
+dh_installdirs
+dh_installchangelogs
+dh_installdocs
+dh_installexamples
+dh_installman
+dh_link
+dh_strip
+dh_compress
+dh_fixperms
+dh_installdeb
+dh_gencontrol
+dh_md5sums
+dh_builddeb
+dh_installdirs
+dh_installchangelogs
+dh_installdocs
+dh_installexamples
+dh_installman
+dh_link
+dh_strip
+dh_compress
+dh_fixperms
+dh_installdeb
+dh_gencontrol
+dh_md5sums
+dh_builddeb
+dh_installdirs
+dh_installchangelogs
+dh_installdocs
+dh_installexamples
+dh_installman
+dh_link
+dh_strip
+dh_compress
+dh_fixperms
+dh_installdeb
+dh_gencontrol
+dh_md5sums
+dh_builddeb
+dh_installdirs
+dh_installchangelogs
+dh_installdocs
+dh_installexamples
+dh_installman
+dh_link
+dh_strip
+dh_compress
+dh_fixperms
+dh_installdeb
+dh_gencontrol
+dh_md5sums
+dh_builddeb
755 root root . usr /
755 root root . usr/share /
-755 root root . usr/share/dbus-1 /
-755 root root . usr/share/dbus-1/services /
-644 root root . usr/share/dbus-1/services/zouba.service debian/zouba/usr/share/dbus-1/services/zouba.service
755 root root . usr/share/doc /
755 root root . usr/share/doc/zouba /
644 root root . usr/share/doc/zouba/changelog.gz debian/zouba/usr/share/doc/zouba/changelog.gz
Package: zouba
Version: 0.2
-Architecture: armel
-Maintainer: Max Waterman <davidmaxwaterman@fastmail.co.uk>
-Installed-Size: 216
-Depends: libqtm-location (>= 1.0.0-beta1-maemo4), libqtm-bearer (>= 1.0.0-beta1-maemo4), libqt4-maemo5-core (>= 4.6.2~git20100212-0maemo1) | libqt4-core (>= 4.6.2~git20100212-0maemo1), libqt4-maemo5-gui (>= 4.6.2~git20100212-0maemo1) | libqt4-gui (>= 4.6.2~git20100212-0maemo1), libqt4-maemo5-xml (>= 4.6.2~git20100212-0maemo1) | libqt4-xml (>= 4.6.2~git20100212-0maemo1), libqt4-maemo5-network (>= 4.6.2~git20100212-0maemo1) | libqt4-network (>= 4.6.2~git20100212-0maemo1)
Section: user/Other
Priority: extra
+Architecture: armel
+Installed-Size: 204
+Maintainer: Max Waterman <davidmaxwaterman@fastmail.co.uk>
Description: Tells you which bus is next.
Allows you to easily find how to get the bus home. Uses HSL Journey Planner API <http://developer.reittiopas.fi/pages/en/home.php>. Uses GPS for current location. Uses Qt and QtMobility.
Maemo-Icon-26:
-fd259cf3be69375915fdb925257d2233 usr/share/dbus-1/services/zouba.service
-7582f909f6cf0329729f01e323e6c8a1 usr/share/doc/zouba/changelog.gz
+a3eca1c38f1826c11a407a961358565b usr/share/doc/zouba/changelog.gz
5a50138045dfccd50e9ec2f5fd769bcf usr/share/doc/zouba/README.Debian
b941bd01bcea49cabfc186309d46fb74 usr/share/doc/zouba/copyright
-f327a6f11a43e47223c6bebe5434fd81 usr/share/applications/hildon/zouba.desktop
+f0facd09bdb3ff735ea73938db3c774c usr/share/applications/hildon/zouba.desktop
85cbb61cacdd967b3e62a6ba0f84f0b2 usr/share/icons/hicolor/64x64/apps/zouba.png
f9869b1dbe0a28a220a48ebad6ae8fd0 usr/bin/zouba
X-Window-Icon=zouba
X-Window-Icon-Dimmed=zouba
X-Osso-Type=application/x-executable
-X-Osso-Service=com.nokia.zouba
+++ /dev/null
-[D-BUS Service]
-Name=com.nokia.zouba
-Exec=/usr/bin/zouba
GpsController::GpsController() :
m_location( QGeoPositionInfoSource::createDefaultSource(this) ),
- currentLocation(0)
+ m_currentLocation(0),
+ m_useFakeLocation(false)
{
connect(
m_location, SIGNAL( positionUpdated( QGeoPositionInfo ) ),
{
delete m_location;
m_location = 0;
- delete currentLocation;
- currentLocation = 0;
+ delete m_currentLocation;
+ m_currentLocation = 0;
}
void GpsController::updateLocation( QGeoPositionInfo positionInfo )
{
- delete currentLocation;
- currentLocation = new Location( positionInfo );
+ delete m_currentLocation;
+ m_currentLocation = new Location( positionInfo );
}
void GpsController::getGps()
{
- if ( currentLocation != 0 ) {
- emit locationChanged( currentLocation );
+ if ( m_currentLocation != 0 ) {
+ emit locationChanged( m_currentLocation );
}
}
+
+void GpsController::useLiveGps()
+{
+ m_location->startUpdates();
+ m_useFakeLocation=false;
+ m_currentLocation=0;
+}
+
+void GpsController::useFakeGps( Location *fakeLocation )
+{
+ m_location->stopUpdates();
+ m_useFakeLocation=true;
+ delete m_currentLocation;
+ m_currentLocation = new Location( *fakeLocation );
+ emit locationChanged( m_currentLocation );
+}
public Q_SLOTS:
void updateLocation( QGeoPositionInfo positionInfo );
void getGps();
+ void useFakeGps( Location *fakeLocation );
+ void useLiveGps();
Q_SIGNALS:
void locationChanged( Location *newLocation );
private:
QGeoPositionInfoSource *m_location;
- Location *currentLocation;
+ Location *m_currentLocation;
+ bool m_useFakeLocation;
};
#endif // GPSCONTROLLER_H
QApplication app(argc, argv);
QMainWindow *mainWindow = new QMainWindow;
- Ui ui;
- ui.setupUi(mainWindow);
+ Ui *ui = new Ui;;
+ ui->setupUi(mainWindow);
- UiController *uiController = new UiController( &ui );
+ UiController *uiController = new UiController( ui );
Route *route = new Route();
GpsController *gpsController = new GpsController();
gpsController, SLOT( getGps() )
);
+ QObject::connect(
+ ui, SIGNAL( fakeGpsPressed( Location* ) ),
+ gpsController, SLOT( useFakeGps( Location* ) )
+ );
+
+ QObject::connect(
+ ui, SIGNAL( liveGpsPressed() ),
+ gpsController, SLOT( useLiveGps() )
+ );
+
mainWindow->show();
return app.exec();
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()),
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);
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();
class QVBoxLayout;
class QMenu;
class QAction;
+class Location;
class Ui : public QObject
{
QMenu *menu;
QAction *hideMessagesAction;
QAction *showMessagesAction;
+ QAction *useFakeGpsAction;
+ QAction *useLiveGpsAction;
Q_SIGNALS:
void homeAddressChanged( QString address );
void workAddressChanged( QString address );
+ void fakeGpsPressed( Location * );
+ void liveGpsPressed();
private Q_SLOTS:
void setHomeAddress();
void setWorkAddress();
void hideMessages();
void showMessages();
+ void useFakeGps();
+ void useLiveGps();
private:
void setAddress( const QString &label );