rem: fp.init(window, gCalendarBundle.getString( "Save" ), nsIFilePicker.modeSave); 
add:   if (gMode == "new") fp.init(window, gCalendarBundle.getString( "New" ), nsIFilePicker.modeSave); else if (gMode == "open") fp.init(window, gCalendarBundle.getString( "Open" ), nsIFilePicker.modeOpen); else /* gMode == "edit" */ fp.init(window, gCalendarBundle.getString( "Save" ), nsIFilePicker.modeSave); 
context: function launchFilePicker(){   // No show the 'Save As' dialog and ask for a filename to save to   const nsIFilePicker = Components.interfaces.nsIFilePicker;   var gCalendarBundle = document.getElementById("bundle_calendar");   var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);   // caller can force disable of sand box, even if ON globally   fp.init(window, gCalendarBundle.getString( "Save" ), nsIFilePicker.modeSave);   var ServerName = document.getElementById( "server-name-textbox" ).value;   if( ServerName == "" )      fp.defaultString = gCalendarBundle.getString( "filepickerDefString" );   else      fp.defaultString = gCalendarBundle.getFormattedString( "filepickerDefServerString", [ServerName] );      fp.defaultExtension = "ics";   const filterCalendar    = gCalendarBundle.getString( "filterCalendar" );   const extensionCalendar = ".ics";   fp.appendFilter( filterCalendar, "*" + extensionCalendar );      fp.show();   if (fp.file && fp.file.path.length > 0)   {      document.getElementById( "server-path-textbox" ).value = fp.file.path;      gCalendarObject.path = fp.file.path;      if( document.getElementById( "server-name-textbox" ).value == "" )      {         var fullPathRegex = new RegExp(".*[/\\\\:]([^/\\\\:]+)[\.]ics$");                     var filename;                   if (fullPathRegex.test(fp.file.path))            filename = fp.file.path.replace(fullPathRegex, "$1");                     document.getElementById( "server-name-textbox" ).value = filename;      }   }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/40e4684d365b11904778c832fa7284c42b508cd4/localCalDialog.js/buggy/calendar/resources/content/localCalDialog.js