rem: filePicker.init( top.window, GetBundleString( 'ImportSelectAddrFile'), Components.interfaces.nsIFilePicker.modeOpen); 
add: filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrFile'), Components.interfaces.nsIFilePicker.modeOpen); 
context: function ImportAddress( module, success, error) {	if (top.progressInfo.importInterface || top.progressInfo.intervalState) {		error.data = GetBundleString( 'ImportAlreadyInProgress');		return( false);	}	top.progressInfo.importSuccess = false;	var addInterface = module.GetImportInterface( "addressbook");	if (addInterface != null)		addInterface = addInterface.QueryInterface( Components.interfaces.nsIImportGeneric);	if (addInterface == null) {		error.data = GetBundleString( 'ImportAddressBadModule');		return( false);	}			var loc = addInterface.GetStatus( "autoFind");	if (loc == false) {		loc = addInterface.GetData( "addressLocation");		if (loc != null) {			loc = loc.QueryInterface( Components.interfaces.nsIFileSpec);			if (loc != null) {				if (!loc.exists)					loc = null;			}		}	}		if (loc == null) {		// Couldn't find the address book, see if we can		// as the user for the location or not?		if (addInterface.GetStatus( "canUserSetLocation") == 0) {			// an autofind address book that could not be found!			error.data = GetBundleString( 'ImportAddressNotFound');			return( false);		}		var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance();		if (filePicker != null) {			filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker);			if (filePicker == null) {				error.data = GetBundleString( 'ImportAddressNotFound');				return( false);			}		}		else {			error.data = GetBundleString( 'ImportAddressNotFound');			return( false);		}		// The address book location was not found.		// Determine if we need to ask for a directory		// or a single file.		var file = null;		if (addInterface.GetStatus( "supportsMultiple") != 0) {			// ask for dir			try {				filePicker.init( top.window, GetBundleString( 'ImportSelectAddrDir'), Components.interfaces.nsIFilePicker.modeGetFolder);				filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll);				filePicker.show();				if (filePicker.file && (filePicker.file.path.length > 0))					file = filePicker.file.path;				else					file = null;			} catch( ex) {				file = null;			}		}		else {			// ask for file			try {				filePicker.init( top.window, GetBundleString( 'ImportSelectAddrFile'), Components.interfaces.nsIFilePicker.modeOpen);				filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll);				filePicker.show();				if (filePicker.file && (filePicker.file.path.length > 0))					file = filePicker.file.path;				else					file = null;			} catch( ex) {				file = null;			}		}		if (file == null) {			return( false);		}				file = CreateNewFileSpecFromPath( file);		addInterface.SetData( "addressLocation", file);	}		var map = addInterface.GetData( "fieldMap");	if (map != null) {		map = map.QueryInterface( Components.interfaces.nsIImportFieldMap);		if (map != null) {			var result = new Object();			result.ok = false;			top.window.openDialog(				"chrome://messenger/content/fieldMapImport.xul",				"",				"chrome,modal,titlebar",				{fieldMap: map,				 addInterface: addInterface,				 result: result});		}		if (result.ok == false)			return( false);	}	if (addInterface.WantsProgress()) {		if (addInterface.BeginImport( success, error)) {			top.progressInfo.importInterface = addInterface;			// top.intervalState = setInterval( "ContinueImport()", 100);			return( true);		}		else {			return( false);		}	}	else {		if (addInterface.BeginImport( success, error)) {			return( true);		}		else {			return( false);		}	}}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/a7a6aaec82021225369a825c4902d7f206319316/importDialog.js/buggy/mailnews/import/resources/content/importDialog.js