changeset 135:a529a4a4ccbe

I removed the persistent queue (Ticket 33) It caused to many bugs and was blocking me from getting other things done. I think its something that will get implemented again once I figure out the best way to do it.
author Asa Ayers <Asa.Ayers@Gmail.com>
date Sat, 02 Oct 2010 11:38:22 -0700
parents 5eefa40e2a29 (diff) 7f81764aa03a (current diff)
children d3d5e82043d8
files CHANGELOG.txt Core.lua Modules/Crafting.lua
diffstat 5 files changed, 212 insertions(+), 103 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGELOG.txt	Thu Sep 30 17:43:43 2010 -0700
+++ b/CHANGELOG.txt	Sat Oct 02 11:38:22 2010 -0700
@@ -1,3 +1,17 @@
+2010-10-02  Asa Ayers  <Asa.Ayers@Gmail.com>
+
+- I removed the persistent queue (Ticket 33) It caused to many bugs and was blocking me from getting other things done. I think its something that will get implemented again once I figure out the best way to do it.
+
+2010-09-15  Asa Ayers  <Asa.Ayers@Gmail.com>
+
+- Ticket 41 - Fixed a bug that occured if you created items without ever opening /ia crafting.
+- Ticket 40 - Added options to enable counting guild bank inventory.
+
+2010-09-03  Asa Ayers  <Asa.Ayers@Gmail.com>
+
+- Re-enabled IA QuickAuctions decider. I unintentionally disabled it when working on the QAManager code.
+- Ticket 39 - Updated the ItemAuditor window to be pulled to the front when it opens.
+
 2010-09-02  Asa Ayers  <Asa.Ayers@Gmail.com>
 
 - Updated the ArkInventory rule and tooltip to work in QA is compatible instead of if its enabled in ItemAuditor.
@@ -6,6 +20,7 @@
 - Changed Total Profit to Profit Each to match the rest of the interface. Cost and Estimated Sale are both Each.
 - When using the process button for Enchanting, ItemAuditor will check which vellum is used and will use the vellum from your inventory. If the correct vellum is not found, it will upgrade to the next level (use vellum II instead of vellum I). This also means that you have to press process for each scroll to be created.
 - Changed the Have Mats column to show the number of items you could create with the materials you have instead of just a y/n. The have mats filter simply checks that you can make at least 1.
+- Ticket 33 - Implemented a persistent queue. This allows the crafting queue to be seen even if your tradeskills aren't open and allows you to mix all of your tradeskills into a single queue.
 
 2010-09-01  Asa Ayers  <Asa.Ayers@Gmail.com>
 
--- a/Core.lua	Thu Sep 30 17:43:43 2010 -0700
+++ b/Core.lua	Sat Oct 02 11:38:22 2010 -0700
@@ -68,6 +68,7 @@
 		items = {},
 		outbound_cod = {},
 		mailbox = {},
+		enabled_guilds = {},
 	},
 }
 
@@ -81,10 +82,10 @@
 	myMailbox = allMailboxes[UnitName("player")]
 
 	self.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("ItemAuditor", "ItemAuditor")
-	
+
 	LibStub("AceConfig-3.0"):RegisterOptionsTable("ItemAuditor", ItemAuditor.Options, {"ia"})
 	ItemAuditor:RegisterFrame(ItemAuditor_DebugFrame)
-	
+
 	LibStub("AceConsole-3.0"):RegisterChatCommand('rl', ReloadUI)
 
 	if self.db.char.crafting_threshold then
@@ -96,7 +97,7 @@
 		elseif threshold == 3 then
 			self.db.char.profitable_threshold = 50000
 		end
-	
+
 		self.db.char.crafting_threshold = nil
 	end
 
@@ -114,7 +115,7 @@
 
 
 local registeredEvents = {}
-local originalRegisterEvent = ItemAuditor.RegisterEvent 
+local originalRegisterEvent = ItemAuditor.RegisterEvent
 function ItemAuditor:RegisterEvent(event, callback, arg)
 	registeredEvents[event] = true
 	if arg ~= nil then
