Example #1
0
def Plugins(**kwargs):
    localeInit()
    descriptors = [
        PluginDescriptor(where=PluginDescriptor.WHERE_SESSIONSTART,
                         fnc=autostart)
    ]

    show_p = [PluginDescriptor.WHERE_PLUGINMENU]
    if config.suomipoeka.extmenu_plugin.value:
        show_p.append(PluginDescriptor.WHERE_EXTENSIONSMENU)

    descriptors.append(
        PluginDescriptor(name="Suomipoeka " + SuomipoekaVersion,
                         description="Suomipoeka " + _("configuration"),
                         icon="Suomipoeka.png",
                         where=show_p,
                         fnc=pluginOpen))

    if config.suomipoeka.extmenu_list.value and not config.suomipoeka.ml_disable.value:
        descriptors.append(
            PluginDescriptor(name="Suomipoeka MovieList",
                             description="Suomipoeka " +
                             _("movie manipulation list"),
                             where=PluginDescriptor.WHERE_EXTENSIONSMENU,
                             fnc=recordingsOpen))
    return descriptors
Example #2
0
    def openScriptMenu(self):
        if self.browsingVLC(
        ):  #self["list"].getCurrentSelDir() == "VLC servers"
            self.session.open(MessageBox,
                              _("No script operation for VLC streams."),
                              MessageBox.TYPE_ERROR)
            return
        try:
            list = []
            paths = [
                "/usr/lib/enigma2/python/Plugins/Extensions/Suomipoeka/script/",
                "/etc/enigma2/suomipoeka/"
            ]

            for path in paths:
                for e in os.listdir(path):
                    if not os.path.isdir(path + e):
                        if e.endswith(".sh"):
                            list.append([e, path + e])
                        elif e.endswith(".py"):
                            list.append([e, path + e])

            if len(list) == 0:
                self.session.open(
                    MessageBox, paths[0] + "\n\n   or" + paths[1] + "\n\n" +
                    _("Does not contain any scripts."), MessageBox.TYPE_ERROR)
                return

            dlg = self.session.openWithCallback(self.scriptCB, ChoiceBox, " ",
                                                list)
            dlg.setTitle(_("Choose script"))
            dlg["list"].move(0, 30)

        except Exception, e:
            spDebugOut("[spMS] openScriptMenu exception:\n" + str(e))
 def createLinks(self):
     self.session.openWithCallback(self.createLinksCB,
                                   LocationBox,
                                   windowTitle=_("Select Location"),
                                   text=_("Choose directory"),
                                   filename="",
                                   currDir=self.currentPathSel + "/",
                                   minFree=0)
Example #4
0
 def toggleSort(self):
     if self.browsingVLC(): return
     if self["key_green"].text == _("Alpha sort"):
         self["key_green"].text = _("Date sort")
         self.currentGrnText = _("Date sort")
         self["list"].setAlphaSort(True)
     else:
         self["key_green"].text = _("Alpha sort")
         self.currentGrnText = _("Alpha sort")
         self["list"].setAlphaSort(False)
     self.reloadList()
Example #5
0
 def delPathSel(self, path):
     if path != "..":
         path = self.currentPathSel + "/" + path
         if os.path.exists(path):
             if len(os.listdir(path)) > 0:
                 self.session.open(MessageBox, _("Directory is not empty."),
                                   MessageBox.TYPE_ERROR, 10)
             else:
                 spTasker.shellExecute('rmdir "' + path + '"')
                 return True
     else:
         self.session.open(MessageBox,
                           _("Cannot delete the parent directory."),
                           MessageBox.TYPE_ERROR, 10)
     return False
