diff Core.lua @ 123:b21c39ea338c

Removed all ?QuickAuctions? checks and replaced them with ZeroAuctions checks instead. Fixed the copy dialog window.
author Zerotorescue
date Sat, 16 Oct 2010 14:46:04 +0200
parents 13243f627bf4
children 31f58e9c16e6
line wrap: on
line diff
--- a/Core.lua	Sat Oct 16 14:44:48 2010 +0200
+++ b/Core.lua	Sat Oct 16 14:46:04 2010 +0200
@@ -289,14 +289,6 @@
 		end
 	end
 	
-	if select(6, GetAddOnInfo("QuickAuctions")) == nil then
-		self.QuickAuctionsEnabled = true; -- Set this as an object variable so we can use it in our modules
-		
-		-- Ensure this addon is loaded if AddonLoader is installed
-		if AddonLoader and AddonLoader.LoadAddOn then
-			AddonLoader:LoadAddOn("QuickAuctions");
-		end
-	end
 	if select(6, GetAddOnInfo("ZeroAuctions")) == nil then
 		self.ZeroAuctionsEnabled = true; -- Set this as an object variable so we can use it in our modules
 		
@@ -312,7 +304,7 @@
 	
 	-- ADJUST POSITIONS
 	
-	if self.QuickAuctionsEnabled or self.ZeroAuctionsEnabled then
+	if self.ZeroAuctionsEnabled then
 		-- QA is enabled so move the checkbox further to the right
 		
 		self.cbOpenAll:SetPoint("TOPLEFT", MailFrame, "TOPLEFT", 155, -13);
@@ -438,17 +430,6 @@
 	InboxTooMuchMail:Hide()
 	InboxTooMuchMail.Show = function() end
 	
-	if self.QuickAuctionsEnabled then
-		local QAMail = LibStub("AceAddon-3.0"):GetAddon("QuickAuctions", true):GetModule("Mail", true)
-		
-		if QAMail then
-			-- Hide the open all button
-			QAMail.massOpening:Hide();
-			-- Hide the x mail remaining text
-			QAMail.totalMail:Hide();
-		end
-	end
-	
 	if self.ZeroAuctionsEnabled then
 		local QAMail = LibStub("AceAddon-3.0"):GetAddon("ZeroAuctions", true):GetModule("Mail", true)
 		
@@ -573,22 +554,10 @@
 			
 			self:CancelTimer(self.tmrTryAgain, true); -- Insurance
 			
-			if self.QuickAuctionsEnabled and QuickAuctionsAutoMail then
-				-- Remember the last known quick auctions status
-				lastQuickAuctionsStatus = QuickAuctionsAutoMail:GetChecked();
-			end
 			if self.ZeroAuctionsEnabled and ZeroAuctionsAutoMail then
 				-- Remember the last known quick auctions status
 				lastQuickAuctionsStatus = ZeroAuctionsAutoMail:GetChecked();
 			end
-			if self.db.profile.general.autoDisableQAAutoMail and self.QuickAuctionsEnabled and QuickAuctionsAutoMail and QuickAuctionsAutoMail:GetChecked() then
-				-- If auto disable "QA Auto mail" is enabled and QA's auto mail is currently toggled on, turn it off
-				-- We need to do this with a :click to trigger the right events
-				
-				self:Debug("Turning automail |cffff0000off|r.");
-				
-				QuickAuctionsAutoMail:Click();
-			end
 			if self.db.profile.general.autoDisableQAAutoMail and self.ZeroAuctionsEnabled and ZeroAuctionsAutoMail and ZeroAuctionsAutoMail:GetChecked() then
 				-- If auto disable "QA Auto mail" is enabled and QA's auto mail is currently toggled on, turn it off
 				-- We need to do this with a :click to trigger the right events
@@ -638,31 +607,6 @@
 		end
 	end
 	