@@ -161,18 +162,18 @@
 			self.db.factionrealm.item_account[itemName] = nil
 		end
 	end
-	
+
 	for link, data in pairs(self.db.factionrealm.items) do
 		if self:GetItem(link).count == 0 or self:GetItem(link).invested == 0 then
 			self:RemoveItem(link)
 		end
 	end
-	
+
 	self:RefreshQAGroups()
 end
 
--- Options doesn't exist when this file is created the first time, so getOptions will 
--- make one call to :GetModule and return the result and replace itself with a 
+-- Options doesn't exist when this file is created the first time, so getOptions will
+-- make one call to :GetModule and return the result and replace itself with a
 -- function that simply returns the same object. The permanent solution will probably be
 -- to move :Print to a different module.
 local function getOptions()
@@ -210,18 +211,18 @@
 	local i = {}
 	local bagID
 	local slotID
-	
+
 	for bagID = 0, NUM_BAG_SLOTS do
 		scanBag(bagID, i)
 	end
-	
+
 	if bankOpen then
 		scanBag(BANK_CONTAINER, i)
 		for bagID = NUM_BAG_SLOTS+1, NUM_BANKBAGSLOTS do
 			scanBag(bagID, i)
 		end
 	end
-	
+
 	return {items = i, money = GetMoney()}
 end
 
@@ -237,17 +238,17 @@
 			self:Debug("1 diff[" .. link .. "]=" .. diff[link])
 		elseif count - pastInventory.items[link] ~= 0 then
 			diff[link] = count - pastInventory.items[link]
-			self:Debug("2 diff[" .. link .. "]=" .. diff[link])        
-		end    
+			self:Debug("2 diff[" .. link .. "]=" .. diff[link])
+		end
 	end
 
 	for link, count in pairs(pastInventory.items) do
 		if current.items[link] == nil then
 			diff[link] = -count
-			self:Debug("3 diff[" .. link .. "]=" .. diff[link])                
+			self:Debug("3 diff[" .. link .. "]=" .. diff[link])
 		elseif current.items[link] - count ~= 0 then
 			diff[link] = current.items[link] - pastInventory.items[link]
-			self:Debug("4 diff[" .. link .. "]=" .. diff[link])        
+			self:Debug("4 diff[" .. link .. "]=" .. diff[link])
 		end
 	end
 
@@ -264,21 +265,21 @@
 function ItemAuditor:ScanMail()
 	local results = {}
 	local CODPaymentRegex = gsub(COD_PAYMENT, "%%s", "(.*)")
-	
+
 	for mailIndex = 1, GetInboxNumItems() or 0 do
 		local sender, msgSubject, msgMoney, msgCOD, daysLeft, msgItem, _, _, msgText, _, isGM = select(3, GetInboxHeaderInfo(mailIndex))
 		local mailType = self:GetMailType(msgSubject)
-		
+
 		local mailSignature = msgSubject .. '-' .. msgMoney .. '-' .. msgCOD .. '-' .. daysLeft
-		
+
 		results[mailType] = (results[mailType] or {})
-		
+
 		if skipMail[mailSignature] ~= nil then
 			-- do nothing
 		elseif mailType == "NonAHMail" and msgCOD > 0 then
 			mailType = 'COD'
 			results[mailType] = (results[mailType] or {})
-			
+
 			local itemTypes = {}
 			for itemIndex = 1, ATTACHMENTS_MAX_RECEIVE do
 				local itemName, _, count, _, _= GetInboxItem(mailIndex, itemIndex)
@@ -286,25 +287,25 @@
 					itemTypes[itemName] = (itemTypes[itemName] or 0) + count
 				end
 			end
