Quantcast

Clique:

James Whitehead II [12-15-06 - 22:32]
Clique:
* Change API to reflect changes to Dongle
Filename
Clique.lua
CliqueOptions.lua
diff --git a/Clique.lua b/Clique.lua
index 95c5929..166f033 100644
--- a/Clique.lua
+++ b/Clique.lua
@@ -4,20 +4,9 @@

 Clique = {Locals = {}}

-DongleStub("Dongle"):New(Clique, "Clique")
+DongleStub("Dongle"):New("Clique", Clique)

 local L = Clique.Locals
--- Create a frame for event registration
-local eventFrame = CreateFrame("Frame")
-local elapsed = 0
-eventFrame:SetScript("OnUpdate", function()
-	elapsed = elapsed + arg1
-	if elapsed >= 2.0 then
-		elapsed = 0
-		Clique:ClearQueue()
-	end
-end)
-eventFrame:Hide()

 function Clique:Enable()
 	-- Grab the localisation header
@@ -249,7 +238,7 @@ function Clique:RegisterFrame(frame)
 	if frame:GetAttribute("Clique-test") then
 		frame:SetAttribute("Clique-test", nil)
 	else
-		self:Print("Cannot register frame %s", tostring(name))
+		self:PrintF("Cannot register frame %s", tostring(name))
 	end

 	if self.profile.blacklist[name] then
@@ -321,7 +310,7 @@ end

 function Clique:DONGLE_PROFILE_CHANGED(event, addon, svname, name)
 	if addon == "Clique" then
-		self:Print(L.PROFILE_CHANGED, name)
+		self:PrintF(L.PROFILE_CHANGED, name)
 		for name,set in pairs(self.clicksets) do
 			for modifier,entry in pairs(set) do
 				self:DeleteAction(entry)
@@ -346,7 +335,7 @@ end

 function Clique:DONGLE_PROFILE_DELETED(event, addon, svname, name)
 	if addon == "Clique" then
-		self:Print(L.PROFILE_DELETED, name)
+		self:PrintF(L.PROFILE_DELETED, name)

 		self.textlistSelected = nil
 		self:TextListScrollUpdate()
diff --git a/CliqueOptions.lua b/CliqueOptions.lua
index 776d9aa..b982a2a 100644
--- a/CliqueOptions.lua
+++ b/CliqueOptions.lua
@@ -1146,7 +1146,7 @@ function Clique:ButtonOnClick(button)
 	    local offset = FauxScrollFrame_GetOffset(CliqueTextListScroll)
 		local selected = self.textlistSelected - offset
 		local button = getglobal("CliqueTextList"..selected)
-		self:DeleteProfile(button.name:GetText())
+		self.db:DeleteProfile(button.name:GetText())
 	elseif this == CliqueButtonEdit then
 		-- Make a copy of the entry
 		self.customEntry = {}
@@ -1567,7 +1567,7 @@ StaticPopupDialogs["CLIQUE_DELETE_PROFILE"] = {
 	button1 = TEXT(OKAY),
 	button2 = TEXT(CANCEL),
 	OnAccept = function()
-		Clique:DeleteProfile(getglobal(this:GetName().."EditBox"):GetText())
+		Clique.db:DeleteProfile(getglobal(this:GetName().."EditBox"):GetText())
 		Clique:DropDownProfile_OnShow()
 	end,
 	timeout = 0,
@@ -1589,7 +1589,7 @@ StaticPopupDialogs["CLIQUE_DELETE_PROFILE"] = {
 	end,
 	EditBoxOnEnterPressed = function()
 		if ( getglobal(this:GetParent():GetName().."Button1"):IsEnabled() == 1 ) then
-			Clique:DeleteProfile(this:GetText())
+			Clique.db:DeleteProfile(this:GetText())
 			Clique:DropDownProfile_OnShow()
 			this:GetParent():Hide();
 		end