gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Methods +readable/writableTypes


From: Germán Arias
Subject: Re: Methods +readable/writableTypes
Date: Tue, 25 Feb 2014 23:58:18 -0600
User-agent: GNUMail (Version 1.2.1)

Hi,

On 2014-02-25 17:21:54 -0600 Doug Simons <address@hidden> wrote:

> 
> On Feb 24, 2014, at 12:39 PM, Germán Arias wrote:
> 
>> I solve the problem using _openableFileExtensions and 
>> writableTypesForSaveOperation:. The title of the panel let me know the type 
>> of save operation. Now I will add a little hack in ProjectCenter to allow 
>> it use native panels.
> 
> It looks like this change has broken something else. When we call 
> setAllowedFileTypes: on the NSSavePanel and pass our document extension, it 
> works fine when the current window is one of our document windows. When the 
> current main window is not a document window, the save panel shows "All 
> (*.*)" instead of our document type, and when we enter a file name and click 
> Save we get an NSRangeException -- Index 0 is out of range 0 (in 
> 'objectAtIndex:'). I'm not sure yet if the exception is coming from our code 
> or from the save panel, but setting the allowedFileTypes needs to work in any 
> case.

This happen because I use -currentDocument. So, if the main window isn't the 
document window, this method returns nil. I added an improvement to get a valid 
document. Also, I modified your changes in filter_string_from_types(), to use 
the same code for entry "All". I think this should solve your problems. So try 
now.

Regards.
Germán.

> 
> I'll look into it some more, but I'm running short on time today, and may not 
> be near a Windows machine tomorrow...
> 
> Regards,
> 
> Doug
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]