Various improvements to LinePad + UI flow
[pywienerlinien] / gotovienna-qml
index 458fe68..fd7b9a5 100755 (executable)
@@ -1,10 +1,10 @@
-#!/usr/env/python
+#!/usr/bin/env python
 
 """Public transport information for Vienna"""
 
 __author__ = 'kelvan <kelvan@logic.at>'
-__version__ = '0.8.2'
-__website__ = 'https://github.com/kelvan/gotoVienna/'
+__version__ = '0.9.0'
+__website__ = 'http://tinyurl.com/gotoVienna'
 __license__ = 'GNU General Public License v3 or later'
 
 from datetime import datetime
@@ -23,6 +23,26 @@ import sys
 import threading
 from datetime import time
 
+class AboutInfo(QObject):
+    def __init__(self):
+        QObject.__init__(self)
+
+    @Slot(result=unicode)
+    def getAppName(self):
+        return u'gotoVienna %s' % __version__
+
+    @Slot(result=unicode)
+    def getWebsiteURL(self):
+        return __website__
+
+    @Slot(result=unicode)
+    def getCopyright(self):
+        return 'Copyright 2011, 2012 %s' % __author__
+
+    @Slot(result=unicode)
+    def getLicense(self):
+        return __license__
+
 class GotoViennaListModel(QAbstractListModel):
     def __init__(self, objects=None):
         QAbstractListModel.__init__(self)
@@ -144,12 +164,6 @@ class Gui(QObject):
 
         threading.Thread(target=load_async).start()
 
-    stationsLoaded = Signal()
-
-    @Slot(float, float, result='QStringList')
-    def get_nearby_stations(self, lat, lon):
-        return get_nearby_stations(lat, lon)
-
     @Slot(str, str, str, result=str)
     def get_directions_url(self, line, direction, station):
         return self.itip.get_url_from_direction(line, direction, station)
@@ -197,12 +211,15 @@ if __name__ == '__main__':
 
     view = QDeclarativeView()
 
+    aboutInfo = AboutInfo()
+
     # instantiate the Python object
     itip = Gui()
 
     # expose the object to QML
     context = view.rootContext()
     context.setContextProperty('itip', itip)
+    context.setContextProperty('aboutInfo', aboutInfo)
 
     if os.path.abspath(__file__).startswith('/usr/bin/'):
         # Assume system-wide installation, QML from /usr/share/