From 0abc4fbc339db1a569ddf8fce5b888cdc9323ff0 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 15 Oct 2010 10:27:10 +1100 Subject: [PATCH] Restore PLAYER mode in Melodactyl. A quick fix to ascertain the status of player features. --HG-- extra : rebase_source : e941b9f0f3a822b2584ddec66875ec421dd7865c --- melodactyl/content/config.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/melodactyl/content/config.js b/melodactyl/content/config.js index 69ca5727..64925ad2 100644 --- a/melodactyl/content/config.js +++ b/melodactyl/content/config.js @@ -1,12 +1,13 @@ // Copyright (c) 2009 by Martin Stubenschrott // Copyright (c) 2009 by Prathyush Thota -// Copyright (c) 2009 by Doug Kearns +// Copyright (c) 2009-2010 by Doug Kearns +// Copyright (c) 2009-2010 by Kris Maglione // // This work is licensed for reuse under an MIT license. Details are // given in the LICENSE.txt file included with this file. "use strict"; -Components.utils.import("resource://gre/modules/utils.js"); // XXX +Components.utils.import("resource://gre/modules/utils.js"); // XXX: PlacesUtils const Config = Module("config", ConfigBase, { init: function init() { @@ -103,12 +104,14 @@ const Config = Module("config", ConfigBase, { function () { SBSubscribe(); }] }, - focusChange: function () { + // TODO: clean this up + focusChange: function (win) { // Switch to -- PLAYER -- mode for Songbird Media Player. if (config.isPlayerWindow) - dactyl.mode = modes.PLAYER; + modes.set(modes.PLAYER); else - dactyl.mode = modes.NORMAL; + if (modes.main == modes.PLAYER) + modes.pop(); }, hasTabbrowser: true, @@ -268,6 +271,7 @@ const Config = Module("config", ConfigBase, { "": modes.NORMAL | modes.INSERT, "": modes.NORMAL | modes.INSERT }; + config.modes.forEach(function (mode) { modes.addMode.apply(modes, mode); }); // XXX }, options: function () { // TODO: SB doesn't explicitly support an offline mode. Should we? --djk