예제 #1
0
파일: app.py 프로젝트: feiying/AppStream
from pkglist import PkgListModel
from reviewslist import ReviewsListModel
from categoriesmodel import CategoriesModel

from softwarecenter.utils import mangle_paths_if_running_in_local_checkout

if __name__ == '__main__':
    app = QApplication(sys.argv)

    # TODO do this async
    app.cache = get_pkg_info()
    app.cache.open()

    view = QDeclarativeView()
    view.setWindowTitle(view.tr("Ubuntu Software Center"))
    view.setWindowIcon(QIcon(os.path.join(os.path.dirname(__file__),
        "../../../data/icons/scalable/apps/softwarecenter.svg")))
    view.setResizeMode(QtDeclarative.QDeclarativeView.SizeRootObjectToView)

    # if running locally, fixup softwarecenter.paths
    mangle_paths_if_running_in_local_checkout()

    # ideally this should be part of the qml by using a qmlRegisterType()
    # but that does not seem to be supported in pyqt yet(?) so we need
    # to cowboy it in here
    pkglistmodel = PkgListModel()
    reviewslistmodel = ReviewsListModel()
    categoriesmodel = CategoriesModel()
    rc = view.rootContext()
    rc.setContextProperty('pkglistmodel', pkglistmodel)
from pkglist import PkgListModel
from reviewslist import ReviewsListModel
from categoriesmodel import CategoriesModel

from softwarecenter.utils import mangle_paths_if_running_in_local_checkout

if __name__ == '__main__':
    app = QApplication(sys.argv)

    # TODO do this async
    app.cache = get_pkg_info()
    app.cache.open()

    view = QDeclarativeView()
    view.setWindowTitle(view.tr("Ubuntu Software Center"))
    view.setWindowIcon(
        QIcon(
            os.path.join(
                os.path.dirname(__file__),
                "../../../data/icons/scalable/apps/softwarecenter.svg")))
    view.setResizeMode(QtDeclarative.QDeclarativeView.SizeRootObjectToView)

    # if running locally, fixup softwarecenter.paths
    mangle_paths_if_running_in_local_checkout()

    # ideally this should be part of the qml by using a qmlRegisterType()
    # but that does not seem to be supported in pyqt yet(?) so we need
    # to cowboy it in here
    pkglistmodel = PkgListModel()
    reviewslistmodel = ReviewsListModel()
예제 #3
0
from pkglist import PkgListModel
from reviewslist import ReviewsListModel
from categoriesmodel import CategoriesModel

from softwarecenter.utils import mangle_paths_if_running_in_local_checkout

if __name__ == '__main__':
    app = QApplication(sys.argv)

    # TODO do this async
    app.cache = get_pkg_info()
    app.cache.open()

    view = QDeclarativeView()
    view.setWindowTitle(view.tr("X-Mario App Store"))
    view.setWindowIcon(QIcon(os.path.join(os.path.dirname(__file__),
        "../../../data/icons/scalable/apps/softwarecenter.svg")))
    view.setResizeMode(QtDeclarative.QDeclarativeView.SizeRootObjectToView)

    # if running locally, fixup softwarecenter.paths
    mangle_paths_if_running_in_local_checkout()

    # ideally this should be part of the qml by using a qmlRegisterType()
    # but that does not seem to be supported in pyqt yet(?) so we need
    # to cowboy it in here
    pkglistmodel = PkgListModel()
    reviewslistmodel = ReviewsListModel()
    categoriesmodel = CategoriesModel()
    rc = view.rootContext()
    rc.setContextProperty('pkglistmodel', pkglistmodel)