Example #6
0
    def __init__(self, session, playlist, recordings):
        # MoviePlayer.__init__ will start playback for the given service!!
        MoviePlayer.__init__(self, session,
                             session.nav.getCurrentlyPlayingServiceReference())
        self.skinName = "MoviePlayer"

        self["actions"] = HelpableActionMap(
            self, "PluginPlayerActions", {
                "bInfo": (self.openEventView, _("show event details")),
                "leavePlayer": (self.leavePlayer, _("Stop playback")),
                "bRADIO": (self.btnRadio, _("Open extensions menu"))
            })

        self.playInit(playlist, recordings)
        self.onShown.append(self.onDialogShow)
Example #7
0
    def updateTitle(self):
        if self.selectIdx != -1:
            self.setTitle(_("*** Multiselection active ***"))
            return
        lotime = localtime()
        title = "[%02d:%02d] " % (lotime[3], lotime[4])
        if os.path.exists(self.currentPathSel + "/"):
            stat = os.statvfs(self.currentPathSel + "/")
            free = (stat.f_bavail if stat.f_bavail != 0 else
                    stat.f_bfree) * stat.f_bsize / 1048576
            if free >= 10240:  #unit in Giga bytes if more than 10 GB free
                title = "(%d GB) " % (free / 1024)
            else:
                title = "(%d MB) " % (free)

        title += self.currentPathSel + (self.currentPathSel == "") * "/"

        if not self["list"].currentSelIsDirectory() and not self.browsingVLC():
            try:
                service = self.getCurrent()
                if service is not None and config.suomipoeka.movie_descdis.value:
                    lenght = self["list"].getLenghtOfCurrent()
                    title += " <" + ("%d min, " % lenght) * (lenght > 0)
                    title += "%d MB>" % (os.path.getsize(service.getPath()) /
                                         1048576)
            except Exception, e:
                spDebugOut("[spMS] updateTitle exception:\n" + str(e))
Example #8
0
 def evEOF(self, needToClose=False):
     # see if there are more to play
     if (self.playcount + 1) < len(self.playlist):
         self.playcount += 1
         service = self.playlist[self.playcount]
         self.currentlyPlaying = service
         if os.path.exists(service.getPath()):
             self.recordings.viewedToggle(
                 service,
                 True)  # rename .cutsr to .cuts if user has toggled it
             self.session.nav.playService(service)
             self.currentlyPlaying = service
             self.setSeekState(InfoBarSeek.SEEK_STATE_PLAY)
             self.doSeek(0)
             DelayedFunction(200, self.setAudioTrack)
             DelayedFunction(1000, self.setSubtitleState, True)
         else:
             self.session.open(
                 MessageBox,
                 _("Skipping movie, the file does not exist.\n\n") +
                 service.getPath(), MessageBox.TYPE_ERROR, 10)
             self.evEOF(needToClose)
     else:
         if 0:
             MoviePlayer.handleLeave(self, config.usage.on_movie_eof.value)
         else:
             if needToClose or config.usage.on_movie_eof.value != "pause":  # ask, movielist, quit or pause
                 global gClosedByDeleteleavePlayer
                 gClosedByDelete = needToClose
                 self.leavePlayer(False)
Example #9
0
 def moveMovie(self):
     if self.browsingVLC() or self["list"].getCurrentSelDir(
     ) == "VLC servers":
         return
     current = self.getCurrent()
     if current is not None:
         selectedlist = self["list"].makeSelectionList()
         dialog = False
         if self["list"].currentSelIsDirectory():
             if current != selectedlist[0]:  # first selection != cursor pos?
                 targetPath = self.currentPathSel
                 if self["list"].getCurrentSelDir() == "..":
                     targetPath = os.path.split(targetPath)[0]
                 else:
                     targetPath += "/" + self["list"].getCurrentSelDir()
                 self.execFileOp(targetPath, selectedlist)
                 self["list"].resetSelectionList()
             else:
                 if len(selectedlist) == 1:
                     self.session.open(
                         MessageBox,
                         _("How to move files:\nSelect some movies with the VIDEO-button, move the cursor on top of the destination directory and press yellow."
                           ), MessageBox.TYPE_ERROR, 10)
                 else:
                     dialog = True
         else:
             dialog = True
         if dialog:
             try:
                 from Screens.LocationBox import LocationBox
                 if len(selectedlist) == 1 and self["list"].serviceBusy(
                         selectedlist[0]):
                     return
                 self.tmpSelList = selectedlist
                 self.session.openWithCallback(
                     self.mvDirSelected,
                     LocationBox,
                     windowTitle=_("Select Location"),
                     text=_("Choose directory"),
                     filename="",
                     currDir=self.currentPathSel + "/",
                     minFree=0)
             except:
                 self.session.open(
                     MessageBox,
                     _("How to move files:\nSelect some movies with the VIDEO-button, move the cursor on top of the destination directory and press yellow."
                       ), MessageBox.TYPE_ERROR, 10)
