From bbe4a54e88911a498e3a626caa7f73aa600aef78 Mon Sep 17 00:00:00 2001 From: ackis Date: Tue, 21 Apr 2009 17:04:40 +0000 Subject: [PATCH] Fix issue when search provides no results (Ticket 495) --- ARLFrame.lua | 23 ++++++++++++----------- Locals/testdeDE.lua | 1 + Locals/testenUS.lua | 1 + Locals/testesMX.lua | 1 + 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/ARLFrame.lua b/ARLFrame.lua index 9b932f2..6225c4d 100644 --- a/ARLFrame.lua +++ b/ARLFrame.lua @@ -192,6 +192,15 @@ StaticPopupDialogs["ARL_ALLEXCLUDED"] = { hideOnEscape = 1 } +StaticPopupDialogs["ARL_SEARCHFILTERED"] = { + text = L["ARL_SEARCHFILTERED"], + button1 = L["Ok"], + timeout = 0, + exclusive = 1, + whileDead = 1, + hideOnEscape = 1 +} + -- Description: function addon:CloseWindow() @@ -1176,6 +1185,9 @@ local function RecipeList_Update() if (showpopup == true) then StaticPopup_Show("ARL_ALLEXCLUDED") end + -- We have some search text that is preventing stuff from being displayed + elseif (ARL_SearchText:GetText() ~= "") then + else addon:Print(L["NO_DISPLAY"]) addon:Print("DEBUG: recipes_total check for 0") @@ -3618,12 +3630,10 @@ function addon:CreateFrame( ARL_SearchButton:Disable() ARL_SearchButton:SetScript("OnClick", function(this) - local searchtext = ARL_SearchText:GetText() searchtext = searchtext:trim() if (searchtext ~= "") then - ARL_LastSearchedText = searchtext addon:SearchRecipeDB(recipeDB, searchtext) @@ -3632,9 +3642,7 @@ function addon:CreateFrame( ARL_SearchButton:SetNormalFontObject("GameFontDisableSmall") ARL_SearchButton:Disable() - end - end ) @@ -3643,7 +3651,6 @@ function addon:CreateFrame( "GameFontHighlightSmall", "", "CENTER", L["CLEAR_DESC"], 3) ARL_ClearButton:SetScript("OnClick", function() - addon:ResetSearch(recipeDB) ARL_SearchText:SetText(L["SEARCH_BOX_DESC"]) @@ -3663,19 +3670,15 @@ function addon:CreateFrame( initDisplayStrings() RecipeList_Update() - end ) ARL_SearchText = CreateFrame("EditBox", "ARL_SearchText", addon.Frame, "InputBoxTemplate") ARL_SearchText:SetText(L["SEARCH_BOX_DESC"]) ARL_SearchText:SetScript("OnEnterPressed", function(this) - local searchtext = ARL_SearchText:GetText() searchtext = searchtext:trim() - if (searchtext ~= "") and (searchtext ~= L["SEARCH_BOX_DESC"]) then - ARL_LastSearchedText = searchtext addon:SearchRecipeDB(recipeDB, searchtext) @@ -3684,9 +3687,7 @@ function addon:CreateFrame( ARL_SearchButton:SetNormalFontObject("GameFontDisableSmall") ARL_SearchButton:Disable() - end - end ) ARL_SearchText:SetScript("OnEditFocusGained", diff --git a/Locals/testdeDE.lua b/Locals/testdeDE.lua index 9d8606a..342f8a1 100644 --- a/Locals/testdeDE.lua +++ b/Locals/testdeDE.lua @@ -1632,3 +1632,4 @@ L["Joseph Wilson"] = true L["Oluros"] = true L["Rekka the Hammer"] = true L["Arthur Denny"] = true +L["ARL_SEARCHFILTERED"] = "Your search has no results." diff --git a/Locals/testenUS.lua b/Locals/testenUS.lua index 6a6170c..f009fc0 100644 --- a/Locals/testenUS.lua +++ b/Locals/testenUS.lua @@ -383,6 +383,7 @@ L["NOTSCANNED"] = "You have not yet scanned this profession. Please open this p L["ALL_FILTERED"] = "Although you have already scanned this profession, your filters are currently preventing any recipes from being displayed. Please change your filters and try again." L["ARL_ALLKNOWN"] = "You know all the recipes for this profession." L["ARL_ALLEXCLUDED"] = "Although you have already scanned this profession, your exclusions are currently preventing any recipes from being displayed. Please change your exclusions and try again." +L["ARL_SEARCHFILTERED"] = "Your search has no results." L["NO_DISPLAY"] = "No recipes to display. If you get this message please submit a ticket at http://www.wowace.com/projects/arl/tickets listing what filters you have, what is in your exclusion list, which profession, and the number of known/unknown recipes." -- Error/warning Text diff --git a/Locals/testesMX.lua b/Locals/testesMX.lua index 3a6c17f..1d78f4a 100644 --- a/Locals/testesMX.lua +++ b/Locals/testesMX.lua @@ -1614,3 +1614,4 @@ L["Joseph Wilson"] = true L["Oluros"] = true L["Rekka the Hammer"] = true L["Arthur Denny"] = true +L["ARL_SEARCHFILTERED"] = "Your search has no results." -- 1.7.9.5