diff gui.lua @ 149:df0ca8ed1aff

Be smarter when joining a raid. Add some more flow-control debug printing. Given (A) joining a raid, which triggers a delayed addon load, and seeing the "what to do next" popup, and (B) restoring previous data which contains only a raid roster or generated text, fix the interaction in which the activation from (B) overrides the user's choice in (A)'s popup.
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Thu, 08 Jan 2015 15:22:27 -0500
parents 113dd7c86222
children 63bda09d88fe
line wrap: on
line diff
--- a/gui.lua	Wed Jan 07 17:37:43 2015 -0500
+++ b/gui.lua	Thu Jan 08 15:22:27 2015 -0500
@@ -2194,8 +2194,8 @@
 		b:SetList{"Full Tracking", "Broadcasting", "Disabled"}
 		b:SetValue(self.enabled and 1 or (self.rebroadcast and 2 or 3))
 		b:SetCallback("OnValueChanged", function(_w,event,choice)
-			if choice == 1 then       self:Activate()
-			elseif choice == 2 then   self:Activate(nil,true)
+			if choice == 1 then       self:Activate("dropdown")
+			elseif choice == 2 then   self:Activate("dropdownbc",nil,true)
 			else                      self:Deactivate()
 			end
 			_w = display:GetUserData('comm_ident')
@@ -2578,13 +2578,18 @@
 	button2 = "Broadcast Only",      -- "cancel", middle
 	button3 = HELP_LABEL,            -- "alt", right
 	OnAccept = function (dialog, addon)
-		addon:Activate()
+		pprint('remind', "OnAccept")
+		addon:Activate("remind")
 	end,
 	noCancelOnEscape = true,
+	noCancelOnReuse = true,
+	closeButton = true,
 	OnCancel = function (dialog, addon)
-		addon:Activate(nil,true)
+		pprint('remind', "OnCancel")
+		addon:Activate("remindbc",nil,true)
 	end,
 	OnAlt = function (dialog, addon)
+		pprint('remind', "OnAlt")
 		-- hitting escape also calls this, but the 3rd arg would be "clicked"
 		-- in both cases, not useful here.
 		if MouseIsOver(dialog.button3) then
@@ -2595,6 +2600,11 @@
 			addon.popped = true
 		end
 	end,
+	--@debug@
+	OnHide = function (dialog, addon)
+		pprint('remind', "OnHide")
+	end,
+	--@end-debug@
 }
 
 -- Callback for each Next/Accept stage of inserting a new loot or boss row via