mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Changing from default action to a different one should work (didn't if the
default was "save"). Bug 193054, r=pkw@us.ibm.com, sr=mscott, a=asa
This commit is contained in:
parent
1853e2d568
commit
a01da841e5
@ -515,9 +515,7 @@ nsHelperAppDialog.prototype = {
|
||||
return this.helperAppChoice() != this.mLauncher.MIMEInfo.preferredApplicationHandler;
|
||||
},
|
||||
|
||||
// See if the user changed things, and if so, update the
|
||||
// mimeTypes.rdf entry for this mime type.
|
||||
updateHelperAppPref: function() {
|
||||
updateMIMEInfo: function() {
|
||||
var needUpdate = false;
|
||||
// If current selection differs from what's in the mime info object,
|
||||
// then we need to update.
|
||||
@ -554,16 +552,20 @@ nsHelperAppDialog.prototype = {
|
||||
|
||||
// Make sure mime info has updated setting for the "always ask" flag.
|
||||
this.mLauncher.MIMEInfo.alwaysAskBeforeHandling = this.dialogElement( "alwaysAskMe" ).checked;
|
||||
|
||||
if ( needUpdate ) {
|
||||
// We update by passing this mime info into the "Edit Type" helper app
|
||||
// pref dialog. It will update the data source and close the dialog
|
||||
// automatically.
|
||||
this.mDialog.openDialog( "chrome://communicator/content/pref/pref-applications-edit.xul",
|
||||
"_blank",
|
||||
"chrome,modal=yes,resizable=no",
|
||||
this );
|
||||
}
|
||||
|
||||
return needUpdate;
|
||||
},
|
||||
|
||||
// See if the user changed things, and if so, update the
|
||||
// mimeTypes.rdf entry for this mime type.
|
||||
updateHelperAppPref: function() {
|
||||
// We update by passing this mime info into the "Edit Type" helper app
|
||||
// pref dialog. It will update the data source and close the dialog
|
||||
// automatically.
|
||||
this.mDialog.openDialog( "chrome://communicator/content/pref/pref-applications-edit.xul",
|
||||
"_blank",
|
||||
"chrome,modal=yes,resizable=no",
|
||||
this );
|
||||
},
|
||||
|
||||
// onOK:
|
||||
@ -601,6 +603,7 @@ nsHelperAppDialog.prototype = {
|
||||
// "Save to Disk" dialog. In those cases, we don't want to
|
||||
// update the helper application preferences in the RDF file.
|
||||
try {
|
||||
var needUpdate = this.updateMIMEInfo();
|
||||
if ( this.dialogElement( "saveToDisk" ).selected )
|
||||
this.mLauncher.saveToDisk( null, false );
|
||||
else
|
||||
@ -609,8 +612,10 @@ nsHelperAppDialog.prototype = {
|
||||
// Update user pref for this mime type (if necessary). We do not
|
||||
// store anything in the mime type preferences for the ambiguous
|
||||
// type application/octet-stream.
|
||||
if ( this.mLauncher.MIMEInfo.MIMEType != "application/octet-stream" )
|
||||
if ( needUpdate &&
|
||||
this.mLauncher.MIMEInfo.MIMEType != "application/octet-stream" ) {
|
||||
this.updateHelperAppPref();
|
||||
}
|
||||
|
||||
} catch(e) { }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user