def __init__(self): self["rc"] = MultiPixmap() self["arrowdown"] = MovingPixmap() self["arrowdown2"] = MovingPixmap() self["arrowup"] = MovingPixmap() self["arrowup2"] = MovingPixmap() self.initRcused() (rcArrowDownW, rcArrowDownH, rcArrowUpW, rcArrowUpH, rcheight, rcheighthalf) = (18, 70, 18, 0, 500, 250) if config.misc.rcused == 2: (rcArrowDownW, rcArrowDownH, rcArrowUpW, rcArrowUpH, rcheight, rcheighthalf) = skin.parameters.get("RcArrow", (18, 70, 18, 0, 500, 250)) self.rcheight = rcheight self.rcheighthalf = rcheighthalf self.selectpics = [] self.selectpics.append((self.rcheighthalf, ["arrowdown", "arrowdown2"], (-rcArrowDownW, -rcArrowDownH))) self.selectpics.append( (self.rcheight, ["arrowup", "arrowup2"], (-rcArrowUpW, rcArrowUpH))) self.readPositions() self.clearSelectedKeys() self.onShown.append(self.initRc)
def __init__(self, session): self.xmlfile = "tutorialwizard.xml" Wizard.__init__(self, session, showSteps=False, showStepSlider=False, showList=True, showConfig=False) self["rc"] = MovingPixmap() self["arrowdown"] = MovingPixmap() self["arrowup"] = MovingPixmap() self["arrowup2"] = MovingPixmap()
def __init__(self): self["rc"] = MultiPixmap() self["arrowdown"] = MovingPixmap() self["arrowdown2"] = MovingPixmap() self["arrowup"] = MovingPixmap() self["arrowup2"] = MovingPixmap() config.misc.rcused = ConfigInteger(default=1) sizes = componentSizes[Rc.SKIN_COMPONENT_KEY] rcheight = sizes.get(Rc.SKIN_COMPONENT_RCHEIGHT, 500) rcheighthalf = sizes.get(Rc.SKIN_COMPONENT_RCHEIGHTHALF, 250) self.rcheight = rcheight self.rcheighthalf = rcheighthalf self.selectpics = [] self.selectpics.append((self.rcheighthalf, ["arrowdown", "arrowdown2"], (-18, -70))) self.selectpics.append((self.rcheight, ["arrowup", "arrowup2"], (-18, 0))) self.readPositions() self.clearSelectedKeys() self.onShown.append(self.initRc)
def __init__(self, session, silent = True, showSteps = False, neededTag = None): DreamInfoHandler.__init__(self, self.statusCallback, neededTag=neededTag) self.silent = silent self.setDirectory() WizardLanguage.__init__(self, session, showSteps=False) self['wizard'] = Pixmap() self['rc'] = MovingPixmap() self['arrowdown'] = MovingPixmap() self['arrowup'] = MovingPixmap() self['arrowup2'] = MovingPixmap()
def __init__(self): self["rc"] = MultiPixmap() self['red'] = MovingPixmap() self['tunera'] = MovingPixmap() self['tunerb'] = MovingPixmap() self['tunerc'] = MovingPixmap() self['tunerd'] = MovingPixmap() self["arrowdown"] = MovingPixmap() self["arrowdown2"] = MovingPixmap() self["arrowup"] = MovingPixmap() self["arrowup2"] = MovingPixmap() config.misc.rcused = ConfigInteger(default=1) self.isDefaultRc = rc_model.rcIsDefault() self.rcheight = 500 self.rcheighthalf = 250 self.selectpics = [] self.selectpics.append((self.rcheighthalf, ["arrowdown", "arrowdown2"], (-18, -70))) self.selectpics.append((self.rcheight, ["arrowup", "arrowup2"], (-18, 0))) self['red'].hide() #if self.has_key('languagetext'): # self['languagetext'].hide() self.readPositions() self.clearSelectedKeys() self.onShown.append(self.initRc)
def __init__(self, session, silent = True, showSteps = False, neededTag = None, default = False, showMulticontentList = False): DreamInfoHandler.__init__(self, self.statusCallback, neededTag = neededTag) self.silent = silent self.setDirectory() self.default = default WizardLanguage.__init__(self, session, showSteps = False, showMulticontentList = showMulticontentList) self["wizard"] = Pixmap() self["rc"] = MovingPixmap() self["arrowdown"] = MovingPixmap() self["arrowup"] = MovingPixmap() self["arrowup2"] = MovingPixmap()
def __init__(self): self['rc'] = MultiPixmap() self['arrowdown'] = MovingPixmap() self['arrowdown2'] = MovingPixmap() self['arrowup'] = MovingPixmap() self['arrowup2'] = MovingPixmap() config.misc.rcused = ConfigInteger(default=1) self.isDefaultRc = rc_model.rcIsDefault() self.rcheight = 500 self.rcheighthalf = 250 self.selectpics = [] self.selectpics.append((self.rcheighthalf, ['arrowdown', 'arrowdown2'], (-18, -70))) self.selectpics.append((self.rcheight, ['arrowup', 'arrowup2'], (-18, 0))) self.readPositions() self.clearSelectedKeys() self.onShown.append(self.initRc)
def __init__(self, session, api=None): Screen.__init__(self, session) HelpableScreen.__init__(self) InfoBarNotifications.__init__(self) if api is None: if config.plugins.ecasa.last_backend.value == 'picasa': self.api = PicasaApi(cache=config.plugins.ecasa.cache.value) else: self.api = FlickrApi(config.plugins.ecasa.flickr_api_key.value, cache=config.plugins.ecasa.cache.value) try: self.api.setCredentials( config.plugins.ecasa.google_username.value, config.plugins.ecasa.google_password.value ) except Exception as e: AddPopup( _("Unable to authenticate with Google: %s.") % (e.message), MessageBox.TYPE_ERROR, 5, id=AUTHENTICATION_ERROR_ID, ) else: self.api = api self["key_red"] = StaticText(_("Close")) self["key_green"] = StaticText(_("Albums")) self["key_yellow"] = StaticText() self["key_blue"] = StaticText(_("Search")) for i in xrange(self.PICS_PER_PAGE): self['image%d' % i] = Pixmap() self['title%d' % i] = StaticText() self["highlight"] = MovingPixmap() self["waitingtext"] = Label(_("Please wait... Loading list...")) self["overviewActions"] = HelpableActionMap(self, "EcasaOverviewActions", { "up": self.up, "down": self.down, "left": self.left, "right": self.right, "nextPage": (self.nextPage, _("show next page")), "prevPage": (self.prevPage, _("show previous page")), "select": self.select, "exit":self.close, "albums":(self.albums, _("show your albums (if logged in)")), "search":(self.search, _("start a new search")), "contextMenu":(self.contextMenu, _("open context menu")), }, -1) self.offset = 0 self.__highlighted = 0 self.pictures = () # thumbnail loader self.picload = ePicLoad() self.picload.PictureData.get().append(self.gotPicture) self.currentphoto = None self.queue = deque() self.onLayoutFinish.append(self.layoutFinished)
def __init__(self, session): Screen.__init__(self, session) self.session = session self.movies = [] self.pics = [] self.names = [] self.selectedEntry = 0 self.mainUrl = "http://iptv.orf.at" self.pic = "/tmp/orf.jpg" self.working = False self.cacheDialog = self.session.instantiateDialog(ORFatCache) self.cacheTimer = eTimer() self.cacheTimer.callback.append(self.chechCachedFile) self.transcodeServer = None self["pic"] = MovingPixmap() self["actions"] = ActionMap(["WizardActions", "MenuActions"], { "ok": self.okClicked, "back": self.exit, "up": self.up, "down": self.down, "menu": self.selectServer }, -1) self.onLayoutFinish.append(self.downloadList)
def __init__(self,session,parent): size_w = getDesktop(0).size().width() size_h = getDesktop(0).size().height() self.skin = """<screen position="0,0" size="%i,%i" flags="wfNoBorder" title="LastFMSaveScreen" > <widget name="cover" position="50,50" size="%i,%i" /> </screen>"""%(size_w,size_h,self.coverartsize[0],self.coverartsize[1]) Screen.__init__(self,session) self.imageconverter = ImageConverter(self.coverartsize[0],self.coverartsize[1],self.setCoverArt) self.session = session self.streamplayer = parent.streamplayer self.parent = parent self["cover"] = MovingPixmap() self["actions"] = ActionMap(["InfobarChannelSelection","WizardActions", "DirectionActions","MenuActions","ShortcutActions","GlobalActions","HelpActions"], { "ok": self.action_exit, "back": self.action_exit, "red": self.parent.action_startstop, "green": self.parent.skipTrack, "yellow": self.parent.love, "blue": self.parent.banTrack , }, -1) self.onLayoutFinish.append(self.update) self.updatetimer = eTimer() self.updatetimer.timeout.get().append(self.update) self.updatetimer.start(1000) if config.plugins.LastFM.sreensaver.coverartanimation.value: self.startmovingtimer = eTimer() self.startmovingtimer.timeout.get().append(self.movePixmap) self.startmovingtimer.start(config.plugins.LastFM.sreensaver.coverartinterval.value*1000)
def __init__(self): self["rc"] = MultiPixmap() self["arrowdown"] = MovingPixmap() self["arrowdown2"] = MovingPixmap() self["arrowup"] = MovingPixmap() self["arrowup2"] = MovingPixmap() self.rcheight = 500 self.rcheighthalf = 250 self.selectpics = [] self.selectpics.append((self.rcheighthalf, ["arrowdown", "arrowdown2"], (-18,-70))) self.selectpics.append((self.rcheight, ["arrowup", "arrowup2"], (-18,0))) self.readPositions() self.clearSelectedKeys() self.onShown.append(self.initRc)
def __init__(self, session, packagesAvailable, packagesMissing): self.xmlfile = "restorewizard.xml" WizardLanguage.__init__(self, session) self.skinName = "DefaultWizard" self._packagesAvailable = packagesAvailable self._packagesMissing = packagesMissing self._commands = [] self["wizard"] = Pixmap() self["rc"] = MovingPixmap() self["arrowdown"] = MovingPixmap() self["arrowup"] = MovingPixmap() self["arrowup2"] = MovingPixmap() self._packages = [] for p in self._packagesAvailable: self._packages.append(getConfigListEntry(p, ConfigYesNo(default=True)))
def __init__(self, session, names, urls, pics=[]): skin = skin_path + '/GridMain.xml' f = open(skin, 'r') self.skin = f.read() f.close() Screen.__init__(self, session) self['title'] = Label(_('..:: TiVuStream Revolution ::..')) tmpfold = config.plugins.TivuStream.cachefold.value + "/tivustream/tmp" picfold = config.plugins.TivuStream.cachefold.value + "/tivustream/pic" # pics = getpics(names, pics, tmpfold, picfold) self.picsint = eTimer() self.picsint.start(1000, True) pics = getpics(names, pics, tmpfold, picfold) sleep(3) list = [] self.pos = [] self.pos = pos self.name = "TivuStream" self.pics = pics self.urls = urls self.names = names self.names1 = names list = names self["info"] = Label() self["menu"] = List(list) self["frame"] = MovingPixmap() i = 0 while i < 16: self["label" + str(i + 1)] = StaticText() self["pixmap" + str(i + 1)] = Pixmap() i = i + 1 i = 0 ip = 0 self.index = 0 self.ipage = 1 self.icount = 0 ln = len(self.names1) self.npage = int(float(ln / 10)) + 1 self["actions"] = ActionMap( [ "OkCancelActions", "MenuActions", "DirectionActions", "NumberActions" ], { "ok": self.okClicked, "cancel": self.cancel, "left": self.key_left, "right": self.key_right, "up": self.key_up, "down": self.key_down, }) global srefInit self.initialservice = self.session.nav.getCurrentlyPlayingServiceReference( ) srefInit = self.initialservice self.onLayoutFinish.append(self.openTest)
def __init__(self, session, instance, fwd): Screen.__init__(self, session) self.session = session self.infobarInstance = instance self.fwd = fwd if isinstance(session.current_dialog, MoviePlayer): self.dvd = False self.vdb = False elif DVDPlayer is not None and isinstance(session.current_dialog, DVDPlayer): self.dvd = True self.vdb = False else: self.dvd = False self.vdb = 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=["<>"], default="<>") if self.fwd: txt = _("Jump x minutes forward:") else: txt = _("Jump x minutes back:") ConfigListScreen.__init__(self, [ getConfigListEntry(txt, self.minuteInput), getConfigListEntry(_("Go to position:"), self.positionEntry), getConfigListEntry(_("Sensibility:"), config.plugins.Seekbar.sensibility), getConfigListEntry(_("Overwrite left and right buttons:"), config.plugins.Seekbar.overwrite_left_right) ]) self["cursor"] = MovingPixmap() self["time"] = Label() self["actions"] = ActionMap(["WizardActions"], {"back": self.exit}, -1) self.cursorTimer = eTimer() self.cursorTimer_conn = self.cursorTimer.timeout.connect( self.updateCursor) self.cursorTimer.start(200, False) self.onLayoutFinish.append(self.firstStart)
def __init__(self): self["rc"] = MultiPixmap() self["arrowdown"] = MovingPixmap() self["arrowdown2"] = MovingPixmap() self["arrowup"] = MovingPixmap() self["arrowup2"] = MovingPixmap() config.misc.rcused = ConfigInteger(default=1) self.isDefaultRc = rc_model.rcIsDefault() self.rcheight = 500 self.rcheighthalf = 250 self.selectpics = [] # self.selectpics.append((self.rcheighthalf, ["arrowdown", "arrowdown2"], (-18,-70))) # self.selectpics.append((self.rcheight, ["arrowup", "arrowup2"], (-18,0))) # [iq from Tools.HardwareInfo import HardwareInfo if HardwareInfo().get_device_name() in ('twin', 'tm2toe', '2t', 'tmtwinoe', 'tmsingle', 'tmsinglemini', 'tmnanooe'): self.selectpics.append( (self.rcheighthalf, ["arrowdown", "arrowdown2"], (-23, -98))) self.selectpics.append((self.rcheight, ["arrowup", "arrowup2"], (-23, 0))) if HardwareInfo().get_device_name() in ('ios100hd', 'ios200hd', 'ios300hd', 'mediabox', 'optimussos1', 'optimussos2'): self.selectpics.append( (self.rcheighthalf, ["arrowdown", "arrowdown2"], (-23, -125))) self.selectpics.append((self.rcheight, ["arrowup", "arrowup2"], (-22, -45))) else: self.selectpics.append( (self.rcheighthalf, ["arrowdown", "arrowdown2"], (-18, -70))) self.selectpics.append((self.rcheight, ["arrowup", "arrowup2"], (-18, -0))) # iq] self.readPositions() self.clearSelectedKeys() self.onShown.append(self.initRc)
def __init__(self): self["rc"] = MultiPixmap() self["arrowdown"] = MovingPixmap() self["arrowdown2"] = MovingPixmap() self["arrowup"] = MovingPixmap() self["arrowup2"] = MovingPixmap() config.misc.rcused = ConfigInteger(default=1) self.rcheight = 474 self.rcheighthalf = 220 self.selectpics = [] self.selectpics.append((self.rcheighthalf, ["arrowdown", "arrowdown2"], (-18, -70))) self.selectpics.append((self.rcheight, ["arrowup", "arrowup2"], (-18, -0))) self.readPositions() self.clearSelectedKeys() self.onShown.append(self.initRc)
def __init__(self): self["rc"] = MultiPixmap() self["arrowdown"] = MovingPixmap() self["arrowdown2"] = MovingPixmap() self["arrowup"] = MovingPixmap() self["arrowup2"] = MovingPixmap() config.misc.rcused = ConfigInteger(default=1) self.rcheight = 500 self.rcheighthalf = 250 self.selectpics = [] # self.selectpics.append((self.rcheighthalf, ["arrowdown", "arrowdown2"], (-18,-70))) # self.selectpics.append((self.rcheight, ["arrowup", "arrowup2"], (-18,0))) # [iq from Tools.HardwareInfo import HardwareInfo if HardwareInfo().get_device_name() in ('twin', 'tm2t'): self.selectpics.append( (self.rcheighthalf, ["arrowdown", "arrowdown2"], (-23, -98))) self.selectpics.append((self.rcheight, ["arrowup", "arrowup2"], (-23, 0))) if HardwareInfo().get_device_name() in ('ios100hd'): self.selectpics.append( (self.rcheighthalf, ["arrowdown", "arrowdown2"], (-18, -160))) self.selectpics.append((self.rcheight, ["arrowup", "arrowup2"], (-18, -95))) else: self.selectpics.append( (self.rcheighthalf, ["arrowdown", "arrowdown2"], (-18, -70))) self.selectpics.append((self.rcheight, ["arrowup", "arrowup2"], (-18, -0))) # iq] self.readPositions() self.clearSelectedKeys() self.onShown.append(self.initRc)
def __init__(self): self["seekbarcursor"] = MovingPixmap() self["seekbarcursor"].hide() self["seekbartime"] = Label() self["seekbartime"].hide() self.cursorTimer = eTimer() self.cursorTimer.callback.append(self.__updateCursor) self.cursorShown = False self.seekBarShown = False self.seekBarLocked = False self.isNumberSeek = False self.counter = 0 self.onHide.append(self.__seekBarHide) self.onShow.append(self.__seekBarShown) self.resetMySpass()
def __init__(self, session, instance, fwd): self.session = session Screen.__init__(self, session) self.infobarInstance = instance self.fwd = fwd if isinstance(session.current_dialog, MoviePlayer): self.dvd = False self.vdb = False elif DVDPlayer is not None and isinstance(session.current_dialog, DVDPlayer): self.dvd = True self.vdb = False else: self.dvd = False self.vdb = 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 = ConfigSelection( default=config.plugins.timejump.defaulttime.value, choices=time_options) self.positionEntry = ConfigSelection(choices=["<>"], default="<>") txt = _("Jump video time:") ConfigListScreen.__init__(self, [ getConfigListEntry(txt, self.minuteInput), getConfigListEntry(_("Go to position:"), self.positionEntry) ]) self["cursor"] = MovingPixmap() self["time"] = Label() self["actions"] = ActionMap(["WizardActions"], {"back": self.exit}, -1) self.cursorTimer = eTimer() self.cursorTimer.callback.append(self.updateCursor) self.cursorTimer.start(200, False) self.onLayoutFinish.append(self.firstStart)
def __init__(self, session, instance, fwd): Screen.__init__(self, session) self.skinName = SkinTools.appendResolution( "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 = eTimer() self.cursorTimer.callback.append(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, parent): size_w = getDesktop(0).size().width() size_h = getDesktop(0).size().height() self.skin = """<screen position="0,0" size="%i,%i" flags="wfNoBorder" title="LastFMSaveScreen" > <widget name="cover" position="50,50" size="%i,%i" /> </screen>""" % (size_w, size_h, self.coverartsize[0], self.coverartsize[1]) Screen.__init__(self, session) HelpableScreen.__init__(self) self.imageconverter = ImageConverter(self.coverartsize[0], self.coverartsize[1], self.setCoverArt) self.session = session self.streamplayer = parent.streamplayer self.parent = parent self["cover"] = MovingPixmap() self["actions"] = HelpableActionMap( self, ["WizardActions", "ShortcutActions"], { "ok": (self.action_exit, _("Exit screensaver")), "back": (self.action_exit, _("Exit screensaver")), "red": (self.parent.action_startstop, _("Start/stop streaming")), "green": (self.parent.skipTrack, _("Skip current track")), "yellow": (self.parent.love, _("Mark track as loved")), "blue": (self.parent.banTrack, _("Ban track, never play")) }, prio=-1, description=config.plugins.LastFM.name.value + " " + _("Screensaver")) self.onLayoutFinish.append(self.update) self.updatetimer = eTimer() self.updatetimer.timeout.get().append(self.update) self.updatetimer.start(1000) if config.plugins.LastFM.sreensaver.coverartanimation.value: self.startmovingtimer = eTimer() self.startmovingtimer.timeout.get().append(self.movePixmap) self.startmovingtimer.start( config.plugins.LastFM.sreensaver.coverartinterval.value * 1000)
def __init__(self, activeYPos, pixmap): MovingPixmap.__init__(self) self.activeYPos = activeYPos self.pixmapName = pixmap
def __init__(self, session, instance, fwd): Screen.__init__(self, session) self.session = session self.infobarInstance = instance self.fwd = fwd self.movie = isinstance(session.current_dialog, MoviePlayer) try: self.media_player = isinstance(session.current_dialog, MediaPlayer) except: self.media_player = False try: self.dvd_pli = isinstance(session.current_dialog, DVDPlayer) except: self.dvd_pli = False try: self.old_dvd = isinstance(session.current_dialog, DVDPlayer2) except: self.old_dvd = False try: self.ytube = isinstance(session.current_dialog, YouTubePlayer) except: self.ytube = False try: self.tmbd_trailer = isinstance(session.current_dialog, tmbdTrailerPlayer) except: self.tmbd_trailer = False try: self.vod = isinstance(session.current_dialog, nVODplayer) except: self.vod = False try: self.yamp_player = isinstance(session.current_dialog, YampScreen) except: self.yamp_player = False try: self.seasondream = isinstance(session.current_dialog, Player) except: self.seasondream = False try: self.cutlisteditor = isinstance(session.current_dialog, CutListEditor) except: self.cutlisteditor = False try: self.timeshift = isinstance(session.current_dialog, InfoBar) except: self.timeshift = False 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=["<>"], default="<>") if self.fwd: txt = _("Jump x minutes forward:") else: txt = _("Jump x minutes back:") ConfigListScreen.__init__(self, [ getConfigListEntry(txt, self.minuteInput), getConfigListEntry(_("Go to position:"), self.positionEntry), getConfigListEntry(_("Sensibility:"), config.plugins.Seekbar.sensibility), getConfigListEntry(_("Overwrite left and right buttons:"), config.plugins.Seekbar.overwrite_left_right)]) self["cursor"] = MovingPixmap() self["time"] = Label() self["actions"] = ActionMap(["WizardActions"], {"back": self.exit}, -1) self.cursorTimer = eTimer() self.cursorTimer.callback.append(self.updateCursor) self.cursorTimer.start(200, False) self.onLayoutFinish.append(self.firstStart)
def __init__(self): self["rc"] = MultiPixmap() self["arrowdown"] = MovingPixmap() self["arrowdown2"] = MovingPixmap() self["arrowup"] = MovingPixmap() self["arrowup2"] = MovingPixmap() config.misc.rcused = ConfigInteger(default=1) self.isDefaultRc = rc_model.rcIsDefault() self.rcheight = 500 self.rcheighthalf = 250 self.selectpics = [] # self.selectpics.append((self.rcheighthalf, ["arrowdown", "arrowdown2"], (-18,-70))) # self.selectpics.append((self.rcheight, ["arrowup", "arrowup2"], (-18,0))) # [ IQON : by LeeWS : replace below list from upper 2 lines. from Tools.HardwareInfo import HardwareInfo if HardwareInfo().get_device_name() in ('twin', 'tm2toe', '2t', 'tmtwinoe', 'tmsingle', 'tmsinglemini', 'tmnanooe', 'tmnano2t', 'tm2tsuper', 'tmnanosuper', 'tmnano2super'): self.selectpics.append( (self.rcheighthalf, ["arrowdown", "arrowdown2"], (-23, -98))) self.selectpics.append((self.rcheight, ["arrowup", "arrowup2"], (-23, 0))) if HardwareInfo().get_device_name() in ( 'ios100hd', 'ios200hd', 'ios300hd', 'mediabox', 'optimussos1', 'optimussos2', 'force1', 'optimussos1plus', 'optimussos2plus', 'force1plus', 'force2', 'force2solid', 'tmnanose', 'optimussosplus', 'force2plus', 'tmnanosecombo', 'tmnanosem2', 'force2eco', 'fusionhd'): if HardwareInfo().get_device_name() == "force1plus": # f = open("/etc/.brandtype", 'r') # line = f.readline() # if "technomate" in line: # self.selectpics.append((self.rcheighthalf, ["arrowdown", "arrowdown2"], (-23,-98))) # self.selectpics.append((self.rcheight, ["arrowup", "arrowup2"], (-23,0))) # else: # self.selectpics.append((self.rcheighthalf, ["arrowdown", "arrowdown2"], (-23,-125))) # self.selectpics.append((self.rcheight, ["arrowup", "arrowup2"], (-22,-45))) # f.close() self.selectpics.append( (self.rcheighthalf, ["arrowdown", "arrowdown2"], (-23, -125))) self.selectpics.append( (self.rcheight, ["arrowup", "arrowup2"], (-22, -45))) else: self.selectpics.append( (self.rcheighthalf, ["arrowdown", "arrowdown2"], (-23, -125))) self.selectpics.append( (self.rcheight, ["arrowup", "arrowup2"], (-22, -45))) else: self.selectpics.append( (self.rcheighthalf, ["arrowdown", "arrowdown2"], (-18, -70))) self.selectpics.append((self.rcheight, ["arrowup", "arrowup2"], (-18, -0))) # IQON ] : by LeeWS self.readPositions() self.clearSelectedKeys() self.onShown.append(self.initRc)
def __init__(self, session, piclist, lastindex, path): self.textcolor = config.pic.textcolor.value self.color = config.pic.bgcolor.value tlf = TemplatedListFonts() self._labelFontSize = tlf.size(tlf.SMALLER) self._labelFontFace = tlf.face(tlf.SMALLER) sizes = componentSizes[Pic_Thumb.SKIN_COMPONENT_KEY] self._descSize = sizes.get(Pic_Thumb.SKIN_COMPONENT_DESCRIPTION_SIZE, 35) self._margin = sizes.get(Pic_Thumb.SKIN_COMPONENT_MARGIN, 10) self._spaceX = sizes.get(Pic_Thumb.SKIN_COMPONENT_SPACE_X, 55) self._spaceY = sizes.get(Pic_Thumb.SKIN_COMPONENT_SPACE_Y, 30) self._thumbX = sizes.get(Pic_Thumb.SKIN_COMPONENT_THUMP_X, 190) self._thumbY = sizes.get(Pic_Thumb.SKIN_COMPONENT_THUMP_Y, 200) size_w = getDesktop(0).size().width() size_h = getDesktop(0).size().height() self.thumbsX = size_w // (self._spaceX + self._thumbX ) # thumbnails in X self.thumbsY = size_h // (self._spaceY + self._thumbY ) # thumbnails in Y self.thumbsC = self.thumbsX * self.thumbsY # all thumbnails self.positionlist = [] skincontent = "" posX = -1 for x in range(self.thumbsC): posY = x // self.thumbsX posX += 1 if posX >= self.thumbsX: posX = 0 absX = self._spaceX + (posX * (self._spaceX + self._thumbX)) absY = self._spaceY + (posY * (self._spaceY + self._thumbY)) self.positionlist.append((absX, absY)) absX += self._margin absY += self._margin skincontent += '<widget source="label%s" render="Label" position="%s,%s" size="%s,%s" font="%s;%s" valign="top" halign="center" zPosition="2" transparent="1" foregroundColor="%s"/>' % ( x, absX, absY + self._thumbY - self._descSize, self._thumbX, self._descSize, self._labelFontFace, self._labelFontSize, self.textcolor) skincontent += '<widget name="thumb%s" position="%s,%s" size="%s,%s" zPosition="2" transparent="1" />' % ( x, absX, absY, self._thumbX, self._thumbY - self._descSize - self._margin) # Screen, backgroundlabel and MovingPixmap doubleMargin = self._margin * 2 self.skin = """<screen position="0,0" size="{0},{1}" flags="wfNoBorder" > <eLabel position="0,0" zPosition="0" size="{0},{1}" backgroundColor="{2}" /> \ <widget name="frame" position="35,30" size="{3},{4}" pixmap="pic_frame.png" zPosition="1" alphatest="on" />{5}</screen>""".format( size_w, size_h, self.color, self._thumbX + doubleMargin, self._thumbY + doubleMargin, skincontent) Screen.__init__(self, session) self["actions"] = ActionMap( [ "OkCancelActions", "ColorActions", "DirectionActions", "MovieSelectionActions" ], { "cancel": self.Exit, "ok": self.KeyOk, "left": self.key_left, "right": self.key_right, "up": self.key_up, "down": self.key_down, "showEventInfo": self.StartExif, }, -1) self["frame"] = MovingPixmap() for x in range(self.thumbsC): self["label" + str(x)] = StaticText() self["thumb" + str(x)] = Pixmap() self.Thumbnaillist = [] self.filelist = [] self.currPage = -1 self.dirlistcount = 0 self.path = path index = 0 framePos = 0 Page = 0 for x in piclist: if x[0][1] == False: self.filelist.append( (index, framePos, Page, x[0][0], path + x[0][0])) index += 1 framePos += 1 if framePos > (self.thumbsC - 1): framePos = 0 Page += 1 else: self.dirlistcount += 1 self.maxentry = len(self.filelist) - 1 self.index = lastindex - self.dirlistcount if self.index < 0: self.index = 0 self.picload = ePicLoad() self.picload_conn = self.picload.PictureData.connect(self.showPic) self.onLayoutFinish.append(self.setPicloadConf) self.ThumbTimer = eTimer() self.ThumbTimer_conn = self.ThumbTimer.timeout.connect(self.showPic)
def __init__(self, session, piclist, lastindex, path): self.textcolor = config.pic.textcolor.value self.color = config.pic.bgcolor.value textsize = 20 self.spaceX = 35 self.picX = 190 self.spaceY = 30 self.picY = 200 size_w = getDesktop(0).size().width() size_h = getDesktop(0).size().height() self.thumbsX = size_w / (self.spaceX + self.picX) # thumbnails in X self.thumbsY = size_h / (self.spaceY + self.picY) # thumbnails in Y self.thumbsC = self.thumbsX * self.thumbsY # all thumbnails self.positionlist = [] skincontent = "" posX = -1 for x in range(self.thumbsC): posY = x / self.thumbsX posX += 1 if posX >= self.thumbsX: posX = 0 absX = self.spaceX + (posX*(self.spaceX + self.picX)) absY = self.spaceY + (posY*(self.spaceY + self.picY)) self.positionlist.append((absX, absY)) skincontent += "<widget source=\"label" + str(x) + "\" render=\"Label\" position=\"" + str(absX+5) + "," + str(absY+self.picY-textsize) + "\" size=\"" + str(self.picX - 10) + "," + str(textsize) + "\" font=\"Regular;14\" zPosition=\"2\" transparent=\"1\" noWrap=\"1\" foregroundColor=\"" + self.textcolor + "\" />" skincontent += "<widget name=\"thumb" + str(x) + "\" position=\"" + str(absX+5)+ "," + str(absY+5) + "\" size=\"" + str(self.picX -10) + "," + str(self.picY - (textsize*2)) + "\" zPosition=\"2\" transparent=\"1\" alphatest=\"on\" />" # Screen, backgroundlabel and MovingPixmap self.skin = "<screen position=\"0,0\" size=\"" + str(size_w) + "," + str(size_h) + "\" flags=\"wfNoBorder\" > \ <eLabel position=\"0,0\" zPosition=\"0\" size=\""+ str(size_w) + "," + str(size_h) + "\" backgroundColor=\"" + self.color + "\" /><widget name=\"frame\" position=\"35,30\" size=\"190,200\" pixmap=\"pic_frame.png\" zPosition=\"1\" alphatest=\"on\" />" + skincontent + "</screen>" Screen.__init__(self, session) self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "DirectionActions", "MovieSelectionActions"], { "cancel": self.Exit, "ok": self.KeyOk, "left": self.key_left, "right": self.key_right, "up": self.key_up, "down": self.key_down, "showEventInfo": self.StartExif, }, -1) self["frame"] = MovingPixmap() for x in range(self.thumbsC): self["label"+str(x)] = StaticText() self["thumb"+str(x)] = Pixmap() self.Thumbnaillist = [] self.filelist = [] self.currPage = -1 self.dirlistcount = 0 self.path = path index = 0 framePos = 0 Page = 0 for x in piclist: if x[0][1] == False: self.filelist.append((index, framePos, Page, x[0][0], path + x[0][0])) index += 1 framePos += 1 if framePos > (self.thumbsC -1): framePos = 0 Page += 1 else: self.dirlistcount += 1 self.maxentry = len(self.filelist)-1 self.index = lastindex - self.dirlistcount if self.index < 0: self.index = 0 self.picload = ePicLoad() self.picload.PictureData.get().append(self.showPic) self.onLayoutFinish.append(self.setPicloadConf) self.ThumbTimer = eTimer() self.ThumbTimer.callback.append(self.showPic)
def __init__(self, session, piclist, lastindex, path): self["key_red"] = Button("") self["key_green"] = Button("Slide Show") self["key_yellow"] = Button("File View") self["key_blue"] = Button(_("Settings")) self.textcolor = config.plugins.mc_pp.textcolor.value self.color = config.plugins.mc_pp.bgcolor.value textsize = 20 self.spaceX = 20 self.spaceY = 28 self.picX = config.plugins.mc_pp.ThumbWidth.value self.picY = config.plugins.mc_pp.ThumbHeight.value size_w = getDesktop(0).size().width() size_h = getDesktop(0).size().height() if size_w == 1280: self.spaceTop = 130 self.spaceLeft = 50 self.ButtonPosY = 95 else: self.spaceTop = 120 self.spaceLeft = 25 self.ButtonPosY = 72 self.thumbsX = size_w / (self.spaceX + self.picX) # thumbnails in X self.thumbsY = size_h / (self.spaceY + self.picY) # thumbnails in Y self.thumbsC = self.thumbsX * self.thumbsY # all thumbnails self.positionlist = [] skincontent = "" posX = -1 for x in range(self.thumbsC): posY = x / self.thumbsX posX += 1 if posX >= self.thumbsX: posX = 0 absX = self.spaceLeft + self.spaceX + (posX*(self.spaceX + self.picX)) absY = self.spaceTop + self.spaceY + (posY*(self.spaceY + self.picY)) self.positionlist.append((absX, absY)) skincontent += "<widget name=\"label" + str(x) + "\" position=\"" + str(absX+5) + "," + str(absY+self.picY-textsize) + "\" size=\"" + str(self.picX - 10) + "," + str(textsize) + "\" font=\"Regular;14\" zPosition=\"2\" transparent=\"1\" noWrap=\"1\" foregroundColor=\"" + self.textcolor + "\" />" skincontent += "<widget name=\"thumb" + str(x) + "\" position=\"" + str(absX+5)+ "," + str(absY+5) + "\" size=\"" + str(self.picX -10) + "," + str(self.picY - (textsize*2)) + "\" zPosition=\"2\" transparent=\"1\" alphatest=\"on\" />" # Screen, buttons, backgroundlabel and MovingPixmap self.skin = "<screen position=\"0,0\" size=\"" + str(size_w) + "," + str(size_h) + "\" flags=\"wfNoBorder\" > \ <ePixmap name=\"mb_bg\" position=\"0,0\" zPosition=\"1\" size=\""+ str(size_w) + "," + str(size_h) + "\" pixmap=\""+ mcpath +"skins/defaultHD/images/background.png\" /> \ <ePixmap pixmap=\""+ mcpath +"icons/key-red.png\" position=\"60," + str(self.ButtonPosY) + "\" zPosition=\"2\" size=\"140,40\" transparent=\"1\" alphatest=\"on\" /> \ <ePixmap pixmap=\""+ mcpath +"icons/key-green.png\" position=\"210," + str(self.ButtonPosY) + "\" zPosition=\"2\" size=\"140,40\" transparent=\"1\" alphatest=\"on\" /> \ <ePixmap pixmap=\""+ mcpath +"icons/key-yellow.png\" position=\"360," + str(self.ButtonPosY) + "\" zPosition=\"2\" size=\"140,40\" transparent=\"1\" alphatest=\"on\" /> \ <ePixmap pixmap=\""+ mcpath +"icons/key-blue.png\" position=\"510," + str(self.ButtonPosY) + "\" zPosition=\"2\" size=\"140,40\" transparent=\"1\" alphatest=\"on\" /> \ <widget name=\"key_red\" position=\"60," + str(self.ButtonPosY) + "\" zPosition=\"3\" size=\"140,40\" font=\"Regular;20\" valign=\"center\" halign=\"center\" backgroundColor=\"#9f1313\" transparent=\"1\" /> \ <widget name=\"key_green\" position=\"210," + str(self.ButtonPosY) + "\" zPosition=\"3\" size=\"140,40\" font=\"Regular;20\" valign=\"center\" halign=\"center\" backgroundColor=\"#1f771f\" transparent=\"1\" /> \ <widget name=\"key_yellow\" position=\"360," + str(self.ButtonPosY) + "\" zPosition=\"3\" size=\"140,40\" font=\"Regular;20\" valign=\"center\" halign=\"center\" backgroundColor=\"#a08500\" transparent=\"1\" /> \ <widget name=\"key_blue\" position=\"510," + str(self.ButtonPosY) + "\" zPosition=\"3\" size=\"140,40\" font=\"Regular;20\" valign=\"center\" halign=\"center\" backgroundColor=\"#18188b\" transparent=\"1\" /> \ <eLabel position=\"0,0\" zPosition=\"0\" size=\""+ str(size_w) + "," + str(size_h) + "\" backgroundColor=\"" + self.color + "\" /> \ <widget name=\"frame\" position=\"35,30\" size=\"" + str(self.picX +1) + "," + str(self.picY +10) + "\" pixmap=\"pic_frame.png\" zPosition=\"3\" alphatest=\"on\" />" + skincontent + "</screen>" Screen.__init__(self, session) self["actions"] = HelpableActionMap(self, "MC_PictureViewerActions", { "ok": (self.KeyOk, "Show Picture"), "cancel": (self.Exit, "Exit Picture Viewer"), "left": (self.key_left, "List Top"), "right": (self.key_right, "List Bottom"), "up": (self.key_up, "List up"), "down": (self.key_down, "List down"), "info": (self.StartExif, "Show File Info"), "green": (self.startslideshow, "Start Slideshow"), "yellow": (self.close, "File View"), "blue": (self.Settings, "Settings"), }, -2) self["frame"] = MovingPixmap() for x in range(self.thumbsC): self["label"+str(x)] = Label() self["thumb"+str(x)] = Pixmap() self.Thumbnaillist = [] self.filelist = [] self.currPage = -1 self.dirlistcount = 0 self.path = path index = 0 framePos = 0 Page = 0 for x in piclist: if x[0][1] == False: self.filelist.append((index, framePos, Page, x[0][0], path + x[0][0])) index += 1 framePos += 1 if framePos > (self.thumbsC -1): framePos = 0 Page += 1 else: self.dirlistcount += 1 self.maxentry = len(self.filelist)-1 self.index = lastindex - self.dirlistcount if self.index < 0: self.index = 0 self.picload = ePicLoad() self.picload.PictureData.get().append(self.showPic) self.onLayoutFinish.append(self.setPicloadConf) self.ThumbTimer = eTimer() self.ThumbTimer.callback.append(self.showPic)
def __init__(self, session, args=0): # some default values - be careful if you change this... stone_width = 30 stone_height = 30 stone_space = 4 self.maxslices = 4 self.stonesX = 15 self.stonesY = 10 self.maxstones = self.stonesX * self.stonesY path = "/usr/lib/enigma2/python/Plugins/Extensions/eSame/data/" # Load bitmaps... self.maps = [] for color in ["red", "blue", "green"]: tmp = [] for x in range(self.maxslices): tmp.append(LoadPixmap(path + color + str(x) + ".png")) self.maps.append(tmp) # solve focus coordinates and generate part of skin... self.focuslist = [] skincontent = "" posX = -1 for x in range(self.maxstones): posY = x / self.stonesX posX += 1 if posX >= self.stonesX: posX = 0 absX = stone_space + (posX * (stone_space + stone_width)) absY = stone_space + (posY * (stone_space + stone_height)) self.focuslist.append((absX + 5, absY + 5)) skincontent += "<widget name=\"stone" + str( x) + "\" position=\"" + str(absX + 5) + "," + str( absY + 5 ) + "\" size=\"" + str(stone_width) + "," + str( stone_height ) + "\" zPosition=\"2\" transparent=\"1\" alphatest=\"on\" />" # solve window size... size_w = 5 + stone_width * self.stonesX + stone_space * (self.stonesX - 1) + 5 size_h = 5 + stone_height * self.stonesY + stone_space * ( self.stonesY - 1) + 85 # get framebuffer resolution... desk = getDesktop(0) w = int(desk.size().width()) h = int(desk.size().height()) # display window in center... x0 = (w - size_w) / 2 y0 = (h - size_h) / 2 # solve skin... self.skin = "<screen position=\""+str(x0)+","+str(y0)+"\" size=\"" + str(size_w) + "," + str(size_h) + "\" title=\"eSame v0.1\" >" +\ "<widget name=\"frame\" position=\""+str(5+stone_space)+","+str(5+stone_space)+"\" size=\""+str(stone_width)+","+str(stone_height)+"\" pixmap=\""+path+"focus.png\" zPosition=\"1\" alphatest=\"on\" />" +\ "<widget name=\"lbColors\" position=\"5,"+str(size_h-85)+"\" size=\"170,40\" valign=\"center\" font=\"Regular;17\" />" +\ "<widget name=\"lbBoard\" position=\"175,"+str(size_h-85)+"\" size=\"140,40\" valign=\"center\" font=\"Regular;17\" />" +\ "<widget name=\"lbMarked\" position=\"310,"+str(size_h-85)+"\" size=\"100,40\" valign=\"center\" font=\"Regular;17\" />" +\ "<widget name=\"lbScore\" position=\"410,"+str(size_h-85)+"\" size=\"110,40\" valign=\"center\" font=\"Regular;17\" />" +\ "<ePixmap name=\"green\" position=\"5,"+str(size_h-45)+"\" zPosition=\"3\" size=\"140,40\" pixmap=\"buttons/green.png\" transparent=\"1\" alphatest=\"on\" /> \n" +\ "<ePixmap name=\"yellow\" position=\""+str(size_w-145)+","+str(size_h-45)+"\" zPosition=\"3\" size=\"140,40\" pixmap=\"buttons/yellow.png\" transparent=\"1\" alphatest=\"on\" /> \n" +\ "<widget name=\"key_green\" position=\"5,"+str(size_h-45)+"\" zPosition=\"4\" size=\"140,40\" valign=\"center\" halign=\"center\" font=\"Regular;18\" transparent=\"1\" foregroundColor=\"white\" shadowColor=\"black\" shadowOffset=\"-1,-1\" /> \n" +\ "<widget name=\"key_yellow\" position=\""+str(size_w-145)+","+str(size_h-45)+"\" zPosition=\"4\" size=\"140,40\" valign=\"center\" halign=\"center\" font=\"Regular;18\" transparent=\"1\" foregroundColor=\"white\" shadowColor=\"black\" shadowOffset=\"-1,-1\" /> \n" +\ skincontent + "</screen>" Screen.__init__(self, session) self["actions"] = ActionMap( ["OkCancelActions", "WizardActions", "ColorActions"], { "cancel": self.Exit, "ok": self.key_ok, "left": self.key_left, "right": self.key_right, "up": self.key_up, "down": self.key_down, "green": self.key_green, "yellow": self.key_yellow, }, -1) self["frame"] = MovingPixmap() self["lbColors"] = Label() self["lbBoard"] = Label() self["lbMarked"] = Label() self["lbScore"] = Label() self["key_green"] = Button("new game") self["key_yellow"] = Button("reset game") for x in range(self.maxstones): self["stone" + str(x)] = Pixmap() self.maxentry = self.maxstones - 1 self.stonefield = StoneField(self.stonesX, self.stonesY, 3, 0) self.onLayoutFinish.append(self.startup)
def __init__(self, session): self.folder = '/usr/lib/enigma2/python/Plugins/Extensions/PurePrestige/Stools/toolsbuttons/' self.fillplgfolders() piclist = self.fullpath path = self.folder lastindex = 0 self.textcolor = config.PPrestige.textcolor.value self.color = config.PPrestige.bgcolor.value self.mtitle = 'Tools' dwidth = getDesktop(0).size().width() size_w = getDesktop(0).size().width() size_h = getDesktop(0).size().height() if dwidth == 1280: size_w = 650 size_h = 600 textsize = 20 self.spaceX = 35 self.picX = 180 self.spaceY = 20 self.picY = 170 else: textsize = 20 self.spaceX = 30 self.picX = 185 self.spaceY = 20 self.picY = 156 self.thumbsX = 3 self.thumbsY = 3 self.thumbsC = self.thumbsX * self.thumbsY self.positionlist = [] skincontent = '' posX = -1 for x in range(self.thumbsC): posY = x / self.thumbsX posX += 1 if posX >= self.thumbsX: posX = 0 absX = self.spaceX + posX * (self.spaceX + self.picX) absY = self.spaceY + posY * (self.spaceY + self.picY) self.positionlist.append((absX, absY)) skincontent += '<widget source="label' + str( x ) + '" render="Label" position="' + str(absX - 25) + ',' + str( absY + self.picY - textsize + 5 ) + '" size="' + str(self.picX + 15) + ',' + str( textsize ) + '" font="Regular;20" zPosition="2" transparent="1" noWrap="1" halign="' + 'center' + '" valign="' + 'center' + '" foregroundColor="' + self.textcolor + '" />' skincontent += '<widget name="thumb' + str( x) + '" position="' + str(absX + 5) + ',' + str( absY + 5) + '" size="' + str(self.picX - 30) + ',' + str( self.picY - 20 ) + '" zPosition="2" transparent="1" alphatest="on" />' if dwidth == 1280: self.skin = '<screen position="center,77" title="' + self.mtitle + '" size="' + str( size_w ) + ',' + str( size_h ) + '" > \t\t\t<eLabel position="0,0" zPosition="0" size="' + str( size_w ) + ',' + str( size_h ) + '" backgroundColor="' + self.color + '" /><widget name="frame" position="20,20" size="145,145" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/PurePrestige/pic_frame.png" zPosition="1" alphatest="on" />' + skincontent + '</screen>' else: self.skin = '<screen position="20,center" flags="wfNoBorder" title="Pure Prestige" size="' + str( size_w ) + ',' + str( size_h ) + '" > \t\t\t<eLabel position="0,0" zPosition="0" size="' + str( size_w ) + ',' + str( size_h ) + '" backgroundColor="' + self.color + '" /><widget name="frame" position="20,20" size="145,145" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/PurePrestige/pic_frame.png" zPosition="1" alphatest="on" />' + skincontent + '</screen>' Screen.__init__(self, session) self['actions'] = ActionMap( [ 'OkCancelActions', 'ColorActions', 'DirectionActions', 'MovieSelectionActions' ], { 'cancel': self.Exit, 'ok': self.KeyOk, 'left': self.key_left, 'right': self.key_right, 'up': self.key_up, 'down': self.key_down }, -1) self['frame'] = MovingPixmap() for x in range(self.thumbsC): self['label' + str(x)] = StaticText() self['thumb' + str(x)] = Pixmap() self.Thumbnaillist = [] self.filelist = [] self.currPage = -1 self.dirlistcount = 0 self.path = path index = 0 framePos = 0 Page = 0 for x in piclist: if x: self.filelist.append((index, framePos, Page, x, path + x)) index += 1 framePos += 1 if framePos > self.thumbsC - 1: framePos = 0 Page += 1 else: self.dirlistcount += 1 self.maxentry = len(self.filelist) - 1 self.index = lastindex - self.dirlistcount if self.index < 0: self.index = 0 self.picload = ePicLoad() self.onLayoutFinish.append(self.setPicloadConf) self.showPic
def __init__(self, session, piclist, lastindex, path): self.textcolor = config.pic1.textcolor.value self.color = config.pic1.bgcolor.value textsize = 20 self.spaceX = 35 self.picX = 190 self.spaceY = 30 self.picY = 200 size_w = getDesktop(0).size().width() size_h = getDesktop(0).size().height() self.thumbsX = size_w / (self.spaceX + self.picX) self.thumbsY = size_h / (self.spaceY + self.picY) self.thumbsC = self.thumbsX * self.thumbsY self.positionlist = [] skincontent = '' posX = -1 for x in range(self.thumbsC): posY = x / self.thumbsX posX += 1 if posX >= self.thumbsX: posX = 0 absX = self.spaceX + posX * (self.spaceX + self.picX) absY = self.spaceY + posY * (self.spaceY + self.picY) self.positionlist.append((absX, absY)) skincontent += '<widget source="label' + str( x ) + '" render="Label" position="' + str(absX + 5) + ',' + str( absY + self.picY - textsize ) + '" size="' + str(self.picX - 10) + ',' + str( textsize ) + '" font="Regular;14" zPosition="2" transparent="1" noWrap="1" foregroundColor="' + self.textcolor + '" />' skincontent += '<widget name="thumb' + str( x) + '" position="' + str(absX + 5) + ',' + str( absY + 5) + '" size="' + str(self.picX - 10) + ',' + str( self.picY - textsize * 2 ) + '" zPosition="2" transparent="1" alphatest="on" />' self.skin = '<screen position="0,0" size="' + str(size_w) + ',' + str( size_h ) + '" flags="wfNoBorder" > \t\t\t<eLabel position="0,0" zPosition="0" size="' + str( size_w ) + ',' + str( size_h ) + '" backgroundColor="' + self.color + '" /><widget name="frame" position="35,30" size="190,200" pixmap="pic_frame.png" zPosition="1" alphatest="on" />' + skincontent + '</screen>' Screen.__init__(self, session) self['actions'] = ActionMap( [ 'OkCancelActions', 'ColorActions', 'DirectionActions', 'MovieSelectionActions' ], { 'cancel': self.Exit, 'ok': self.KeyOk, 'left': self.key_left, 'right': self.key_right, 'up': self.key_up, 'down': self.key_down }, -1) self['frame'] = MovingPixmap() for x in range(self.thumbsC): self['label' + str(x)] = StaticText() self['thumb' + str(x)] = Pixmap() self.Thumbnaillist = [] self.filelist = [] self.currPage = -1 self.dirlistcount = 0 self.path = path index = 0 framePos = 0 Page = 0 for x in piclist: if x: self.filelist.append((index, framePos, Page, x, path + x)) index += 1 framePos += 1 if framePos > self.thumbsC - 1: framePos = 0 Page += 1 else: self.dirlistcount += 1 self.maxentry = len(self.filelist) - 1 self.index = lastindex - self.dirlistcount if self.index < 0: self.index = 0 self.picload = ePicLoad() self.picload.PictureData.get().append(self.showPic) self.onLayoutFinish.append(self.setPicloadConf) self.ThumbTimer = eTimer() self.ThumbTimer.callback.append(self.showPic)