Bug 225574 - Applications greyed out in file dialogs. Patch by Nathan Hamblen. r=jhpedemonte,sr=sfraser

This commit is contained in:
pedemont%us.ibm.com 2004-09-30 22:48:33 +00:00
Родитель ddc468e6d6
Коммит be537ec4bf
2 изменённых файлов: 10 добавлений и 3 удалений

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

@ -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;