зеркало из https://github.com/mozilla/gecko-dev.git
Bug 225574 - Applications greyed out in file dialogs. Patch by Nathan Hamblen. r=jhpedemonte,sr=sfraser
This commit is contained in:
Родитель
ddc468e6d6
Коммит
be537ec4bf
|
@ -74,6 +74,7 @@ OSType nsFilePicker::sCurrentProcessSignature = 0;
|
|||
//-------------------------------------------------------------------------
|
||||
nsFilePicker::nsFilePicker()
|
||||
: mAllFilesDisplayed(PR_TRUE)
|
||||
, mApplicationsDisplayed(PR_FALSE)
|
||||
, mSelectedType(0)
|
||||
, mTypeOffset(0)
|
||||
{
|
||||
|
@ -387,8 +388,8 @@ nsFilePicker::GetLocalFiles(const nsString& inTitle, PRBool inAllowMultiple, nsC
|
|||
// sets up the |mTypeLists| array so the filter proc can use it
|
||||
MapFilterToFileTypes();
|
||||
|
||||
// allow packages to be chosen if the filter is "*"
|
||||
if (mAllFilesDisplayed)
|
||||
// allow packages to be chosen if the filter is "*" or "..apps"
|
||||
if (mAllFilesDisplayed || mApplicationsDisplayed)
|
||||
dialogCreateOptions.optionFlags |= kNavSupportPackages;
|
||||
|
||||
// Display the get file dialog. Only use a filter proc if there are any
|
||||
|
@ -704,6 +705,11 @@ nsFilePicker::MapFilterToFileTypes ( )
|
|||
char* filter = ToNewCString(filterWide);
|
||||
|
||||
NS_ASSERTION ( filterWide.Length(), "Oops. filepicker.properties not correctly installed");
|
||||
|
||||
// look for the flag indicating applications
|
||||
if (filterWide.EqualsLiteral("..apps"))
|
||||
mApplicationsDisplayed = PR_TRUE;
|
||||
|
||||
if ( filterWide.Length() && filter )
|
||||
{
|
||||
PRUint32 filterIndex = 0; // Index into the filter string
|
||||
|
|
|
@ -111,7 +111,8 @@ protected:
|
|||
NavCallBackUserData callbackUD,
|
||||
NavFilterModes filterMode ) ;
|
||||
|
||||
PRBool mAllFilesDisplayed;
|
||||
PRPackedBool mAllFilesDisplayed;
|
||||
PRPackedBool mApplicationsDisplayed;
|
||||
nsString mTitle;
|
||||
PRInt16 mMode;
|
||||
nsCOMArray<nsILocalFile> mFiles;
|
||||
|
|
Загрузка…
Ссылка в новой задаче