Add ascending/descending, fix selection issue

This commit is contained in:
Athozus 2023-04-05 18:21:01 +02:00
parent 3e2d022c87
commit 618b338295
No known key found for this signature in database
GPG key ID: B50895022E8484BF
5 changed files with 32 additions and 17 deletions

View file

@ -24,14 +24,14 @@ function mail.show_sent(name, sortfield, sortdirection)
button[6,8.7;2.5,0.5;about;]] .. S("About") .. [[]
button_exit[6,9.5;2.5,0.5;quit;]] .. S("Close") .. [[]
dropdown[0,9.4;2,0.5;sortfield;]] .. S("From") .. "," .. S("Subject") .. "," .. S("Date") .. [[;]] .. tostring(sortfield) .. [[;1]
dropdown[0,9.4;2,0.5;sortfield;]] .. S("To") .. "," .. S("Subject") .. "," .. S("Date") .. [[;]] .. tostring(sortfield) .. [[;1]
dropdown[2.2,9.4;2,0.5;sortdirection;]] .. S("Ascending") .. "," .. S("Descending") .. [[;]] .. tostring(sortdirection) .. [[;1]
tablecolumns[color;text;text]
table[0,0.7;5.75,8.35;sent;#999,]] .. S("To") .. "," .. S("Subject")
local formspec = { sent_formspec }
local entry = mail.get_storage_entry(name)
local messages = mail.sort_messages(entry.outbox, sortfield, sortdirection)
local messages = mail.sort_messages(entry.outbox, tostring(sortfield), tostring(sortdirection))
mail.message_drafts[name] = nil