Example #10
0
 def onDialogShow(self):
     if self.wasClosed:
         self.wasClosed = False
         self["key_red"].text = _("Delete")
         self["key_green"].text = self.currentGrnText
         self["key_yellow"].text = _("Move")
         self["key_blue"].text = _(config.suomipoeka.movie_bluefunc.value)
         if config.suomipoeka.movie_reload.value or self[
                 "list"].newRecordings or self["list"].__len__() == 0:
             DelayedFunction(50, self.reloadList)
         self.initCursor()
         self.updateTitle()
         try:
             self.descFieldInit()
         except:
             pass
         self.updateEventInfo()
Example #11
0
 def playLast(self):
     global gLastPlayedMovies
     if gLastPlayedMovies is None:
         self.session.open(MessageBox,
                           _("Last played movie/playlist not available..."),
                           MessageBox.TYPE_ERROR, 10)
     else:
         self.wasClosed = True
         self.close(None)
         self.openPlayer(gLastPlayedMovies)
Example #12
0
 def trashcanCreate(self, confirmed):
     try:
         os.makedirs(config.suomipoeka.movie_trashpath.value)
         self.reloadList()  # reload to show the trashcan
     except Exception, e:
         self.session.open(
             MessageBox,
             _("Trashcan create failed. Check mounts and permissions."),
             MessageBox.TYPE_ERROR)
         spDebugOut("[spMS] trashcanCreate exception:\n" + str(e))
    def ShowAutoRestartInfo(self):
        # call the Execute/Stop function to update minutes
        if config.suomipoeka.enigmarestart.value:
            self.RestartTimerStart(True)
        else:
            self.RestartTimerStop()

        from Suomipoeka import _
        if self.timerActive:
            mints = self.minutes % 60
            hours = self.minutes / 60
            self.session.open(
                MessageBox,
                _("Next Enigma auto-restart in ") + str(hours) + " h " +
                str(mints) + " min", MessageBox.TYPE_INFO, 4)
        else:
            self.session.open(
                MessageBox, _("Enigma auto-restart is currently not active."),
                MessageBox.TYPE_INFO, 4)
 def InitRestart(self):
     if Screens.Standby.inStandby:
         self.LaunchRestart(True)  # no need to query if in standby mode
     else:
         # query from the user if it is ok to restart now
         stri = _(
             "Suomipoeka Enigma2 auto-restart launching, continue? Select no to postpone by one hour."
         )
         self.session.openWithCallback(self.LaunchRestart, MessageBox, stri,
                                       MessageBox.TYPE_YESNO, 30)
Example #15
0
 def stopRecordQ(self):
     try:
         filenames = ""
         for e in self.recsToStop:
             filenames += "\n" + e.split("/")[-1][:-3]
         self.session.openWithCallback(
             self.stopRecordConfirmation, MessageBox,
             _("Stop ongoing recording?\n") + filenames,
             MessageBox.TYPE_YESNO)
     except Exception, e:
         spDebugOut("[spMS] stopRecordQ exception:\n" + str(e))
