Fixed delete on an unsaved page
Cogwheel-17646 [05-09-08 - 22:14]
Fixed delete on an unsaved page
diff --git a/WowLua.lua b/WowLua.lua
index 786acd1..6d329b2 100644
--- a/WowLua.lua
+++ b/WowLua.lua
@@ -397,8 +397,14 @@ function WowLua:Button_Undo(button)
end
function WowLua:Button_Delete(button)
+ if self:IsModified() then
+ -- Display the unsaved changes dialog
+ local dialog = StaticPopup_Show("WOWLUA_UNSAVED")
+ dialog.data = "Button_Delete"
+ return
+ end
+
local page, entry = self:GetCurrentPage()
-
if self:GetNumPages() == 1 then
self:Button_New()
self:Button_Previous()