Changeset 828


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

Option to save log.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Transmission.xcodeproj/project.pbxproj

    r819 r828  
    9494                A2305AAD0A3DCCEF00AB2D77 /* ProgressBarEndGray.png in Resources */ = {isa = PBXBuildFile; fileRef = A2305AA80A3DCCEF00AB2D77 /* ProgressBarEndGray.png */; };
    9595                A232D29E0A70903E00973B12 /* Filter.png in Resources */ = {isa = PBXBuildFile; fileRef = A232D29D0A70903E00973B12 /* Filter.png */; };
     96                A23BBEB70A9BBE77003F7274 /* BarButton.m in Sources */ = {isa = PBXBuildFile; fileRef = A27431D90A68538400FA780A /* BarButton.m */; };
    9697                A246004D0A6DCE4600D19088 /* SpeedLimitButtonPressed.png in Resources */ = {isa = PBXBuildFile; fileRef = A246004C0A6DCE4600D19088 /* SpeedLimitButtonPressed.png */; };
    9798                A24600510A6DCE6600D19088 /* SpeedLimitButtonBlue.png in Resources */ = {isa = PBXBuildFile; fileRef = A246004F0A6DCE6600D19088 /* SpeedLimitButtonBlue.png */; };
     
    120121                A26D450B0A0503AC00A10BB3 /* peermessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D1838A309DEC0430047D688 /* peermessages.h */; };
    121122                A2710E770A86796000CE4F7D /* PrefsWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = A2710E750A86796000CE4F7D /* PrefsWindow.m */; };
    122                 A27431DB0A68538400FA780A /* BarButton.m in Sources */ = {isa = PBXBuildFile; fileRef = A27431D90A68538400FA780A /* BarButton.m */; };
    123123                A27A53570A06A76400E1F16F /* StatusSep.png in Resources */ = {isa = PBXBuildFile; fileRef = A27A53560A06A76400E1F16F /* StatusSep.png */; };
    124124                A27ABC240A6ADE410020EC71 /* ImageBackgroundView.m in Sources */ = {isa = PBXBuildFile; fileRef = A27ABC220A6ADE410020EC71 /* ImageBackgroundView.m */; };
     
    829829                                A200B9200A22798F007BBB1E /* InfoWindowController.m in Sources */,
    830830                                A2AF1C390A3D0F6200F1575D /* FileTableView.m in Sources */,
    831                                 A27431DB0A68538400FA780A /* BarButton.m in Sources */,
    832831                                A27ABC240A6ADE410020EC71 /* ImageBackgroundView.m in Sources */,
    833832                                A2710E770A86796000CE4F7D /* PrefsWindow.m in Sources */,
    834833                                A256588D0A9A695400E8A03B /* MessageWindowController.m in Sources */,
     834                                A23BBEB70A9BBE77003F7274 /* BarButton.m in Sources */,
    835835                        );
    836836                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/macosx/Controller.m

    r807 r828  
    865865        [panel setCanSelectHiddenExtension: YES];
    866866       
    867         [panel beginSheetForDirectory: nil file: [torrent name]
    868             modalForWindow: fWindow modalDelegate: self didEndSelector:
    869             @selector(saveTorrentCopySheetClosed:returnCode:contextInfo:) contextInfo: torrents];
    870     }
    871 }
    872 
    873 - (void) saveTorrentCopySheetClosed: (NSSavePanel *) panel returnCode: (int) code
    874     contextInfo: (NSMutableArray *) torrents
     867        [panel beginSheetForDirectory: nil file: [torrent name] modalForWindow: fWindow modalDelegate: self
     868            didEndSelector: @selector(saveTorrentCopySheetClosed:returnCode:contextInfo:) contextInfo: torrents];
     869    }
     870}
     871
     872- (void) saveTorrentCopySheetClosed: (NSSavePanel *) panel returnCode: (int) code contextInfo: (NSMutableArray *) torrents
    875873{
    876874    //if save successful, copy torrent to new location with name of data file
     
    880878   
    881879    [torrents removeObjectAtIndex: 0];
    882     [self performSelectorOnMainThread: @selector(copyTorrentFileForTorrents:)
    883                 withObject: torrents waitUntilDone: NO];
     880    [self performSelectorOnMainThread: @selector(copyTorrentFileForTorrents:) withObject: torrents waitUntilDone: NO];
    884881}
    885882
  • trunk/macosx/English.lproj/MessageWindow.nib/classes.nib

    r813 r828  
    33        {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
    44        {
    5             ACTIONS = {changeLevel = id; clearLog = id; };
     5            ACTIONS = {changeLevel = id; clearLog = id; writeToFile = id; };
    66            CLASS = MessageWindowController;
    77            LANGUAGE = ObjC;
  • trunk/macosx/MessageWindowController.h

    r821 r828  
    4141- (void) clearLog: (id) sender;
    4242
     43- (void) writeToFile: (id) sender;
     44
    4345@end
  • 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.