Example #16
0
 def reloadList2(self, moveToIdx=-1, mayOpenDialog=True):
     self.selectIdx = -1
     try:
         if os.path.exists(self.currentPathSel) or self.browsingVLC():
             self["list"].reload(self.currentPathSel + "/" *
                                 (self.currentPathSel != "/"))
             if moveToIdx >= 0: self["list"].moveToIndex(moveToIdx)
             self.updateAfterKeyPress()
         else:
             if mayOpenDialog:
                 self.session.open(
                     MessageBox,
                     _("Error: path '%s' not available!" %
                       self.currentPathSel), MessageBox.TYPE_ERROR)
             else:
                 Notifications.AddNotification(
                     MessageBox,
                     _("Error: path '%s' not available!" %
                       self.currentPathSel), MessageBox.TYPE_ERROR)
     except Exception, e:
         spDebugOut("[spMS] reloadList exception:\n" + str(e))
Example #17
0
 def stopRecordConfirmation(self, confirmed):
     if not confirmed: return
     # send as a list?
     stoppedAll = True
     for e in self.recsToStop:
         stoppedAll = stoppedAll and self["list"].recControl.stopRecording(
             e)
     if not stoppedAll:
         self.session.open(
             MessageBox,
             _("Not stopping any repeating timers. Modify them with the timer editor."
               ), MessageBox.TYPE_INFO, 10)
 def createDirCB(self, name):
     if name is not None:
         name = self.currentPathSel + "/" + name
         if os.path.exists(name):
             self.session.open(MessageBox,
                               _("Directory " + name + " already exists."),
                               MessageBox.TYPE_ERROR)
         else:
             try:
                 os.mkdir(name)
             except Exception, e:
                 spDebugOut("[spMM] createDir exception:\n" + str(e))
             self.close("reload")
Example #19
0
 def movieSelected(self):
     try:
         global gLastPlayedMovies
         current = self.getCurrent()
         if current is not None:
             if self["list"].currentSelIsDirectory():
                 self.setNextPathSel(self["list"].getCurrentSelDir())
             elif self["list"].currentSelIsVlc():
                 entry = self["list"].list[self["list"].getCurrentIndex()]
                 self.vlcMovieSelected(entry)
             else:
                 playlist = self["list"].makeSelectionList()
                 spDebugOut("[spMS] Playlist len = " + str(len(playlist)))
                 if not self["list"].serviceBusy(playlist[0]):
                     gLastPlayedMovies = [] + playlist  # force a copy instead of an reference!
                     self.wasClosed = True
                     self.close(None)
                     self.openPlayer(gLastPlayedMovies)
                 else:
                     self.session.open(MessageBox, _("File not available."),
                                       MessageBox.TYPE_ERROR, 10)
     except Exception, e:
         spDebugOut("[spMS] movieSelected exception:\n" + str(e))
Example #20
0
 def deleteMovieConfimation(self, confirmed):
     if confirmed and self.moviesToDelete is not None and len(
             self.moviesToDelete) > 0:
         if self.delCurrentlyPlaying:
             if self.playerInstance is not None:
                 self.playerInstance.removeFromPlaylist(self.moviesToDelete)
         delete = config.suomipoeka.movie_trashcan_limit.value == 0 or self.permanentDel
         if os.path.exists(
                 config.suomipoeka.movie_trashpath.value) or delete:
             # if the user doesn't want to keep the movies in the trash, purge immediately
             self.execFileOp(config.suomipoeka.movie_trashpath.value,
                             self.moviesToDelete,
                             op="delete",
                             purgeTrash=delete)
             for x in self.moviesToDelete:
                 self.lastPlayedCheck(x)
             self["list"].resetSelectionList()
         elif not delete:
             self.session.openWithCallback(
                 self.trashcanCreate, MessageBox,
                 _("Delete failed because the trashcan directory does not exist. Attempt to create it now?"
                   ), MessageBox.TYPE_YESNO)
         self.moviesToDelete = None
         self.updateAfterKeyPress()