-			
+
 			if self:tcount(itemTypes) == 1 then
 				for itemName, count in pairs(itemTypes) do
 					results[mailType][itemName] = (results[mailType][itemName] or {total=0,count=0})
 					results[mailType][itemName].total = results[mailType][itemName].total + msgCOD
-					
+
 					if inboundCOD[mailSignature] == nil then
 						results[mailType][itemName].count = results[mailType][itemName].count + count
 						inboundCOD[mailSignature] = (inboundCOD[mailSignature] or 0) + count
 					else
 						results[mailType][itemName].count = inboundCOD[mailSignature]
 					end
-					
-					
+
+
 				end
 			else
 				self:Debug("Don't know what to do with more than one item type on COD mail.")
 			end
-		elseif mailType == "CODPayment" then	
+		elseif mailType == "CODPayment" then
 			-- /dump ItemAuditor.db.factionrealm.outbound_cod
 			self:Debug(msgSubject)
 			self:Debug(CODPaymentRegex)
@@ -313,7 +314,7 @@
 			if outboundSubject ~= nil then
 				self:Debug(outboundSubject)
 				trackID = select(3, outboundSubject:find('[[]IA: (%d*)[]]'))
-				
+
 				if trackID ~= nil then
 					trackID = tonumber(trackID)
 					self:Debug('COD ID: %s', trackID)
@@ -323,31 +324,31 @@
 						self:Print("WARNING: {%s} has an invalid ItemAuditor tracking number.", msgSubject)
 					else
 						itemName = trackID .. "|" .. cod['link']
-						
-						
+
+
 						results[mailType][itemName] = (results[mailType][itemName] or {total=0,count=0})
 						results[mailType][itemName].total = results[mailType][itemName].total - msgMoney
 						results[mailType][itemName].count = results[mailType][itemName].count - cod.count
 					end
 				end
 			end
-			
+
 			if trackID == nil then
 				skipMail[mailSignature] = true
 				self:Print("WARNING: {%s} is a COD payment but doesn't have an ItemAuditor tracking number.", msgSubject)
 			end
-			
+
 		elseif mailType == "AHSuccess" then
 			local invoiceType, itemName, playerName, bid, buyout, deposit, consignment = GetInboxInvoiceInfo(mailIndex);
 			results[mailType][itemName] = (results[mailType][itemName] or {total=0,count=0})
 			results[mailType][itemName].total = results[mailType][itemName].total - deposit - buyout + consignment
-			
+
 
 		elseif mailType == "AHWon" then
 			local invoiceType, itemName, playerName, bid, buyout, deposit, consignment = GetInboxInvoiceInfo(mailIndex);
 			results[mailType][itemName] = (results[mailType][itemName] or {total=0,count=0})
 			results[mailType][itemName].total = results[mailType][itemName].total + bid
-			
+
 			local count = select(3, GetInboxItem(mailIndex,1))
 			results[mailType][itemName].count = results[mailType][itemName].count + count
 		elseif mailType == "AHExpired" or mailType == "AHCancelled" or mailType == "AHOutbid" then
@@ -370,7 +371,7 @@
 			-- self:Print(format("|cFF00FF00MailScan|r: %s - %s - %s x %s", mailType, item, data.total, data.count))
 		end
 	end
-	return results   
+	return results
 end
 
 local realm = GetRealmName()
@@ -385,6 +386,10 @@
 		count = count + (DataStore:GetMailItemCount(character, searchID) or 0)
 		count = count + (DataStore:GetCurrencyItemCount(character, searchID) or 0)
 	end
+	for guildName in pairs(self.db.factionrealm.enabled_guilds) do
+		count = count + DataStore:GetGuildBankItemCount(DataStore:GetGuilds()[guildName], searchID)
+	end
+
 	local itemName = GetItemInfo(searchID)
 	for character, mailbox in pairs(allMailboxes) do
 		for type, items in pairs(mailbox) do
@@ -405,7 +410,7 @@
 	if viewOnly == nil then
 		viewOnly = false
 	end
