rem: fp.init(window, "Open", nsIFilePicker.modeOpen); 
add: fp.init(window, "Open", nsIFilePicker.modeOpenMultiple); 
context: function loadEventsFromFile(){  var dupResult = { cancelled: false, discard: true, prompt: false };  openDialog("chrome://calendar/content/importDuplicatesDialog.xul", "caDuplicates", "chrome,modal,centerscreen", dupResult );  if (dupResult.cancelled == true)    return;//   dump("*******************\n");//   dump("cancelled: " + dupResult.cancelled + "\n");//   dump("discard:   " + dupResult.discard + "\n");//   dump("prompt:    " + dupResult.prompt + "\n");//   dump("*******************\n");  const nsIFilePicker = Components.interfaces.nsIFilePicker;    var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);       fp.init(window, "Open", nsIFilePicker.modeOpen);  fp.defaultExtension = "ics";     fp.appendFilter( filterCalendar, "*" + extensionCalendar );  fp.appendFilter( filterXcs, "*" + extensionXcs );  fp.appendFilter( filterOutlookCsv, "*" + extensionCsv );  fp.show();  if (fp.file && fp.file.path.length > 0)     {      var aDataStream = readDataFromFile( fp.file.path, "UTF-8" );      var calendarEventArray = new Array();      var duplicateEventArray = new Array();      switch (fp.filterIndex) {      case 0 : // ics        calendarEventArray = parseIcalData( aDataStream );        break;      case 1 : // xcs        calendarEventArray = parseXCSData( aDataStream );        break;      case 2: // csv        var ret = parseOutlookCSVData( aDataStream, dupResult.discard, dupResult.prompt );        calendarEventArray = ret.calendarEventArray;        duplicateEventArray = ret.calendarDuplicateArray;        break;      }         // If there are no events to import, let the user know      //      if (calendarEventArray.length == 0 && (duplicateEventArray.length == 0 || dupResult.discard == true) ) {        alert("No events to import...");        return false;      }            // Show a dialog with option to import events with or without dialogs      var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService();       promptService = promptService.QueryInterface(Components.interfaces.nsIPromptService);       var result = {value:0};       if (calendarEventArray.length > 0) {        var buttonPressed =                promptService.confirmEx(window,                                   "Import", "About to import " + calendarEventArray.length + " event(s).\nDo you want to open all new events to import before importing?",                                   (promptService.BUTTON_TITLE_YES * promptService.BUTTON_POS_0) +                                   (promptService.BUTTON_TITLE_NO * promptService.BUTTON_POS_1) +                                   (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_2),                                   null,null,null,null, result);         if(buttonPressed == 0) // YES          {             addEventsToCalendar( calendarEventArray );            return true;          }        else if(buttonPressed == 1) // NO          {             addEventsToCalendar( calendarEventArray, true );            return true;          }         else if(buttonPressed == 2) // CANCEL          {             return false;           }       }      // Depending on how the user chose to deal with duplicates,      // either add them blindly, or prompt then for each.      //      if (duplicateEventArray.length > 0) {        if (dupResult.discard == false) {          if (dupResult.prompt)            alert("Some duplicate entries were imported. Each one will display in the New Event dialog,\n where you can skip it using Cancel, or edit and accept it using OK.");          addEventsToCalendar( duplicateEventArray, !dupResult.prompt );        }      }    }      return false;}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/372655b4aa4dd0c1eec775623448c9c5cf29e4dd/calendarImportExport.js/clean/calendar/resources/content/calendarImportExport.js