Aggiunto elimina file dalla cartella download

This commit is contained in:
Alhaziel
2020-03-13 12:45:46 +01:00
parent 31f5c88e2a
commit 8c3dc2f57a
3 changed files with 48 additions and 3 deletions

View File

@@ -157,6 +157,22 @@ msgctxt "#30036"
msgid "Module not found or incompatible with the device."
msgstr "Modulo non trovato o incompatibile con il dispositivo."
msgctxt "#30037"
msgid "Delete Folder"
msgstr ""
msgctxt "#30038"
msgid "Do you really want to delete the %s folder and all its contents?"
msgstr ""
msgctxt "#30039"
msgid "Delete File"
msgstr ""
msgctxt "#30040"
msgid "Do you really want to delete the %s file?"
msgstr ""
msgctxt "#30043"
msgid "Force view mode:"
msgstr ""

View File

@@ -157,6 +157,22 @@ msgctxt "#30036"
msgid "Module not found or incompatible with the device."
msgstr "Modulo non trovato o incompatibile con il dispositivo."
msgctxt "#30037"
msgid "Delete Folder"
msgstr "Elimina Cartella"
msgctxt "#30038"
msgid "Do you really want to delete the %s folder and all its contents?"
msgstr "Vuoi veramente eliminare la cartella %s e tutto il suo contenuto?"
msgctxt "#30039"
msgid "Delete File"
msgstr "Elimina File"
msgctxt "#30040"
msgid "Do you really want to delete the %s file?"
msgstr "Vuoi veramente eliminare il file %s?"
msgctxt "#30043"
msgid "Force view mode:"
msgstr "Forza modalità di visualizzazione:"

View File

@@ -130,18 +130,31 @@ def settings(item):
def browser(item):
logger.info()
itemlist = []
context = [{ 'title': 'cancella', 'channel': 'downloads', 'action': "del_file"}]
for file in filetools.listdir(item.url):
if file == "list": continue
if filetools.isdir(filetools.join(item.url, file)):
itemlist.append(
Item(channel=item.channel, title=file, action=item.action, url=filetools.join(item.url, file)))
itemlist.append(Item(channel=item.channel, title=file, action=item.action, url=filetools.join(item.url, file), context=[{ 'title': config.get_localized_string(30037), 'channel': 'downloads', 'action': "del_dir"}]))
else:
itemlist.append(Item(channel=item.channel, title=file, action="play", url=filetools.join(item.url, file)))
itemlist.append(Item(channel=item.channel, title=file, action="play", url=filetools.join(item.url, file), context=[{ 'title': config.get_localized_string(30039), 'channel': 'downloads', 'action': "del_file"}]))
return itemlist
def del_file(item):
ok = platformtools.dialog_yesno(config.get_localized_string(30039),config.get_localized_string(30040))
if ok:
filetools.remove(item.url)
platformtools.itemlist_refresh()
def del_dir(item):
ok = platformtools.dialog_yesno(config.get_localized_string(30037),config.get_localized_string(30038))
if ok:
filetools.rmdirtree(item.url)
platformtools.itemlist_refresh()
def clean_all(item):
logger.info()