RE: Document Based App - open
RE: Document Based App - open
- Subject: RE: Document Based App - open
- From: "Jonathan E. Jackel" <email@hidden>
- Date: Fri, 4 Feb 2005 10:46:46 -0500
- Importance: Normal
The way I have implemented this idea is to have an "Import" command that
creates a native document out of non-native data, like a text file. This
approach handles Save/Save As behavior properly -- which, by the way, does
not include graying out "Save". Rather, "Save" checks to see if the
document has been saved before, and if not, invokes "Save As", which puts up
a save panel.
I don't think "Open" is the right menu command for this type of behavior
because it implies the very thing that is annoying you: that the file, if
modified, will be saved back to the same location it was opened from.
Nonetheless, assuming you simply want to put up the save panel when the user
invokes "Save" on a newly imported document, you might try [yourDocument
setFilename:nil] as the last step in importing the file. I haven't tried it
myself, but the docs imply that if there is no filename and the user invokes
"Save", the document actually responds with "Save As" behavior.
Jonathan
> -----Original Message-----
> From: cocoa-dev-bounces+jonathan=email@hidden
> [mailto:cocoa-dev-bounces+jonathan=email@hidden]On Behalf
> Of Jeff LaMarche
> Sent: Friday, February 04, 2005 10:22 AM
> To: Cocoa Dev
> Subject: Document Based App - open
>
>
> I've got a document based app that has a document type that it
> supports, and one that it can use as the basis for a new document. I
> originally had different menu commands for each one, but found that my
> testers were confused - they tried to just open both kinds of
> documents.
>
> So, thought it seems a little odd, now you can use Open for either (and
> it seems to be more intuitive). If you open a native document, it just
> opens it. If you select the other filetype, it creates a new document
> based on information take from the "opened" file. I change the document
> type and the filename of the new document, but NSDocument still thinks
> it's an existing file, the "Save..." menu option is still highlighted.
> Is there a way to tell a document that it should behave as if it's a
> newly created document, or do I need to manually gray out the "Save..."
> option in this situation?
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden