comparison gui.lua @ 40:dc3a66688e50

More debug message tweaks. Put comm and loot caches on separate-but-related expirations; comm is now a bit shorter and loot is now a bit longer. Check cache expirations more often (possibly revert this).
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Fri, 30 Dec 2011 21:29:44 +0000
parents 8f7ec6ccf5e3
children 4f1e71f62776
comparison
equal deleted inserted replaced
39:8f7ec6ccf5e3 40:dc3a66688e50
857 end 857 end
858 858
859 -- Tab 1: Events Of Interest (implementation) 859 -- Tab 1: Events Of Interest (implementation)
860 tabs_OnGroupSelected["eoi"] = function(ocontainer,specials) 860 tabs_OnGroupSelected["eoi"] = function(ocontainer,specials)
861 if (not addon.rebroadcast) and (not addon.enabled) and (#g_loot < 1) then 861 if (not addon.rebroadcast) and (not addon.enabled) and (#g_loot < 1) then
862 return addon.dprint('flow', "Nothing to show in first tab, skipping creation") 862 addon.dprint('flow', "Nothing to show in first tab, skipping creation")
863 return
863 end 864 end
864 865
865 -- The first time this function is called, we set up a persistent ST 866 -- The first time this function is called, we set up a persistent ST
866 -- object and store it. Any other delayed setup work is done, and then 867 -- object and store it. Any other delayed setup work is done, and then
867 -- this function replaces itself with a smaller, sleeker, sexier one. 868 -- this function replaces itself with a smaller, sleeker, sexier one.
1414 addon:Print("Addon channel ID set to '".. addon.ident.. "' for rebroadcasting and listening.") 1415 addon:Print("Addon channel ID set to '".. addon.ident.. "' for rebroadcasting and listening.")
1415 end) 1416 end)
1416 w:SetDisabled(addon.enabled or addon.rebroadcast) 1417 w:SetDisabled(addon.enabled or addon.rebroadcast)
1417 grp:AddChild(w) 1418 grp:AddChild(w)
1418 1419
1419 w = mkbutton("EditBox", nil, addon.recent_messages.ttl, [[comm cache (only) ttl]]) 1420 w = mkbutton("EditBox", nil, addon.recent_messages.ttl, [[comm cache TTL]])
1420 w:SetRelativeWidth(0.05) 1421 w:SetRelativeWidth(0.05)
1421 w:SetLabel("ttl") 1422 w:SetLabel("ttl")
1422 w:SetCallback("OnTextChanged", adv_careful_OnTextChanged) 1423 w:SetCallback("OnTextChanged", adv_careful_OnTextChanged)
1423 w:SetCallback("OnEnterPressed", function(_w,event,value) 1424 w:SetCallback("OnEnterPressed", function(_w,event,value)
1424 value = tonumber(value) or addon.recent_messages.ttl 1425 value = tonumber(value) or addon.recent_messages.ttl
1498 w:SetFullWidth(true) 1499 w:SetFullWidth(true)
1499 w:SetType("checkbox") 1500 w:SetType("checkbox")
1500 w:SetLabel(d) 1501 w:SetLabel(d)
1501 if d == "notraid" then 1502 if d == "notraid" then
1502 w:SetDescription[[Tick this before enabling to make the addon work outside of raid groups]] 1503 w:SetDescription[[Tick this before enabling to make the addon work outside of raid groups]]
1503 elseif d == "alsolog" then
1504 w:SetDescription[[Also log all debug messages to disk. See print_log.lua in the addon folder for later viewing.]]
1505 else 1504 else
1505 if d == "alsolog" then
1506 w:SetDescription[[Also log all debug messages to disk. See print_log.lua in the addon folder for later viewing.]]
1507 end
1506 w:SetDisabled(not addon.DEBUG_PRINT) 1508 w:SetDisabled(not addon.DEBUG_PRINT)
1507 end 1509 end
1508 w:SetValue(v) 1510 w:SetValue(v)
1509 w:SetCallback("OnValueChanged", function(_w,event,value) addon.debug[d] = value end) 1511 w:SetCallback("OnValueChanged", function(_w,event,value) addon.debug[d] = value end)
1510 simple:AddChild(w) 1512 simple:AddChild(w)