Shorten various messages --- otherwise they are NOT SHOWN at all.

Also, mark pagedirty in all cases when deleting the file, to cause the screen refresh --
otherwise the message "Press 'Y' to confirm" stays there indefinitely.
This commit is contained in:
Tigran Aivazian
2012-09-09 15:08:46 +01:00
parent f1e197cbfd
commit 2c6dfae807

View File

@@ -364,21 +364,20 @@ function FileChooser:addAllCommands()
local pos = self.perpage*(self.page-1)+self.current
local folder = self.dirs[pos]
if folder == ".." then
showInfoMsgWithDelay("<UP-DIR> can not be deleted! ",2000,1)
showInfoMsgWithDelay(".. cannot be deleted! ",2000,1)
elseif folder then
InfoMessage:show("Press \'Y\' to confirm deleting... ",0)
InfoMessage:show("Press \'Y\' to confirm",0)
if self:ReturnKey() == KEY_Y then
if lfs.rmdir(self.path.."/"..folder) then
self.pagedirty = true
table.remove(self.dirs, offset)
self.items = self.items - 1
self.current = self.current - 1
else
showInfoMsgWithDelay("This folder can not be deleted! ",2000,1)
showInfoMsgWithDelay("Cannot be deleted!",2000,1)
end
end
else
InfoMessage:show("Press \'Y\' to confirm deleting... ",0)
InfoMessage:show("Press \'Y\' to confirm",0)
if self:ReturnKey() == KEY_Y then
pos = pos - #self.dirs
local fullpath = self.path.."/"..self.files[pos]
@@ -390,9 +389,9 @@ function FileChooser:addAllCommands()
table.remove(self.files, pos)
self.items = self.items - 1
self.current = self.current - 1
self.pagedirty = true
end
end -- if folder == ".."
self.pagedirty = true
end -- function
)
-- make renaming flexible: it either keeps old extention (BEGINNERS_MODE) or