<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>tekKonfig/tekKonfigTopTab.lua</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,12 +1,14 @@
 
-local NUMROWS, NUMCOLS, ICONSIZE, ICONGAP, GAP, EDGEGAP = 6, 10, 32, 3, 8, 16
+local NUMROWS, NUMCOLS, ICONSIZE, ICONGAP, GAP, EDGEGAP = 5, 10, 32, 3, 8, 16
 local tekcheck = LibStub(&quot;tekKonfig-Checkbox&quot;)
-local rows, offset, scrollbar = {}, 0
+local rows, offset, scrollbar, tradeview, grouptext = {}, 0
+local normaltext, tradetext = &quot;These items are only restocked if you are NOT carrying a tradeskill bag.  They will also restock from the bank.&quot;, &quot;These items are only restocked if you are carrying a tradeskill bag.  Bank restocking will not take place.&quot;
 
 
 local frame = CreateFrame(&quot;Frame&quot;, &quot;StealYourCarbonConfig&quot;, InterfaceOptionsFramePanelContainer)
 frame.name = &quot;Steal Your Carbon&quot;
 frame:SetScript(&quot;OnShow&quot;, function(frame)
+	local tektab = LibStub(&quot;tekKonfig-TopTab&quot;)
 	local StealYourCarbon = StealYourCarbon
 	local title, subtitle = LibStub(&quot;tekKonfig-Heading&quot;).new(frame, &quot;Steal Your Carbon&quot;, &quot;To add an item drop it in the frame below or type '/carbon add [Item Link] 20'.  Shift-click to add/remove a full satck.  Set the quantity to 0 to remove the item.&quot;)
 
@@ -31,18 +33,44 @@ frame:SetScript(&quot;OnShow&quot;, function(frame)
 	upgradewater:SetChecked(StealYourCarbon.db.upgradewater)
 
 
-	local group = LibStub(&quot;tekKonfig-Group&quot;).new(frame, &quot;Restock Items&quot;, &quot;TOP&quot;, upgradewater, &quot;BOTTOM&quot;, 0, -EDGEGAP)
+	local group = LibStub(&quot;tekKonfig-Group&quot;).new(frame, nil, &quot;TOP&quot;, upgradewater, &quot;BOTTOM&quot;, 0, -EDGEGAP-GAP)
 	group:SetPoint(&quot;LEFT&quot;, EDGEGAP, 0)
 	group:SetPoint(&quot;BOTTOMRIGHT&quot;, -EDGEGAP, EDGEGAP)
 
+	local tab1 = tektab.new(frame, &quot;Normal&quot;, &quot;BOTTOMLEFT&quot;, group, &quot;TOPLEFT&quot;, 0, -4)
+	local tab2 = tektab.new(frame, &quot;Tradeskill&quot;, &quot;LEFT&quot;, tab1, &quot;RIGHT&quot;, -15, 0)
+	tab2:Deactivate()
+	tab1:SetScript(&quot;OnClick&quot;, function(self)
+		self:Activate()
+		tab2:Deactivate()
+		tradeview = false
+		StealYourCarbon:UpdateConfigList()
+	end)
+	tab2:SetScript(&quot;OnClick&quot;, function(self)
+		self:Activate()
+		tab1:Deactivate()
+		tradeview = true
+		StealYourCarbon:UpdateConfigList()
+	end)
+
+	grouptext = group:CreateFontString(nil, &quot;ARTWORK&quot;, &quot;GameFontHighlightSmall&quot;)
+	grouptext:SetHeight(32)
+	grouptext:SetPoint(&quot;TOPLEFT&quot;, group, &quot;TOPLEFT&quot;, EDGEGAP, -EDGEGAP)
+	grouptext:SetPoint(&quot;RIGHT&quot;, group, -EDGEGAP-16, 0)
+	grouptext:SetNonSpaceWrap(true)
+	grouptext:SetJustifyH(&quot;LEFT&quot;)
+	grouptext:SetJustifyV(&quot;TOP&quot;)
+	grouptext:SetText(normaltext)
+
 
 	local function OnReceiveDrag()
 		local infotype, itemid, itemlink = GetCursorInfo()
-		if infotype == &quot;item&quot; then StealYourCarbon.db.stocklist[itemid] = select(8, GetItemInfo(itemid))
+		local stocklist = tradeview and StealYourCarbon.db.tradestocklist or StealYourCarbon.db.stocklist
+		if infotype == &quot;item&quot; then stocklist[itemid] = select(8, GetItemInfo(itemid))
 		elseif infotype == &quot;merchant&quot; then
 			local itemlink = GetMerchantItemLink(itemid)
 			itemid = tonumber(itemlink:match(&quot;item:(%d+):&quot;))
-			StealYourCarbon.db.stocklist[itemid] = select(8, GetItemInfo(itemid))
+			stocklist[itemid] = select(8, GetItemInfo(itemid))
 		end
 		StealYourCarbon:UpdateConfigList()
 		return ClearCursor()
@@ -50,12 +78,13 @@ frame:SetScript(&quot;OnShow&quot;, function(frame)
 	local function OnClick(self)
 		PlaySound(&quot;UChatScrollButton&quot;)
 		local diff = (self.up and 1 or -1) * (IsShiftKeyDown() and select(8, GetItemInfo(self.row.id)) or 1)
-		StealYourCarbon.db.stocklist[self.row.id] = StealYourCarbon.db.stocklist[self.row.id] + (diff)
-		if StealYourCarbon.db.stocklist[self.row.id] &lt;= 0 then
-			StealYourCarbon.db.stocklist[self.row.id] = 0
+		local stocklist = tradeview and StealYourCarbon.db.tradestocklist or StealYourCarbon.db.stocklist
+		stocklist[self.row.id] = stocklist[self.row.id] + (diff)
+		if stocklist[self.row.id] &lt;= 0 then
+			stocklist[self.row.id] = 0
 			self.row.down:Disable()
 		else self.row.down:Enable() end
-		self.row.count:SetText(StealYourCarbon.db.stocklist[self.row.id])
+		self.row.count:SetText(stocklist[self.row.id])
 	end
 	local function OnClick2() if CursorHasItem() then OnReceiveDrag() end end
 	local function ShowTooltip(self)
@@ -67,7 +96,7 @@ frame:SetScript(&quot;OnShow&quot;, function(frame)
 	local function HideTooltip() GameTooltip:Hide() end
 	for i=1,NUMROWS*2 do
 		local row = CreateFrame(&quot;Frame&quot;, nil, group)
-		if i == 1 then row:SetPoint(&quot;TOP&quot;, group, 0, -EDGEGAP)
+		if i == 1 then row:SetPoint(&quot;TOP&quot;, grouptext, &quot;BOTTOM&quot;, 0, -GAP/2)
 		elseif i%2 == 0 then row:SetPoint(&quot;TOP&quot;, rows[i-1], &quot;TOP&quot;)
 		else row:SetPoint(&quot;TOP&quot;, rows[i-1], &quot;BOTTOM&quot;, 0, -6) end
 		if i%2 == 1 then
@@ -151,21 +180,26 @@ frame:SetScript(&quot;OnShow&quot;, function(frame)
 	frame:EnableMouseWheel()
 	frame:SetScript(&quot;OnMouseWheel&quot;, function(self, val) scrollbar:SetValue(scrollbar:GetValue() - val) end)
 	frame:SetScript(&quot;OnShow&quot;, function() StealYourCarbon:UpdateConfigList() end)
-	frame:SetScript(&quot;OnHide&quot;, function() for i,v in pairs(StealYourCarbon.db.stocklist) do if v == 0 then StealYourCarbon.db.stocklist[i] = nil end end end)
+	frame:SetScript(&quot;OnHide&quot;, function()
+		local stocklist = tradeview and StealYourCarbon.db.tradestocklist or StealYourCarbon.db.stocklist
+		for i,v in pairs(stocklist) do if v == 0 then stocklist[i] = nil end end
+	end)
 	StealYourCarbon:UpdateConfigList()
 	scrollbar:SetValue(0)
 end)
 
 
 function StealYourCarbon:UpdateConfigList()
+	grouptext:SetText(tradeview and tradetext or normaltext)
 	local items = 0
-	for i in pairs(StealYourCarbon.db.stocklist) do items = items + 1 end
+	local stocklist = tradeview and StealYourCarbon.db.tradestocklist or StealYourCarbon.db.stocklist
+	for i in pairs(stocklist) do items = items + 1 end
 	local maxoffset = math.ceil((items - NUMROWS*2 + 1)/2)
 	scrollbar:SetMinMaxValues(0, math.max(maxoffset, 0))
 
 	local emptyshown = false
-	local id, qty = next(self.db.stocklist)
-	for i=1,offset do id, qty = next(self.db.stocklist, id) end
+	local id, qty = next(stocklist)
+	for i=1,offset do id, qty = next(stocklist, id) end
 
 
 	for _,row in ipairs(rows) do
@@ -181,7 +215,7 @@ function StealYourCarbon:UpdateConfigList()
 			row.stack:SetText(&quot;Stack Size: &quot;..(stack or &quot;???&quot;))
 			row.icon:Show()
 			row:Show()
-			id, qty = next(self.db.stocklist, id)
+			id, qty = next(stocklist, id)
 		elseif not emptyshown then
 			emptyshown = true
 			row.id = nil</diff>
      <filename>Config.lua</filename>
    </modified>
    <modified>
      <diff>@@ -99,6 +99,7 @@ function StealYourCarbon:ADDON_LOADED(event, addon)
 	if addon:lower() ~= &quot;stealyourcarbon&quot; then return end
 
 	StealYourCarbonDB = StealYourCarbonDB or {stocklist = {}}
+	StealYourCarbonDB.tradestocklist = StealYourCarbonDB.tradestocklist or {}
 	self.db = StealYourCarbonDB
 
 	self:UnregisterEvent(&quot;ADDON_LOADED&quot;)
@@ -120,14 +121,28 @@ local function GS(cash)
 end
 
 
+local tradebags = {
+	[8] = true, -- Leatherworking
+	[16] = true, -- Inscription
+	[32] = true, -- Herb
+	[128] = true, -- Engineering
+}
+local function HasTradeskillBag()
+	for i=1,4 do
+		if tradebags[select(2, GetContainerNumFreeSlots(i))] then return true end
+	end
+end
+
+
 function StealYourCarbon:MERCHANT_SHOW()
-	if self.db.upgradewater then self:UpgradeWater() end
-	local spent = 0
+	local hastradebag = HasTradeskillBag()
+	if self.db.upgradewater and not hastradebag then self:UpgradeWater() end
+	local spent, stocklist = 0, hastradebag and self.db.tradestocklist or self.db.stocklist
 	for i=1,GetMerchantNumItems() do
 		local link = GetMerchantItemLink(i)
 		local itemID = link and ids[link]
-		if itemID and self.db.stocklist[itemID] then
-			local needed = self.db.stocklist[itemID] - GetItemCount(itemID)
+		if itemID and stocklist[itemID] then
+			local needed = stocklist[itemID] - GetItemCount(itemID)
 			if needed &gt; 0 then
 				local _, _, price, qty, avail = GetMerchantItemInfo(i)
 				local tobuy = avail &gt; 0 and avail &lt; needed and avail or needed
@@ -179,6 +194,7 @@ end
 
 
 function StealYourCarbon:BANKFRAME_OPENED()
+	if HasTradeskillBag() then return end
 	for id,num in pairs(self.db.stocklist) do
 		local inbag = GetItemCount(id)
 		if inbag &lt; num and GetItemCount(id, true) &gt; inbag then SwapFromBank(id, inbag ~= 0) end</diff>
      <filename>StealYourCarbon.lua</filename>
    </modified>
    <modified>
      <diff>@@ -9,4 +9,5 @@
 	&lt;Script file=&quot;tekKonfigDropdown.lua&quot;/&gt;
 	&lt;Script file=&quot;tekKonfigAboutPanel.lua&quot;/&gt;
 	&lt;Script file=&quot;tekKonfigGroup.lua&quot;/&gt;
+	&lt;Script file=&quot;tekKonfigTopTab.lua&quot;/&gt;
 &lt;/Ui&gt;</diff>
      <filename>tekKonfig/tekKonfig.xml</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5bcf7665c4df75ef29034fdb8df50923de55d140</id>
    </parent>
  </parents>
  <author>
    <name>Tekkub</name>
    <email>tekkub@gmail.com</email>
  </author>
  <url>http://github.com/tekkub/stealyourcarbon/commit/3c5a4fa418c9e03adc91d1999390d88043bd1500</url>
  <id>3c5a4fa418c9e03adc91d1999390d88043bd1500</id>
  <committed-date>2008-11-26T14:33:42-08:00</committed-date>
  <authored-date>2008-11-26T14:33:42-08:00</authored-date>
  <message>Add tradeskill bag restocking

Will pull in items from the tradeskill list only if you're carrying a leatherworking, engineering, herb or inscription bag
Will NOT pull items for the normal list when you have one of these bags equipped
Also will not pull from bank</message>
  <tree>edbd84f804997b2a3a7f1ebee36940c21f8aba86</tree>
  <committer>
    <name>Tekkub</name>
    <email>tekkub@gmail.com</email>
  </committer>
</commit>