Example #21
0
	def buildMovieListEntry(self, serviceref, sortkey, datesort, moviestring, filename, selnum):
		if datesort is None:
			res = [ None ]
			pmap = [self.dirPic, self.vlcdPic][sortkey=="VLCd" or filename=="VLC servers"]
			if filename=="..": pmap = self.backPic
			res.append(MultiContentEntryPixmapAlphaTest(pos=(0,2), size=(22,40), png=pmap, **{}))
			res.append(MultiContentEntryText(pos=(30, 0), size=(310, 40), font=1, flags=RT_HALIGN_LEFT, text=filename))
			res.append(MultiContentEntryText(pos=(self.CoolDirPos, 0), size=(200, 40), font=1, flags=RT_HALIGN_LEFT, text=_("Directory")))
			return res

		date, time, pixmap = "---.---  ", "---:---", self.mov1Pic
		nameWithPath = self.loadPath + filename
		if config.suomipoeka.movie_mark.value and not os.path.exists(nameWithPath + ".cuts"):
			pixmap = self.mov2Pic

		if datesort == "VLCs":
			date, time, pixmap = "VLC", " stream", self.vlcPic
		elif not datesort.startswith("0000"):
			# datesort = YYMMDDTTTT
			if datesort[6:10] != "3333":
			  time = datesort[6:8] + ":" + datesort[8:10]
			date = datesort[4:6] + "." + datesort[2:4] + "." + "  " #+ datesort[0:2]
		elif filename.endswith(".mp3"):
			date, time, pixmap = "MP3", " audio", self.mp3Pic
			moviestring = moviestring[:-4]
		elif filename.endswith(".ogg"):
			date, time, pixmap = "OGG", " audio", self.mp3Pic
			moviestring = moviestring[:-4]
		elif filename.endswith(".mpg"):
			date, time = "MPEG", " video"
			moviestring = moviestring[:-4]
		elif filename.endswith(".mpeg"):
			date, time = "MPEG", " video"
			moviestring = moviestring[:-5]
		elif filename.endswith(".avi"):
			date, time = "AVI", " video"
			moviestring = moviestring[:-4]
		elif filename.endswith(".mkv"):
			date, time = "MKV", " video"
			moviestring = moviestring[:-4]


		selnumtxt = ""
		if selnum == 9999: selnumtxt = "[M]"
		elif selnum == 9998: selnumtxt = "[D]"
		elif selnum > 0: selnumtxt = "%02d" % selnum
		if serviceref in self.highlightsMov: selnumtxt = "[M]"
		elif serviceref in self.highlightsDel: selnumtxt = "[D]"

		if self.recControl.isRecording(nameWithPath):
			date, pixmap = "REC...  ", self.mov3Pic
		elif self.recControl.isRemoteRecording(nameWithPath):
			date, pixmap = "rec...  ", self.mov4Pic
		res = [ None ]
		res.append(MultiContentEntryText(pos=(self.CoolDatePos, 0), size=(90, 40), font=1, flags=RT_HALIGN_RIGHT, text=date))
		res.append(MultiContentEntryText(pos=(self.CoolMoviePos, 0), size=(self.CoolMovieSize, 40), font=1, flags=RT_HALIGN_LEFT, text=moviestring))
		res.append(MultiContentEntryText(pos=(self.CoolTimePos, 0), size=(85, 40), font=1, flags=RT_HALIGN_LEFT, text=time))
		res.append(MultiContentEntryText(pos=(0, 0), size=(26, 40), font=1, flags=RT_HALIGN_LEFT, text=selnumtxt))
		if config.suomipoeka.movie_icons.value and selnum == 0:
			res.append(MultiContentEntryPixmapAlphaTest(pos=(0,2), size=(20,20), png=pixmap, **{}))
		return res
 def emptyTrash(self):
     self.hide()
     self.session.openWithCallback(
         self.emptyTrashCB, MessageBox,
         _("Permanently delete all files in trashcan?"),
         MessageBox.TYPE_YESNO)
 def remRogueFiles(self):
     self.hide()
     self.session.openWithCallback(
         self.remRogueFilesCB, MessageBox,
         _("Locate rogue files and remove them? (permanently if no trashcan available, may take a minute or so)"
           ), MessageBox.TYPE_YESNO)
    def __init__(self, session, menumode, mlist, service, selections,
                 currentPath):
        Screen.__init__(self, session)
        self.mode = menumode
        self.mlist = mlist
        self.service = service
        self.selections = selections
        self.currentPathSel = currentPath

        self.menu = []
        if menumode == "normal":
            self["title"] = StaticText(_("Choose operation"))
            if config.suomipoeka.movie_bluefunc.value == "Movie home":
                self.menu.append(
                    (_("Play last"), boundFunction(self.close, "Play last")))
            else:
                self.menu.append(
                    (_("Movie home"), boundFunction(self.close, "Movie home")))

            if os.path.exists(config.suomipoeka.movie_trashpath.value):
                if self.service is not None:
                    self.menu.append((_("Delete permanently"),
                                      boundFunction(self.close, "delete")))
