WoWInterface SVN Torta

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 32 to Rev 33
    Reverse comparison

Rev 32 → Rev 33

trunk/Torta/CL3.lua
183,32 → 183,38
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);
trunk/Torta/UIManager.lua
415,7 → 415,22
hasEditBox = 1,
hideOnEscape = 1,
}
StaticPopupDialogs["TORTA_CLDELETELIST"] = {
text = "Are you REALLY sure you want to delete the list \"|cffffd000%s|r\"?",
button1 = YES,
button2 = NO,
showAlert = true,
OnAccept = function(self, data)
Torta.cl3:DeleteList(data, true);
end,
whileDead = 1,
timeout = 30,
hideOnEscape = 1
}
-- Dialogs end here
-- ====================================================================
 
--
 
-- ====================================================================
-- Misc. UI init code