gui:UpdateExplorerScrollBar(); |
end |
|
function Checklist3:DeleteList(index) |
print(Torta.db.profile.cfg.loadedList); |
function Checklist3:DeleteList(index, confirmed) |
assert(index); |
local loadedListIndex = Torta.db.profile.cfg.loadedList; |
tremove(Torta.db.profile.lists, index); |
-- print(index, loadedListIndex); |
if loadedListIndex then |
if index < loadedListIndex then |
print(index, loadedListIndex, index < loadedListIndex); |
if confirmed then |
local loadedListIndex = Torta.db.profile.cfg.loadedList; |
tremove(Torta.db.profile.lists, index); |
-- print(index, loadedListIndex); |
if loadedListIndex then |
if index < loadedListIndex then |
-- print(index, loadedListIndex, index < loadedListIndex); |
self:LoadList(nil); |
self:LoadList(loadedListIndex - 1); |
end |
end |
gui:UpdateExplorerScrollBar(); |
if not Torta.db.profile.lists[Torta.db.profile.cfg.loadedList] then |
print(Torta.db.profile.cfg.loadedList); |
Torta.db.profile.cfg.loadedList = false; |
self:LoadList(nil); |
self:LoadList(loadedListIndex - 1); |
gui:UpdateCLScrollBar(); |
end |
else |
local dialog = StaticPopup_Show("TORTA_CLDELETELIST", self:GetList(index).meta.listName) |
if dialog then |
dialog.data = index; |
end |
end |
gui:UpdateExplorerScrollBar(); |
if not Torta.db.profile.lists[Torta.db.profile.cfg.loadedList] then |
print(Torta.db.profile.cfg.loadedList); |
Torta.db.profile.cfg.loadedList = false; |
self:LoadList(nil); |
gui:UpdateCLScrollBar(); |
end |
end |
|
function Checklist3:RenameList(listID, newName) |
print(listID, newName); |
-- print(listID, newName); |
if not (type(newName) == "string") then |
print(":D"); |
-- print(":D"); |
local listName = self:GetList(listID).meta.listName |
local dialog = StaticPopup_Show("TORTA_CLRENAMELIST", listName); |
getglobal(dialog:GetName() .. "EditBox"):SetText(listName); |