mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-26 18:31:29 +00:00
Bug #60907 --> When bringing up the helper app dialog, if a helper app is already
present then be sure to default the action to Open instead of Save To Disk. sr=alecf r=sspitzer
This commit is contained in:
parent
d9d4d975b7
commit
cf018a27ff
@ -49,20 +49,10 @@ nsHelperAppLauncherDialog.prototype= {
|
||||
initDialog : function () {
|
||||
// "Always ask me" is always set (or else we wouldn't have got here!).
|
||||
document.getElementById( "alwaysAskMe" ).checked = true;
|
||||
document.getElementById( "alwaysAskMe" ).setAttribute( "disabled", "true" );
|
||||
document.getElementById( "alwaysAskMe" ).setAttribute("disabled", "true");
|
||||
|
||||
// Pre-select the choice the user made last time.
|
||||
this.chosenApp = this.appLauncher.MIMEInfo.preferredApplicationHandler;
|
||||
if ( this.chosenApp && this.appLauncher.MIMEInfo.preferredAction != this.nsIMIMEInfo.saveToDisk ) {
|
||||
// Run app.
|
||||
document.getElementById( "runApp" ).checked = true;
|
||||
} else {
|
||||
// Save to disk.
|
||||
document.getElementById( "saveToDisk" ).checked = true;
|
||||
// Disable choose app button.
|
||||
document.getElementById( "chooseApp" ).setAttribute( "disabled", "true" );
|
||||
}
|
||||
|
||||
var applicationDescription = this.appLauncher.MIMEInfo.applicationDescription;
|
||||
if (applicationDescription != "")
|
||||
document.getElementById( "appName" ).value = applicationDescription;
|
||||
@ -72,6 +62,15 @@ nsHelperAppLauncherDialog.prototype= {
|
||||
document.getElementById( "appName" ).value = this.chosenApp.unicodePath;
|
||||
}
|
||||
|
||||
if ( applicationDescription && this.appLauncher.MIMEInfo.preferredAction != this.nsIMIMEInfo.saveToDisk ) {
|
||||
document.getElementById( "runApp" ).checked = true;
|
||||
} else {
|
||||
// Save to disk.
|
||||
document.getElementById( "saveToDisk" ).checked = true;
|
||||
// Disable choose app button.
|
||||
document.getElementById( "chooseApp" ).setAttribute( "disabled", "true" );
|
||||
}
|
||||
|
||||
// Put content type into dialog text.
|
||||
var html = document.getElementById( "intro" );
|
||||
if ( html && html.childNodes && html.childNodes.length ) {
|
||||
@ -103,6 +102,8 @@ nsHelperAppLauncherDialog.prototype= {
|
||||
// Get boolean switch from checkbox.
|
||||
var dontAskNextTime = !document.getElementById( "alwaysAskMe" ).checked;
|
||||
|
||||
// this.appLauncher.MIMEInfo.alwaysAskBeforeHandling = document.getElementById( "alwaysAskMe" ).checked;
|
||||
|
||||
if ( document.getElementById( "runApp" ).checked ) {
|
||||
// Update preferred action if the user chose an app.
|
||||
if ( this.userChoseApp ) {
|
||||
|
Loading…
Reference in New Issue
Block a user