diff ReAction.lua @ 47:e12b736c23c3

Added Layout Editor
author Flick <flickerstreak@gmail.com>
date Fri, 11 Apr 2008 22:21:28 +0000
parents aa0b7fd68462
children 7b7d178dec52
line wrap: on
line diff
--- a/ReAction.lua	Thu Apr 10 23:27:58 2008 +0000
+++ b/ReAction.lua	Fri Apr 11 22:21:28 2008 +0000
@@ -116,15 +116,12 @@
   SlashHandler = function(option)
     if option == "config" then
       ReAction:ShowConfig()
-    elseif option == "unlock" then
-      ReAction:SetConfigMode(true)
-    elseif option == "lock" then
-      ReAction:SetConfigMode(false)
+    elseif option == "layout" then
+      ReAction:ShowLayout()
     else
       ReAction:Print(("%3.1f.%d"):format(ReAction.version,ReAction.revision))
       ReAction:Print("/reaction config")
-      ReAction:Print("/reaction unlock")
-      ReAction:Print("/reaction lock")
+      ReAction:Print("/reaction layout")
     end
   end
 end
@@ -289,15 +286,16 @@
   local bar, name = SelectBar(x)
   if bar and name and newname then
     if self.bars[newname] then
-      error(L["ReAction: name already in use"])
+      UIErrorsFrame:AddMessage(("%s ('%s')"):format(L["ReAction: name already in use"],newname))
+    else
+      self.bars[newname] = self.bars[name]
+      self.bars[name] = nil
+      bar:SetName(newname or "")
+      local cfg = self.db.profile.bars
+      cfg[newname], cfg[name] = cfg[name], nil
+      self:CallMethodOnAllModules("RenameBarConfig", name, newname)
+      self.callbacks:Fire("OnRenameBar", name, newname)
     end
-    self.bars[newname] = self.bars[name]
-    self.bars[name] = nil
-    bar:SetName(newname or "")
-    local cfg = self.db.profile.bars
-    cfg[newname], cfg[name] = cfg[name], nil
-    self:CallMethodOnAllModules("RenameBarConfig", name, newname)
-    self.callbacks:Fire("OnRenameBar", name, newname)
   end
 end
 
@@ -344,3 +342,6 @@
   self:CallModuleMethod("ConfigUI","OpenConfig")
 end
 
+function ReAction:ShowLayout()
+  self:CallModuleMethod("ConfigUI","LaunchLayoutEditor")
+end