-	if self.QuickAuctionsEnabled then
-		-- Quick Auctions enabled?
-		-- Toggle automailing as per settings
-		
-		if self.db.profile.general.autoReenableQAAutoMail and QuickAuctionsAutoMail and not QuickAuctionsAutoMail:GetChecked() then
-			-- If auto re-enable "QA Auto mail" is enabled and QA's auto mail is currently toggled OFF, turn it on
-			-- We need to do this with a :click to trigger the right events
-			
-			self:Debug("Turning automail |cff00ff00on|r.");
-			
-			QuickAuctionsAutoMail:Click();
-		elseif self.db.profile.general.autoSetBackQAAutoMail and QuickAuctionsAutoMail and lastQuickAuctionsStatus ~= QuickAuctionsAutoMail:GetChecked() then
-			-- If auto set back "QA Auto mail" is enabled and QA's auto mail is currently not the same as it was before starting, toggle it
-			-- We need to do this with a :click to trigger the right events
-			
-			if lastQuickAuctionsStatus then
-				self:Debug("Turning automail |cff00ff00on|r.");
-			else
-				self:Debug("Turning automail |cffff0000off|r.");
-			end
-				
-			QuickAuctionsAutoMail:Click();
-		end
-	end
-	
 	if self.ZeroAuctionsEnabled then
 		-- Zero Auctions enabled?
 		-- Toggle automailing as per settings
@@ -794,17 +738,6 @@
 function MailOpener:ToggleQAStatus()
 	self:Debug("defaultQAStatus:" .. self.db.profile.general.defaultQAStatus);
 	
-	if self.QuickAuctionsEnabled and self.db.profile.general.defaultQAStatus ~= "__remember" and QuickAuctionsAutoMail then
-		if self.db.profile.general.defaultQAStatus == "_enabled" and not QuickAuctionsAutoMail:GetChecked() then
-			self:Debug("Turning automail |cff00ff00on|r.");
-			
-			QuickAuctionsAutoMail:Click();
-		elseif self.db.profile.general.defaultQAStatus == "disabled" and QuickAuctionsAutoMail:GetChecked() then
-			self:Debug("Turning automail |cffff0000off|r.");
-			
-			QuickAuctionsAutoMail:Click();
-		end
-	end
 	if self.ZeroAuctionsEnabled and self.db.profile.general.defaultQAStatus ~= "__remember" and ZeroAuctionsAutoMail then
 		if self.db.profile.general.defaultQAStatus == "_enabled" and not ZeroAuctionsAutoMail:GetChecked() then
 			self:Debug("Turning automail |cff00ff00on|r.");
@@ -837,23 +770,21 @@
 	text = L["Press CTRL-C to copy."],
 	button2 = CLOSE,
 	hasEditBox = 1,
-	hasWideEditBox = 1,
-	OnShow = function()
-		local editBox = _G[this:GetName().."WideEditBox"];
-		if editBox and MailOpener.currentPopupContents then
-			editBox:SetText(MailOpener.currentPopupContents);
-			editBox:SetFocus();
-			editBox:HighlightText(0);
+	editBoxWidth = 360,
+	OnShow = function(self)
+		if self.editBox and MailOpener.currentPopupContents then
+			self.editBox:SetText(MailOpener.currentPopupContents);
+			self.editBox:SetFocus();
+			self.editBox:HighlightText(0);
 		end
 		
 		-- Position the close button in the middle
-		local button = _G[this:GetName().."Button2"];
-		if button then
+		if self.button2 then
 			-- Remove previous know position
-			button:ClearAllPoints();
-			button:SetWidth(200);
+			self.button2:ClearAllPoints();
+			self.button2:SetWidth(200);
 			-- Reposition in the center
-			button:SetPoint("CENTER", editBox, "CENTER", 0, -30);
+			self.button2:SetPoint("CENTER", self.editBox, "CENTER", 0, -30);
 		end
 	end,
 	EditBoxOnEscapePressed = function(self)