def __init__(self, session, items, service=None): Screen.__init__(self, session) self.skinName = "AdvancedMovieSelectionDownload" self.onShow.append(self.selectionChanged) self.onClose.append(self.__onClose) self.service = service self["logo"] = Pixmap() self["info"] = Label() self["title"] = Label() self["poster"] = Pixmap() self["poster"].hide() self["description"] = ScrollLabel() self["key_red"] = Button(_("Cancel")) self["key_green"] = Button("") self["key_yellow"] = Button("") self["key_yellow"] = Label(_("Manual search")) if service is not None: self["key_green"] = Label(_("Save infos/cover")) else: self["key_green"] = Label(_("Background")) self["key_yellow"].hide() self["ActionsMap"] = ActionMap(["SetupActions", "ColorActions"], { "ok": self.titleSelected, "green": self.titleSelected, "red": self.__cancel, "yellow": self.editTitle, "cancel": self.__cancel, "left": self.scrollLabelPageUp, "right": self.scrollLabelPageDown }, -1) self.onShown.append(self.setWindowTitle) self.l = [] self["list"] = MenuList(self.l) self["list"].onSelectionChanged.append(self.selectionChanged) self.picload = PicLoader() self.picload.addCallback(self.paintPosterPixmap) self.movie_title = "" if self.service is not None: self.movie_title = ServiceCenter.getInstance().info(self.service).getName(self.service) self.progressTimer = xTimer() self.progressTimer.addCallback(self.refresh) self.progressTimer.start(50, True) return if service is not None: items = [(service,)] global fetchingMovies if fetchingMovies is None or (fetchingMovies is not None and fetchingMovies.finished): fetchingMovies = FetchingMovies(session, items) else: fetchingMovies.cancel = False self.progressTimer = xTimer() self.progressTimer.addCallback(self.updateProgress) self.progressTimer.start(250, False) fetchingMovies.is_hidden = False
def __init__(self): self.popup = self.session.instantiateDialog(PopupInputDialog) self["config_actions"] = NumberActionMap( ["SetupActions"], { "1": self.keyNumberPressed, "2": self.keyNumberPressed, "3": self.keyNumberPressed, "4": self.keyNumberPressed, "5": self.keyNumberPressed, "6": self.keyNumberPressed, "7": self.keyNumberPressed, "8": self.keyNumberPressed, "9": self.keyNumberPressed, "0": self.keyNumberPressed, }, -1) # to prevent left/right overriding the listbox # we use extra actions to disable them self["SetupActions"] = NumberActionMap( ["SetupActions"], { "cancel": self.hidePopup, "deleteForward": self.keyBackspace, }, -1) self["InputAsciiActions"] = ActionMap( ["InputAsciiActions"], {"gotAsciiCode": self.keyGotAscii}, -2) self.last_result = -1 self.__timer = xTimer() self.__timer.addCallback(self.__timeout) self.__timer_reload = xTimer() self.__timer_reload.addCallback(self.__timeout_reload) self.onClose.append(self.__onClose) self.onLayoutFinish.append(self.__onLayoutFinish)
def __init__(self, session): self.session = session self.recTimer = xTimer() self.recTimer.addCallback(self.autoDeleteAllMovies) self.wastebasketTimer = xTimer() self.wastebasketTimer.addCallback(self.autoDeleteAllMovies) self.startTimer() config.AdvancedMovieSelection.empty_wastebasket_time.addNotifier(self.startTimer, initial_call=False)
def __init__(self): self.fwd_timer = xTimer() self.fwd_timer.addCallback(self.fwd) self.dvd_preview_timer = xTimer() self.dvd_preview_timer.addCallback(self.playLastDVD) self.video_preview_timer = xTimer() self.video_preview_timer.addCallback(self.playMovie) self.service = None self.currentlyPlayingService = None self.cut_list = None self.lastService = None self.updateVideoPreviewSettings() self.onClose.append(self.__playLastService) self.dvdScreen = self.session.instantiateDialog(DVDOverlay)
def __init__(self, session): Screen.__init__(self, session) HelpableScreen.__init__(self) self.skinName = "AdvancedMovieSelectionTrash" self.delayTimer = xTimer() self.delayTimer.addCallback(self.updateHDDData) self.current_ref = eServiceReferenceTrash(config.movielist.last_videodir.value) self["ColorActions"] = HelpableActionMap(self, "ColorActions", { "red": (self.canDelete, _("Delete selected movie")), "green": (self.restore, _("Restore movie")), "yellow": (self.canDeleteAll, _("Empty wastbasket")), "blue": (self.restoreAll, _("Restore all movies")), }) self["key_red"] = Button(_("Delete movie")) self["key_green"] = Button(_("Restore movie")) self["key_yellow"] = Button(_("Empty Trash")) self["key_blue"] = Button(_("Restore all movies")) self["waitingtext"] = Label(_("Please wait... Loading trash list...")) self["freeDiskSpace"] = self.diskinfo = DiskInfo(config.movielist.last_videodir.value, DiskInfo.FREE, update=False) self["location"] = Label() self["warning"] = Label() self["wastetxt"] = Label() self["MenuIcon"] = Pixmap() self["autoemptylast"] = Label() self["autoemptynext"] = Label() self["list"] = TrashMovieList(None) self.list = self["list"] self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions", { "cancel": (self.abort, _("Exit wastebasket")) }) self.inited = False self.onShown.append(self.setWindowTitle)
def __init__(self, session, title="", text=""): VirtualKeyBoard.__init__(self, session, title, text) NumericalTextInput.__init__(self, nextFunc=self.nextFunc) self.configText = None if config.AdvancedMovieSelection.keyboard.value == "virtual": use = self.KEYBOARD elif config.AdvancedMovieSelection.keyboard.value == "numerical": use = self.NUM_KEYB else: use = self.BOTH if not use & self.KEYBOARD: # hide the keyboard self["list"].hide() # overwrite VirtualKeyBoard actions # make sure not overwrite any action of base class self["actions"] = ActionMap(["OkCancelActions", "WizardActions", "ColorActions", "KeyboardInputActions", "InputBoxActions", "InputAsciiActions"], { "ok": self.__ok, "cancel": self.__cancel, "left": self.keyLeft, "right": self.keyRight, "up": self.keyHome, "down": self.keyEnd, "red": self.__cancel, "green": self.__ok, "yellow": self.dummy, "deleteForward": self.keyDelete, "deleteBackward": self.keyBackspace, "back": self.dummy }, -2) if use & self.NUM_KEYB: self.timer = xTimer() self.timer.addCallback(self.timeout) self.configText = ConfigText("", False) if text: self.configText.text = text self.configText.marked_pos = len(text) self["config_actions"] = NumberActionMap(["SetupActions", "InputAsciiActions", "KeyboardInputActions"], { "1": self.keyNumberGlobal, "2": self.keyNumberGlobal, "3": self.keyNumberGlobal, "4": self.keyNumberGlobal, "5": self.keyNumberGlobal, "6": self.keyNumberGlobal, "7": self.keyNumberGlobal, "8": self.keyNumberGlobal, "9": self.keyNumberGlobal, "0": self.keyNumberGlobal }, -1) # to prevent left/right overriding the listbox if use & self.KEYBOARD: self.selectedKey = self.getKeyIndex(u"OK") self.onLayoutFinish.append(self.__onLayoutFinish) self.onClose.append(self.__onClose)
def __init__(self, session, items): Thread.__init__(self, name="AMS-FetchingMoviesThread") self.session = session self.is_hidden = False self.movie_title = "" self.current = 0 self.total = 0 self.timer = xTimer() self.timer.addCallback(self.checkFinished) self.items = items self.start() self.finished = False self.timer.start(2000, False)
def __init__(self, session, instance, fwd): Screen.__init__(self, session) self.skinName = "AdvancedMovieSelectionSeekbar" self.session = session self.infobarInstance = instance self.fwd = fwd if isinstance(session.current_dialog, MoviePlayer): self.dvd = False else: self.dvd = True self.percent = 0.0 self.length = None service = session.nav.getCurrentService() if service: self.seek = service.seek() if self.seek: self.length = self.seek.getLength() position = self.seek.getPlayPosition() if self.length and position: if int(position[1]) > 0: self.percent = float(position[1]) * 100.0 / float( self.length[1]) self.minuteInput = ConfigNumber(default=5) self.positionEntry = ConfigSelection( choices=[_("Use arrow left/right for position")], default=_("Use arrow left/right for position")) if self.fwd: txt = _("Jump x minutes forward (OK for seek):") else: txt = _("Jump x minutes back (OK for seek):") ConfigListScreen.__init__(self, [ getConfigListEntry(txt, self.minuteInput), getConfigListEntry(_("Go manual to position (OK for seek):"), self.positionEntry) ]) self["cursor"] = MovingPixmap() self["time"] = Label() self["actions"] = ActionMap(["WizardActions"], {"back": self.exit}, -1) self.cursorTimer = xTimer() self.cursorTimer.addCallback(self.updateCursor) self.cursorTimer.start(200, False) self.onShown.append(self.setWindowTitle) self.onLayoutFinish.append(self.firstStart) self.firstime = True self.onExecBegin.append(self.__onExecBegin)
def __init__(self, session): Screen.__init__(self, session) HelpableScreen.__init__(self) self.timer = xTimer() self.timer.addCallback(self.update) self["ColorActions"] = HelpableActionMap( self, "ColorActions", { "red": (self.abort, _("Abort selected job")), "green": (self.close, _("Close")), }) self["key_red"] = Button(_("Cancel")) self["key_green"] = Button(_("Close")) self["list"] = ProgressList() self["list"].connectSelChanged(self.selectionChanged) self["OkCancelActions"] = HelpableActionMap( self, "OkCancelActions", { "cancel": (self.close, _("Close")), "ok": (self.ok, _("Show detail of selected job")) }) self.onShown.append(self.setWindowTitle)
def __init__(self, session, service, eventName=None, shortDescription=None): Screen.__init__(self, session) InfoLoadChoice.__init__(self, self.callback_green_pressed) self.skinName = "TheTVDBMain" if not pathExists(temp_dir): os.mkdir(temp_dir, 0777) self["setupActions"] = ActionMap( [ "ColorActions", "DirectionActions", "SetupActions", "OkCancelActions" ], { "exit": self.cancel, "ok": self.ok_pressed, "red": self.red_pressed, "green": self.green_pressed, "blue": self.blue_pressed, "yellow": self.yellow_pressed, "cancel": self.cancel, "upUp": self.pageUp, "leftUp": self.pageUp, "downUp": self.pageDown, "rightUp": self.pageDown, }) self.service = service self.ratingstars = -1 self.searchTitle = eventName self.description = shortDescription if service is not None: info = ServiceCenter.getInstance().info(service) self.searchTitle = info.getName(service) self.description = info.getInfoString( service, iServiceInformation.sDescription) print "[tvdb]", str(self.searchTitle), "-", str(self.description) if self.description == self.searchTitle: self.description = "" self.picload = PicLoader() self.picload.addCallback(self.paintPosterPixmapCB) self.picload2 = PicLoader() self.picload2.addCallback(self.paintBannerPixmapCB) self["cover"] = Pixmap() self["banner"] = Pixmap() self["stars"] = ProgressBar() self["no_stars"] = Pixmap() self["description"] = ScrollLabel("") self["description_episode"] = ScrollLabel("") self["extended"] = Label("") self["extended_episode"] = Label("") self["status"] = Label("") self["result_txt"] = Label("") self["voted"] = Label("") self["list"] = SeriesList() self["episodes_list"] = EpisodesList() self["seperator"] = Pixmap() self["thetvdb_logo"] = Pixmap() self["button_red"] = Pixmap() self["button_green"] = Pixmap() self["button_yellow"] = Pixmap() self["button_blue"] = Pixmap() self["key_red"] = StaticText("") self["key_green"] = StaticText("") self["key_yellow"] = StaticText("") self["key_blue"] = StaticText("") self.timer = xTimer() self.timer.addCallback(self.getSeriesList) self.red_button_timer = xTimer() self.red_button_timer.addCallback(self.callback_red_pressed) self.blue_button_timer = xTimer() self.blue_button_timer.addCallback(self.callback_blue_pressed) self.onLayoutFinish.append(self.layoutFinished) self.onClose.append(self.deleteTempDir) self.view_mode = self.SHOW_SEARCH self.updateView() self.startSearch()
def __init__(self, callback): self.__callback = callback self.__timer = xTimer() self.__timer.addCallback(self.__timerCallback)
def __init__(self, session, searchTitle, service=None): Screen.__init__(self, session) HelpableScreen.__init__(self) InfoLoadChoice.__init__(self, self.callback_green_pressed) self.skinName = ["TMDbMain"] if config.AdvancedMovieSelection.show_backdrop.value: SkinTools.insertBackdrop(self.skinName) self.service = service self.movies = [] if not os_path.exists(IMAGE_TEMPFILE): os_mkdir(IMAGE_TEMPFILE) self["ColorActions"] = HelpableActionMap( self, "ColorActions", { "red": (self.red_pressed, _("Toggle detail and list view")), "green": (self.green_pressed, _("Save info/cover")), "yellow": (self.yellow_pressed, _("Manual search")), "blue": (self.blue_pressed, _("Trailer search")), }, -1) self["WizardActions"] = HelpableActionMap( self, "WizardActions", { "ok": (self.ok_pressed, _("Toggle detail and list view")), "back": (self.cancel, _("Close")), "left": (self.left, _("Show previous cover")), "right": (self.right, _("Show next cover")), "up": (self.moveUp, _("Move up")), "down": (self.moveDown, _("Move down")), }, -1) self["EPGSelectActions"] = HelpableActionMap( self, "EPGSelectActions", { "nextBouquet": (self.nextBackdrop, _("Show next backdrop")), "prevBouquet": (self.prevBackdrop, _("Show previous backdrop")), }) self["ChannelSelectBaseActions"] = HelpableActionMap( self, "ChannelSelectBaseActions", { "nextMarker": (self.right, _("Show next cover")), "prevMarker": (self.left, _("Show previous cover")), }, -1) self["list"] = TMDbList() self["tmdblogo"] = Pixmap() self["cover"] = Pixmap() self["backdrop"] = Pixmap() self.picload = PicLoader() self.picload.addCallback(self.paintCoverPixmapCB) self.backdrop_picload = PicLoader() self.backdrop_picload.addCallback(self.paintBackdropPixmapCB) self["description"] = ScrollLabel() self["extended"] = Label() self["status"] = Label() self["stars"] = ProgressBar() self["no_stars"] = Pixmap() self["vote"] = Label() self["result_txt"] = Label() self["seperator"] = Pixmap() self["button_red"] = Pixmap() self["button_green"] = Pixmap() self["button_yellow"] = Pixmap() self["button_blue"] = Pixmap() self["key_red"] = StaticText("") self["key_green"] = StaticText("") self["key_yellow"] = StaticText("") self["key_blue"] = StaticText("") self.ratingstars = -1 self.searchTitle = searchTitle self.downloadItems = {} self.useTMDbInfoAsEventInfo = True self.timer = xTimer() self.timer.addCallback(self.searchForMovies) self.blue_button_timer = xTimer() self.blue_button_timer.addCallback(self.callback_blue_pressed) self.onClose.append(self.deleteTempDir) self.onLayoutFinish.append(self.layoutFinished) self.view_mode = self.SHOW_SEARCH self.automatic_show_detail = True
def __init__(self): self.timer = xTimer() self.timer.addCallback(self.__timeout)
def __init__(self): self["ServiceEvent"] = ServiceEvent() self["ShortDesc"] = Label("") self.timer = xTimer() self.timer.addCallback(self.updateEventInfo) self.onShow.append(self.__selectionChanged)