~osomon/software-center/qml-uds-q

« back to all changes in this revision

Viewing changes to softwarecenter/ui/qml/app.py

  • Committer: Olivier Tilloy
  • Date: 2012-05-08 17:15:01 UTC
  • mfrom: (1773.3.68 qml-5.0)
  • Revision ID: olivier.tilloy@canonical.com-20120508171501-h45wp0ehhdngbgzc
Alternate home screen that partially mimicks S-C 5.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
from softwarecenter.db.pkginfo import get_pkg_info
33
33
 
34
 
from pkglist import PkgListModel
 
34
#from applicationsmodel import ApplicationsModel
35
35
from reviewslist import ReviewsListModel
36
36
from categoriesmodel import CategoriesModel
37
37
 
41
41
    app = QApplication(sys.argv)
42
42
 
43
43
    # TODO do this async
44
 
    app.cache = get_pkg_info()
45
 
    app.cache.open()
 
44
    #app.cache = get_pkg_info()
 
45
    #app.cache.open()
46
46
 
47
47
    view = QDeclarativeView()
48
48
    view.setWindowTitle(view.tr("Ubuntu Software Center"))
56
56
    # ideally this should be part of the qml by using a qmlRegisterType()
57
57
    # but that does not seem to be supported in pyqt yet(?) so we need
58
58
    # to cowboy it in here
59
 
    pkglistmodel = PkgListModel()
60
 
    reviewslistmodel = ReviewsListModel()
 
59
    #applicationsmodel = ApplicationsModel()
 
60
    #reviewslistmodel = ReviewsListModel()
61
61
    categoriesmodel = CategoriesModel()
62
62
    rc = view.rootContext()
63
 
    rc.setContextProperty('pkglistmodel', pkglistmodel)
64
 
    rc.setContextProperty('reviewslistmodel', reviewslistmodel)
 
63
    #rc.setContextProperty('applicationsmodel', applicationsmodel)
 
64
    #rc.setContextProperty('reviewslistmodel', reviewslistmodel)
65
65
    rc.setContextProperty('categoriesmodel', categoriesmodel)
66
66
 
67
67
    # debug
68
68
    if len(sys.argv) > 1:
69
69
        # FIXME: we really should set the text entry here
70
 
        pkglistmodel.setSearchQuery(sys.argv[1])
 
70
        #applicationsmodel.setSearchQuery(sys.argv[1])
 
71
        pass
71
72
 
72
73
    # load the main QML file into the view
73
 
    qmlpath = os.path.join(os.path.dirname(__file__), "sc.qml")
 
74
    qmlpath = os.path.join(os.path.dirname(__file__), "sc2.qml")
74
75
    view.setSource(QUrl.fromLocalFile(qmlpath))
75
76
 
76
77
    # show it