예제 #1
0
    def viewQuiz(self, quizNum, name, link, solution=None):
        log("FilmWisePlugin: %d. %s (%s)" % (quizNum, name, link))
        xbmc.executebuiltin("ActivateWindow(busydialog)")

        filmWise = FilmWiseCore()
        quizDetails = filmWise.getQuizData(link)

        viewer = FilmWiseViewer.createFilmWiseViewer(quizNum, name, quizDetails, solution)
        xbmc.executebuiltin("Dialog.Close(busydialog)")

        viewer.doModal()

        del filmWise
예제 #2
0
    if len(quizList) > 0:
        Settings.setLastViewed(quizList[0]['link'])

    displayList = []

    for quiz in quizList:
        displayName = "%s %s" % (quiz['date'], quiz['name'])
        displayList.append(displayName)

    xbmc.executebuiltin("Dialog.Close(busydialog)")

    # Show the list to the user
    select = xbmcgui.Dialog().select(ADDON.getLocalizedString(32001), displayList)
    if select < 0:
        log("FilmWise: Cancelled by user")
    else:
        xbmc.executebuiltin("ActivateWindow(busydialog)")
        quiz = quizList[select]
        log("FilmWise: Selected quiz: %s (%s)" % (displayList[select], quiz['link']))

        # Now get the details of the selected quiz
        quizDetails = filmWise.getQuizData(quiz['link'])

        viewer = FilmWiseViewer.createFilmWiseViewer(quiz['number'], quiz['name'], quizDetails, quiz['solution'])
        xbmc.executebuiltin("Dialog.Close(busydialog)")

        viewer.doModal()

    del filmWise
    log("FilmWise: Ended")