Exemplo n.º 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
Exemplo n.º 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")
Exemplo n.º 3
0
        log("FilmWise: Notify enabled")
        lastViewed = Settings.getLastViewed()
        if lastViewed not in [None, ""]:
            # Find out the current list
            filmWise = FilmWiseCore()
            quizList = filmWise.getQuizList()

            # Now the system has been loaded, we should update the last viewed setting
            if len(quizList) > 0:
                if lastViewed != quizList[0]['link']:
                    # Either display the notification or open the viewer automatically
                    if Settings.isAutoOpenNewQuiz():
                        log("FilmWise: Service auto starting quiz: %s" % quizList[0]['link'])

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

                        viewer = FilmWiseViewer.createFilmWiseViewer(quizList[0]['number'], quizList[0]['name'], quizDetails, quizList[0]['solution'])
                        viewer.doModal()

                        # Record that we actually viewed the latest quiz
                        Settings.setLastViewed(quizList[0]['link'])
                    else:
                        quizNum = ''
                        if quizList[0]['number'] > 0:
                            quizNum = " (#%d)" % quizList[0]['number']
                        msg = "%s%s" % (ADDON.getLocalizedString(32013).encode('utf-8'), quizNum)
                        xbmcgui.Dialog().notification(ADDON.getLocalizedString(32001).encode('utf-8'), msg, ICON, 5000, False)
                else:
                    log("FilmWise: Latest quiz already viewed")
            else: