.desktop using absolute paths. Install the icon in the right location.
[mussorgsky] / src / mussorgsky-qml.py
old mode 100644 (file)
new mode 100755 (executable)
index a78f09e..a73bdf1
@@ -6,37 +6,39 @@ from PySide.QtCore import *
 from PySide.QtGui import *
 from PySide.QtDeclarative import QDeclarativeView
 
-from qml.albumModel import AlbumModel
-from qml.logic import MussorgskyLogic
+from albumModel import AlbumModel
+from controller import MussorgskyController
 
 # Create Qt application and the QDeclarative view
 app = QApplication(sys.argv)
 view = QDeclarativeView()
 
+controller = MussorgskyController (view.rootContext ())
 
-#MOCK_DATA = [
-#     AlbumItem ("Are you experienced?", "Jimy Hendrix", None),
-#     AlbumItem ("Bring them all back home", "Bob dylan", None),
-#     AlbumItem ("OK computer", "Radiohead", None),
-#     AlbumItem ("Absolution", "Muse", None),
-#     AlbumItem ("Come with us", "Chemical brothers", None)
-#    ]
+#from albumItem import AlbumItem
+#MOCK_DATA = [AlbumItem (u"x", u"y") for i in xrange (0, 100)]
+#albumModel = AlbumModel (MOCK_DATA)
 
-logic = MussorgskyLogic ()
-
-albumModel = AlbumModel (logic.get_all_albums())
+albumModel = AlbumModel (controller.get_all_albums())
 print "Model with", albumModel.rowCount(), "rows"
 
+#from coverModel import CoversModel
+#coverModel = CoversModel ()
+
 rc = view.rootContext ()
 rc.setContextProperty ('albumModel', albumModel)
+rc.setContextProperty ('missionControl', controller)
+#rc.setContextProperty ('coversModel', coverModel)
 
 # Create an URL to the QML file
 #url = QUrl('view.qml')
 url = QUrl ("../ui/main.qml")
 # Set the QML file and show
 view.setSource(url)
-
+view.engine().quit.connect (app.quit)
 
 view.show()
+
+
 # Enter Qt main loop
 sys.exit(app.exec_())