-	
+
 	local itemName = nil
 	if self:GetSafeLink(link) == nil then
 		itemName = link
@@ -413,8 +418,8 @@
 		link = self:GetSafeLink(link)
 		itemName = GetItemInfo(link)
 	end
-	
-	
+
+
 	if self.db.factionrealm.item_account[itemName] ~= nil then
 		self.db.factionrealm.items[link] = {
 			count = ItemAuditor:GetItemCount(self:GetIDFromLink(link)),
@@ -422,33 +427,33 @@
 		}
 		self.db.factionrealm.item_account[itemName] = nil
 	end
-	
+
 	if viewOnly == false and self.db.factionrealm.items[link] == nil then
-		
+
 		self.db.factionrealm.items[link] = {
 			count =  ItemAuditor:GetItemCount(self:GetIDFromLink(link)),
 			invested = abs(self.db.factionrealm.item_account[itemName] or 0),
 		}
-		
+
 	end
-	
+
 	if self.db.factionrealm.items[link] ~= nil then
 		self.db.factionrealm.items[link].count =  ItemAuditor:GetItemCount(self:GetIDFromLink(link))
-		
+
 		if self.db.factionrealm.items[link].invested == nil then
 			self.db.factionrealm.items[link].invested = 0
 		end
 	end
-	
+
 	if viewOnly == true and self.db.factionrealm.items[link] == nil then
 		return {count = 0, invested = 0}
 	elseif viewOnly == true then
-		
+
 		return {count = self.db.factionrealm.items[link].count, invested = self.db.factionrealm.items[link].invested}
 	end
-	
-	
-	
+
+
+
 	return self.db.factionrealm.items[link]
 end
 
@@ -475,19 +480,19 @@
 		self.db.factionrealm.item_account[itemName] = (self.db.factionrealm.item_account[itemName] or 0) + value
 		item = {invested = self.db.factionrealm.item_account[itemName], count = 1}
 	else
-		
+
 		item = self:GetItem(realLink)
 		item.invested = item.invested + value
 		itemName = GetItemInfo(realLink)
 	end
-	
+
 	if value > 0 and countChange > 0 and item.invested == value and item.count ~= countChange then
 		local costPerItem = value / countChange
 		value = costPerItem * item.count
 		item.invested = value
 		self:Print("You already owned %s %s with an unknown price, so they have also been updated to %s each", (item.count - countChange), itemName, self:FormatMoney(costPerItem))
 	end
-	
+
 	if abs(value) > 0 then
 		if  item.invested < 0 then
 			if self.db.profile.messages.cost_updates then
@@ -496,7 +501,7 @@
 			self:RemoveItem(link)
 		-- This doesn't work when you mail the only copy of an item you have to another character.
 		--[[
-		elseif item.count == 0 and realLink and ItemAuditor:GetItemCount(self:GetIDFromLink(realLink)) then 
+		elseif item.count == 0 and realLink and ItemAuditor:GetItemCount(self:GetIDFromLink(realLink)) then
 			self:Print("You ran out of " .. itemName .. " and never recovered " .. self:FormatMoney(item.invested))
 			self:RemoveItem(link)
 		]]
@@ -506,7 +511,7 @@
 			end
 		end
 	end
-	
+
 	if realLink ~= nil then
 		ItemAuditor:UpdateQAThreshold(realLink)
 		self:SendMessage("IA_COST_CHANGED", realLink, unpack({ItemAuditor:GetItemCost(realLink)}))
@@ -558,14 +563,40 @@
 
 	if item.invested > 0 then
 		local count = item.count
-		
+
 		if countModifier ~= nil then
 			count = count - countModifier
 		end
-		if count > 0 then 
+		if count > 0 then
 			return ceil(item.invested), ceil(item.invested/count), count
 		end
 		return ceil(item.invested), 0, count
 	end
 	return 0, 0, ItemAuditor:GetItemCount(ItemAuditor:GetIDFromLink(link))
 end
