# HG changeset patch # User James D. Callahan III # Date 1363722710 18000 # Node ID 03f1fbe6410490251b8a3dde883a507a78e8a44b # Parent 7f5982e01953addc99101e71bbd8ffee1777f295 The Submit button now attaches comments to the appropriate DB entries. diff -r 7f5982e01953 -r 03f1fbe64104 Comments.lua --- a/Comments.lua Tue Mar 19 12:54:21 2013 -0500 +++ b/Comments.lua Tue Mar 19 14:51:50 2013 -0500 @@ -14,6 +14,7 @@ local ParseGUID = private.ParseGUID local ItemLinkToID = private.ItemLinkToID +local DBEntry = private.DBEntry -- CONSTANTS ---------------------------------------------------------- @@ -257,7 +258,15 @@ submit:Enable(false) submit:SetScript("OnClick", function() - -- TODO: Make this assign the comment to the correct SavedVariables entry. + local entry = DBEntry(URL_TYPE_MAP[comment_subject.type_name], comment_subject.id) + + if not entry then + WDP:Print("An error has occurred; please report at http://wow.curseforge.com/addons/wowdb-profiler/create-ticket/") + return + end + entry.comments = entry.comments or {} + entry.comments[#entry.comments + 1] = edit_box:GetText() + edit_box:SetText("") _G.HideUIPanel(panel) end) diff -r 7f5982e01953 -r 03f1fbe64104 Main.lua --- a/Main.lua Tue Mar 19 12:54:21 2013 -0500 +++ b/Main.lua Tue Mar 19 14:51:50 2013 -0500 @@ -299,6 +299,7 @@ end return unit end +private.DBEntry = DBEntry local NPCEntry do @@ -778,6 +779,7 @@ local _, item_link = _G.GetItemInfo(identifier) HandleItemUse(item_link) end) + self:SetCurrentAreaID("OnEnable") self:GROUP_ROSTER_CHANGE() end