Mercurial > wow > mailopener
comparison Modules/Config.lua @ 68:eadff31e61e8
Localization of all files. Testing packager settings (especially automatic locale exports), localization is not yet finished.
| author | Zerotorescue |
|---|---|
| date | Wed, 15 Sep 2010 13:10:56 +0200 |
| parents | 4166a335ca81 |
| children | f01e0184a275 |
comparison
equal
deleted
inserted
replaced
| 67:4166a335ca81 | 68:eadff31e61e8 |
|---|---|
| 1 local MailOpener = LibStub("AceAddon-3.0"):GetAddon("MailOpener"); | 1 local MailOpener = LibStub("AceAddon-3.0"):GetAddon("MailOpener"); |
| 2 local mod = MailOpener:NewModule("Config", "AceEvent-3.0", "AceTimer-3.0"); | 2 local mod = MailOpener:NewModule("Config", "AceEvent-3.0", "AceTimer-3.0"); |
| 3 | 3 |
| 4 mod.moduleDescription = "Builds and loads the config frame(s) and handles the slash commands. Automatically loaded when needed."; | 4 mod.moduleDescription = L["Builds and loads the config frame(s) and handles the slash commands. Automatically loaded when needed."]; |
| 5 mod.moduleRequired = false; | 5 mod.moduleRequired = false; |
| 6 | 6 |
| 7 local Media = LibStub("LibSharedMedia-3.0"); | 7 local Media = LibStub("LibSharedMedia-3.0"); |
| 8 Media:Register("sound", "Cartoon FX", [[Sound\Doodad\Goblin_Lottery_Open03.wav]]); | 8 Media:Register("sound", "Cartoon FX", [[Sound\Doodad\Goblin_Lottery_Open03.wav]]); |
| 9 Media:Register("sound", "Cheer", [[Sound\Event Sounds\OgreEventCheerUnique.wav]]); | 9 Media:Register("sound", "Cheer", [[Sound\Event Sounds\OgreEventCheerUnique.wav]]); |
| 28 function mod:OnEnable() | 28 function mod:OnEnable() |
| 29 MailOpener:Debug("Enabling |cff00ffffConfig|r module."); | 29 MailOpener:Debug("Enabling |cff00ffffConfig|r module."); |
| 30 | 30 |
| 31 if MailOpener.db.global.currentTip == -1 and MailOpener.db.profile.general.continueOpening == false then | 31 if MailOpener.db.global.currentTip == -1 and MailOpener.db.profile.general.continueOpening == false then |
| 32 StaticPopupDialogs["MailOpenerFirstConfigUseConfirmBox"] = { | 32 StaticPopupDialogs["MailOpenerFirstConfigUseConfirmBox"] = { |
| 33 text = "Do you wish to enable \"continue opening mail\"? Read the tip at the bottom of the \"General\" config for more information.", | 33 text = L["Do you wish to enable \"continue opening mail\"? Read the tip at the bottom of the \"General\" config for more information."], |
| 34 button1 = "Yes", | 34 button1 = L["Yes"], |
| 35 button2 = "No", | 35 button2 = L["No"], |
| 36 OnAccept = function() | 36 OnAccept = function() |
| 37 MailOpener.db.profile.general.continueOpening = true; | 37 MailOpener.db.profile.general.continueOpening = true; |
| 38 | 38 |
| 39 print("|cff15ff00Mail Opener|r: Enabling the functionality. Remember you can always change this setting in the \"Open All\" config (|cff00ffff/mo c|r)."); | 39 MailOpener:Print(L["Enabling the functionality. Remember you can always change this setting in the \"Open All\" config (|cff00ffff/mo c|r)."]); |
| 40 end, | 40 end, |
| 41 OnCancel = function (_,reason) | 41 OnCancel = function (_,reason) |
| 42 print("|cff15ff00Mail Opener|r: You can always change this setting in the \"Open All\" config (|cff00ffff/mo c|r)."); | 42 MailOpener:Print(L["You can always change this setting in the \"Open All\" config (|cff00ffff/mo c|r)."]); |
| 43 end, | 43 end, |
| 44 timeout = 0, | 44 timeout = 0, |
| 45 whileDead = 1, | 45 whileDead = 1, |
| 46 hideOnEscape = 1, | 46 hideOnEscape = 1, |
| 47 }; | 47 }; |
| 60 -- Then we erase tips that are irrelevant to us | 60 -- Then we erase tips that are irrelevant to us |
| 61 -- and finally the table will be replaced with the currently selected tip | 61 -- and finally the table will be replaced with the currently selected tip |
| 62 | 62 |
| 63 -- Can't put this in the abive scope as the ADDONEnable vars would then always be empty | 63 -- Can't put this in the abive scope as the ADDONEnable vars would then always be empty |
| 64 tip = { | 64 tip = { |
| 65 "To make Mail Opener automatically continue the opening of a batch of mail that had previously been interupted, you will have to tick the \"|cfffed000Continue opening mail|r\"-box at the \"|cfffed000Open All|r\" config. By default Mail Opener will always automatically start opening mail right after a server refresh, but you will have to manually resume mail opening if it gets interupted (e.g. because you closed the mailbox or because your bags were full).", | 65 L["To make Mail Opener automatically continue the opening of a batch of mail that had previously been interrupted, you will have to tick the \"|cfffed000Continue opening mail|r\"-box at the \"|cfffed000Open All|r\" config. By default Mail Opener will always automatically start opening mail right after a server refresh, but you will have to manually resume mail opening if it gets interrupted (e.g. because you closed the mailbox or because your bags were full)."], |
| 66 "You can |cfffed000shift-click|r a mail icon to loot all attachments from that single mail.", | 66 L["You can |cfffed000shift-click|r a mail icon to loot all attachments from that single mail."], |
| 67 { | 67 { |
| 68 txt = "|cfffed000Postal|r allows you to return mail by |cfffed000alt-clicking|r the mail icon.", | 68 txt = L["|cfffed000Postal|r allows you to return mail by |cfffed000alt-clicking|r the mail icon."], |
| 69 shown = (MailOpener.PostalEnabled), | 69 shown = (MailOpener.PostalEnabled), |
| 70 }, | 70 }, |
| 71 { | 71 { |
| 72 txt = "|cfffed000Mail Opener|r is not meant to be a full replacement of |cfffed000Postal|r, it will only handle the opening of your mail and you can run both addons simultaneously.", | 72 txt = L["|cfffed000Mail Opener|r is not meant to be a full replacement of |cfffed000Postal|r, it will only handle the opening of your mail and you can run both addons simultaneously."], |
| 73 shown = (MailOpener.PostalEnabled), | 73 shown = (MailOpener.PostalEnabled), |
| 74 }, | 74 }, |
| 75 "You can click the time remaining text to get it into a popup dialog so you can copy it (with |cfffed000CTRL-C|r) and then paste it (with |cfffed000CTRL-V|r) elsewhere.", | 75 L["You can click the time remaining text to get it into a popup dialog so you can copy it (with |cfffed000CTRL-C|r) and then paste it (with |cfffed000CTRL-V|r) elsewhere."], |
| 76 { | 76 { |
| 77 txt = "If you are looking for an addon with many handy modifications for |cfffed000sending|r mail, you might want to consider |cfffed000Postal|r.", | 77 txt = L["If you are looking for an addon with many handy modifications for |cfffed000sending|r mail, you might want to consider |cfffed000Postal|r."], |
| 78 shown = (not MailOpener.PostalEnabled), | 78 shown = (not MailOpener.PostalEnabled), |
| 79 }, | 79 }, |
| 80 "|cfffed000Cost on Delivery|r and |cfffed000Blizzard|r mail will always be skipped, regardless of any filters.", | 80 L["|cfffed000Cost on Delivery|r and |cfffed000Blizzard|r mail will always be skipped, regardless of any filters."], |
| 81 "|cfffed000Right-click|r the |cfffed000open all|r button to quickly adjust your mail opening filters.", | 81 L["|cfffed000Right-click|r the |cfffed000open all|r button to quickly adjust your mail opening filters."], |
| 82 "|cfffed000Shift-click|r the |cfffed000open all|r button to temporarily override your filters and loot every single mail containing attachments and/or gold.", | 82 L["|cfffed000Shift-click|r the |cfffed000open all|r button to temporarily override your filters and loot every single mail containing attachments and/or gold."], |
| 83 "Please report |cfffed000issues|r and |cfffed000suggestions|r/|cfffed000requests|r at the |cfffed000CurseForge ticket tracker|r, I will try to process and respond to them all (you can find a link to the ticket tracker in the addon description at Curse).", | 83 L["Please report |cfffed000issues|r and |cfffed000suggestions|r/|cfffed000requests|r at the |cfffed000CurseForge ticket tracker|r, I will try to process and respond to them all (you can find a link to the ticket tracker in the addon description at Curse)."], |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 -- Remove any "hidden" tips | 86 -- Remove any "hidden" tips |
| 87 for i = table.getn(tip), 1 do | 87 for i = table.getn(tip), 1 do |
| 88 local val = tip[i]; | 88 local val = tip[i]; |
| 139 MailOpener.debugChannel = chatFrame; | 139 MailOpener.debugChannel = chatFrame; |
| 140 | 140 |
| 141 print("New debug channel created."); | 141 print("New debug channel created."); |
| 142 end | 142 end |
| 143 else | 143 else |
| 144 print("Wrong command, available: /mo config (or /mo c)"); | 144 print(L["Wrong command, available: /mo config (or /mo c)"]); |
| 145 end | 145 end |
| 146 end | 146 end |
| 147 | 147 |
| 148 function mod:Load() | 148 function mod:Load() |
| 149 if not AceConfigDialog then | 149 if not AceConfigDialog then |
| 177 end | 177 end |
| 178 | 178 |
| 179 function mod:GetOptions() | 179 function mod:GetOptions() |
| 180 local options = { | 180 local options = { |
| 181 type = "group", | 181 type = "group", |
| 182 name = "Mail Opener", | 182 name = L["Mail Opener"], |
| 183 childGroups = "tree", | 183 childGroups = "tree", |
| 184 args = { | 184 args = { |
| 185 }, | 185 }, |
| 186 }; | 186 }; |
| 187 | 187 |
| 230 function mod:GetModuleGroupsContainer() | 230 function mod:GetModuleGroupsContainer() |
| 231 local modulesConfigGroup = { | 231 local modulesConfigGroup = { |
| 232 order = 400, | 232 order = 400, |
| 233 type = "group", | 233 type = "group", |
| 234 childGroups = "tree", | 234 childGroups = "tree", |
| 235 name = "Modules", | 235 name = L["Modules"], |
| 236 desc = "Change settings for modules or toggle them on or off.", | 236 desc = L["Change settings for modules or toggle them on or off."], |
| 237 args = { | 237 args = { |
| 238 General = { | 238 General = { |
| 239 order = 10, | 239 order = 10, |
| 240 type = "group", | 240 type = "group", |
| 241 inline = true, | 241 inline = true, |
| 242 name = "Modules Status", | 242 name = L["Modules Status"], |
| 243 args = { | 243 args = { |
| 244 headerName = { | 244 headerName = { |
| 245 order = 0, | 245 order = 0, |
| 246 width = "normal", | 246 width = "normal", |
| 247 type = "description", | 247 type = "description", |
| 248 fontSize = "medium", | 248 fontSize = "medium", |
| 249 name = "|cfffed000Module Name|r", | 249 name = L["|cfffed000Module Name|r"], |
| 250 }, | 250 }, |
| 251 headerStatus = { | 251 headerStatus = { |
| 252 order = 1, | 252 order = 1, |
| 253 width = "half", | 253 width = "half", |
| 254 type = "description", | 254 type = "description", |
| 255 fontSize = "medium", | 255 fontSize = "medium", |
| 256 name = "|cfffed000Status|r", | 256 name = L["|cfffed000Status|r"], |
| 257 }, | 257 }, |
| 258 headerDefault = { | 258 headerDefault = { |
| 259 order = 2, | 259 order = 2, |
| 260 width = "double", | 260 width = "double", |
| 261 type = "description", | 261 type = "description", |
| 262 fontSize = "medium", | 262 fontSize = "medium", |
| 263 name = "|cfffed000Default Status|r", | 263 name = L["|cfffed000Default Status|r"], |
| 264 }, | 264 }, |
| 265 headerseperator = { | 265 headerseperator = { |
| 266 order = 3, | 266 order = 3, |
| 267 type = "description", | 267 type = "description", |
| 268 name = "", | 268 name = "", |
| 293 width = "half", | 293 width = "half", |
| 294 type = "description", | 294 type = "description", |
| 295 fontSize = "medium", | 295 fontSize = "medium", |
| 296 name = function() | 296 name = function() |
| 297 if module:IsEnabled() then | 297 if module:IsEnabled() then |
| 298 return "|cff00ff00Enabled|r"; | 298 return L["|cff00ff00Enabled|r"]; |
| 299 else | 299 else |
| 300 return "|cffff0000Disabled|r"; | 300 return L["|cffff0000Disabled|r"]; |
| 301 end | 301 end |
| 302 end, | 302 end, |
| 303 }; | 303 }; |
| 304 -- Default status | 304 -- Default status |
| 305 modulesConfigGroup.args.General.args[moduleName .. "default"] = { | 305 modulesConfigGroup.args.General.args[moduleName .. "default"] = { |
| 308 type = "description", | 308 type = "description", |
| 309 fontSize = "medium", | 309 fontSize = "medium", |
| 310 name = function() | 310 name = function() |
| 311 local desc = ""; | 311 local desc = ""; |
| 312 if MailOpener.db.profile.modules[moduleName] == nil or MailOpener.db.profile.modules[moduleName] == true then | 312 if MailOpener.db.profile.modules[moduleName] == nil or MailOpener.db.profile.modules[moduleName] == true then |
| 313 desc = "|cff00ff00Enabled|r"; | 313 desc = L["|cff00ff00Enabled|r"]; |
| 314 else | 314 else |
| 315 desc = "|cffff0000Disabled|r"; | 315 desc = L["|cffff0000Disabled|r"]; |
| 316 end | 316 end |
| 317 | 317 |
| 318 if module.moduleRequired then | 318 if module.moduleRequired then |
| 319 desc = desc .. " (Required module)"; | 319 desc = desc .. " " .. L["(Required module)"]; |
| 320 end | 320 end |
| 321 | 321 |
| 322 return desc; | 322 return desc; |
| 323 end, | 323 end, |
| 324 }; | 324 }; |
| 349 | 349 |
| 350 function mod:GetGeneralOptions() | 350 function mod:GetGeneralOptions() |
| 351 local generalConfigGroup = { | 351 local generalConfigGroup = { |
| 352 order = 100, | 352 order = 100, |
| 353 type = "group", | 353 type = "group", |
| 354 name = "General", | 354 name = L["General"], |
| 355 desc = "Change general Mail Opener settings.", | 355 desc = L["Change general Mail Opener settings."], |
| 356 args = { | 356 args = { |
| 357 -- General config inline group | 357 -- General config inline group |
| 358 generalConfig = { | 358 generalConfig = { |
| 359 order = 10, | 359 order = 10, |
| 360 type = "group", | 360 type = "group", |
| 361 inline = true, | 361 inline = true, |
| 362 name = "General", | 362 name = L["General"], |
| 363 args = { | 363 args = { |
| 364 defaultStatus = { | 364 defaultStatus = { |
| 365 order = 0, | 365 order = 0, |
| 366 type = "select", | 366 type = "select", |
| 367 name = "Default mail opener status", | 367 name = L["Default mail opener status"], |
| 368 desc = "Select the default Mail Opener status when you open a mailbox for the first time since your log on.", | 368 desc = L["Select the default Mail Opener status when you open a mailbox for the first time since your log on."], |
| 369 values = { | 369 values = { |
| 370 _enabled = "Completely enabled", | 370 _enabled = L["Completely enabled"], |
| 371 disabled = "Auto opening disabled", | 371 disabled = L["Auto opening disabled"], |
| 372 xdisabled = "Addon Disabled", | 372 xdisabled = L["Addon Disabled"], |
| 373 }, | 373 }, |
| 374 get = function() return MailOpener.db.profile.general.defaultStatus; end, | 374 get = function() return MailOpener.db.profile.general.defaultStatus; end, |
| 375 set = function(i, v) MailOpener.db.profile.general.defaultStatus = v; end, | 375 set = function(i, v) MailOpener.db.profile.general.defaultStatus = v; end, |
| 376 }, | 376 }, |
| 377 defaultQAStatus = { | 377 defaultQAStatus = { |
| 378 order = 10, | 378 order = 10, |
| 379 type = "select", | 379 type = "select", |
| 380 name = "Default QA Auto Mail status", | 380 name = L["Default QA Auto Mail status"], |
| 381 desc = "Select the default Quick Auctions auto mail status whenever you open a mailbox.", | 381 desc = L["Select the default Quick Auctions auto mail status whenever you open a mailbox."], |
| 382 values = { | 382 values = { |
| 383 __remember = "Remember", | 383 __remember = L["Remember"], |
| 384 _enabled = "Enabled", | 384 _enabled = L["Enabled"], |
| 385 disabled = "Disabled", | 385 disabled = L["Disabled"], |
| 386 }, | 386 }, |
| 387 get = function() return MailOpener.db.profile.general.defaultQAStatus; end, | 387 get = function() return MailOpener.db.profile.general.defaultQAStatus; end, |
| 388 set = function(i, v) MailOpener.db.profile.general.defaultQAStatus = v; end, | 388 set = function(i, v) MailOpener.db.profile.general.defaultQAStatus = v; end, |
| 389 hidden = (not MailOpener.QuickAuctionsEnabled), | 389 hidden = (not MailOpener.QuickAuctionsEnabled), |
| 390 }, | 390 }, |
| 391 continueOpeningStackableItems = { | 391 continueOpeningStackableItems = { |
| 392 order = 15, | 392 order = 15, |
| 393 type = "toggle", | 393 type = "toggle", |
| 394 name = "Continue trying to open mail after your bags are full", | 394 name = L["Continue trying to open mail after your bags are full"], |
| 395 desc = "If there are a lot of stackable items in your mailbox (e.g. glyphs) you may want to toggle this option on.\n\nThis will cause your Blizzard error frame to get extremely spammy if there's a lot of mail remaining. With this disabled, Mail Opener will completely stop opening mail while your inventory is full.", | 395 desc = L["If there are a lot of stackable items in your mailbox (e.g. glyphs) you may want to toggle this option on.\n\nThis will cause your Blizzard error frame to get extremely spammy if there's a lot of mail remaining. With this disabled, Mail Opener will completely stop opening mail while your inventory is full."], |
| 396 width = "full", | 396 width = "full", |
| 397 get = function() return MailOpener.db.profile.general.continueOpeningStackableItems; end, | 397 get = function() return MailOpener.db.profile.general.continueOpeningStackableItems; end, |
| 398 set = function(i, v) MailOpener.db.profile.general.continueOpeningStackableItems = v; end, | 398 set = function(i, v) MailOpener.db.profile.general.continueOpeningStackableItems = v; end, |
| 399 }, | 399 }, |
| 400 showHelpTooltips = { | 400 showHelpTooltips = { |
| 401 order = 17, | 401 order = 17, |
| 402 type = "toggle", | 402 type = "toggle", |
| 403 name = "Display help tooltips at the mailbox buttons added by Mail Opener.", | 403 name = L["Display help tooltips at the mailbox buttons added by Mail Opener."], |
| 404 desc = "Display the help tooltips when hovering at any of the mailbox buttons added by Mail Opener.", | 404 desc = L["Display the help tooltips when hovering at any of the mailbox buttons added by Mail Opener."], |
| 405 width = "full", | 405 width = "full", |
| 406 get = function() return MailOpener.db.profile.general.showHelpTooltips; end, | 406 get = function() return MailOpener.db.profile.general.showHelpTooltips; end, |
| 407 set = function(i, v) MailOpener.db.profile.general.showHelpTooltips = v; end, | 407 set = function(i, v) MailOpener.db.profile.general.showHelpTooltips = v; end, |
| 408 }, | 408 }, |
| 409 autoDisableQAAutoMail = { | 409 autoDisableQAAutoMail = { |
| 410 order = 20, | 410 order = 20, |
| 411 type = "toggle", | 411 type = "toggle", |
| 412 name = "Turn Quick Auction's auto mail status |cffff0000off|r when opening mail", | 412 name = L["Turn Quick Auction's auto mail status |cffff0000off|r when opening mail"], |
| 413 desc = "Quick Auction's auto mail is buggy when using other mail opening addons. If you are collecting mail while auto mailer is enabled wrong items may be send to the wrong character.\n\nTo solve this you must disable Quick Auction's auto mail while opening mail and you can re-enable it when mail opening is finished.", | 413 desc = L["Quick Auction's auto mail is buggy when using other mail opening addons. If you are collecting mail while auto mailer is enabled wrong items may be send to the wrong character.\n\nTo solve this you must disable Quick Auction's auto mail while opening mail and you can re-enable it when mail opening is finished."], |
| 414 width = "full", | 414 width = "full", |
| 415 get = function() return MailOpener.db.profile.general.autoDisableQAAutoMail; end, | 415 get = function() return MailOpener.db.profile.general.autoDisableQAAutoMail; end, |
| 416 set = function(i, v) MailOpener.db.profile.general.autoDisableQAAutoMail = v; end, | 416 set = function(i, v) MailOpener.db.profile.general.autoDisableQAAutoMail = v; end, |
| 417 hidden = (not MailOpener.QuickAuctionsEnabled), | 417 hidden = (not MailOpener.QuickAuctionsEnabled), |
| 418 }, | 418 }, |
| 419 autoReenableQAAutoMail = { | 419 autoReenableQAAutoMail = { |
| 420 order = 30, | 420 order = 30, |
| 421 type = "toggle", | 421 type = "toggle", |
| 422 name = "Turn Quick Auction's auto mail status |cff00ff00on|r after opening mail has finished", | 422 name = L["Turn Quick Auction's auto mail status |cff00ff00on|r after opening mail has finished"], |
| 423 desc = "Quick Auction's auto mail is buggy when using other mail opening addons. If you are collecting mail while auto mailer is enabled wrong items may be send to the wrong character.\n\nTo solve this you must disable Quick Auction's auto mail while opening mail and you can re-enable it when mail opening is finished.", | 423 desc = L["Quick Auction's auto mail is buggy when using other mail opening addons. If you are collecting mail while auto mailer is enabled wrong items may be send to the wrong character.\n\nTo solve this you must disable Quick Auction's auto mail while opening mail and you can re-enable it when mail opening is finished."], |
| 424 width = "full", | 424 width = "full", |
| 425 get = function() return MailOpener.db.profile.general.autoReenableQAAutoMail; end, | 425 get = function() return MailOpener.db.profile.general.autoReenableQAAutoMail; end, |
| 426 set = function(i, v) MailOpener.db.profile.general.autoReenableQAAutoMail = v; end, | 426 set = function(i, v) MailOpener.db.profile.general.autoReenableQAAutoMail = v; end, |
| 427 hidden = (not MailOpener.QuickAuctionsEnabled), | 427 hidden = (not MailOpener.QuickAuctionsEnabled), |
| 428 disabled = function() return (MailOpener.db.profile.general.autoSetBackQAAutoMail and not MailOpener.db.profile.general.autoReenableQAAutoMail); end, | 428 disabled = function() return (MailOpener.db.profile.general.autoSetBackQAAutoMail and not MailOpener.db.profile.general.autoReenableQAAutoMail); end, |
| 429 }, | 429 }, |
| 430 autoSetBackQAAutoMail = { | 430 autoSetBackQAAutoMail = { |
| 431 order = 40, | 431 order = 40, |
| 432 type = "toggle", | 432 type = "toggle", |
| 433 name = "Set Quick Auction's auto mail status |cff00ffffback|r after opening mail has finished (remember it)", | 433 name = L["Set Quick Auction's auto mail status |cff00ffffback|r after opening mail has finished (remember it)"], |
| 434 desc = "Instead of always turning Quick Auction's auto mail on after mail opening you can choose to set it back to the value it was prior to opening mail.", | 434 desc = L["Instead of always turning Quick Auction's auto mail on after mail opening you can choose to set it back to the value it was prior to opening mail."], |
| 435 width = "full", | 435 width = "full", |
| 436 get = function() return MailOpener.db.profile.general.autoSetBackQAAutoMail; end, | 436 get = function() return MailOpener.db.profile.general.autoSetBackQAAutoMail; end, |
| 437 set = function(i, v) MailOpener.db.profile.general.autoSetBackQAAutoMail = v; end, | 437 set = function(i, v) MailOpener.db.profile.general.autoSetBackQAAutoMail = v; end, |
| 438 hidden = (not MailOpener.QuickAuctionsEnabled), | 438 hidden = (not MailOpener.QuickAuctionsEnabled), |
| 439 disabled = function() return (MailOpener.db.profile.general.autoReenableQAAutoMail and not MailOpener.db.profile.general.autoSetBackQAAutoMail); end, | 439 disabled = function() return (MailOpener.db.profile.general.autoReenableQAAutoMail and not MailOpener.db.profile.general.autoSetBackQAAutoMail); end, |
| 443 -- Profile config inline group | 443 -- Profile config inline group |
| 444 profileConfig = { | 444 profileConfig = { |
| 445 order = 15, | 445 order = 15, |
| 446 type = "group", | 446 type = "group", |
| 447 inline = true, | 447 inline = true, |
| 448 name = "New Character Specfic Profile", | 448 name = L["New Character Specific Profile"], |
| 449 args = { | 449 args = { |
| 450 description = { | 450 description = { |
| 451 order = 10, | 451 order = 10, |
| 452 type = "description", | 452 type = "description", |
| 453 name = "You can create a new profile to allow different behaviour for different characters. Imagine setting up a profile for your AH banker which will retrieve all sorts of mail containing items while other characters don't automatically open mail with items sent by other players.", | 453 name = L["You can create a new profile to allow different behaviour for different characters. Imagine setting up a profile for your AH banker which will retrieve all sorts of mail containing items while other characters don't automatically open mail with items sent by other players."], |
| 454 }, | 454 }, |
| 455 header = { | 455 header = { |
| 456 order = 15, | 456 order = 15, |
| 457 type = "header", | 457 type = "header", |
| 458 name = "", | 458 name = "", |
| 459 }, | 459 }, |
| 460 createNewProfile = { | 460 createNewProfile = { |
| 461 order = 20, | 461 order = 20, |
| 462 type = "execute", | 462 type = "execute", |
| 463 name = "Create a new character specific profile", | 463 name = L["Create a new character specific profile"], |
| 464 desc = "Create a new profile for this user. You can also make profile groups at the profiles tab to the left.", | 464 desc = L["Create a new profile for this user. You can also make profile groups at the profiles tab to the left."], |
| 465 width = "double", | 465 width = "double", |
| 466 func = function() | 466 func = function() |
| 467 MailOpener.db:SetProfile(UnitName("player") .. " - " .. GetRealmName()); | 467 MailOpener.db:SetProfile(UnitName("player") .. " - " .. GetRealmName()); |
| 468 end, | 468 end, |
| 469 }, | 469 }, |
| 472 -- Tip | 472 -- Tip |
| 473 tipConfig = { | 473 tipConfig = { |
| 474 order = 20, | 474 order = 20, |
| 475 type = "group", | 475 type = "group", |
| 476 inline = true, | 476 inline = true, |
| 477 name = "Mail Opening Tip", | 477 name = L["Mail Opening Tip"], |
| 478 args = { | 478 args = { |
| 479 description = { | 479 description = { |
| 480 order = 10, | 480 order = 10, |
| 481 type = "description", | 481 type = "description", |
| 482 fontSize = "medium", | 482 fontSize = "medium", |
| 483 name = function() return tip; end, | 483 name = function() return tip; end, |
| 484 }, | 484 }, |
| 485 nextTip = { | 485 nextTip = { |
| 486 order = 20, | 486 order = 20, |
| 487 type = "execute", | 487 type = "execute", |
| 488 name = "Next Tip", | 488 name = L["Next Tip"], |
| 489 width = "half", | 489 width = "half", |
| 490 func = function() self:NextTip(); self:GetTip(); end, | 490 func = function() self:NextTip(); self:GetTip(); end, |
| 491 }, | 491 }, |
| 492 }, | 492 }, |
| 493 }, -- end Tip | 493 }, -- end Tip |
| 499 | 499 |
| 500 function mod:GetNotificationsOptions() | 500 function mod:GetNotificationsOptions() |
| 501 local notificationsConfigGroup = { | 501 local notificationsConfigGroup = { |
| 502 order = 200, | 502 order = 200, |
| 503 type = "group", | 503 type = "group", |
| 504 name = "Notifications", | 504 name = L["Notifications"], |
| 505 desc = "Toggle notifications.", | 505 desc = L["Toggle notifications."], |
| 506 args = { | 506 args = { |
| 507 -- Notifications config inline group | 507 -- Notifications config inline group |
| 508 nofitications = { | 508 nofitications = { |
| 509 order = 10, | 509 order = 10, |
| 510 type = "group", | 510 type = "group", |
| 511 inline = true, | 511 inline = true, |
| 512 name = "Notifications", | 512 name = L["Notifications"], |
| 513 args = { | 513 args = { |
| 514 description = { | 514 description = { |
| 515 order = 10, | 515 order = 10, |
| 516 type = "description", | 516 type = "description", |
| 517 name = "Toggle which notification you wish to see.", | 517 name = L["Notifications"], |
| 518 }, | 518 }, |
| 519 }, | 519 }, |
| 520 }, -- end Notifications config inline group | 520 }, -- end Notifications config inline group |
| 521 | 521 |
| 522 -- General Notifications config inline group | 522 -- General Notifications config inline group |
| 523 general = { | 523 general = { |
| 524 order = 20, | 524 order = 20, |
| 525 type = "group", | 525 type = "group", |
| 526 inline = true, | 526 inline = true, |
| 527 name = "General Notifications", | 527 name = L["General Notifications"], |
| 528 args = { | 528 args = { |
| 529 --[[welcome = { | |
| 530 order = 20, | |
| 531 type = "toggle", | |
| 532 name = "Show message when |cfffed000opening the mailbox|r", | |
| 533 desc = "Print the welcome message whenever you open the mailbox.", | |
| 534 set = function(i, v) MailOpener.db.profile.notifications.welcome = v; end, | |
| 535 get = function() return MailOpener.db.profile.notifications.welcome; end, | |
| 536 width = "double", | |
| 537 }, | |
| 538 bye = { | |
| 539 order = 21, | |
| 540 type = "toggle", | |
| 541 name = "Show message when |cfffed000closing the mailbox|r", | |
| 542 desc = "Print the bye message whenever you close the mailbox.", | |
| 543 set = function(i, v) MailOpener.db.profile.notifications.bye = v; end, | |
| 544 get = function() return MailOpener.db.profile.notifications.bye; end, | |
| 545 width = "double", | |
| 546 },]] | |
| 547 fishedOpeningBatch = { | 529 fishedOpeningBatch = { |
| 548 order = 22, | 530 order = 22, |
| 549 type = "toggle", | 531 type = "toggle", |
| 550 name = "Announce when |cfffed000finished opening the current batch|r", | 532 name = L["Announce when |cfffed000finished opening the current batch|r"], |
| 551 desc = "Announce when opening of the current batch of mail has been completed.", | 533 desc = L["Announce when opening of the current batch of mail has been completed."], |
| 552 set = function(i, v) MailOpener.db.profile.notifications.finishedCurrentBatch = v; end, | 534 set = function(i, v) MailOpener.db.profile.notifications.finishedCurrentBatch = v; end, |
| 553 get = function() return MailOpener.db.profile.notifications.finishedCurrentBatch; end, | 535 get = function() return MailOpener.db.profile.notifications.finishedCurrentBatch; end, |
| 554 width = "double", | 536 width = "double", |
| 555 }, | 537 }, |
| 556 noMoreMailAvailable = { | 538 noMoreMailAvailable = { |
| 557 order = 23, | 539 order = 23, |
| 558 type = "toggle", | 540 type = "toggle", |
| 559 name = "Announce when |cfffed000the mailbox is completely empty|r", | 541 name = L["Announce when |cfffed000the mailbox is completely empty|r"], |
| 560 desc = "Announce when there is nothing left for Mail Opener to open.", | 542 desc = L["Announce when there is nothing left for Mail Opener to open."], |
| 561 set = function(i, v) MailOpener.db.profile.notifications.mailboxIsEmpty = v; end, | 543 set = function(i, v) MailOpener.db.profile.notifications.mailboxIsEmpty = v; end, |
| 562 get = function() return MailOpener.db.profile.notifications.mailboxIsEmpty; end, | 544 get = function() return MailOpener.db.profile.notifications.mailboxIsEmpty; end, |
| 563 width = "double", | 545 width = "double", |
| 564 }, | 546 }, |
| 565 }, | 547 }, |
| 568 -- Mail Skipped Notifications config inline group | 550 -- Mail Skipped Notifications config inline group |
| 569 mailSkipped = { | 551 mailSkipped = { |
| 570 order = 30, | 552 order = 30, |
| 571 type = "group", | 553 type = "group", |
| 572 inline = true, | 554 inline = true, |
| 573 name = "Mail Skipped Notifications", | 555 name = L["Mail Skipped Notifications"], |
| 574 args = { | 556 args = { |
| 575 descriptionMailSkipped = { | 557 descriptionMailSkipped = { |
| 576 order = 31, | 558 order = 31, |
| 577 type = "description", | 559 type = "description", |
| 578 name = "Announce when mail is skipped because...", | 560 name = L["Announce when mail is skipped because..."], |
| 579 }, | 561 }, |
| 580 | 562 |
| 581 skippedToggleAll = { | 563 skippedToggleAll = { |
| 582 order = 35, | 564 order = 35, |
| 583 type = "toggle", | 565 type = "toggle", |
| 584 name = "Toggle everything", | 566 name = L["Toggle everything"], |
| 585 desc = "Announce when mail is skipped for |cfffed000any|r reason.", | 567 desc = L["Announce when mail is skipped for |cfffed000any|r reason."], |
| 586 set = function(i, v) MailOpener.db.profile.notifications.skipped.all = v; end, | 568 set = function(i, v) MailOpener.db.profile.notifications.skipped.all = v; end, |
| 587 get = function() return MailOpener.db.profile.notifications.skipped.all; end, | 569 get = function() return MailOpener.db.profile.notifications.skipped.all; end, |
| 588 }, | 570 }, |
| 589 skippedInventoryFull = { | 571 skippedInventoryFull = { |
| 590 order = 36, | 572 order = 36, |
| 591 type = "toggle", | 573 type = "toggle", |
| 592 name = "Your inventory is full", | 574 name = L["Your inventory is full"], |
| 593 desc = "Announce when mail is skipped because |cfffed000your inventory is full|r.", | 575 desc = L["Announce when mail is skipped because |cfffed000your inventory is full|r."], |
| 594 set = function(i, v) MailOpener.db.profile.notifications.skipped.inventoryFull = v; end, | 576 set = function(i, v) MailOpener.db.profile.notifications.skipped.inventoryFull = v; end, |
| 595 get = function() return MailOpener.db.profile.notifications.skipped.inventoryFull; end, | 577 get = function() return MailOpener.db.profile.notifications.skipped.inventoryFull; end, |
| 596 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, | 578 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, |
| 597 }, | 579 }, |
| 598 skippedKeepFreeSpaceLimit = { | 580 skippedKeepFreeSpaceLimit = { |
| 599 order = 37, | 581 order = 37, |
| 600 type = "toggle", | 582 type = "toggle", |
| 601 name = "Keep free space limit reached", | 583 name = L["Keep free space limit reached"], |
| 602 desc = "Announce when mail is skipped because |cfffed000the keep free space limit has been reached|r.", | 584 desc = L["Announce when mail is skipped because |cfffed000the keep free space limit has been reached|r."], |
| 603 set = function(i, v) MailOpener.db.profile.notifications.skipped.keepFreeSpaceLimit = v; end, | 585 set = function(i, v) MailOpener.db.profile.notifications.skipped.keepFreeSpaceLimit = v; end, |
| 604 get = function() return MailOpener.db.profile.notifications.skipped.keepFreeSpaceLimit; end, | 586 get = function() return MailOpener.db.profile.notifications.skipped.keepFreeSpaceLimit; end, |
| 605 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, | 587 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, |
| 606 }, | 588 }, |
| 607 skippedGMMail = { | 589 skippedGMMail = { |
| 608 order = 38, | 590 order = 38, |
| 609 type = "toggle", | 591 type = "toggle", |
| 610 name = "GM mail", | 592 name = L["Blizzard mail"], |
| 611 desc = "Announce when mail is skipped because it's |cfffed000mail sent by a Game Master|r.", | 593 desc = L["Announce when mail is skipped because it's |cfffed000mail sent by Blizzard|r."], |
| 612 set = function(i, v) MailOpener.db.profile.notifications.skipped.GMMail = v; end, | 594 set = function(i, v) MailOpener.db.profile.notifications.skipped.GMMail = v; end, |
| 613 get = function() return MailOpener.db.profile.notifications.skipped.GMMail; end, | 595 get = function() return MailOpener.db.profile.notifications.skipped.GMMail; end, |
| 614 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, | 596 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, |
| 615 }, | 597 }, |
| 616 skippedCOD = { | 598 skippedCOD = { |
| 617 order = 39, | 599 order = 39, |
| 618 type = "toggle", | 600 type = "toggle", |
| 619 name = "C.O.D. mail", | 601 name = L["C.O.D. mail"], |
| 620 desc = "Announce when mail is skipped because it's |cfffed000a Cost On Delivery mail|r.", | 602 desc = L["Announce when mail is skipped because it's |cfffed000a Cost On Delivery mail|r."], |
| 621 set = function(i, v) MailOpener.db.profile.notifications.skipped.COD = v; end, | 603 set = function(i, v) MailOpener.db.profile.notifications.skipped.COD = v; end, |
| 622 get = function() return MailOpener.db.profile.notifications.skipped.COD; end, | 604 get = function() return MailOpener.db.profile.notifications.skipped.COD; end, |
| 623 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, | 605 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, |
| 624 }, | 606 }, |
| 625 skippedNormalGoldMail = { | 607 skippedNormalGoldMail = { |
| 626 order = 40, | 608 order = 40, |
| 627 type = "toggle", | 609 type = "toggle", |
| 628 name = "Normal mail with gold", | 610 name = L["Normal mail with gold"], |
| 629 desc = "Announce when mail is skipped because it's |cfffed000normal mail containing gold|r.", | 611 desc = L["Announce when mail is skipped because it's |cfffed000normal mail containing gold|r."], |
| 630 set = function(i, v) MailOpener.db.profile.notifications.skipped.normalGoldMail = v; end, | 612 set = function(i, v) MailOpener.db.profile.notifications.skipped.normalGoldMail = v; end, |
| 631 get = function() return MailOpener.db.profile.notifications.skipped.normalGoldMail; end, | 613 get = function() return MailOpener.db.profile.notifications.skipped.normalGoldMail; end, |
| 632 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, | 614 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, |
| 633 }, | 615 }, |
| 634 skippedNormalItemsMail = { | 616 skippedNormalItemsMail = { |
| 635 order = 41, | 617 order = 41, |
| 636 type = "toggle", | 618 type = "toggle", |
| 637 name = "Normal mail with attachments", | 619 name = L["Normal mail with attachments"], |
| 638 desc = "Announce when mail is skipped because it's |cfffed000normal mail containing items|r.", | 620 desc = L["Announce when mail is skipped because it's |cfffed000normal mail containing items|r."], |
| 639 set = function(i, v) MailOpener.db.profile.notifications.skipped.normalItemsMail = v; end, | 621 set = function(i, v) MailOpener.db.profile.notifications.skipped.normalItemsMail = v; end, |
| 640 get = function() return MailOpener.db.profile.notifications.skipped.normalItemsMail; end, | 622 get = function() return MailOpener.db.profile.notifications.skipped.normalItemsMail; end, |
| 641 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, | 623 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, |
| 642 }, | 624 }, |
| 643 skippedAHExpired = { | 625 skippedAHExpired = { |
| 644 order = 42, | 626 order = 42, |
| 645 type = "toggle", | 627 type = "toggle", |
| 646 name = "Auction expired mail", | 628 name = L["Auction expired mail"], |
| 647 desc = "Announce when mail is skipped because it's |cfffed000auction expired mail|r.", | 629 desc = L["Announce when mail is skipped because it's |cfffed000auction expired mail|r."], |
| 648 set = function(i, v) MailOpener.db.profile.notifications.skipped.AHexpired = v; end, | 630 set = function(i, v) MailOpener.db.profile.notifications.skipped.AHexpired = v; end, |
| 649 get = function() return MailOpener.db.profile.notifications.skipped.AHexpired; end, | 631 get = function() return MailOpener.db.profile.notifications.skipped.AHexpired; end, |
| 650 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, | 632 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, |
| 651 }, | 633 }, |
| 652 skippedAHSuccessful = { | 634 skippedAHSuccessful = { |
| 653 order = 43, | 635 order = 43, |
| 654 type = "toggle", | 636 type = "toggle", |
| 655 name = "Auction successful mail", | 637 name = L["Auction successful mail"], |
| 656 desc = "Announce when mail is skipped because it's |cfffed000auction successful mail|r.", | 638 desc = L["Announce when mail is skipped because it's |cfffed000auction successful mail|r."], |
| 657 set = function(i, v) MailOpener.db.profile.notifications.skipped.AHsuccess = v; end, | 639 set = function(i, v) MailOpener.db.profile.notifications.skipped.AHsuccess = v; end, |
| 658 get = function() return MailOpener.db.profile.notifications.skipped.AHsuccess; end, | 640 get = function() return MailOpener.db.profile.notifications.skipped.AHsuccess; end, |
| 659 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, | 641 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, |
| 660 }, | 642 }, |
| 661 skippedAHWon = { | 643 skippedAHWon = { |
| 662 order = 44, | 644 order = 44, |
| 663 type = "toggle", | 645 type = "toggle", |
| 664 name = "Auction won mail", | 646 name = L["Auction won mail"], |
| 665 desc = "Announce when mail is skipped because it's |cfffed000auction won mail|r.", | 647 desc = L["Announce when mail is skipped because it's |cfffed000auction won mail|r."], |
| 666 set = function(i, v) MailOpener.db.profile.notifications.skipped.AHwon = v; end, | 648 set = function(i, v) MailOpener.db.profile.notifications.skipped.AHwon = v; end, |
| 667 get = function() return MailOpener.db.profile.notifications.skipped.AHwon; end, | 649 get = function() return MailOpener.db.profile.notifications.skipped.AHwon; end, |
| 668 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, | 650 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, |
| 669 }, | 651 }, |
| 670 skippedAHCanceled = { | 652 skippedAHCanceled = { |
| 671 order = 45, | 653 order = 45, |
| 672 type = "toggle", | 654 type = "toggle", |
| 673 name = "Auction canceled mail", | 655 name = L["Auction canceled mail"], |
| 674 desc = "Announce when mail is skipped because it's |cfffed000auction canceled mail|r.", | 656 desc = L["Announce when mail is skipped because it's |cfffed000auction canceled mail|r."], |
| 675 set = function(i, v) MailOpener.db.profile.notifications.skipped.AHcanceled = v; end, | 657 set = function(i, v) MailOpener.db.profile.notifications.skipped.AHcanceled = v; end, |
| 676 get = function() return MailOpener.db.profile.notifications.skipped.AHcanceled; end, | 658 get = function() return MailOpener.db.profile.notifications.skipped.AHcanceled; end, |
| 677 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, | 659 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, |
| 678 }, | 660 }, |
| 679 skippedAHOutbid = { | 661 skippedAHOutbid = { |
| 680 order = 46, | 662 order = 46, |
| 681 type = "toggle", | 663 type = "toggle", |
| 682 name = "Auction outbid mail", | 664 name = L["Auction outbid mail"], |
| 683 desc = "Announce when mail is skipped because it's |cfffed000auction outbid mail|r.", | 665 desc = L["Announce when mail is skipped because it's |cfffed000auction outbid mail|r."], |
| 684 set = function(i, v) MailOpener.db.profile.notifications.skipped.AHoutbid = v; end, | 666 set = function(i, v) MailOpener.db.profile.notifications.skipped.AHoutbid = v; end, |
| 685 get = function() return MailOpener.db.profile.notifications.skipped.AHoutbid; end, | 667 get = function() return MailOpener.db.profile.notifications.skipped.AHoutbid; end, |
| 686 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, | 668 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, |
| 687 }, | 669 }, |
| 688 skippedOther = { | 670 skippedOther = { |
| 689 order = 47, | 671 order = 47, |
| 690 type = "toggle", | 672 type = "toggle", |
| 691 name = "Other mail (e.g. plain text)", | 673 name = L["Other mail (e.g. plain text)"], |
| 692 desc = "Announce when mail is skipped because it's |cfffed000any other kind of mail|r (e.g. plain text).", | 674 desc = L["Announce when mail is skipped because it's |cfffed000any other kind of mail|r (e.g. plain text)."], |
| 693 set = function(i, v) MailOpener.db.profile.notifications.skipped.other = v; end, | 675 set = function(i, v) MailOpener.db.profile.notifications.skipped.other = v; end, |
| 694 get = function() return MailOpener.db.profile.notifications.skipped.other; end, | 676 get = function() return MailOpener.db.profile.notifications.skipped.other; end, |
| 695 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, | 677 disabled = function() return (not MailOpener.db.profile.notifications.skipped.all); end, |
| 696 }, | 678 }, |
| 697 }, | 679 }, |
| 700 -- Mail Processed Notifications config inline group | 682 -- Mail Processed Notifications config inline group |
| 701 mailProcessed = { | 683 mailProcessed = { |
| 702 order = 40, | 684 order = 40, |
| 703 type = "group", | 685 type = "group", |
| 704 inline = true, | 686 inline = true, |
| 705 name = "Mail Processed Notifications", | 687 name = L["Mail Processed Notifications"], |
| 706 args = { | 688 args = { |
| 707 descriptionMailProcessed = { | 689 descriptionMailProcessed = { |
| 708 order = 61, | 690 order = 61, |
| 709 type = "description", | 691 type = "description", |
| 710 name = "Announce when mail is processed because...", | 692 name = L["Announce when mail is processed because..."], |
| 711 }, | 693 }, |
| 712 | 694 |
| 713 processedToggleAll = { | 695 processedToggleAll = { |
| 714 order = 65, | 696 order = 65, |
| 715 type = "toggle", | 697 type = "toggle", |
| 716 name = "Toggle everything", | 698 name = L["Toggle everything"], |
| 717 desc = "Announce when mail is processed for |cfffed000any|r reason.", | 699 desc = L["Announce when mail is processed for |cfffed000any|r reason."], |
| 718 set = function(i, v) MailOpener.db.profile.notifications.processed.all = v; end, | 700 set = function(i, v) MailOpener.db.profile.notifications.processed.all = v; end, |
| 719 get = function() return MailOpener.db.profile.notifications.processed.all; end, | 701 get = function() return MailOpener.db.profile.notifications.processed.all; end, |
| 720 }, | 702 }, |
| 721 processedNormalGoldMail = { | 703 processedNormalGoldMail = { |
| 722 order = 70, | 704 order = 70, |
| 723 type = "toggle", | 705 type = "toggle", |
| 724 name = "Normal mail with gold", | 706 name = L["Normal mail with gold"], |
| 725 desc = "Announce when mail is processed because it's |cfffed000normal mail containing gold|r.", | 707 desc = L["Announce when mail is processed because it's |cfffed000normal mail containing gold|r."], |
| 726 set = function(i, v) MailOpener.db.profile.notifications.processed.normalGoldMail = v; end, | 708 set = function(i, v) MailOpener.db.profile.notifications.processed.normalGoldMail = v; end, |
| 727 get = function() return MailOpener.db.profile.notifications.processed.normalGoldMail; end, | 709 get = function() return MailOpener.db.profile.notifications.processed.normalGoldMail; end, |
| 728 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, | 710 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, |
| 729 }, | 711 }, |
| 730 processedNormalItemsMail = { | 712 processedNormalItemsMail = { |
| 731 order = 71, | 713 order = 71, |
| 732 type = "toggle", | 714 type = "toggle", |
| 733 name = "Normal mail with attachments", | 715 name = L["Normal mail with attachments"], |
| 734 desc = "Announce when mail is processed because it's |cfffed000normal mail containing items|r.", | 716 desc = L["Announce when mail is processed because it's |cfffed000normal mail containing items|r."], |
| 735 set = function(i, v) MailOpener.db.profile.notifications.processed.normalItemsMail = v; end, | 717 set = function(i, v) MailOpener.db.profile.notifications.processed.normalItemsMail = v; end, |
| 736 get = function() return MailOpener.db.profile.notifications.processed.normalItemsMail; end, | 718 get = function() return MailOpener.db.profile.notifications.processed.normalItemsMail; end, |
| 737 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, | 719 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, |
| 738 }, | 720 }, |
| 739 processedAHExpired = { | 721 processedAHExpired = { |
| 740 order = 72, | 722 order = 72, |
| 741 type = "toggle", | 723 type = "toggle", |
| 742 name = "Auction expired mail", | 724 name = L["Auction expired mail"], |
| 743 desc = "Announce when mail is processed because it's |cfffed000auction expired mail|r.", | 725 desc = L["Announce when mail is processed because it's |cfffed000auction expired mail|r."], |
| 744 set = function(i, v) MailOpener.db.profile.notifications.processed.AHexpired = v; end, | 726 set = function(i, v) MailOpener.db.profile.notifications.processed.AHexpired = v; end, |
| 745 get = function() return MailOpener.db.profile.notifications.processed.AHexpired; end, | 727 get = function() return MailOpener.db.profile.notifications.processed.AHexpired; end, |
| 746 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, | 728 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, |
| 747 }, | 729 }, |
| 748 processedAHSuccessful = { | 730 processedAHSuccessful = { |
| 749 order = 73, | 731 order = 73, |
| 750 type = "toggle", | 732 type = "toggle", |
| 751 name = "Auction successful mail", | 733 name = L["Auction successful mail"], |
| 752 desc = "Announce when mail is processed because it's |cfffed000auction successful mail|r.", | 734 desc = L["Announce when mail is processed because it's |cfffed000auction successful mail|r."], |
| 753 set = function(i, v) MailOpener.db.profile.notifications.processed.AHsuccess = v; end, | 735 set = function(i, v) MailOpener.db.profile.notifications.processed.AHsuccess = v; end, |
| 754 get = function() return MailOpener.db.profile.notifications.processed.AHsuccess; end, | 736 get = function() return MailOpener.db.profile.notifications.processed.AHsuccess; end, |
| 755 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, | 737 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, |
| 756 }, | 738 }, |
| 757 processedAHWon = { | 739 processedAHWon = { |
| 758 order = 74, | 740 order = 74, |
| 759 type = "toggle", | 741 type = "toggle", |
| 760 name = "Auction won mail", | 742 name = L["Auction won mail"], |
| 761 desc = "Announce when mail is processed because it's |cfffed000auction won mail|r.", | 743 desc = L["Announce when mail is processed because it's |cfffed000auction won mail|r."], |
| 762 set = function(i, v) MailOpener.db.profile.notifications.processed.AHwon = v; end, | 744 set = function(i, v) MailOpener.db.profile.notifications.processed.AHwon = v; end, |
| 763 get = function() return MailOpener.db.profile.notifications.processed.AHwon; end, | 745 get = function() return MailOpener.db.profile.notifications.processed.AHwon; end, |
| 764 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, | 746 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, |
| 765 }, | 747 }, |
| 766 processedAHCanceled = { | 748 processedAHCanceled = { |
| 767 order = 75, | 749 order = 75, |
| 768 type = "toggle", | 750 type = "toggle", |
| 769 name = "Auction canceled mail", | 751 name = L["Auction canceled mail"], |
| 770 desc = "Announce when mail is processed because it's |cfffed000auction canceled mail|r.", | 752 desc = L["Announce when mail is processed because it's |cfffed000auction canceled mail|r."], |
| 771 set = function(i, v) MailOpener.db.profile.notifications.processed.AHcanceled = v; end, | 753 set = function(i, v) MailOpener.db.profile.notifications.processed.AHcanceled = v; end, |
| 772 get = function() return MailOpener.db.profile.notifications.processed.AHcanceled; end, | 754 get = function() return MailOpener.db.profile.notifications.processed.AHcanceled; end, |
| 773 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, | 755 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, |
| 774 }, | 756 }, |
| 775 processedAHOutbid = { | 757 processedAHOutbid = { |
| 776 order = 76, | 758 order = 76, |
| 777 type = "toggle", | 759 type = "toggle", |
| 778 name = "Auction outbid mail", | 760 name = L["Auction outbid mail"], |
| 779 desc = "Announce when mail is processed because it's |cfffed000auction outbid mail|r.", | 761 desc = L["Announce when mail is processed because it's |cfffed000auction outbid mail|r."], |
| 780 set = function(i, v) MailOpener.db.profile.notifications.processed.AHoutbid = v; end, | 762 set = function(i, v) MailOpener.db.profile.notifications.processed.AHoutbid = v; end, |
| 781 get = function() return MailOpener.db.profile.notifications.processed.AHoutbid; end, | 763 get = function() return MailOpener.db.profile.notifications.processed.AHoutbid; end, |
| 782 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, | 764 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, |
| 783 }, | 765 }, |
| 784 processedOther = { | 766 processedOther = { |
| 785 order = 77, | 767 order = 77, |
| 786 type = "toggle", | 768 type = "toggle", |
| 787 name = "Other mail (e.g. plain text)", | 769 name = L["Other mail (e.g. plain text)"], |
| 788 desc = "Announce when mail is processed because it's |cfffed000any other kind of mail|r (e.g. plain text).", | 770 desc = L["Announce when mail is processed because it's |cfffed000any other kind of mail|r (e.g. plain text)."], |
| 789 set = function(i, v) MailOpener.db.profile.notifications.processed.other = v; end, | 771 set = function(i, v) MailOpener.db.profile.notifications.processed.other = v; end, |
| 790 get = function() return MailOpener.db.profile.notifications.processed.other; end, | 772 get = function() return MailOpener.db.profile.notifications.processed.other; end, |
| 791 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, | 773 disabled = function() return (not MailOpener.db.profile.notifications.processed.all); end, |
| 792 }, | 774 }, |
| 793 }, | 775 }, |
| 796 -- Sound Notifications config inline group | 778 -- Sound Notifications config inline group |
| 797 sound = { | 779 sound = { |
| 798 order = 50, | 780 order = 50, |
| 799 type = "group", | 781 type = "group", |
| 800 inline = true, | 782 inline = true, |
| 801 name = "Sound Notifications", | 783 name = L["Sound Notifications"], |
| 802 args = { | 784 args = { |
| 803 descriptionMailProcessed = { | 785 descriptionMailProcessed = { |
| 804 order = 61, | 786 order = 61, |
| 805 type = "description", | 787 type = "description", |
| 806 name = "Play a sound when...", | 788 name = L["Play a sound when..."], |
| 807 }, | 789 }, |
| 808 bagsFullSound = { | 790 bagsFullSound = { |
| 809 order = 100, | 791 order = 100, |
| 810 type = "toggle", | 792 type = "toggle", |
| 811 name = "Inventory is full", | 793 name = L["Inventory is full"], |
| 812 desc = "Play a sound when your inventory is full. You can select what sound in the select box next to this.", | 794 desc = L["Play a sound when your inventory is full. You can select what sound in the select box next to this."], |
| 813 set = function(i, v) MailOpener.db.profile.notifications.bagsFullSound = v; end, | 795 set = function(i, v) MailOpener.db.profile.notifications.bagsFullSound = v; end, |
| 814 get = function() return MailOpener.db.profile.notifications.bagsFullSound; end, | 796 get = function() return MailOpener.db.profile.notifications.bagsFullSound; end, |
| 815 width = "medium", | 797 width = "medium", |
| 816 }, | 798 }, |
| 817 bagsFullSoundFile = { | 799 bagsFullSoundFile = { |
| 818 order = 101, | 800 order = 101, |
| 819 type = "select", | 801 type = "select", |
| 820 name = "Sound File", | 802 name = L["Sound File"], |
| 821 desc = "Sound file to play when your bags are full.", | 803 desc = L["Sound file to play when your bags are full."], |
| 822 dialogControl = "LSM30_Sound", | 804 dialogControl = "LSM30_Sound", |
| 823 set = function(i, v) | 805 set = function(i, v) |
| 824 MailOpener.db.profile.notifications.bagsFullSoundFile = Media:Fetch("sound", v); | 806 MailOpener.db.profile.notifications.bagsFullSoundFile = Media:Fetch("sound", v); |
| 825 MailOpener.db.profile.notifications.bagsFullSoundFileName = v; | 807 MailOpener.db.profile.notifications.bagsFullSoundFileName = v; |
| 826 | 808 |
| 827 PlaySoundFile(MailOpener.db.profile.notifications.bagsFullSoundFile); | 809 PlaySoundFile(MailOpener.db.profile.notifications.bagsFullSoundFile); |
| 828 | 810 |
| 829 print("|cff15ff00Mail Opener|r: You may have to increase the mail opening interval if this sound effect gets spammy. The recommended value is 10 seconds."); | 811 MailOpener:Print(L["You may have to increase the mail opening interval if this sound effect gets spammy. The recommended value is 10 seconds."]); |
| 830 end, | 812 end, |
| 831 get = function() return MailOpener.db.profile.notifications.bagsFullSoundFileName end, | 813 get = function() return MailOpener.db.profile.notifications.bagsFullSoundFileName end, |
| 832 values = function () return (Media:HashTable("sound") or nil); end, | 814 values = function () return (Media:HashTable("sound") or nil); end, |
| 833 disabled = function() return (not MailOpener.db.profile.notifications.bagsFullSound); end, | 815 disabled = function() return (not MailOpener.db.profile.notifications.bagsFullSound); end, |
| 834 }, | 816 }, |
| 835 bagsFullSoundOnlyOnce = { | 817 bagsFullSoundOnlyOnce = { |
| 836 order = 102, | 818 order = 102, |
| 837 type = "toggle", | 819 type = "toggle", |
| 838 name = "Only once", | 820 name = L["Only once"], |
| 839 desc = "Only play this sound once each time new mail has been arrived or your bags are updated.", | 821 desc = L["Only play this sound once each time new mail has been arrived or your bags are updated."], |
| 840 set = function(i, v) MailOpener.db.profile.notifications.bagsFullSoundOnlyOnce = v; end, | 822 set = function(i, v) MailOpener.db.profile.notifications.bagsFullSoundOnlyOnce = v; end, |
| 841 get = function() return MailOpener.db.profile.notifications.bagsFullSoundOnlyOnce; end, | 823 get = function() return MailOpener.db.profile.notifications.bagsFullSoundOnlyOnce; end, |
| 842 disabled = function() return (not MailOpener.db.profile.notifications.bagsFullSound); end, | 824 disabled = function() return (not MailOpener.db.profile.notifications.bagsFullSound); end, |
| 843 --width = "half", | 825 --width = "half", |
| 844 }, | 826 }, |
| 845 bagsFullSoundOnlyOncePerMailboxVisit = { | 827 bagsFullSoundOnlyOncePerMailboxVisit = { |
| 846 order = 103, | 828 order = 103, |
| 847 type = "toggle", | 829 type = "toggle", |
| 848 name = "...per mailbox visit", | 830 name = L["...per mailbox visit"], |
| 849 desc = "Only play this sound once each time you visit the mailbox.", | 831 desc = L["Only play this sound once each time you visit the mailbox."], |
| 850 set = function(i, v) MailOpener.db.profile.notifications.bagsFullSoundOnlyOncePerMailboxVisit = v; end, | 832 set = function(i, v) MailOpener.db.profile.notifications.bagsFullSoundOnlyOncePerMailboxVisit = v; end, |
| 851 get = function() return MailOpener.db.profile.notifications.bagsFullSoundOnlyOncePerMailboxVisit; end, | 833 get = function() return MailOpener.db.profile.notifications.bagsFullSoundOnlyOncePerMailboxVisit; end, |
| 852 disabled = function() return (not MailOpener.db.profile.notifications.bagsFullSound or not MailOpener.db.profile.notifications.bagsFullSoundOnlyOnce); end, | 834 disabled = function() return (not MailOpener.db.profile.notifications.bagsFullSound or not MailOpener.db.profile.notifications.bagsFullSoundOnlyOnce); end, |
| 853 }, | 835 }, |
| 854 mailboxEmptySound = { | 836 mailboxEmptySound = { |
| 855 order = 110, | 837 order = 110, |
| 856 type = "toggle", | 838 type = "toggle", |
| 857 name = "No more mail can be opened", | 839 name = L["No more mail can be opened"], |
| 858 desc = "Play a sound when no more mail can be opened. You can select what sound in the select box next to this.", | 840 desc = L["Play a sound when no more mail can be opened. You can select what sound in the select box next to this."], |
| 859 set = function(i, v) MailOpener.db.profile.notifications.mailboxEmptySound = v; end, | 841 set = function(i, v) MailOpener.db.profile.notifications.mailboxEmptySound = v; end, |
| 860 get = function() return MailOpener.db.profile.notifications.mailboxEmptySound; end, | 842 get = function() return MailOpener.db.profile.notifications.mailboxEmptySound; end, |
| 861 --width = "double", | 843 --width = "double", |
| 862 }, | 844 }, |
| 863 mailboxEmptySoundFile = { | 845 mailboxEmptySoundFile = { |
| 864 order = 111, | 846 order = 111, |
| 865 type = "select", | 847 type = "select", |
| 866 name = "Sound File", | 848 name = L["Sound File"], |
| 867 desc = "Sound file to play when Mail Opener can't open any more mail.", | 849 desc = L["Sound file to play when Mail Opener can't open any more mail."], |
| 868 dialogControl = "LSM30_Sound", | 850 dialogControl = "LSM30_Sound", |
| 869 set = function(i, v) | 851 set = function(i, v) |
| 870 MailOpener.db.profile.notifications.mailboxEmptySoundFile = Media:Fetch("sound", v); | 852 MailOpener.db.profile.notifications.mailboxEmptySoundFile = Media:Fetch("sound", v); |
| 871 MailOpener.db.profile.notifications.mailboxEmptySoundFileName = v; | 853 MailOpener.db.profile.notifications.mailboxEmptySoundFileName = v; |
| 872 | 854 |
| 873 PlaySoundFile(MailOpener.db.profile.notifications.mailboxEmptySoundFile); | 855 PlaySoundFile(MailOpener.db.profile.notifications.mailboxEmptySoundFile); |
| 874 | 856 |
| 875 print("|cff15ff00Mail Opener|r: You may have to increase the mail opening interval if this sound effect gets spammy. The recommended value is 10 seconds."); | 857 MailOpener:Print(L["You may have to increase the mail opening interval if this sound effect gets spammy. The recommended value is 10 seconds."]); |
| 876 end, | 858 end, |
| 877 get = function() return MailOpener.db.profile.notifications.mailboxEmptySoundFileName end, | 859 get = function() return MailOpener.db.profile.notifications.mailboxEmptySoundFileName end, |
| 878 values = function () return (Media:HashTable("sound") or nil); end, | 860 values = function () return (Media:HashTable("sound") or nil); end, |
| 879 disabled = function() return (not MailOpener.db.profile.notifications.mailboxEmptySound); end, | 861 disabled = function() return (not MailOpener.db.profile.notifications.mailboxEmptySound); end, |
| 880 }, | 862 }, |
| 881 mailboxEmptySoundOnlyOnce = { | 863 mailboxEmptySoundOnlyOnce = { |
| 882 order = 112, | 864 order = 112, |
| 883 type = "toggle", | 865 type = "toggle", |
| 884 name = "Only once", | 866 name = L["Only once"], |
| 885 desc = "Only play this sound once each time new mail has been arrived.", | 867 desc = L["Only play this sound once each time new mail has been arrived."], |
| 886 set = function(i, v) MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOnce = v; end, | 868 set = function(i, v) MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOnce = v; end, |
| 887 get = function() return MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOnce; end, | 869 get = function() return MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOnce; end, |
| 888 disabled = function() return (not MailOpener.db.profile.notifications.mailboxEmptySound); end, | 870 disabled = function() return (not MailOpener.db.profile.notifications.mailboxEmptySound); end, |
| 889 --width = "half", | 871 --width = "half", |
| 890 }, | 872 }, |
| 891 mailboxEmptySoundOnlyOncePerMailboxVisit = { | 873 mailboxEmptySoundOnlyOncePerMailboxVisit = { |
| 892 order = 113, | 874 order = 113, |
| 893 type = "toggle", | 875 type = "toggle", |
| 894 name = "...per mailbox visit", | 876 name = L["...per mailbox visit"], |
| 895 desc = "Only play this sound once each time you visit the mailbox.", | 877 desc = L["Only play this sound once each time you visit the mailbox."], |
| 896 set = function(i, v) MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOncePerMailboxVisit = v; end, | 878 set = function(i, v) MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOncePerMailboxVisit = v; end, |
| 897 get = function() return MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOncePerMailboxVisit; end, | 879 get = function() return MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOncePerMailboxVisit; end, |
| 898 disabled = function() return (not MailOpener.db.profile.notifications.bagsFullSound or not MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOnce); end, | 880 disabled = function() return (not MailOpener.db.profile.notifications.bagsFullSound or not MailOpener.db.profile.notifications.mailboxEmptySoundOnlyOnce); end, |
| 899 }, | 881 }, |
| 900 }, | 882 }, |