#				self.menu.append((_("Cleanup trashcan"), boundFunction(self.cleanTrash)))
                self.menu.append(
                    (_("Empty trashcan"), boundFunction(self.emptyTrash)))
                self.menu.append(
                    (_("Go to trashcan"), boundFunction(self.close, "trash")))
            self.menu.append(
                (_("Remove rogue files"), boundFunction(self.remRogueFiles)))
            self.menu.append(
                (_("Create link(s)"), boundFunction(self.createLinks)))
            self.menu.append(
                (_("Create directory"), boundFunction(self.createDir)))
            self.menu.append(
                (_("Bookmark directory"), boundFunction(self.bookmarkDir)))
            self.menu.append(
                (_("Bookmarks"), boundFunction(self.openBookmark)))
        elif menumode == "plugins":
            self["title"] = StaticText(_("Choose plugin"))
            if self.service is not None:
                for p in plugins.getPlugins(PluginDescriptor.WHERE_MOVIELIST):
                    self.menu.append(
                        (p.description, boundFunction(self.execPlugin, p)))
        elif menumode == "bookmarks":
            self["title"] = StaticText(_("Choose bookmark"))
            try:
                bmfile = open(
                    config.suomipoeka.folder.value + "/bookmarks.cfg", "r")
                #for x in bmfile.readline():
                #	self.menu.append((x, boundFunction(self.close, x)))
                for line in bmfile:
                    self.menu.append((line, boundFunction(self.close, line)))
                bmfile.close()
            except Exception, e:
                spDebugOut("[spMM] bookmarks mode exception:\n" + str(e))
