Quantcast

Ensure attributed are updated when settings change.

James Whitehead II [10-13-10 - 16:25]
Ensure attributed are updated when settings change.

This fixes a bug where changign a binding via the menu did not update
the actual bindings that were set on frames
Filename
BindConfig.lua
Clique.lua
diff --git a/BindConfig.lua b/BindConfig.lua
index 008ba5b..fd79c1a 100755
--- a/BindConfig.lua
+++ b/BindConfig.lua
@@ -407,7 +407,10 @@ function CliqueConfig:AcceptSetBinding()
         -- This was a CHANGE binding instead of a SET binding
         dialog.binding.key = key
         dialog.binding = nil
+        -- Do not forget to update the attributes as well
         self:UpdateList()
+        addon:UpdateAttributes()
+        addon:UpdateGlobalAttributes()
     else
         local succ, err = addon:AddBinding{
             key = key,
@@ -430,8 +433,9 @@ local function toggleSet(binding, set)
         else
             binding.sets[set] = true
         end
-        addon:UpdateAttributes()
         CliqueConfig:UpdateList()
+        addon:UpdateAttributes()
+        addon:UpdateGlobalAttributes()
     end
 end

diff --git a/Clique.lua b/Clique.lua
index a3d8ed9..93c1ad7 100755
--- a/Clique.lua
+++ b/Clique.lua
@@ -422,6 +422,7 @@ function addon:AddBinding(entry)
     table.insert(self.bindings, entry)

     self:UpdateAttributes()
+
     return true
 end

@@ -455,6 +456,7 @@ function addon:DeleteBinding(entry)

     -- Update the attributes
     self:UpdateAttributes()
+    self:UpdateGlobalAttributes()
 end

 function addon:ClearAttributes()