use nsIFilePicker instead of nsIFileSpecWithUI

This commit is contained in:
pavlov%netscape.com 2006-09-14 05:47:53 +00:00
Родитель ec968d36ad
Коммит d38be5ba1d
1 изменённых файлов: 8 добавлений и 11 удалений

Просмотреть файл

@ -704,20 +704,17 @@ function RevealSearchPanel()
newWin.saveFileAndPos = true;
}
const nsIFilePicker = Components.interfaces.nsIFilePicker;
function BrowserOpenFileWindow()
{
// Get filespecwithui component.
var fileSpec = createInstance( "component://netscape/filespecwithui", "nsIFileSpecWithUI" );
var url = null;
// Get filepicker component.
try {
fileSpec.parentWindow = window;
url = fileSpec.chooseFile( bundle.GetStringFromName( "openFile" ) );
fileSpec.parentWindow = null;
} catch ( exception ) {
}
if ( url && url != "" ) {
openNewWindowWith( url );
}
var fp = Components.classes["component://mozilla/filepicker"].createInstance(nsIFilePicker);
fp.init(window, bundle.GetStringFromName("openFile"), nsIFilePicker.modeOpen);
fp.setFilters(nsIFilePicker.filterAll);
fp.show();
openNewWindowWith(fp.file.path);
} catch (ex) { }
}
function OpenFile(url) {