diff options
author | drebs <drebs@leap.se> | 2014-06-03 11:04:02 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2014-06-03 11:07:45 -0300 |
commit | c29e78d2caa6bd0477e92ebab38c62f5bc18c857 (patch) | |
tree | 0ea74b1da56a2d663db1afa52c126bceaabcabbf /chrome/content/statusBar | |
parent | e8de1db4a667fab1525c78847d7b672072caeba2 (diff) |
Only disable caching checkbox if caching is already disabled (#4811).
Diffstat (limited to 'chrome/content/statusBar')
-rw-r--r-- | chrome/content/statusBar/statusBarOverlay.js | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/chrome/content/statusBar/statusBarOverlay.js b/chrome/content/statusBar/statusBarOverlay.js index 31ec16a..c82b3f2 100644 --- a/chrome/content/statusBar/statusBarOverlay.js +++ b/chrome/content/statusBar/statusBarOverlay.js @@ -18,6 +18,7 @@ Components.utils.import("resource:///modules/mailServices.js"); +Components.utils.import("resource://gre/modules/Services.jsm"); var accountNotConfigured = getStringBundle( "chrome://bitmask/locale/statusBar.properties") @@ -51,6 +52,12 @@ function starUp() { updatePanel(); if (!isBitmaskAccountConfigured()) { launchAccountWizard(); + } else { + var server = getBitmaskServer(); + // TODO: add an alert that there exists a bitmask account with caching + // enabled. + //if (server.offlineDownload == true) + // alertPrompt('WARNING!'); } } @@ -86,9 +93,15 @@ function handleStatusBarClick() { * TODO: also verify for SMTP configuration? */ function isBitmaskAccountConfigured() { + return !!getBitmaskServer(); +} + +/** + * Get a configured bitmask account + */ +function getBitmaskServer() { var accountManager = Cc["@mozilla.org/messenger/account-manager;1"] .getService(Ci.nsIMsgAccountManager); - var existing = accountManager.findRealServer( + return accountManager.findRealServer( "", IMAP_HOST, "imap", IMAP_PORT); - return !!existing; } |