Ignore:
Timestamp:
Jan 22, 2013, 12:09:48 AM (9 years ago)
Author:
livings124
Message:

#1220 Initial Mac support for changing file and folder names. Not fully complete.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r13804 r13828  
    4848#import "StatusBarController.h"
    4949#import "FilterBarController.h"
     50#import "FileRenameSheetController.h"
    5051#import "BonjourController.h"
    5152#import "Badger.h"
     
    17391740    if ([paths count] > 0)
    17401741        [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs: paths];
     1742}
     1743
     1744- (IBAction) renameSelected: (id) sender
     1745{
     1746    NSArray * selected = [fTableView selectedTorrents];
     1747    NSAssert([selected count] == 1, @"1 transfer needs to be selected to rename, but %ld are selected", [selected count]);
     1748    Torrent * torrent = selected[0];
     1749   
     1750    [FileRenameSheetController presentSheetForTorrent:torrent modalForWindow: fWindow completionHandler: ^(BOOL didRename) {
     1751        NSLog(@"finished");
     1752    }];
    17411753}
    17421754
     
    42864298    if (action == @selector(revealFile:))
    42874299        return canUseTable && [fTableView numberOfSelectedRows] > 0;
     4300   
     4301    //enable renaming file/folder
     4302    if (action == @selector(renameSelectedTorrent:))
     4303        return canUseTable && [fTableView numberOfSelectedRows] == 1;
    42884304
    42894305    //enable remove items
Note: See TracChangeset for help on using the changeset viewer.