+
+ItemAuditor.Options.args.misc= {
+	name = "Misc",
+	type = 'group',
+	args = {
+	},
+}
+local function GetGuild(info)
+	local guildName = info[#(info)]
+	return (ItemAuditor.db.factionrealm.enabled_guilds[guildName] == true)
+end
+
+local function SetGuild(info, value)
+	local guildName = info[#(info)]
+	ItemAuditor.db.factionrealm.enabled_guilds[guildName] = value or nil
+end
+
+for guildName in pairs(DataStore:GetGuilds()) do
+	ItemAuditor.Options.args.misc.args[guildName] = {
+		type = "toggle",
+		name = "Count "..guildName.." Guild Bank",
+		get = GetGuild,
+		set = SetGuild,
+		order = 11,
+	}
+end
--- a/Modules/Crafting.lua	Thu Sep 30 17:43:43 2010 -0700
+++ b/Modules/Crafting.lua	Sat Oct 02 11:38:22 2010 -0700
@@ -10,6 +10,7 @@
 local parseMoney = ItemAuditor.parseMoney
 
 local realData = {}
+local nameMap = nil
 
 local vellumLevelMap = {
 	[38682] = 37602, -- Armor Vellum => Armor Vellum II
@@ -18,6 +19,39 @@
 	[39350] = 43146, -- Weapon Vellum II => Weapon Vellum III
 }
 
+function Crafting:OnInitialize()
+	self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
+end
+
+local function getQueueLocation(name)
+	if not nameMap then
+		nameMap = {}
+		for key, data in pairs(realData) do
+			nameMap[data.skillName] = key
+		end
+	end
+	return nameMap[name]
+end
+
+--@debug@
+Crafting.getQueueLocation = getQueueLocation
+function Crafting.getNameMap()
+	return nameMap
+end
+
+function Crafting.getRealData()
+	return realData
+end
+--@end-debug@
+
+function Crafting:UNIT_SPELLCAST_SUCCEEDED(event, unit, spell)
+	if unit == "player" and getQueueLocation(spell) then
+		local data = realData[getQueueLocation(spell)]
+		data.queue = data.queue - 1
+		ItemAuditor:RefreshCraftingTable()
+	end
+end
+
 local queueDestinations = {}
 local displayCraftingDestinations = {}
 function Crafting.RegisterQueueDestination(name, destination)
@@ -35,7 +69,7 @@
 	if dest and queueDestinations[dest] then
 		return queueDestinations[dest], dest
 	end
-	-- If there is none selected or the selected option has 
+	-- If there is none selected or the selected option has
 	-- dissapeared, choose the first one in the list
 	for name, func in pairs(queueDestinations) do
 		if dest then
@@ -44,7 +78,7 @@
 		ItemAuditor.db.profile.queue_destination = name
 		return func, name
 	end
-	
+
 	error('Unable to determine queue destination.')
 end
 
@@ -81,7 +115,7 @@
 		else
 			cellFrame.text:SetText("")
 		end
-		
+
 	end
 end
 
@@ -94,20 +128,20 @@
 			end
 		end,
 	},
-	{ name= "Cost Each", width = 100, align = "RIGHT", 
+	{ name= "Cost Each", width = 100, align = "RIGHT",
 		['DoCellUpdate'] = displayMoney,
 	},
-	{ name= "Est Sale Each", width = 100, align = "RIGHT", 
+	{ name= "Est Sale Each", width = 100, align = "RIGHT",
 		['DoCellUpdate'] = displayMoney,
 	},
 	{ name= "Decided By", width = 125, align = "RIGHT",
-		
+
 	},
-	{ name= "craft", width = 50, align = "RIGHT", 
-		
+	{ name= "craft", width = 50, align = "RIGHT",
+
 	},
-	{ name= "Have Mats", width = 60, align = "RIGHT", 
-		
+	{ name= "Have Mats", width = 60, align = "RIGHT",
+
 	},
 	{ name= "Profit Each", width = 100, align = "RIGHT",
 		['DoCellUpdate'] = displayMoney,
@@ -117,7 +151,7 @@
 function Crafting.ExportToSkillet(data)
 	local skillString = select(3, string.find(data.recipeLink, "^|%x+|H(.+)|h%[.+%]"))
 	local _, skillId = strsplit(":", skillString)
-	
+
 	ItemAuditor:AddToQueue(skillId,tradeSkillIndex, data.queue)
 end
 
@@ -135,7 +169,7 @@
 	else
 		error('destination must be a function or a string')
 	end
-	
+
 	local index = 1
 	local data = ItemAuditor:GetCraftingRow(index)
 	while data do
@@ -144,7 +178,7 @@
 		end
 		index = index + 1
 		data = ItemAuditor:GetCraftingRow(index)
-		
+
 	end
 end
 
@@ -152,6 +186,10 @@
 Crafting.filter_have_mats = false
 Crafting.filter_show_all = false
 local function tableFilter(self, row, ...)
+	if Crafting.nameFilter then
+		return string.find(row[1], Crafting.nameFilter) ~= nil
+	end
+
 	if Crafting.filter_show_all then
 		return true
 	end
@@ -173,19 +211,19 @@
 	if craftingContent == false then
 		local window  = container.frame
 		craftingContent = CreateFrame("Frame",nil,window)
-		craftingContent:SetBackdropColor(0, 0, 1, 0.5) 
+		craftingContent:SetBackdropColor(0, 0, 1, 0.5)
 		craftingContent:SetBackdropBorderColor(1, 0, 0, 1)
-		
+
 		craftingContent:SetPoint("TOPLEFT", window, 10, -50)
 		craftingContent:SetPoint("BOTTOMRIGHT",window, -10, 10)
-		
+
 		craftingTable = ScrollingTable:CreateST(craftingCols, 22, nil, nil, craftingContent )
-		
-		IAcc = craftingContent 
+
+		IAcc = craftingContent
 		IAccWindow = window
 		craftingTable.frame:SetPoint("TOPLEFT",craftingContent, 0,0)
 		craftingTable.frame:SetPoint("BOTTOMRIGHT", craftingContent, 0, 30)
-		
+
 		craftingTable:RegisterEvents({
 			["OnEnter"] = function (rowFrame, cellFrame, data, cols, row, realrow, column, scrollingTable, ...)
 				if realrow then
@@ -200,7 +238,7 @@
 				  GameTooltip:Hide()
 			end,
 		});
-		
+
 		local craftingView = CreateFrame("Button", nil, craftingContent, "UIPanelButtonTemplate")
 		craftingView:SetText("View")
 		craftingView:SetSize(50, 25)
@@ -232,10 +270,10 @@
 
 		btnProcess = CreateFrame("Button", nil, craftingContent, "UIPanelButtonTemplate")
 		btnProcess:SetText("Process")
-		btnProcess:SetSize(100, 25) 
+		btnProcess:SetSize(100, 25)
 		btnProcess:SetPoint("BOTTOMRIGHT", craftingContent, 0, 0)
 		btnProcess:RegisterForClicks("LeftButtonUp");
-		
+
 		local function UpdateProcessTooltip(btn)
 			local data = ItemAuditor:GetCraftingRow(1)
 			if data then
@@ -270,10 +308,16 @@
 				return useVellum(vellumLevelMap[vellumID], idealVellum or vellumID)
 			end
 		end
-		
+
 		btnProcess:SetScript("OnClick", function (self, button, down)
 			local data = ItemAuditor:GetCraftingRow(1)
 			if data then
+				-- This will make sure the correct tradeskill window is open.
+				local tradeskillName = GetTradeSkillLine()
+				if data.tradeskillName ~= tradeskillName then
+					CastSpellByName(data.tradeskillName)
+				end
+
 				local queue = data.queue
 				local vellumID = nil
 				_, _, _, _, altVerb = GetTradeSkillInfo(data.tradeSkillIndex)
@@ -287,8 +331,6 @@
 					useVellum(vellumID)
 				end
 
-				data.queue = data.queue - queue
-				ItemAuditor:RefreshCraftingTable()
 				UpdateProcessTooltip()
 			end
 		end)
@@ -298,37 +340,37 @@
 		btnProcess:SetScript("OnLeave", function()
 			GameTooltip:Hide()
 		end)
-	
+
 		btnSkillet = CreateFrame("Button", nil, craftingContent, "UIPanelButtonTemplate")
 
-		btnSkillet:SetSize(125, 25) 
+		btnSkillet:SetSize(125, 25)
 		btnSkillet:SetPoint("BOTTOMRIGHT", btnProcess, 'BOTTOMLEFT', 0, 0)
 		btnSkillet:RegisterForClicks("LeftButtonUp");
 		btnSkillet:SetScript("OnClick", function (self, button, down)
 			Crafting.Export()
 		end)
-		
+
 	end
 	local destination = select(2, Crafting.GetQueueDestination())
 	btnSkillet:SetText("Export to "..destination)
-	
+
 	craftingContent:Show()
-	
+
 	if container.parent then
 		local width = 80
-		for i, data in pairs(craftingCols) do 
+		for i, data in pairs(craftingCols) do
 			width = width + data.width
 		end
 		container.parent:SetWidth(width);
 	end
-	
+
 	ItemAuditor:RegisterEvent("TRADE_SKILL_SHOW", function()
 		if craftingContent and craftingContent:IsVisible() then
 			ItemAuditor:UpdateCraftingTable()
 		end
 	end)
 	ItemAuditor:UpdateCraftingTable()
-	
+
 	return craftingContent
 end
 
@@ -341,7 +383,7 @@
 
 function Crafting.RegisterCraftingDecider(name, decider, options)
 	craftingDeciders[name] = decider
-	
+
 	ItemAuditor.Options.args.crafting_options.args['chk'..name] = {
 		type = "toggle",
 		name = "Enable "..name,
@@ -349,7 +391,7 @@
 		set = function(info, value) ItemAuditor.db.profile.disabled_deciders[name] = not value end,
 		order = 11,
 	}
-	
+
 	if options then
 		ItemAuditor.Options.args.crafting_options.args['decider_'..name] = {
 			handler = {},
@@ -367,7 +409,7 @@
 	for name, decider in pairs(craftingDeciders) do
 		if not ItemAuditor.db.profile.disabled_deciders[name] and name ~= lastWinner then
 			newDecision, reason = decider(data)
-			
+
 			if newDecision > data.queue then
 				data.queue = newDecision
 				lastWinner = (reason or name)
@@ -378,12 +420,12 @@
 			end
 		end
 	end
-	
+
 	winner = lastWinner
 	lastWinner = ""
-	
+
 	data.queue = ceil(data.queue / GetTradeSkillNumMade(data.tradeSkillIndex))
-	
+
 	return winner, data.queue
 end
 
@@ -432,15 +474,21 @@
 		self:Print("This feature requires Auctionator, Auctioneer, AuctionLite, or AuctionMaster.")
 		return
 	end
-	wipe(realData)
+	local tradeskillName = GetTradeSkillLine()
+
 	wipe(tableData)
-	
+
 	local profitableItems = {}
 	local profitableIndex = 1
 	local numChecked = 0
+	local numTradeSkills = GetNumTradeSkills()
+	if tradeskillName == 'UNKNOWN' then
+		numTradeSkills  = 0
+	end
+
 	local row = 1
 	
-	for i = 1, GetNumTradeSkills() do
+	for i = 1, numTradeSkills do
 		local itemLink = GetTradeSkillItemLink(i)
 		local itemId = Utils.GetItemID(itemLink)
 		local vellumID = nil
@@ -459,7 +507,7 @@
 		if recipeLink ~= nil and itemId ~= nil then
 			local skillName, skillType, numAvailable, isExpanded, altVerb = GetTradeSkillInfo(i)
 			local itemName, itemLink= GetItemInfo(itemId)
-			
+
 			-- This check has to be here for things like Inscription Research that don't produce an item.
 			if itemLink then
 				local count = ItemAuditor:GetItemCount(itemId)
@@ -469,7 +517,7 @@
 					local reagentName, _, reagentCount = GetTradeSkillReagentInfo(i, reagentId);
 					local reagentLink = GetTradeSkillReagentItemLink(i, reagentId)
 					local reagentTotalCost = self:GetReagentCost(reagentLink, reagentCount)
-					
+
 					reagents[reagentId] = {
 						link = reagentLink,
 						itemID = Utils.GetItemID(reagentLink),
@@ -503,6 +551,7 @@
 					recipeID = Utils.GetItemID(recipeLink),
 					link = itemLink,
 					name = itemName,
+					skillName = skillName,
 					count = count,
 					price = price,
 					cost = totalCost,
@@ -512,8 +561,9 @@
 					tradeSkillIndex = i,
 					queue = 0,
 					winner = "",
+					tradeskillName = tradeskillName,
 				}
-				
+
 				data.winner, data.queue = Decide(data)
 				--[[
 					If it wasn't vetoed we need to reduce the number by how many are owned
@@ -522,12 +572,13 @@
 				if data.queue > 0 then
 					data.queue = max(0, data.queue - count)
 				end
-				
-				-- If a tradeskill makes 5 at a time and something asks for 9, we should only 
+
+				-- If a tradeskill makes 5 at a time and something asks for 9, we should only
 				-- craft twice to get 10.
 				data.queue = ceil(data.queue / GetTradeSkillNumMade(i))
-				
+
 				realData[row] = data
+				nameMap[skillName] = row
 				row = row + 1
 			end
 		end
@@ -565,7 +616,16 @@
 end
 
 function ItemAuditor:RefreshCraftingTable()
+	-- If the crafting table hasn't been created/displayed, there is no
+	-- reason to try to update it.
+	if not craftingTable then
+		return
+	end
+	tableData = {}
+	nameMap = {}
 	for key, data in pairs(realData) do
+		nameMap[data.name] = key
+
 		tableData[key] = {
 			data.name,
 			data.cost,
@@ -577,7 +637,7 @@
 		}
 	end
 	craftingTable:SetData(tableData, true)
-	
+
 	if self:GetCraftingRow(1) then
 		btnProcess:Enable()
 	else
--- a/Modules/Frames.lua	Thu Sep 30 17:43:43 2010 -0700
+++ b/Modules/Frames.lua	Sat Oct 02 11:38:22 2010 -0700
@@ -64,6 +64,8 @@
 		
 		displayFrame:AddChild(displayFrame.tab)
 	end
+
+	displayFrame.frame:Raise()
 	
 	if not selectedTab then
 		for key in pairs(tabs) do 
--- a/Modules/QuickAuctions.lua	Thu Sep 30 17:43:43 2010 -0700
+++ b/Modules/QuickAuctions.lua	Sat Oct 02 11:38:22 2010 -0700
@@ -118,7 +118,7 @@
 end
 
 local function isProfitable(data)
-	if ItemAuditor.IsQAEnabled() then
+	if ItemAuditor:IsQACompatible() then
 		local QAGroup = QAAPI:GetItemGroup(data.link)
 		if QAGroup ~= nil then
 			local currentInvested, _, currentCount = ItemAuditor:GetItemCost(data.link)
@@ -157,8 +157,7 @@
 		set = function(info, value)
 			ItemAuditor.db.char.qa_extra = value
 		end,
-		handler = ItemAuditor,
-		disabled = 'IsQACompatible',
+		disabled = function() return not ItemAuditor:IsQACompatible() end,
 		order = 10,
 	},
 }