Quantcast

Different name on button icon is now clickable again

Ahmil Jilani [10-16-14 - 22:12]
Different name on button icon is now clickable again
Filename
SuperDuperMacro/SuperDuperMacro_Frames.lua
SuperDuperMacro/SuperDuperMacro_Interface.lua
diff --git a/SuperDuperMacro/SuperDuperMacro_Frames.lua b/SuperDuperMacro/SuperDuperMacro_Frames.lua
index e8add7e..8fb03ba 100644
--- a/SuperDuperMacro/SuperDuperMacro_Frames.lua
+++ b/SuperDuperMacro/SuperDuperMacro_Frames.lua
@@ -133,7 +133,13 @@ f:SetText("Change Name/Icon")
 f:SetWidth(140)
 f:SetHeight(22)
 f:SetPoint("RIGHT", sdm_usageButton, "LEFT")
-f:SetScript("OnClick", function() sdm_changeIconFrame:Show() end)
+f:SetScript("OnClick", function()
+	if MacroPopupFrame ~= nil and MacroPopupFrame:IsShown() then
+		print(sdm_printPrefix.."The change macro name/icon frame is already open.")
+	else
+		sdm_changeIconFrame:Show()
+	end
+end)
 sdm_AddToExclusiveGroup(f, "centerwindows", true)

 f = CreateFrame("Button", "sdm_saveAsButton", sdm_mainFrame, "UIPanelButtonTemplate")
diff --git a/SuperDuperMacro/SuperDuperMacro_Interface.lua b/SuperDuperMacro/SuperDuperMacro_Interface.lua
index 5a93080..7727c77 100644
--- a/SuperDuperMacro/SuperDuperMacro_Interface.lua
+++ b/SuperDuperMacro/SuperDuperMacro_Interface.lua
@@ -628,7 +628,8 @@ function sdm_OnShow_changeIconFrame(f)
 		f.prevpoints[i]={MacroPopupFrame:GetPoint(i)}
 	end
 	MacroPopupFrame:ClearAllPoints()
-	--MacroPopupFrame:SetParent(f)
+	f.prevParent = MacroPopupFrame:GetParent()
+	MacroPopupFrame:SetParent(f)
 	MacroPopupFrame:SetPoint("TOP", f, "BOTTOM", 0,15)
 	MacroPopupFrame:Show()
 	_,_,_,_,f.fontstring = MacroPopupFrame:GetRegions()
@@ -661,7 +662,7 @@ function sdm_OnHide_changeIconFrame(f)
 	MacroPopupEditBox:SetAutoFocus(true)
 	MacroPopupFrame.mode=f.prevmode
 	MacroPopupFrame:ClearAllPoints()
-	--MacroPopupFrame:SetParent(UIParent)
+	MacroPopupFrame:SetParent(f.prevParent)
 	for _,point in ipairs(f.prevpoints) do
 		MacroPopupFrame:SetPoint(point[1], point[2], point[3], point[4], point[5])
 	end