rem: var addInterface = module.GetImportInterface( "addressbook"); 
add: addInterface = module.GetImportInterface( "addressbook"); 
context: function ImportAddress( module, success, error) {  if (top.progressInfo.importInterface || top.progressInfo.intervalState) {    error.data = gImportMsgsBundle.getString('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 = gImportMsgsBundle.getString('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 = gImportMsgsBundle.getString('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 = gImportMsgsBundle.getString('ImportAddressNotFound');        return( false);      }    }    else {      error.data = gImportMsgsBundle.getString('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, gImportMsgsBundle.getString('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, gImportMsgsBundle.getString('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: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/a13c578c74a271d71c7bbffcad93448a91476ecd/importDialog.js/buggy/mailnews/import/resources/content/importDialog.js