Mercurial > wow > mailopener
comparison Modules/FailSafe.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 | 8168280420ae |
| 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("FailSafe", "AceEvent-3.0", "AceTimer-3.0"); | 2 local mod = MailOpener:NewModule("FailSafe", "AceEvent-3.0", "AceTimer-3.0"); |
| 3 | 3 |
| 4 mod.moduleDescription = "Prevents the mail opening from completely stopping when the opening of a single mail gets stuck."; | 4 mod.moduleDescription = L["Prevents the mail opening from completely stopping when the opening of a single mail gets stuck."]; |
| 5 mod.moduleRequired = false; | 5 mod.moduleRequired = false; |
| 6 | 6 |
| 7 function mod:OnInitialize() | 7 function mod:OnInitialize() |
| 8 local defaults = { | 8 local defaults = { |
| 9 profile = { | 9 profile = { |
| 72 end | 72 end |
| 73 | 73 |
| 74 function mod:Continue() | 74 function mod:Continue() |
| 75 MailOpener:GetModule("OpenAll"):Continue(); | 75 MailOpener:GetModule("OpenAll"):Continue(); |
| 76 | 76 |
| 77 print("|cff15ff00Mail Opener|r (FailSafe): Mail opening timeout, continueing with the next mail."); | 77 MailOpener:Print(L["(FailSafe) Mail opening timeout, continuing with the next mail."]); |
| 78 end | 78 end |
| 79 | 79 |
| 80 function mod:GetOptionsGroup() | 80 function mod:GetOptionsGroup() |
| 81 local configGroup = { | 81 local configGroup = { |
| 82 order = 0, | 82 order = 0, |
| 83 type = "modulesSubGroup", | 83 type = "modulesSubGroup", |
| 84 name = "FailSafe", | 84 name = L["FailSafe"], |
| 85 desc = "Change settings for the FailSafe module.", | 85 desc = L["Change settings for the FailSafe module."], |
| 86 args = { | 86 args = { |
| 87 General = { | 87 General = { |
| 88 order = 10, | 88 order = 10, |
| 89 type = "group", | 89 type = "group", |
| 90 inline = true, | 90 inline = true, |
| 91 name = "General", | 91 name = L["General"], |
| 92 args = { | 92 args = { |
| 93 description = { | 93 description = { |
| 94 order = 10, | 94 order = 10, |
| 95 type = "description", | 95 type = "description", |
| 96 name = function() | 96 name = function() |
| 97 local descText = "With this button you can completely toggle this module |cff00ff00on|r or |cffff0000off|r. This setting will be remembered and the module will be automatically toggled |cff00ff00on|r or |cffff0000off|r upon logon as it was last set.\n\n"; | 97 local descText = L["With this button you can completely toggle this module |cff00ff00on|r or |cffff0000off|r. This setting will be remembered and the module will be automatically toggled |cff00ff00on|r or |cffff0000off|r upon logon as it was last set."] .. "\n\n"; |
| 98 | 98 |
| 99 if self:IsEnabled() then | 99 if self:IsEnabled() then |
| 100 descText = descText .. "Status: |cff00ff00Enabled|r"; | 100 descText = descText .. L["Status: %s"]:format(L["|cff00ff00Enabled|r"]); |
| 101 else | 101 else |
| 102 descText = descText .. "Status: |cffff0000Disabled|r"; | 102 descText = descText .. L["Status: %s"]:format(L["|cffff0000Disabled|r"]); |
| 103 end | 103 end |
| 104 | 104 |
| 105 return descText; | 105 return descText; |
| 106 end, | 106 end, |
| 107 }, | 107 }, |
| 108 disable = { | 108 disable = { |
| 109 order = 20, | 109 order = 20, |
| 110 type = "execute", | 110 type = "execute", |
| 111 name = function() | 111 name = function() |
| 112 if self:IsEnabled() then | 112 if self:IsEnabled() then |
| 113 return "Disable Module"; | 113 return L["Disable Module"]; |
| 114 else | 114 else |
| 115 return "Enable Module"; | 115 return L["Enable Module"]; |
| 116 end | 116 end |
| 117 end, | 117 end, |
| 118 desc = "Click here to completely toggle this module on or off.", | 118 desc = L["Click here to completely toggle this module on or off."], |
| 119 width = "double", | 119 width = "double", |
| 120 func = function() | 120 func = function() |
| 121 if self:IsEnabled() then | 121 if self:IsEnabled() then |
| 122 self:Disable(); | 122 self:Disable(); |
| 123 | 123 |
| 133 }, | 133 }, |
| 134 SingleMailTimeout = { | 134 SingleMailTimeout = { |
| 135 order = 20, | 135 order = 20, |
| 136 type = "group", | 136 type = "group", |
| 137 inline = true, | 137 inline = true, |
| 138 name = "Single Mail Opening Timeout", | 138 name = L["Single Mail Opening Timeout"], |
| 139 args = { | 139 args = { |
| 140 description = { | 140 description = { |
| 141 order = 10, | 141 order = 10, |
| 142 type = "description", | 142 type = "description", |
| 143 name = "Change how long FailSafe should wait before skipping the last mail and continueing with the next. This will prevent mail opening getting stuck forever because a single mail is frozen for whatever reason.", | 143 name = L["Change how long FailSafe should wait before skipping the last mail and continuing with the next. This will prevent mail opening getting stuck forever because a single mail is frozen for whatever reason."], |
| 144 }, | 144 }, |
| 145 timeout = { | 145 timeout = { |
| 146 order = 20, | 146 order = 20, |
| 147 type = "range", | 147 type = "range", |
| 148 width = "double", | 148 width = "double", |
| 149 min = 1, | 149 min = 1, |
| 150 max = 60, | 150 max = 60, |
| 151 step = 0.5, | 151 step = 0.5, |
| 152 name = "Single Mail Timeout", | 152 name = L["Single Mail Timeout"], |
| 153 desc = "Change how long FailSafe should wait before skipping the last mail and continueing with the next. This should prevent mail opening getting stuck because a single mail is stuck for whatever reason.\n\nDefault value is 20 seconds.", | 153 desc = L["Change how long FailSafe should wait before skipping the last mail and continuing with the next. This should prevent mail opening getting stuck because a single mail is stuck for whatever reason.\n\nDefault value is 20 seconds."], |
| 154 get = function() return self.db.profile.timeout; end, | 154 get = function() return self.db.profile.timeout; end, |
| 155 set = function(i, v) self.db.profile.timeout = v; end, | 155 set = function(i, v) self.db.profile.timeout = v; end, |
| 156 }, | 156 }, |
| 157 }, | 157 }, |
| 158 }, | 158 }, |
