def close(self): """ save viewtype and last focusposition """ addon.set_setting("viewtype_selection", str(self.getCurrentContainerId())) self.last_position = self.getCurrentListPosition() super(DialogBaseList, self).close()
def save_autocomplete(self): if not self.search_str: return None listitem = {"label": self.search_str} if listitem in self.last_searches: self.last_searches.remove(listitem) self.last_searches.appendleft(listitem) addon.set_setting(self.setting_name, str(list(self.last_searches)))
def onInit(self): self.clearProperty('NavMode') self.clearProperty('streetview') self.venues = self.getControl(C_PLACES_LIST) self.update() self.venues.reset() self.venues.addItems(items=utils.create_listitems(self.items)) self.clearProperty("index") if not addon.setting('firststart') == "true": addon.set_setting('firststart', 'true') xbmcgui.Dialog().ok(addon.LANG(32001), addon.LANG(32002), addon.LANG(32003))
def check_version(): """ check version, open TextViewer if update detected """ if not addon.setting("changelog_version") == addon.VERSION: text = utils.read_from_file(os.path.join(addon.PATH, "changelog.txt"), True) xbmcgui.Dialog().textviewer(heading=addon.LANG(24036), text=text) addon.set_setting("changelog_version", addon.VERSION) if not addon.setting("first_start_infodialog"): addon.set_setting("first_start_infodialog", "True") xbmcgui.Dialog().ok(heading=addon.NAME, line1=addon.LANG(32140), line2=addon.LANG(32141))
def open_dialog(self, dialog): if self.active_dialog: self.window_stack.append(self.active_dialog) self.active_dialog.close() utils.check_version() if not addon.setting("first_start_infodialog"): addon.set_setting("first_start_infodialog", "True") xbmcgui.Dialog().ok(heading=addon.NAME, line1=addon.LANG(32140), line2=addon.LANG(32141)) self.active_dialog = dialog dialog.doModal() if dialog.cancelled: addon.set_global("infobackground", self.saved_background) self.window_stack = [] return None if self.window_stack: self.active_dialog = self.window_stack.pop() xbmc.sleep(300) self.active_dialog.doModal() else: addon.set_global("infobackground", self.saved_background)
def open_dialog(self, dialog): if self.active_dialog: self.window_stack.append(self.active_dialog) self.active_dialog.close() utils.check_version() if not addon.setting("first_start_infodialog"): addon.set_setting("first_start_infodialog", "True") xbmcgui.Dialog().ok(heading=addon.NAME, message=addon.LANG(32140) + '[CR]' + addon.LANG(32141)) self.active_dialog = dialog dialog.doModal() # if dialog.canceled: # addon.set_global("infobackground", self.saved_background) # self.window_stack = [] # return None if self.window_stack: self.active_dialog = self.window_stack.pop() xbmc.sleep(300) self.active_dialog.doModal() else: addon.set_global("infobackground", self.saved_background)
import xbmcvfs import TheMovieDB as tmdb from kodi65 import windows from kodi65 import addon from kodi65 import utils from kodi65 import busy from kodi65 import player from kodi65 import local_db INFO_XML_CLASSIC = u'script-%s-DialogVideoInfo.xml' % (addon.ID) LIST_XML_CLASSIC = u'script-%s-VideoList.xml' % (addon.ID) ACTOR_XML_CLASSIC = u'script-%s-DialogInfo.xml' % (addon.ID) if addon.bool_setting("force_native_layout") and addon.setting("xml_version") != addon.VERSION: addon.set_setting("xml_version", addon.VERSION) INFO_XML = u'script-%s-DialogVideoInfo-classic.xml' % (addon.ID) LIST_XML = u'script-%s-VideoList-classic.xml' % (addon.ID) ACTOR_XML = u'script-%s-DialogInfo-classic.xml' % (addon.ID) path = os.path.join(addon.PATH, "resources", "skins", "Default", "1080i") xbmcvfs.copy(strSource=os.path.join(path, INFO_XML_CLASSIC), strDestnation=os.path.join(path, INFO_XML)) xbmcvfs.copy(strSource=os.path.join(path, LIST_XML_CLASSIC), strDestnation=os.path.join(path, LIST_XML)) xbmcvfs.copy(strSource=os.path.join(path, ACTOR_XML_CLASSIC), strDestnation=os.path.join(path, ACTOR_XML)) else: INFO_XML = INFO_XML_CLASSIC LIST_XML = LIST_XML_CLASSIC ACTOR_XML = ACTOR_XML_CLASSIC
from . import TheMovieDB as tmdb from kodi65 import windows from kodi65 import addon from kodi65 import utils from kodi65 import busy from kodi65 import player from kodi65 import local_db INFO_XML_CLASSIC = 'script-%s-DialogVideoInfo.xml' % (addon.ID) LIST_XML_CLASSIC = 'script-%s-VideoList.xml' % (addon.ID) ACTOR_XML_CLASSIC = 'script-%s-DialogInfo.xml' % (addon.ID) if addon.bool_setting("force_native_layout" ) and addon.setting("xml_version") != addon.VERSION: addon.set_setting("xml_version", addon.VERSION) INFO_XML = 'script-%s-DialogVideoInfo-classic.xml' % (addon.ID) LIST_XML = 'script-%s-VideoList-classic.xml' % (addon.ID) ACTOR_XML = 'script-%s-DialogInfo-classic.xml' % (addon.ID) path = os.path.join(addon.PATH, "resources", "skins", "Default", "1080i") xbmcvfs.copy(strSource=os.path.join(path, INFO_XML_CLASSIC), strDestination=os.path.join(path, INFO_XML)) xbmcvfs.copy(strSource=os.path.join(path, LIST_XML_CLASSIC), strDestination=os.path.join(path, LIST_XML)) xbmcvfs.copy(strSource=os.path.join(path, ACTOR_XML_CLASSIC), strDestination=os.path.join(path, ACTOR_XML)) else: INFO_XML = INFO_XML_CLASSIC LIST_XML = LIST_XML_CLASSIC ACTOR_XML = ACTOR_XML_CLASSIC