diff options
author | Kris Maglione <kris@vimperator.org> | 2010-06-17 08:25:41 -0400 |
---|---|---|
committer | Kris Maglione <kris@vimperator.org> | 2010-06-17 08:25:41 -0400 |
commit | 05a3bcf1806d466e84173d3d52e0f8883db85f92 (patch) | |
tree | 4cf228ce33c0d56c9e5ad65070d0dd54efdfafdf | |
parent | a72c4af900ce44892dde49939b7dfe9c96aedf92 (diff) | |
download | pentadactyl-05a3bcf1806d466e84173d3d52e0f8883db85f92.tar.gz |
Only echo the download complete message in the active window.
--HG--
branch : testing
-rw-r--r-- | common/content/commandline.js | 9 | ||||
-rw-r--r-- | common/content/io.js | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/common/content/commandline.js b/common/content/commandline.js index 81e54619..8ee48769 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -331,10 +331,11 @@ const CommandLine = Module("commandline", { FORCE_MULTILINE : 1 << 0, FORCE_SINGLELINE : 1 << 1, - DISALLOW_MULTILINE : 1 << 2, // if an echo() should try to use the single line + DISALLOW_MULTILINE : 1 << 2, // If an echo() should try to use the single line // but output nothing when the MOW is open; when also // FORCE_MULTILINE is given, FORCE_MULTILINE takes precedence - APPEND_TO_MESSAGES : 1 << 3, // add the string to the message this._history + APPEND_TO_MESSAGES : 1 << 3, // Add the string to the message this._history. + ACTIVE_WINDOW : 1 << 4, // Only echo in active window. get completionContext() this._completions.context, @@ -501,6 +502,10 @@ const CommandLine = Module("commandline", { if (flags & this.APPEND_TO_MESSAGES) this._messageHistory.add({ str: str, highlight: highlightGroup }); + if ((flags & this.ACTIVE_WINDOW) && + window != services.get("windowWatcher").activeWindow && + services.get("windowWatcher").activeWindow.liberator) + return; // The DOM isn't threadsafe. It must only be accessed from the main thread. liberator.callInMainThread(function () { diff --git a/common/content/io.js b/common/content/io.js index 75cb6054..3350df4f 100644 --- a/common/content/io.js +++ b/common/content/io.js @@ -340,7 +340,7 @@ const IO = Module("io", { let file = download.targetFile.path; let size = download.size; - liberator.echomsg("Download of " + title + " to " + file + " finished", 1); + liberator.echomsg("Download of " + title + " to " + file + " finished", 1, commandline.ACTIVE_WINDOW); autocommands.trigger("DownloadPost", { url: url, title: title, file: file, size: size }); } }, |