Ignore:
Timestamp:
Aug 22, 2006, 11:00:53 PM (16 years ago)
Author:
livings124
Message:

Option to save log.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/MessageWindowController.m

    r824 r828  
    146146}
    147147
     148- (void) writeToFile: (id) sender
     149{
     150    NSString * string = [[fTextView string] retain];
     151   
     152    NSSavePanel * panel = [NSSavePanel savePanel];
     153    [panel setRequiredFileType: @"txt"];
     154    [panel setCanSelectHiddenExtension: YES];
     155   
     156    [panel beginSheetForDirectory: nil file: @"untitled" modalForWindow: [self window] modalDelegate: self
     157        didEndSelector: @selector(writeToFileSheetClosed:returnCode:contextInfo:) contextInfo: string];
     158}
     159
     160- (void) writeToFileSheetClosed: (NSSavePanel *) panel returnCode: (int) code contextInfo: (NSString *) string
     161{
     162    if (code == NSOKButton)
     163        [string writeToFile: [panel filename] atomically: YES encoding: NSUTF8StringEncoding error: nil];
     164   
     165    [string release];
     166}
     167
    148168@end
Note: See TracChangeset for help on using the changeset viewer.