changes to make nsIFileSpecWithUI useful from javascript.
now, this works from js:
var filePicker = Components.classes["component://netscape/filespecwithui"].createInstance();
filePicker = filePicker.QueryInterface(Components.interfaces.nsIFileSpecWithUI);
file = filePicker.chooseFile("Select a file");
git-svn-id: svn://10.0.0.236/trunk@41727 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
4b341e222b
commit
48a99dd009
@ -68,6 +68,7 @@ interface nsIFileSpecWithUI : nsIFileSpec
|
||||
, in string extraFilterTitle
|
||||
, in string extraFilter
|
||||
);
|
||||
string chooseFile(in string title);
|
||||
void chooseDirectory(in string title);
|
||||
};
|
||||
|
||||
|
||||
@ -77,6 +77,14 @@ NS_IMETHODIMP nsFileSpecWithUIImpl::chooseOutputFile(
|
||||
return mBaseFileSpec->setFromFileSpec(spec);
|
||||
} // nsFileSpecImpl::chooseOutputFile
|
||||
|
||||
NS_IMETHODIMP nsFileSpecWithUIImpl::chooseFile(const char *title, char **_retval)
|
||||
{
|
||||
nsresult rv = chooseInputFile(title, eAllFiles, nsnull, nsnull);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = GetURLString(_retval);
|
||||
return rv;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_IMETHODIMP nsFileSpecWithUIImpl::chooseInputFile(
|
||||
const char *inTitle,
|
||||
|
||||
@ -37,6 +37,8 @@ class nsFileSpecWithUIImpl
|
||||
|
||||
NS_IMETHOD chooseOutputFile(const char *windowTitle, const char *suggestedLeafName);
|
||||
|
||||
NS_IMETHOD chooseFile(const char *title, char **_retval);
|
||||
|
||||
NS_IMETHOD chooseInputFile(
|
||||
const char *title,
|
||||
nsIFileSpecWithUI::StandardFilterMask standardFilterMask,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user