def reloadList(self, sel=None, home=False):
     if not fileExists(config.movielist.last_videodir.value):
         path = defaultMoviePath()
         config.movielist.last_videodir.value = path
         config.movielist.last_videodir.save()
         self.current_ref = eServiceReferenceTrash(path)
         self["freeDiskSpace"].path = path
     if sel is None:
         sel = self.getCurrent()
     self["list"].reload(self.current_ref)
     if config.AdvancedMovieSelection.wastelist_buildtype.value == 'listAllMoviesMedia':
         title = _("Wastebasket: %s") % ("/media")
     else:
         title = _("Wastebasket: %s") % (
             config.movielist.last_videodir.value)
     self["location"].setText(title)
     if not (sel and self["list"].moveTo(sel)):
         if home:
             self["list"].moveToIndex(0)
     self["freeDiskSpace"].update()
     count = Trashcan.getTrashCount()
     cap = Trashcan.getTrashSize()
     if cap <= 999:
         wastebasket_info = (_("Trash count: %d") %
                             (count)) + ' / ' + (_("Trash size: %d MB") %
                                                 cap)
     else:
         format_string = _("Trash size:") + " %%.%sf GB" % (
             config.AdvancedMovieSelection.filesize_digits.value)
         wastebasket_info = _("Trash count:") + (
             " %d / " % (count)) + (format_string) % (cap / 1000.0)
     if count == 0:
         self["wastetxt"].setText(_("Wastebasket is empty!"))
     else:
         self["wastetxt"].setText(wastebasket_info)
 def reloadList(self, sel=None, home=False):
     if not fileExists(config.movielist.last_videodir.value):
         path = defaultMoviePath()
         config.movielist.last_videodir.value = path
         config.movielist.last_videodir.save()
         self.current_ref = eServiceReferenceTrash(path)
         self["freeDiskSpace"].path = path
     if sel is None:
         sel = self.getCurrent()
     self["list"].reload(self.current_ref)
     if config.AdvancedMovieSelection.wastelist_buildtype.value == "listAllMoviesMedia":
         title = _("Wastebasket: %s") % ("/media")
     else:
         title = _("Wastebasket: %s") % (config.movielist.last_videodir.value)
     self["location"].setText(title)
     if not (sel and self["list"].moveTo(sel)):
         if home:
             self["list"].moveToIndex(0)
     self["freeDiskSpace"].update()
     count = Trashcan.getTrashCount()
     cap = Trashcan.getTrashSize()
     if cap <= 999:
         wastebasket_info = (_("Trash count: %d") % (count)) + " / " + (_("Trash size: %d MB") % cap)
     else:
         format_string = _("Trash size:") + " %%.%sf GB" % (config.AdvancedMovieSelection.filesize_digits.value)
         wastebasket_info = _("Trash count:") + (" %d / " % (count)) + (format_string) % (cap / 1000.0)
     if count == 0:
         self["wastetxt"].setText(_("Wastebasket is empty!"))
     else:
         self["wastetxt"].setText(wastebasket_info)
 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):
     Screen.__init__(self, session)
     HelpableScreen.__init__(self)
     self.skinName = SkinTools.appendResolution("AdvancedMovieSelectionTrash")
     self.delayTimer = eTimer()
     self.delayTimer.callback.append(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.staticIP = getIpAddress("eth0")
     self["OkCancelActions"] = HelpableActionMap(
         self, "OkCancelActions", {"cancel": (self.abort, _("Exit wastebasket"))}
     )
     self["MenuActions"] = HelpableActionMap(self, "MenuActions", {"menu": (self.clientSetup, _("Clientbox setup"))})
     self.inited = False
     self.onShown.append(self.setWindowTitle)