Example #25
0
    def __init__(self, session):
        Screen.__init__(self, session)
        SelectionEventInfo.__init__(self)
        CoolWide = getDesktop(0).size().width()
        skinpath = str(resolveFilename)
        self.skinName = "MovieSelectionSP"
        if CoolWide == 720:
            skin = "/usr/lib/enigma2/python/Plugins/Extensions/Suomipoeka/CoolSkin/MovieSelectionSP_720.xml"
        elif CoolWide == 1024:
            skin = "/usr/lib/enigma2/python/Plugins/Extensions/Suomipoeka/CoolSkin/MovieSelectionSP_1024.xml"
        else:
            skin = "/usr/lib/enigma2/python/Plugins/Extensions/Suomipoeka/CoolSkin/MovieSelectionSP_1280.xml"
        Cool = open(skin)
        self.skin = Cool.read()
        Cool.close()
        self.wasClosed = True
        self.playerInstance = None
        self.selectIdx = -1
        self.cursorDir = 0
        self.currentGrnText = _("Alpha sort")
        self["wait"] = Label(_("Reading directory..."))
        self["list"] = MovieList()
        self["key_red"] = Button()
        self["key_green"] = Button()
        self["key_yellow"] = Button()
        self["key_blue"] = Button()
        global gMS
        gMS = self
        self["actions"] = HelpableActionMap(
            self, "PluginMovieSelectionActions", {
                "bOK": (self.movieSelected, _("Play selected movie(s)")),
                "bOKL": (self.unUsed, "-"),
                "bEXIT": (self.abort, _("Close movie list")),
                "bMENU": (self.openMenu, _("Open menu")),
                "bINFO": (self.showEventInformation, _("Show event info")),
                "bINFOL": (self.unUsed, "-"),
                "bRed": (self.deleteFile, _("Delete file or empty dir")),
                "bGreen": (self.toggleSort, _("Toggle sort mode")),
                "bYellow": (self.moveMovie, _("Move selected movie(s)")),
                "bBlue":
                (self.blueFunc, _("Movie home / Play last (configurable)")),
                "bRedL": (self.unUsed, "-"),
                "bGreenL": (self.unUsed, "-"),
                "bYellowL": (self.openScriptMenu, _("Open shell script menu")),
                "bBlueL": (self.openBookmarks, _("Open bookmarks")),
                "bLeftUp": (self.keyPress, _("Move cursor page up")),
                "bRightUp": (self.keyPress, _("Move cursor page down")),
                "bUpUp": (self.keyPressU, _("Move cursor up")),
                "bDownUp": (self.keyPressD, _("Move cursor down")),
                "bBqtPlus": (self.bouquetPlus, _("Move cursor 1/2 page up")),
                "bBqtMnus":
                (self.bouquetMinus, _("Move cursor 1/2 page down")),
                "bArrowR": (self.unUsed, "-"),
                "bArrowRL": (self.unUsed, "-"),
                "bArrowL": (self.unUsed, "-"),
                "bArrowLL": (self.unUsed, "-"),
                "bVIDEO":
                (self.selectionToggle, _("Toggle service selection")),
                "bAUDIO": (self.openMenuPlugins, _("Available plugins menu")),
                "bAUDIOL": (self.unUsed, "-"),
                "bMENUL": (self.openMenuPlugins, _("Available plugins menu")),
                "bTV": (self.reloadList, _("Reload movie file list")),
                "bTVL": (self.unUsed, "-"),
                "bRADIO": (self.viewedToggle, _("Toggle viewed / not viewed")),
                "bRADIOL": (self.unUsed, "-"),
                "bTEXT": (self.multiSelect, _("Start / end multiselection")),
                "bTEXTL": (self.unUsed, "-")
            })
        self["actions"].csel = self
        HelpableScreen.__init__(self)

        self.currentPathSel = config.suomipoeka.movie_homepath.value
        self.parentStack = []
        self.onExecBegin.append(self.onDialogShow)
Example #26
0
config.suomipoeka.key_repeat = ConfigInteger(default=500, limits=(250, 900))
config.suomipoeka.enigmarestart = ConfigYesNo(default=False)
config.suomipoeka.enigmarestart_begin = ConfigClock(default=60 * 60 * 2)
config.suomipoeka.enigmarestart_end = ConfigClock(default=60 * 60 * 5)
config.suomipoeka.enigmarestart_stby = ConfigYesNo()
config.suomipoeka.debug = ConfigYesNo()
config.suomipoeka.folder = ConfigText(default="/hdd/suomipoeka",
                                      fixed_size=False,
                                      visible_width=22)
config.suomipoeka.debugfile = ConfigText(default="output.txt",
                                         fixed_size=False,
                                         visible_width=22)
config.suomipoeka.ml_disable = ConfigYesNo()
config.suomipoeka.movie_bluefunc = ConfigSelection(default="Movie home",
                                                   choices=[("Movie home",
                                                             _("Movie home")),
                                                            ("Play last",
                                                             _("Play last"))])
config.suomipoeka.movie_descdis = ConfigYesNo()
config.suomipoeka.movie_descdelay = ConfigInteger(default=200,
                                                  limits=(10, 999))
