From dbe348687eaf95049a2dfe30807c5fc7d2250a2f Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 14 Jun 2009 02:14:03 +1000 Subject: [PATCH] Add an 'online' option to Muttator. Also changed Vimperator's 'offline' to make use of Firefox's BrowserOffline. --- muttator/NEWS | 4 ++++ muttator/content/config.js | 23 +++++++++++++++++++++++ vimperator/content/config.js | 9 +++++---- xulmus/content/config.js | 4 ++-- 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/muttator/NEWS b/muttator/NEWS index 1a72b793..557c0c6f 100644 --- a/muttator/NEWS +++ b/muttator/NEWS @@ -1,3 +1,7 @@ +2009-XX-XX + * version 0.6a1pre + * add 'online' option + 2008-03-29 * version 0.5 * fixes for recent TB nightly changes diff --git a/muttator/content/config.js b/muttator/content/config.js index 318c31ef..3ee2f9b4 100644 --- a/muttator/content/config.js +++ b/muttator/content/config.js @@ -263,10 +263,33 @@ const config = { //{{{ liberator.loadModule("hints", Hints); } + /////////////////////////////////////////////////////////////////////////////}}} + ////////////////////// COMMANDS //////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + commands.add(["pref[erences]", "prefs"], "Show " + config.hostApplication + " preferences", function () { window.openOptionsDialog(); }, { argCount: "0" }); + + /////////////////////////////////////////////////////////////////////////////}}} + ////////////////////// OPTIONS ///////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + + options.add(["online"], + "Set the 'work offline' option", + "boolean", true, + { + setter: function (value) + { + if (MailOfflineMgr.isOnline() != value) + MailOfflineMgr.toggleOfflineStatus(); + return value; + }, + getter: function () MailOfflineMgr.isOnline() + }); + + //}}} } }; //}}} diff --git a/vimperator/content/config.js b/vimperator/content/config.js index 713199ec..65ea883f 100644 --- a/vimperator/content/config.js +++ b/vimperator/content/config.js @@ -197,7 +197,7 @@ const config = { //{{{ delete img; }; - //////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////}}} ////////////////////// MAPPINGS //////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ @@ -470,8 +470,8 @@ const config = { //{{{ setter: function (value) { const ioService = services.get("io"); - ioService.offline = !value; - gPrefService.setBoolPref("browser.offline", ioService.offline); + if (ioService.offline == value) + BrowserOffline.toggleOfflineStatus(); return value; }, getter: function () !services.get("io").offline @@ -504,8 +504,9 @@ const config = { //{{{ options.add(["urlseparator"], "Set the separator regexp used to separate multiple URL args", "string", ",\\s"); + + //}}} } - //}}} }; //}}} // vim: set fdm=marker sw=4 ts=4 et: diff --git a/xulmus/content/config.js b/xulmus/content/config.js index ebcc8fd8..8b3042e9 100644 --- a/xulmus/content/config.js +++ b/xulmus/content/config.js @@ -515,6 +515,7 @@ const config = { //{{{ ////////////////////// OPTIONS ///////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ + // TODO: SB doesn't explicitly support an offline mode. Should we? --djk options.add(["online"], "Set the 'work offline' option", "boolean", true, @@ -523,8 +524,7 @@ const config = { //{{{ { const ioService = services.get("io"); ioService.offline = !value; - //gPrefService.setBoolPref("browser.offline", ioService.offline); - gPrefs.setBoolPref("browser.offline", ioService.offline); + options.setPref("browser.offline", ioService.offline); return value; }, getter: function () !services.get("io").offline