diff --git a/ui/drafts.lua b/ui/drafts.lua index 0a14c5a..6f164cc 100644 --- a/ui/drafts.lua +++ b/ui/drafts.lua @@ -1,23 +1,28 @@ -- translation local S = minetest.get_translator("mail") -local drafts_formspec = "size[8.5,10;]" .. mail.theme .. [[ - tabheader[0.3,1;boxtab;]] .. - S("Inbox") .. "," .. S("Outbox").. "," .. S("Drafts") .. "," .. S("Trash") .. [[;3;false;false] - - button[6,0.10;2.5,0.5;new;]] .. S("New") .. [[] - button[6,0.95;2.5,0.5;edit;]] .. S("Edit") .. [[] - button[6,1.70;2.5,0.5;delete;]] .. S("Delete") .. [[] - button[6,6.8;2.5,0.5;contacts;]] .. S("Contacts") .. [[] - button[6,7.6;2.5,0.5;maillists;]] .. S("Mail lists") .. [[] - button[6,8.7;2.5,0.5;options;]] .. S("Options") .. [[] - button_exit[6,9.5;2.5,0.5;quit;]] .. S("Close") .. [[] - - tablecolumns[color;text;text] - table[0,0.7;5.75,9.35;drafts;#999,]] .. S("To") .. "," .. S("Subject") - function mail.show_drafts(name) + local trash_tab = "" + if mail.get_setting(name, "trash_move_enable") then + trash_tab = "," .. S("Trash") + end + + local drafts_formspec = "size[8.5,10;]" .. mail.theme .. [[ + tabheader[0.3,1;boxtab;]] .. + S("Inbox") .. "," .. S("Outbox").. "," .. S("Drafts") .. trash_tab .. [[;3;false;false] + + button[6,0.10;2.5,0.5;new;]] .. S("New") .. [[] + button[6,0.95;2.5,0.5;edit;]] .. S("Edit") .. [[] + button[6,1.70;2.5,0.5;delete;]] .. S("Delete") .. [[] + button[6,6.8;2.5,0.5;contacts;]] .. S("Contacts") .. [[] + button[6,7.6;2.5,0.5;maillists;]] .. S("Mail lists") .. [[] + button[6,8.7;2.5,0.5;options;]] .. S("Options") .. [[] + button_exit[6,9.5;2.5,0.5;quit;]] .. S("Close") .. [[] + + tablecolumns[color;text;text] + table[0,0.7;5.75,9.35;drafts;#999,]] .. S("To") .. "," .. S("Subject") + local formspec = { drafts_formspec } local entry = mail.get_storage_entry(name) local messages = entry.drafts diff --git a/ui/inbox.lua b/ui/inbox.lua index e2c771b..ddcf5e2 100644 --- a/ui/inbox.lua +++ b/ui/inbox.lua @@ -13,9 +13,14 @@ function mail.show_inbox(name, sortfieldindex, sortdirection, filter) local sortfield = ({"from","subject","time"})[sortfieldindex] local messages = mail.sort_messages(entry.inbox, sortfield, sortdirection == "2", filter) + local trash_tab = "" + if mail.get_setting(name, "trash_move_enable") then + trash_tab = "," .. S("Trash") + end + local inbox_formspec = "size[8.5,10;]" .. mail.theme .. [[ tabheader[0.3,1;boxtab;]] .. - S("Inbox") .. "," .. S("Outbox").. "," .. S("Drafts") .. "," .. S("Trash") .. [[;1;false;false] + S("Inbox") .. "," .. S("Outbox").. "," .. S("Drafts") .. trash_tab .. [[;1;false;false] button[6,0.10;2.5,0.5;new;]] .. S("New") .. [[] button[6,0.95;2.5,0.5;read;]] .. S("Read") .. [[] diff --git a/ui/outbox.lua b/ui/outbox.lua index e55039b..84afeaf 100644 --- a/ui/outbox.lua +++ b/ui/outbox.lua @@ -13,9 +13,14 @@ function mail.show_outbox(name, sortfieldindex, sortdirection, filter) local sortfield = ({"to","subject","time"})[sortfieldindex] local messages = mail.sort_messages(entry.outbox, sortfield, sortdirection == "2", filter) + local trash_tab = "" + if mail.get_setting(name, "trash_move_enable") then + trash_tab = "," .. S("Trash") + end + local outbox_formspec = "size[8.5,10;]" .. mail.theme .. [[ tabheader[0.3,1;boxtab;]] .. - S("Inbox") .. "," .. S("Outbox").. "," .. S("Drafts") .. "," .. S("Trash") .. [[;2;false;false] + S("Inbox") .. "," .. S("Outbox").. "," .. S("Drafts") .. trash_tab .. [[;2;false;false] button[6,0.10;2.5,0.5;new;]] .. S("New") .. [[] button[6,0.95;2.5,0.5;read;]] .. S("Read") .. [[]