# Path: resources/lib/views/windowxmldialog.py
# class WindowXMLDialog(_BaseWindow, _WindowXMLDialog):
#     def __init__(self, xml_filename, script_path):
#         _WindowXMLDialog.__init__(self, xml_filename, script_path)
#         _BaseWindow.__init__(self)


import xbmcaddon
import xbmcgui
from resources.lib.views.windowxmldialog import WindowXMLDialog
# coding=utf-8


class GameInfo(WindowXMLDialog):
    def __new__(cls, *args, **kwargs):
        return super(GameInfo, cls).__new__(cls, 'gameinfo.xml', xbmcaddon.Addon().getAddonInfo('path'))

    def __init__(self, controller, host, game):
        super(GameInfo, self).__init__('gameinfo.xml', xbmcaddon.Addon().getAddonInfo('path'))
        self.controller = controller
        self.host = host
        self.game = game
        self.list = None
        self.play_btn = None
        self.select_poster_btn = None
        self.select_fanart_btn = None

    def onInit(self):
        self.list = self.getControl(51)
        self.play_btn = self.getControl(52)
        self.select_poster_btn = self.getControl(53)
        self.select_fanart_btn = self.getControl(54)
        self.setFocus(self.play_btn)

        item = xbmcgui.ListItem()
        item.setLabel(self.game.name)
        item.setIconImage(self.game.get_selected_poster())

# Path: resources/lib/views/windowxmldialog.py
# class WindowXMLDialog(_BaseWindow, _WindowXMLDialog):
#     def __init__(self, xml_filename, script_path):
#         _WindowXMLDialog.__init__(self, xml_filename, script_path)
#         _BaseWindow.__init__(self)


# Path: resources/lib/views/gameinfo.py
import xbmcaddon
import xbmcgui
from resources.lib.views.windowxmldialog import WindowXMLDialog

# coding=utf-8


class GameInfo(WindowXMLDialog):
    def __new__(cls, *args, **kwargs):
        return super(GameInfo, cls).__new__(cls, 'gameinfo.xml', xbmcaddon.Addon().getAddonInfo('path'))

    def __init__(self, controller, host, game):
        super(GameInfo, self).__init__('gameinfo.xml', xbmcaddon.Addon().getAddonInfo('path'))
        self.controller = controller
        self.host = host
        self.game = game
        self.list = None
        self.play_btn = None
        self.select_poster_btn = None
        self.select_fanart_btn = None

    def onInit(self):
        self.list = self.getControl(51)
        self.play_btn = self.getControl(52)
        self.select_poster_btn = self.getControl(53)
        self.select_fanart_btn = self.getControl(54)
        self.setFocus(self.play_btn)

        item = xbmcgui.ListItem()
        item.setLabel(self.game.name)
        item.setIconImage(self.game.get_selected_poster())

        item.setThumbnailImage(self.game.get_selected_poster())