# HG changeset patch # User Zerotorescue # Date 1285969264 -7200 # Node ID 981c6ac45a3f790dbd837b6a6c0880a0c30c7c29 # Parent 91fe61693247d141c70a57b19f2cc357754c2e7f Mail opening will now be interrupted when middle or alt-clicking the open all button. diff -r 91fe61693247 -r 981c6ac45a3f Modules/OpenAll.lua --- a/Modules/OpenAll.lua Fri Oct 01 23:39:44 2010 +0200 +++ b/Modules/OpenAll.lua Fri Oct 01 23:41:04 2010 +0200 @@ -46,9 +46,16 @@ button:SetHeight(26); button:SetWidth(120); button:SetPoint("BOTTOM", InboxFrame, "CENTER", -10, -165); - button:RegisterForClicks("LeftButtonUp", "RightButtonUp"); + button:RegisterForClicks("LeftButtonUp", "RightButtonUp", "MiddleButtonUp"); button:SetScript("OnClick", function(self, mouseButton) + local action = "open"; if mouseButton == "RightButton" then + action = "menu"; + elseif mouseButton == "MiddleButton" or (mouseButton == "LeftButton" and IsAltKeyDown()) then + action = "stop"; + end + + if action == "menu" then -- Hide the gametooltip GameTooltip:Hide(); @@ -118,7 +125,7 @@ info.checked = mod.db.profile.filter.normalMoney; UIDropDownMenu_AddButton(info, level); - -- Make Other mail with gold + -- Close link info.text = CLOSE; info.func = function() CloseDropDownMenus(); end; info.checked = nil; @@ -133,12 +140,16 @@ end ToggleDropDownMenu(1, nil, mod.ddmFilters, self:GetName(), 0, 0); + elseif action == "stop" then + MailOpener:Print(L["Interrupting mail opening as the alt key was held down while clicking the open all button or the middle mouse-button was used on it."]); + + mod:StopOpening(true); else mod:Open(true, IsShiftKeyDown()); end end); button.tooltipTitle = L["Open all"]; - button.tooltip = L["Hold |cfffed000shift|r while clicking this button to temporarily override your filters and loot every single mail containing attachments and/or gold.\n\n|cfffed000Right|r click this button to quickly adjust mail opening filters for this profile."]; + button.tooltip = L["Hold |cfffed000shift|r while clicking this button to temporarily override your filters and loot every single mail containing attachments and/or gold.\n\n|cfffed000Right|r click this button to quickly adjust mail opening filters for this profile.\n\n|cfffed000Middle|r click or hold |cfffed000alt|r while clicking this button to interrupt mail opening."]; button:SetScript("OnEnter", function(self) if MailOpener.db.profile.general.showHelpTooltips then GameTooltip:SetOwner(self, "ANCHOR_NONE") @@ -271,6 +282,7 @@ self:RegisterMessage("MO_OPEN_MAIL", "Open"); self:RegisterMessage("MO_SERVER_SYNCED"); self:RegisterMessage("MO_MAIL_EMPTIED"); + self:RegisterMessage("MO_STOP_MAIL_OPENING"); self:CancelTimer(self.tmrTimeRemaining, true); self.tmrTimeRemaining = self:ScheduleRepeatingTimer("UpdateTimer", 1); @@ -292,6 +304,7 @@ self:UnregisterMessage("MO_OPEN_MAIL"); self:UnregisterMessage("MO_SERVER_SYNCED"); self:UnregisterMessage("MO_MAIL_EMPTIED"); + self:UnregisterMessage("MO_STOP_MAIL_OPENING"); self:CancelTimer(self.tmrMailOpener, true); self:CancelTimer(self.tmrTimeRemaining, true); @@ -320,6 +333,10 @@ self:UpdateTimer(); end +function mod:MO_STOP_MAIL_OPENING() + self:StopOpening(true); +end + function mod:UpdateMailCount() local numItems, totalItems = GetInboxNumItems();