Backout bogus commit (changeset 8b921b3250e6)
This commit is contained in:
Родитель
3cb630a433
Коммит
4b38708ec8
|
@ -456,14 +456,14 @@ ifdef BOTH_MANIFESTS
|
|||
MAKE_JARS_FLAGS += --both-manifests
|
||||
endif
|
||||
|
||||
TAR_CREATE_FLAGS = -chf
|
||||
TAR_CREATE_FLAGS = -cvhf
|
||||
|
||||
ifeq ($(OS_ARCH),BSD_OS)
|
||||
TAR_CREATE_FLAGS = -cLf
|
||||
TAR_CREATE_FLAGS = -cvLf
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
TAR_CREATE_FLAGS = -cf
|
||||
TAR_CREATE_FLAGS = -cvf
|
||||
endif
|
||||
|
||||
#
|
||||
|
|
|
@ -84,7 +84,7 @@ pref("browser.toolbars.showbutton.search", true);
|
|||
pref("browser.download.finished_download_sound", false);
|
||||
pref("browser.download.finished_sound_url", "");
|
||||
pref("browser.download.useDownloadDir", false);
|
||||
pref("browser.download.folderList", 1);
|
||||
pref("browser.download.folderList", 2);
|
||||
|
||||
pref("browser.download.manager.showAlertOnComplete", true);
|
||||
pref("browser.download.manager.showAlertInterval", 2000);
|
||||
|
|
|
@ -235,8 +235,7 @@
|
|||
insertafter="context-savelink"/>
|
||||
<menu id="frame">
|
||||
<menupopup id="frame_popup">
|
||||
<menuitem id="context-sendframe"
|
||||
insertafter="context-saveframe"
|
||||
<menuitem insertafter="saveframeas"
|
||||
label="&contextSendFrame.label;"
|
||||
accesskey="&contextSendFrame.accesskey;"
|
||||
oncommand="sendPage(gContextMenu.target.ownerDocument);"/>
|
||||
|
|
|
@ -252,7 +252,6 @@
|
|||
title="&locationBar.title;">
|
||||
<textbox id="urlbar" class="chromeclass-location uri-element" flex="1"
|
||||
type="autocomplete" autocompletesearch="history file"
|
||||
completedefaultindex="true" forcecomplete="false"
|
||||
timeout="50" maxrows="6"
|
||||
disablehistory="false" accesskey="&locationBar.accesskey;"
|
||||
defaultSearchEngine="true" tabscrolling="true"
|
||||
|
|
|
@ -35,7 +35,6 @@ function step3()
|
|||
|
||||
function step3_5()
|
||||
{
|
||||
is(document.activeElement.localName, "tab", "tab key to tab activeElement");
|
||||
is(document.activeElement, tab1, "tab key to tab activeElement");
|
||||
|
||||
EventUtils.synthesizeMouse(tab1, 9, 9, {});
|
||||
|
|
|
@ -249,40 +249,34 @@
|
|||
<menuseparator id="frame-sep"/>
|
||||
<menu id="frame" label="&thisFrameMenu.label;" accesskey="&thisFrameMenu.accesskey;">
|
||||
<menupopup id="frame_popup">
|
||||
<menuitem id="context-showonlythisframe"
|
||||
label="&showOnlyThisFrameCmd.label;"
|
||||
<menuitem label="&showOnlyThisFrameCmd.label;"
|
||||
accesskey="&showOnlyThisFrameCmd.accesskey;"
|
||||
oncommand="gContextMenu.showOnlyThisFrame();"/>
|
||||
<menuitem id="context-openframe"
|
||||
label="&openFrameCmd.label;"
|
||||
<menuitem label="&openFrameCmd.label;"
|
||||
accesskey="&openFrameCmd.accesskey;"
|
||||
oncommand="gContextMenu.openFrame();"/>
|
||||
<menuitem id="context-openframeintab"
|
||||
label="&openFrameCmdInTab.label;"
|
||||
<menuitem label="&openFrameCmdInTab.label;"
|
||||
accesskey="&openFrameCmdInTab.accesskey;"
|
||||
oncommand="gContextMenu.openFrameInTab(event.shiftKey);"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="context-reloadframe"
|
||||
<menuitem id="context-reload-frame"
|
||||
label="&reloadFrameCmd.label;"
|
||||
accesskey="&reloadFrameCmd.accesskey;"
|
||||
oncommand="gContextMenu.reloadFrame();"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="context-bookmarkframe"
|
||||
label="&bookmarkFrameCmd.label;"
|
||||
<menuitem label="&bookmarkFrameCmd.label;"
|
||||
accesskey="&bookmarkFrameCmd.accesskey;"
|
||||
oncommand="gContextMenu.addBookmarkForFrame();"/>
|
||||
<menuitem id="context-saveframe"
|
||||
<menuitem id="saveframeas"
|
||||
valueSaveAs="&saveFrameAsCmd.label;"
|
||||
valueSave="&saveFrameCmd.label;"
|
||||
accesskey="&saveFrameCmd.accesskey;"
|
||||
oncommand="saveDocument(gContextMenu.target.ownerDocument);"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="context-viewframesource"
|
||||
label="&viewFrameSourceCmd.label;"
|
||||
<menuitem label="&viewFrameSourceCmd.label;"
|
||||
accesskey="&viewFrameSourceCmd.accesskey;"
|
||||
oncommand="gContextMenu.viewFrameSource();"/>
|
||||
<menuitem id="context-viewframeinfo"
|
||||
label="&viewFrameInfoCmd.label;"
|
||||
<menuitem label="&viewFrameInfoCmd.label;"
|
||||
accesskey="&viewFrameInfoCmd.accesskey;"
|
||||
oncommand="gContextMenu.viewFrameInfo();"/>
|
||||
</menupopup>
|
||||
|
|
|
@ -532,8 +532,6 @@ function initFileInfo(aFI, aURL, aURLCharset, aDocument,
|
|||
* prompting the user to confirm (or change) the fileName.
|
||||
* @param aFpP a structure (see definition in internalSave(...) method)
|
||||
* containing all the data used within this method.
|
||||
* @param aSkipPrompt If true, we will attempt not to prompt the user for a
|
||||
download location
|
||||
* @return true if the user confirmed a filename in the picker; false if they
|
||||
* dismissed the picker.
|
||||
*/
|
||||
|
|
|
@ -75,14 +75,6 @@ function dmStartup()
|
|||
gDownloadListener = new DownloadProgressListener();
|
||||
gDownloadManager.addListener(gDownloadListener);
|
||||
|
||||
// correct keybinding command attributes which don't do our business yet
|
||||
var key = document.getElementById("key_delete");
|
||||
if (key.hasAttribute("command"))
|
||||
key.setAttribute("command", "cmd_stop");
|
||||
key = document.getElementById("key_delete2");
|
||||
if (key.hasAttribute("command"))
|
||||
key.setAttribute("command", "cmd_stop");
|
||||
|
||||
gDownloadTree.focus();
|
||||
|
||||
if (gDownloadTree.view.rowCount > 0)
|
||||
|
@ -441,13 +433,11 @@ var dlTreeController = {
|
|||
supportsCommand: function(aCommand)
|
||||
{
|
||||
switch (aCommand) {
|
||||
case "cmd_play":
|
||||
case "cmd_pause":
|
||||
case "cmd_resume":
|
||||
case "cmd_retry":
|
||||
case "cmd_cancel":
|
||||
case "cmd_remove":
|
||||
case "cmd_stop":
|
||||
case "cmd_open":
|
||||
case "cmd_show":
|
||||
case "cmd_openReferrer":
|
||||
|
@ -470,13 +460,6 @@ var dlTreeController = {
|
|||
null;
|
||||
|
||||
switch (aCommand) {
|
||||
case "cmd_play":
|
||||
return selectionCount == 1 &&
|
||||
((selItemData.resumable &&
|
||||
(selItemData.isActive ||
|
||||
selItemData.state == nsIDownloadManager.DOWNLOAD_PAUSED)) ||
|
||||
(selItemData.state == nsIDownloadManager.DOWNLOAD_CANCELED ||
|
||||
selItemData.state == nsIDownloadManager.DOWNLOAD_FAILED));
|
||||
case "cmd_pause":
|
||||
return selectionCount == 1 &&
|
||||
selItemData.isActive &&
|
||||
|
@ -501,8 +484,6 @@ var dlTreeController = {
|
|||
selItemData.state == nsIDownloadManager.DOWNLOAD_FAILED);
|
||||
case "cmd_remove":
|
||||
return selectionCount == 1 && !selItemData.isActive;
|
||||
case "cmd_stop":
|
||||
return selectionCount == 1;
|
||||
case "cmd_openReferrer":
|
||||
return selectionCount == 1 && !!selItemData.referrer;
|
||||
case "cmd_copyLocation":
|
||||
|
@ -539,20 +520,6 @@ var dlTreeController = {
|
|||
}
|
||||
|
||||
switch (aCommand) {
|
||||
case "cmd_play":
|
||||
switch (selItemData.state) {
|
||||
case nsIDownloadManager.DOWNLOAD_DOWNLOADING:
|
||||
pauseDownload(selItemData.dlid);
|
||||
break;
|
||||
case nsIDownloadManager.DOWNLOAD_PAUSED:
|
||||
resumeDownload(selItemData.dlid);
|
||||
break;
|
||||
case nsIDownloadManager.DOWNLOAD_FAILED:
|
||||
case nsIDownloadManager.DOWNLOAD_CANCELED:
|
||||
retryDownload(selItemData.dlid);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case "cmd_pause":
|
||||
pauseDownload(selItemData.dlid);
|
||||
break;
|
||||
|
@ -570,14 +537,6 @@ var dlTreeController = {
|
|||
case "cmd_remove":
|
||||
removeDownload(selItemData.dlid);
|
||||
break;
|
||||
case "cmd_stop":
|
||||
if (selItemData.isActive)
|
||||
// fake an nsIDownload with the properties needed by that function
|
||||
cancelDownload({id: selItemData.dlid,
|
||||
targetFile: getLocalFileFromNativePathOrUrl(selItemData.file)});
|
||||
else
|
||||
removeDownload(selItemData.dlid);
|
||||
break;
|
||||
case "cmd_open":
|
||||
// fake an nsIDownload with the properties needed by that function
|
||||
openDownload({displayName: selItemData.target,
|
||||
|
@ -635,10 +594,9 @@ var dlTreeController = {
|
|||
},
|
||||
|
||||
onCommandUpdate: function() {
|
||||
var cmds = ["cmd_play", "cmd_pause", "cmd_resume", "cmd_retry",
|
||||
"cmd_cancel", "cmd_remove", "cmd_stop", "cmd_open", "cmd_show",
|
||||
"cmd_openReferrer", "cmd_copyLocation", "cmd_selectAll",
|
||||
"cmd_clearList"];
|
||||
var cmds = ["cmd_pause", "cmd_resume", "cmd_retry", "cmd_cancel",
|
||||
"cmd_remove", "cmd_open", "cmd_show", "cmd_openReferrer",
|
||||
"cmd_copyLocation", "cmd_selectAll", "cmd_clearList"];
|
||||
for (let command in cmds)
|
||||
goUpdateCommand(cmds[command]);
|
||||
}
|
||||
|
|
|
@ -91,8 +91,6 @@
|
|||
oncommandupdate="dlTreeController.onCommandUpdate()"/>
|
||||
|
||||
<commandset id="downloadCommands">
|
||||
<command id="cmd_play"
|
||||
oncommand="goDoCommand('cmd_play');"/>
|
||||
<command id="cmd_pause"
|
||||
oncommand="goDoCommand('cmd_pause');"/>
|
||||
<command id="cmd_resume"
|
||||
|
@ -103,8 +101,6 @@
|
|||
oncommand="goDoCommand('cmd_cancel');"/>
|
||||
<command id="cmd_remove"
|
||||
oncommand="goDoCommand('cmd_remove');"/>
|
||||
<command id="cmd_stop"
|
||||
oncommand="goDoCommand('cmd_stop');"/>
|
||||
<command id="cmd_open"
|
||||
oncommand="goDoCommand('cmd_open');"/>
|
||||
<command id="cmd_show"
|
||||
|
@ -120,20 +116,11 @@
|
|||
|
||||
<keyset id="tasksKeys">
|
||||
<!-- File Menu -->
|
||||
<key id="key_open"
|
||||
keycode="VK_ENTER"
|
||||
command="cmd_open"/>
|
||||
<key id="key_open2"
|
||||
keycode="VK_RETURN"
|
||||
command="cmd_open"/>
|
||||
<key id="key_close"/>
|
||||
<key id="key_quit"/>
|
||||
<!-- Edit Menu -->
|
||||
<key id="key_cut"/>
|
||||
<key id="key_copy"/>
|
||||
<key id="key_play"
|
||||
key=" "
|
||||
command="cmd_play"/>
|
||||
<key id="key_delete"/>
|
||||
<key id="key_delete2"/>
|
||||
<key id="key_selectAll"/>
|
||||
|
@ -196,7 +183,6 @@
|
|||
<menuitem id="dlMenu_open"
|
||||
label="&cmd.open.label;"
|
||||
accesskey="&cmd.open.accesskey;"
|
||||
key="key_open"
|
||||
command="cmd_open"/>
|
||||
<menuitem id="dlMenu_show"
|
||||
label="&cmd.show.label;"
|
||||
|
@ -369,7 +355,6 @@
|
|||
class="plain"
|
||||
context="downloadContext"
|
||||
enableColumnDrag="true"
|
||||
ondblclick="goDoCommand('cmd_open');"
|
||||
onselect="onTreeSelect(event);">
|
||||
<treecols context="" onclick="sortDownloads(event.target)">
|
||||
<treecol id="Name"
|
||||
|
|
|
@ -44,14 +44,11 @@ include $(DEPTH)/config/autoconf.mk
|
|||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
_CHROME_FILES = \
|
||||
test_action_keys_respect_focus.xul \
|
||||
test_basic_functionality.xul \
|
||||
test_cleanup_search.xul \
|
||||
test_clear_button_disabled.xul \
|
||||
test_close_download_manager.xul \
|
||||
test_delete_key_cancels.xul \
|
||||
test_delete_key_removes.xul \
|
||||
test_enter_dblclick_opens.xul \
|
||||
test_multi_select.xul \
|
||||
test_multiword_search.xul \
|
||||
test_removeDownload_updates_ui.xul \
|
||||
|
@ -59,7 +56,6 @@ _CHROME_FILES = \
|
|||
test_search_keys.xul \
|
||||
test_select_all.xul \
|
||||
test_space_key_pauses_resumes.xul \
|
||||
test_space_key_retries.xul \
|
||||
test_ui_stays_open_on_alert_clickback.xul \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -170,7 +170,7 @@ function test()
|
|||
synthesizeKey("VK_DELETE", {}, win);
|
||||
|
||||
stmt.executeStep();
|
||||
is(stmt.getInt32(0), len - (i + 1),
|
||||
todo_is(stmt.getInt32(0), len - (i + 1),
|
||||
"The download was properly removed");
|
||||
stmt.reset();
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ bug413985obs.prototype = {
|
|||
observe: function(aSubject, aTopic, aData)
|
||||
{
|
||||
if ("timer-callback" == aTopic) {
|
||||
// dispatch a space keypress to pause/resume the download
|
||||
// dispatch a space keypress to resume the download
|
||||
synthesizeKey(" ", {}, this.mWin);
|
||||
}
|
||||
},
|
||||
|
@ -77,11 +77,8 @@ bug413985obs.prototype = {
|
|||
if (aDownload.state == Components.interfaces.nsIDownloadManager.DOWNLOAD_DOWNLOADING &&
|
||||
!this.wasPaused) {
|
||||
this.wasPaused = true;
|
||||
// We have to do this on a timer so other JS stuff that handles the UI
|
||||
// can actually catch up to us...
|
||||
var timer = Components.classes["@mozilla.org/timer;1"]
|
||||
.createInstance(Components.interfaces.nsITimer);
|
||||
timer.init(this, 0, Components.interfaces.nsITimer.TYPE_ONE_SHOT);
|
||||
// dispatch a space keypress to pause the download
|
||||
synthesizeKey(" ", {}, this.mWin);
|
||||
}
|
||||
|
||||
if (aDownload.state == Components.interfaces.nsIDownloadManager.DOWNLOAD_PAUSED &&
|
||||
|
@ -95,7 +92,7 @@ bug413985obs.prototype = {
|
|||
}
|
||||
|
||||
if (aDownload.state == Components.interfaces.nsIDownloadManager.DOWNLOAD_FINISHED) {
|
||||
ok(this.wasPaused && this.wasResumed,
|
||||
todo(this.wasPaused && this.wasResumed,
|
||||
"The download was paused, and then resumed to completion");
|
||||
aDownload.targetFile.remove(false);
|
||||
|
||||
|
@ -172,9 +169,9 @@ function test()
|
|||
var doc = win.document;
|
||||
dm.addListener(new bug413985obs(win));
|
||||
|
||||
addDownload();
|
||||
var dl = addDownload();
|
||||
// we need to focus the download as well
|
||||
doc.getElementById("downloadTree").view.selection.select(0);
|
||||
doc.getElementById("downloadTree").view.selecttion.select(0);
|
||||
os.removeObserver(testObs, DLMGR_UI_DONE);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -319,10 +319,10 @@ DownloadTreeView.prototype = {
|
|||
this._dlList[row].currBytes = aDownload.amountTransferred;
|
||||
this._dlList[row].maxBytes = aDownload.size;
|
||||
this._dlList[row].progress = aDownload.percentComplete;
|
||||
this._dlList[row].resumable = aDownload.resumable;
|
||||
}
|
||||
if (this._dlList[row].state != aDownload.state) {
|
||||
this._dlList[row].state = aDownload.state;
|
||||
this._dlList[row].resumable = aDownload.resumable;
|
||||
switch (this._dlList[row].state) {
|
||||
case nsIDownloadManager.DOWNLOAD_NOTSTARTED:
|
||||
case nsIDownloadManager.DOWNLOAD_DOWNLOADING:
|
||||
|
@ -355,22 +355,12 @@ DownloadTreeView.prototype = {
|
|||
// Make sure we have an item to remove
|
||||
if (row < 0) return;
|
||||
|
||||
var index = this.selection.currentIndex;
|
||||
var wasSingleSelection = this.selection.count == 1;
|
||||
|
||||
// Remove data from the download list
|
||||
this._dlList.splice(row, 1);
|
||||
|
||||
// Tell the tree we removed 1 row at the given row index
|
||||
this._tree.rowCountChanged(row, -1);
|
||||
|
||||
// Update selection if only removed download was selected
|
||||
if (wasSingleSelection && this.selection.count == 0) {
|
||||
index = Math.min(index, this.rowCount - 1);
|
||||
if (index >= 0)
|
||||
this.selection.select(index);
|
||||
}
|
||||
|
||||
window.updateCommands("tree-select");
|
||||
},
|
||||
|
||||
|
|
|
@ -38,177 +38,68 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
const kDesktop = 0;
|
||||
const kDownloads = 1;
|
||||
const kUserDir = 2;
|
||||
var gFPHandler;
|
||||
|
||||
function Startup()
|
||||
{
|
||||
var pAutoDL = document.getElementById("browser.download.autoDownload");
|
||||
SetAutoDLEnabled(pAutoDL.value);
|
||||
var pDLSound = document.getElementById("browser.download.finished_download_sound");
|
||||
SetSoundEnabled(pDLSound.value);
|
||||
|
||||
// Define globals
|
||||
gFPHandler = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService)
|
||||
.getProtocolHandler("file")
|
||||
.QueryInterface(Components.interfaces.nsIFileProtocolHandler);
|
||||
gFPHandler = Components.classes["@mozilla.org/network/protocol;1?name=file"]
|
||||
.getService(Components.interfaces.nsIFileProtocolHandler);
|
||||
|
||||
// if we don't have the alert service, hide the pref UI for using alerts to
|
||||
// notify on download completion
|
||||
// see bug #158711
|
||||
/* XXX: sound is to be reintroduced with bug 490467
|
||||
var downloadDoneNotificationAlertUI = document.getElementById("finishedNotificationAlert");
|
||||
downloadDoneNotificationAlertUI.hidden = !("@mozilla.org/alerts-service;1" in Components.classes);
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables/disables the folder field and Browse button based on whether a
|
||||
* default download directory is being used.
|
||||
*/
|
||||
function ReadUseDownloadDir()
|
||||
function SetAutoDLEnabled(aEnable)
|
||||
{
|
||||
var downloadFolder = document.getElementById("downloadFolder");
|
||||
var chooseFolder = document.getElementById("chooseFolder");
|
||||
var preference = document.getElementById("browser.download.useDownloadDir");
|
||||
downloadFolder.disabled = !preference.value;
|
||||
chooseFolder.disabled = !preference.value;
|
||||
EnableElementById("downloadLocation", !aEnable, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a file picker in which the user can choose the location where
|
||||
* downloads are automatically saved, updating preferences and UI in
|
||||
* response to the choice, if one is made.
|
||||
*/
|
||||
function ChooseFolder()
|
||||
{
|
||||
const nsIFilePicker = Components.interfaces.nsIFilePicker;
|
||||
|
||||
var fp = Components.classes["@mozilla.org/filepicker;1"]
|
||||
.createInstance(nsIFilePicker);
|
||||
var prefutilitiesBundle = document.getElementById("bundle_prefutilities");
|
||||
var title = prefutilitiesBundle.getString("downloadfolder");
|
||||
fp.init(window, title, nsIFilePicker.modeGetFolder);
|
||||
fp.appendFilters(nsIFilePicker.filterAll);
|
||||
|
||||
var folderListPref = document.getElementById("browser.download.folderList");
|
||||
fp.displayDirectory = IndexToFolder(folderListPref.value); // file
|
||||
|
||||
if (fp.show() == nsIFilePicker.returnOK) {
|
||||
var currentDirPref = document.getElementById("browser.download.dir");
|
||||
currentDirPref.value = fp.file;
|
||||
folderListPref.value = FolderToIndex(fp.file);
|
||||
// Note, the real prefs will not be updated yet, so dnld manager's
|
||||
// userDownloadsDirectory may not return the right folder after
|
||||
// this code executes. displayDownloadDirPref will be called on
|
||||
// the assignment above to update the UI.
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the download folder display settings based on the user's
|
||||
* preferences.
|
||||
*/
|
||||
function DisplayDownloadDirPref()
|
||||
{
|
||||
var folderListPref = document.getElementById("browser.download.folderList");
|
||||
var currentDirPref = IndexToFolder(folderListPref.value); // file
|
||||
var prefutilitiesBundle = document.getElementById("bundle_prefutilities");
|
||||
var iconUrlSpec = gFPHandler.getURLSpecFromFile(currentDirPref);
|
||||
var downloadFolder = document.getElementById("downloadFolder");
|
||||
downloadFolder.image = "moz-icon://" + iconUrlSpec + "?size=16";
|
||||
|
||||
// Display a 'pretty' label or the path in the UI.
|
||||
switch (FolderToIndex(currentDirPref)) {
|
||||
case kDesktop:
|
||||
downloadFolder.label = prefutilitiesBundle.getString("desktopFolderName");
|
||||
break;
|
||||
case kDownloads:
|
||||
downloadFolder.label = prefutilitiesBundle.getString("downloadsFolderName");
|
||||
break;
|
||||
default:
|
||||
downloadFolder.label = currentDirPref ? currentDirPref.path : "";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Desktop folder.
|
||||
*/
|
||||
function GetDesktopFolder()
|
||||
{
|
||||
return Components.classes["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Components.interfaces.nsIProperties)
|
||||
.get("Desk", Components.interfaces.nsILocalFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Downloads folder as determined by the XPCOM directory service
|
||||
* via the download manager's attribute defaultDownloadsDirectory.
|
||||
*/
|
||||
function GetDownloadsFolder()
|
||||
{
|
||||
return Components.classes["@mozilla.org/download-manager;1"]
|
||||
.getService(Components.interfaces.nsIDownloadManager)
|
||||
.defaultDownloadsDirectory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines the type of the given folder.
|
||||
*
|
||||
* @param aFolder
|
||||
* the folder whose type is to be determined
|
||||
* @returns integer
|
||||
* kDesktop if aFolder is the Desktop or is unspecified,
|
||||
* kDownloads if aFolder is the Downloads folder,
|
||||
* kUserDir otherwise
|
||||
*/
|
||||
function FolderToIndex(aFolder)
|
||||
{
|
||||
if (!aFolder || aFolder.equals(GetDesktopFolder()))
|
||||
return kDesktop;
|
||||
if (aFolder.equals(GetDownloadsFolder()))
|
||||
return kDownloads;
|
||||
return kUserDir;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts an integer into the corresponding folder.
|
||||
*
|
||||
* @param aIndex
|
||||
* an integer
|
||||
* @returns the Desktop folder if aIndex == kDesktop,
|
||||
* the Downloads folder if aIndex == kDownloads,
|
||||
* the folder stored in browser.download.dir
|
||||
*/
|
||||
function IndexToFolder(aIndex)
|
||||
{
|
||||
var folder;
|
||||
switch (aIndex) {
|
||||
default:
|
||||
folder = document.getElementById("browser.download.dir").value;
|
||||
if (folder && folder.exists())
|
||||
return folder;
|
||||
case kDownloads:
|
||||
folder = GetDownloadsFolder();
|
||||
if (folder && folder.exists())
|
||||
return folder;
|
||||
case kDesktop:
|
||||
return GetDesktopFolder();
|
||||
}
|
||||
}
|
||||
|
||||
/* XXX: sound is to be reintroduced with bug 490467
|
||||
function SetSoundEnabled(aEnable)
|
||||
{
|
||||
EnableElementById("downloadSndURL", aEnable, false);
|
||||
document.getElementById("downloadSndPreview").disabled = !aEnable;
|
||||
}
|
||||
|
||||
function ReadDLFolder(aField)
|
||||
{
|
||||
var file = document.getElementById("browser.download.dir").value;
|
||||
if (file)
|
||||
{
|
||||
aField.file = file;
|
||||
aField.label = (/Mac/.test(navigator.platform)) ? file.leafName : file.path;
|
||||
}
|
||||
}
|
||||
|
||||
function DownloadSelectFolder()
|
||||
{
|
||||
var pref = document.getElementById("browser.download.dir");
|
||||
const nsIFilePicker = Components.interfaces.nsIFilePicker;
|
||||
var fp = Components.classes["@mozilla.org/filepicker;1"]
|
||||
.createInstance(nsIFilePicker);
|
||||
var prefutilitiesBundle = document.getElementById("bundle_prefutilities");
|
||||
var title = prefutilitiesBundle.getString("downloadfolder");
|
||||
fp.init(window, title, nsIFilePicker.modeGetFolder);
|
||||
fp.displayDirectory = pref.value;
|
||||
fp.appendFilters(nsIFilePicker.filterAll);
|
||||
if (fp.show() == nsIFilePicker.returnOK)
|
||||
pref.value = fp.file;
|
||||
}
|
||||
|
||||
|
||||
function BrowseSound()
|
||||
{
|
||||
var pref = document.getElementById("browser.download.finished_sound_url");
|
||||
|
||||
const nsIFilePicker = Components.interfaces.nsIFilePicker;
|
||||
const nsILocalFile = Components.interfaces.nsILocalFile;
|
||||
var fp = Components.classes["@mozilla.org/filepicker;1"]
|
||||
.createInstance(nsIFilePicker);
|
||||
var prefutilitiesBundle = document.getElementById("bundle_prefutilities");
|
||||
|
@ -253,4 +144,3 @@ function ReadSndFile(aField)
|
|||
aField.label = (/Mac/.test(navigator.platform)) ? file.leafName : file.path;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
|
|
@ -48,24 +48,17 @@
|
|||
script="chrome://communicator/content/pref/pref-download.js">
|
||||
|
||||
<preferences>
|
||||
<preference id="browser.download.manager.focusWhenStarting"
|
||||
name="browser.download.manager.focusWhenStarting"
|
||||
type="bool" inverted="true"/>
|
||||
<preference id="browser.download.manager.behavior"
|
||||
name="browser.download.manager.behavior"
|
||||
<preference id="browser.downloadmanager.behavior"
|
||||
name="browser.downloadmanager.behavior"
|
||||
type="int"/>
|
||||
<preference id="browser.download.useDownloadDir"
|
||||
name="browser.download.useDownloadDir"
|
||||
<preference id="browser.download.autoDownload"
|
||||
name="browser.download.autoDownload"
|
||||
type="bool"
|
||||
onchange="SetAutoDLEnabled(this.value);"/>
|
||||
<preference id="browser.download.lastLocation"
|
||||
name="browser.download.lastLocation"
|
||||
type="bool"/>
|
||||
<preference id="browser.download.dir"
|
||||
name="browser.download.dir"
|
||||
type="file"/>
|
||||
<preference id="browser.download.folderList"
|
||||
name="browser.download.folderList"
|
||||
type="int"
|
||||
onchange="DisplayDownloadDirPref();"/>
|
||||
<!-- XXX: to be reintroduced with bug 490467
|
||||
preference id="browser.download.finished_download_sound"
|
||||
<preference id="browser.download.finished_download_sound"
|
||||
name="browser.download.finished_download_sound"
|
||||
type="bool"
|
||||
onchange="SetSoundEnabled(this.value);"/>
|
||||
|
@ -74,18 +67,16 @@
|
|||
type="bool"/>
|
||||
<preference id="browser.download.finished_sound_url"
|
||||
name="browser.download.finished_sound_url"
|
||||
type="string"/ -->
|
||||
type="string"/>
|
||||
<preference id="browser.download.dir"
|
||||
name="browser.download.dir"
|
||||
type="file"/>
|
||||
</preferences>
|
||||
|
||||
<groupbox>
|
||||
<caption label="&downloadBehavior.label;"/>
|
||||
<checkbox id="focusWhenStarting"
|
||||
label="&focusWhenStarting.label;"
|
||||
preference="browser.download.manager.focusWhenStarting"
|
||||
accesskey="&focusWhenStarting.accesskey;"/>
|
||||
<radiogroup id="downloadBehavior"
|
||||
class="indent"
|
||||
preference="browser.download.manager.behavior">
|
||||
preference="browser.downloadmanager.behavior">
|
||||
<radio value="0"
|
||||
label="&openDM.label;"
|
||||
accesskey="&openDM.accesskey;"/>
|
||||
|
@ -100,41 +91,57 @@
|
|||
|
||||
<groupbox>
|
||||
<caption label="&downloadLocation.label;"/>
|
||||
<radiogroup id="saveWhere"
|
||||
preference="browser.download.useDownloadDir"
|
||||
onsyncfrompreference="return document.getElementById('download_pane').ReadUseDownloadDir();">
|
||||
<hbox id="saveToRow">
|
||||
<radio id="saveTo" value="true"
|
||||
label="&saveTo.label;"
|
||||
accesskey="&saveTo.accesskey;"
|
||||
aria-labelledby="saveTo downloadFolder"/>
|
||||
<filefield id="downloadFolder" flex="1"
|
||||
<radiogroup id="autoDownload"
|
||||
preference="browser.download.autoDownload">
|
||||
<radio value="false"
|
||||
label="&promptDownload.label;"
|
||||
accesskey="&promptDownload.accesskey;"/>
|
||||
<radiogroup id="downloadLocation"
|
||||
class="indent"
|
||||
preference="browser.download.lastLocation">
|
||||
<radio value="true"
|
||||
label="&lastLocation.label;"
|
||||
accesskey="&lastLocation.accesskey;"/>
|
||||
<radio value="false"
|
||||
label="&specifiedLocation.label;"
|
||||
accesskey="&specifiedLocation.accesskey;"/>
|
||||
</radiogroup>
|
||||
<radio value="true"
|
||||
label="&autoDownload.label;"
|
||||
accesskey="&autoDownload.accesskey;"/>
|
||||
</radiogroup>
|
||||
|
||||
<separator class="thin"/>
|
||||
|
||||
<vbox>
|
||||
<label value="&downloadFolder.label;"/>
|
||||
<hbox align="center">
|
||||
<filefield id="downloadFolder"
|
||||
flex="1"
|
||||
preference="browser.download.dir"
|
||||
preference-editable="true"
|
||||
aria-labelledby="saveTo"
|
||||
onsyncfrompreference="document.getElementById('download_pane').DisplayDownloadDirPref();"/>
|
||||
<button id="chooseFolder" oncommand="ChooseFolder();"
|
||||
onsyncfrompreference="return document.getElementById('download_pane').ReadDLFolder(this);"/>
|
||||
<button id="chooseDownloadFolder"
|
||||
label="&chooseDownloadFolder.label;"
|
||||
accesskey="&chooseDownloadFolder.accesskey;"/>
|
||||
accesskey="&chooseDownloadFolder.accesskey;"
|
||||
oncommand="DownloadSelectFolder();">
|
||||
<observes element="downloadFolder" attribute="disabled"/>
|
||||
</button>
|
||||
</hbox>
|
||||
<radio id="alwaysAsk" value="false"
|
||||
label="&alwaysAsk.label;"
|
||||
accesskey="&alwaysAsk.accesskey;"/>
|
||||
</radiogroup>
|
||||
</vbox>
|
||||
</groupbox>
|
||||
|
||||
<!-- XXX: to be reintroduced with bug 490467
|
||||
groupbox>
|
||||
<groupbox>
|
||||
<caption label="&finishedBehavior.label;"/>
|
||||
<hbox align="center">
|
||||
<checkbox id="finishedNotificationSound"
|
||||
<checkbox id="finishedNotificationSound"
|
||||
label="&playSound.label;"
|
||||
preference="browser.download.finished_download_sound"
|
||||
accesskey="&playSound.accesskey;"/>
|
||||
<checkbox id="finishedNotificationAlert"
|
||||
preference="browser.download.finished_download_sound"
|
||||
accesskey="&playSound.accesskey;"/>
|
||||
<checkbox id="finishedNotificationAlert"
|
||||
label="&showAlert.label;"
|
||||
preference="browser.download.finished_download_alert"
|
||||
accesskey="&showAlert.accesskey;"/>
|
||||
preference="browser.download.finished_download_alert"
|
||||
accesskey="&showAlert.accesskey;"/>
|
||||
</hbox>
|
||||
|
||||
<hbox align="center" class="indent">
|
||||
|
@ -156,6 +163,6 @@
|
|||
oncommand="PreviewSound();"/>
|
||||
</hbox>
|
||||
</hbox>
|
||||
</groupbox -->
|
||||
</groupbox>
|
||||
</prefpane>
|
||||
</overlay>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<!-- Context Menu -->
|
||||
<!ENTITY popupWindowRejectCmd.label "Reject popup windows from this site">
|
||||
<!ENTITY popupWindowRejectCmd.accesskey "o">
|
||||
<!ENTITY popupWindowRejectCmd.accesskey "">
|
||||
<!ENTITY popupWindowAllowCmd.label "Allow popup windows from this site">
|
||||
<!ENTITY popupWindowAllowCmd.accesskey "o">
|
||||
<!ENTITY popupWindowAllowCmd.accesskey "">
|
||||
<!ENTITY openLinkCmd.label "Open Link in New Window">
|
||||
<!ENTITY openLinkCmd.accesskey "W">
|
||||
<!ENTITY openLinkCmdInTab.label "Open Link in New Tab">
|
||||
|
@ -30,7 +30,7 @@
|
|||
<!ENTITY reloadFrameCmd.accesskey "R">
|
||||
<!ENTITY viewPartialSourceForSelectionCmd.label "View Selection Source">
|
||||
<!ENTITY viewPartialSourceForMathMLCmd.label "View MathML Source">
|
||||
<!ENTITY viewPartialSourceCmd.accesskey "u">
|
||||
<!ENTITY viewPartialSourceCmd.accesskey "e">
|
||||
<!ENTITY viewPageSourceCmd.label "View Page Source">
|
||||
<!ENTITY viewPageSourceCmd.accesskey "V">
|
||||
<!ENTITY viewFrameSourceCmd.label "View Frame Source">
|
||||
|
@ -42,29 +42,29 @@
|
|||
<!ENTITY fitImageCmd.label "Fit Image to Window">
|
||||
<!ENTITY fitImageCmd.accesskey "F">
|
||||
<!ENTITY reloadImageCmd.label "Reload Image">
|
||||
<!ENTITY reloadImageCmd.accesskey "R">
|
||||
<!ENTITY reloadImageCmd.accesskey "e">
|
||||
<!ENTITY viewImageCmd.label "View Image">
|
||||
<!ENTITY viewImageCmd.accesskey "w">
|
||||
<!ENTITY viewImageCmd.accesskey "I">
|
||||
<!ENTITY viewBGImageCmd.label "View Background Image">
|
||||
<!ENTITY viewBGImageCmd.accesskey "w">
|
||||
<!ENTITY setWallpaperCmd.label "Set As Wallpaper">
|
||||
<!ENTITY setWallpaperCmd.accesskey "e">
|
||||
<!ENTITY setWallpaperCmd.accesskey "S">
|
||||
<!ENTITY bookmarkPageCmd.label "Bookmark This Page">
|
||||
<!ENTITY bookmarkPageCmd.accesskey "m">
|
||||
<!ENTITY bookmarkLinkCmd.label "Bookmark This Link">
|
||||
<!ENTITY bookmarkLinkCmd.accesskey "B">
|
||||
<!ENTITY bookmarkLinkCmd.accesskey "L">
|
||||
<!ENTITY bookmarkFrameCmd.label "Bookmark This Frame">
|
||||
<!ENTITY bookmarkFrameCmd.accesskey "B">
|
||||
<!ENTITY bookmarkFrameCmd.accesskey "m">
|
||||
<!ENTITY savePageAsCmd.label "Save Page As…">
|
||||
<!ENTITY savePageCmd.label "Save Page">
|
||||
<!ENTITY savePageCmd.accesskey "e">
|
||||
<!ENTITY savePageCmd.accesskey "a">
|
||||
<!ENTITY savePageCmd.commandkey "s">
|
||||
<!ENTITY saveFrameAsCmd.label "Save Frame As…">
|
||||
<!ENTITY saveFrameCmd.label "Save Frame">
|
||||
<!ENTITY saveFrameCmd.accesskey "m">
|
||||
<!ENTITY saveLinkAsCmd.label "Save Link Target As…">
|
||||
<!ENTITY saveLinkCmd.label "Save Link Target">
|
||||
<!ENTITY saveLinkCmd.accesskey "S">
|
||||
<!ENTITY saveLinkCmd.accesskey "r">
|
||||
<!ENTITY saveImageAsCmd.label "Save Image As…">
|
||||
<!ENTITY saveImageCmd.label "Save Image">
|
||||
<!ENTITY saveImageCmd.accesskey "v">
|
||||
|
@ -77,17 +77,17 @@
|
|||
<!ENTITY selectAllCmd.label "Select All">
|
||||
<!ENTITY selectAllCmd.accesskey "A">
|
||||
<!ENTITY copyLinkCmd.label "Copy Link Location">
|
||||
<!ENTITY copyLinkCmd.accesskey "L">
|
||||
<!ENTITY copyLinkCmd.accesskey "C">
|
||||
<!ENTITY copyImageCmd.label "Copy Image">
|
||||
<!ENTITY copyImageCmd.accesskey "I">
|
||||
<!ENTITY copyImageCmd.accesskey "o">
|
||||
<!ENTITY copyVideoURLCmd.label "Copy Video Location">
|
||||
<!ENTITY copyVideoURLCmd.accesskey "L">
|
||||
<!ENTITY copyVideoURLCmd.accesskey "o">
|
||||
<!ENTITY copyAudioURLCmd.label "Copy Audio Location">
|
||||
<!ENTITY copyAudioURLCmd.accesskey "L">
|
||||
<!ENTITY copyAudioURLCmd.accesskey "o">
|
||||
<!ENTITY metadataCmd.label "Properties">
|
||||
<!ENTITY metadataCmd.accesskey "P">
|
||||
<!ENTITY copyEmailCmd.label "Copy Email Address">
|
||||
<!ENTITY copyEmailCmd.accesskey "A">
|
||||
<!ENTITY copyEmailCmd.accesskey "E">
|
||||
<!ENTITY pasteCmd.label "Paste">
|
||||
<!ENTITY pasteCmd.accesskey "P">
|
||||
<!ENTITY cutCmd.label "Cut">
|
||||
|
@ -116,7 +116,7 @@
|
|||
<!ENTITY bidiSwitchPageDirectionItem.label "Switch Page Direction">
|
||||
<!ENTITY bidiSwitchPageDirectionItem.accesskey "g">
|
||||
<!ENTITY bidiSwitchTextDirectionItem.label "Switch Text Direction">
|
||||
<!ENTITY bidiSwitchTextDirectionItem.accesskey "x">
|
||||
<!ENTITY bidiSwitchTextDirectionItem.accesskey "w">
|
||||
<!ENTITY spellAddToDictionary.label "Add to Dictionary">
|
||||
<!ENTITY spellAddToDictionary.accesskey "o">
|
||||
<!ENTITY spellIgnoreWord.label "Ignore Word">
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
# context menu strings
|
||||
|
||||
searchText=Search Web for "%S"
|
||||
searchText.accesskey=S
|
||||
searchText.accesskey=W
|
||||
|
||||
blockImage=Block Images from %S
|
||||
blockImage.accesskey=k
|
||||
blockImage.accesskey=B
|
||||
unblockImage=Unblock Images from %S
|
||||
unblockImage.accesskey=k
|
||||
unblockImage.accesskey=b
|
||||
|
||||
SaveImageTitle=Save Image
|
||||
SaveVideoTitle=Save Video
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
<!ENTITY cmd.resume.label "Resume">
|
||||
<!ENTITY cmd.resume.accesskey "R">
|
||||
<!ENTITY cmd.retry.label "Retry">
|
||||
<!ENTITY cmd.retry.accesskey "t">
|
||||
<!ENTITY cmd.retry.accesskey "R">
|
||||
<!ENTITY cmd.cancel.label "Cancel">
|
||||
<!ENTITY cmd.cancel.accesskey "C">
|
||||
<!ENTITY cmd.remove.label "Remove From List">
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
<!ENTITY pref.download.title "Downloads">
|
||||
|
||||
<!ENTITY downloadBehavior.label "When starting a download">
|
||||
<!ENTITY focusWhenStarting.label "Flash the download manager if it is already open, otherwise:">
|
||||
<!ENTITY focusWhenStarting.accesskey "F">
|
||||
<!ENTITY downloadLocation.label "When saving a file">
|
||||
<!ENTITY finishedBehavior.label "When a download completes">
|
||||
<!ENTITY openDM.label "Open the download manager">
|
||||
<!ENTITY openDM.accesskey "m">
|
||||
<!ENTITY openProgressDialog.label "Open a progress dialog">
|
||||
<!ENTITY openProgressDialog.accesskey "O">
|
||||
<!ENTITY doNothing.label "Don't open anything">
|
||||
<!ENTITY doNothing.accesskey "D">
|
||||
|
||||
<!ENTITY downloadLocation.label "When saving a file">
|
||||
<!ENTITY saveTo.label "Save files to">
|
||||
<!ENTITY saveTo.accesskey "v">
|
||||
<!ENTITY promptDownload.label "Prompt for download location and default to">
|
||||
<!ENTITY promptDownload.accesskey "P">
|
||||
<!ENTITY lastLocation.label "Last download folder">
|
||||
<!ENTITY lastLocation.accesskey "L">
|
||||
<!ENTITY specifiedLocation.label "Specified download folder">
|
||||
<!ENTITY specifiedLocation.accesskey "e">
|
||||
<!ENTITY autoDownload.label "Automatically download files to specified download folder">
|
||||
<!ENTITY autoDownload.accesskey "A">
|
||||
<!ENTITY downloadFolder.label "Current Download Folder:">
|
||||
<!ENTITY chooseDownloadFolder.label "Choose Folder…">
|
||||
<!ENTITY chooseDownloadFolder.accesskey "C">
|
||||
<!ENTITY alwaysAsk.label "Always ask me where to save files">
|
||||
<!ENTITY alwaysAsk.accesskey "A">
|
||||
|
||||
<!ENTITY finishedBehavior.label "When a download completes">
|
||||
<!ENTITY playSound.label "Play a sound">
|
||||
<!ENTITY playSound.accesskey "s">
|
||||
<!ENTITY showAlert.label "Show an alert">
|
||||
<!ENTITY showAlert.accesskey "a">
|
||||
<!ENTITY showAlert.accesskey "n">
|
||||
<!ENTITY browse.label "Browse…">
|
||||
<!ENTITY browse.accesskey "B">
|
||||
<!ENTITY preview.label "Preview">
|
||||
<!ENTITY preview.accesskey "e">
|
||||
<!ENTITY preview.accesskey "v">
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
cachefolder=Choose Cache Folder
|
||||
choosehomepage=Choose Home Page
|
||||
downloadfolder=Choose a Download Folder
|
||||
desktopFolderName=Desktop
|
||||
downloadsFolderName=Downloads
|
||||
choosesound=Choose a sound
|
||||
|
||||
SoundFiles=Sounds
|
||||
|
|
|
@ -22,9 +22,7 @@ modern.jar:
|
|||
skin/modern/communicator/aboutSessionRestore.css (communicator/aboutSessionRestore.css)
|
||||
skin/modern/communicator/bookmarks/bookmark-folder-closed.gif (communicator/bookmarks/bookmark-folder-closed.gif)
|
||||
skin/modern/communicator/bookmarks/bookmark-folder-dis.gif (communicator/bookmarks/bookmark-folder-dis.gif)
|
||||
skin/modern/communicator/downloads/dl-remove.png (communicator/downloads/dl-remove.png)
|
||||
skin/modern/communicator/downloads/downloadmanager.css (communicator/downloads/downloadmanager.css)
|
||||
skin/modern/communicator/bookmarks/bookmark-folder-open.gif (communicator/bookmarks/bookmark-folder-open.gif)
|
||||
skin/modern/communicator/bookmarks/bookmark-folder-open.gif (communicator/bookmarks/bookmark-folder-open.gif)
|
||||
skin/modern/communicator/bookmarks/bookmark-group.gif (communicator/bookmarks/bookmark-group.gif)
|
||||
skin/modern/communicator/bookmarks/bookmark-item-dis.gif (communicator/bookmarks/bookmark-item-dis.gif)
|
||||
skin/modern/communicator/bookmarks/bookmark-item-updated.gif (communicator/bookmarks/bookmark-item-updated.gif)
|
||||
|
|
Загрузка…
Ссылка в новой задаче