quick & dirty fix for non-maemo devices
authorFlorian Schweikert <kelvan@logic.at>
Wed, 4 May 2011 13:43:02 +0000 (15:43 +0200)
committerFlorian Schweikert <kelvan@logic.at>
Wed, 4 May 2011 13:43:02 +0000 (15:43 +0200)
fix details view

gotoVienna.py
wlSearch.py

index e322dcd..2f1cd06 100644 (file)
@@ -16,7 +16,11 @@ class WienerLinienQt(QMainWindow, Ui_MainWindow):
 
     def __init__(self):
         QMainWindow.__init__(self)
-        self.setAttribute(Qt.WA_Maemo5StackedWindow)
+        # quick&dirty workaround for non-maemo systems
+        try:
+            self.setAttribute(Qt.WA_Maemo5StackedWindow)
+        except:
+            pass
         # _s is used to keep a reference to the Search object, so it does
         # not get destroyed when it falls out of scope (the QML view is
         # destroyed as soon as the Search object is destroyed!)
index 5b5e7f9..6e54bde 100644 (file)
@@ -58,11 +58,15 @@ class Search:
 
     def open_qml(self, dtime=datetime.now()):
         p = Parser(self.get_html(dtime))
-        self.qml_model = QMLModel(p.overview)
+        self.qml_model = QMLModel(p.overview, p.details)
         self.view = QDeclarativeView(self.parent)
         self.view.setWindowTitle('Search results')
         self.view.setWindowFlags(Qt.Window)
-        self.view.setAttribute(Qt.WA_Maemo5StackedWindow)
+        # quick & dirty workaround
+        try:
+            self.view.setAttribute(Qt.WA_Maemo5StackedWindow)
+        except:
+            pass
         self.view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
         self.view.setSource('ui/Overview.qml')
         self.view.rootObject().setProperty('model', self.qml_model)