config.suomipoeka.movie_icons = ConfigYesNo(default=True)
config.suomipoeka.movie_mark = ConfigYesNo(default=True)
config.suomipoeka.movie_metaload = ConfigYesNo(default=True)
config.suomipoeka.movie_reopen = ConfigYesNo()
config.suomipoeka.movie_reopenEOF = ConfigYesNo()
config.suomipoeka.movie_reload = ConfigYesNo()
config.suomipoeka.movie_homepath = ConfigText(default="/hdd/movie",
                                              fixed_size=False,
                                              visible_width=22)
config.suomipoeka.movie_pathlimit = ConfigText(default="/hdd/movie",
Example #27
0
def langListSel():
    newlist = []
    for e in language.getLanguageList():
        newlist.append(_(e[1][0]))
    return newlist
Example #28
0
 def unUsed(self):
     self.session.open(MessageBox, _("No functionality set..."),
                       MessageBox.TYPE_INFO)
Example #29
0
    def deleteMovieQ(self, selectedlist, remoteRec):
        try:
            self.moviesToDelete = selectedlist
            self.delCurrentlyPlaying = False
            rm_add = ""
            if remoteRec:
                rm_add = _(
                    " Deleting remotely recorded and it will display an rec-error dialog on the other DB."
                )

            if self.playerInstance is not None:
                #				if nowPlaying is not None:
                #					self.delCurrentlyPlaying = nowPlaying in selectedlist
                nowPlaying = self.playerInstance.currentlyPlayedMovie(
                ).getPath().split("/")[-1]
                for s in selectedlist:
                    if s.getPath().split("/")[-1] == nowPlaying:
                        self.delCurrentlyPlaying = True
                        break

            entrycount = len(selectedlist)
            delStr = _("Delete") + _(" permanently") * self.permanentDel
            if entrycount == 1:
                service = selectedlist[0]
                name = "\n\n" + self["list"].getFileNameOfService(
                    service).replace(".ts", "")
                if not self.delCurrentlyPlaying:
                    self.session.openWithCallback(self.deleteMovieConfimation,
                                                  MessageBox,
                                                  delStr + "?" + rm_add + name,
                                                  MessageBox.TYPE_YESNO)
                else:
                    self.session.openWithCallback(
                        self.deleteMovieConfimation, MessageBox,
                        delStr + _(" currently played?") + rm_add + name,
                        MessageBox.TYPE_YESNO)
            else:
                if entrycount > 1:
                    movienames = "\n\n"
                    i = 0
                    for service in selectedlist:
                        if i >= 5 and entrycount > 5:  # show only 5 entries in the file list
                            movienames += "..."
                            break
                        i += 1
                        name = self["list"].getFileNameOfService(
                            service).replace(".ts", "")  # TODO: None check
                        if len(name) > 48:
                            name = name[:48] + "..."  # limit the name string
                        movienames += name + "\n" * (i < entrycount)
                    if not self.delCurrentlyPlaying:
                        self.session.openWithCallback(
                            self.deleteMovieConfimation, MessageBox,
                            delStr + _(" all selected video files?") + rm_add +
                            movienames, MessageBox.TYPE_YESNO)
                    else:
                        self.session.openWithCallback(
                            self.deleteMovieConfimation, MessageBox, delStr +
                            _(" all selected video files? The currently playing movie is also one of the selections and its playback will be stopped."
                              ) + rm_add + movienames, MessageBox.TYPE_YESNO)
        except Exception, e:
            self.session.open(MessageBox,
                              _("Delete error:\n") + str(e),
                              MessageBox.TYPE_ERROR)
            spDebugOut("[spMS] deleteMovieQ exception:\n" + str(e))
 def createDir(self):
     self.hide()
     self.session.openWithCallback(self.createDirCB,
                                   InputBox,
                                   title=_("Enter name for new directory."),
                                   windowTitle=_("Create directory"))