Fix code_style.sh to include *.mm files after switch to Obj-C++ (#2846)
This commit is contained in:
parent
e4461c48d7
commit
d943f069f5
|
@ -20,6 +20,7 @@ cfile_includes=(
|
|||
'*.cc'
|
||||
'*.h'
|
||||
'*.m'
|
||||
'*.mm'
|
||||
)
|
||||
cfile_excludes=(
|
||||
'build/*'
|
||||
|
|
|
@ -38,8 +38,8 @@ AboutWindowController* fAboutBoxInstance = nil;
|
|||
self.fCopyrightField.stringValue = [NSBundle.mainBundle localizedStringForKey:@"NSHumanReadableCopyright" value:nil
|
||||
table:@"InfoPlist"];
|
||||
|
||||
[self.fTextView.textStorage setAttributedString:[[NSAttributedString alloc] initWithPath:[NSBundle.mainBundle pathForResource:@"Credits"
|
||||
ofType:@"rtf"]
|
||||
[self.fTextView.textStorage
|
||||
setAttributedString:[[NSAttributedString alloc] initWithPath:[NSBundle.mainBundle pathForResource:@"Credits" ofType:@"rtf"]
|
||||
documentAttributes:nil]];
|
||||
|
||||
//size license button
|
||||
|
|
|
@ -95,8 +95,8 @@
|
|||
}
|
||||
[self.fPriorityPopUp selectItemAtIndex:priorityIndex];
|
||||
|
||||
self.fStartCheck.state = [NSUserDefaults.standardUserDefaults boolForKey:@"AutoStartDownload"] ? NSControlStateValueOn
|
||||
: NSControlStateValueOff;
|
||||
self.fStartCheck.state = [NSUserDefaults.standardUserDefaults boolForKey:@"AutoStartDownload"] ? NSControlStateValueOn :
|
||||
NSControlStateValueOff;
|
||||
|
||||
if (self.fDestination)
|
||||
{
|
||||
|
|
|
@ -146,8 +146,8 @@
|
|||
}
|
||||
[self.fPriorityPopUp selectItemAtIndex:priorityIndex];
|
||||
|
||||
self.fStartCheck.state = [NSUserDefaults.standardUserDefaults boolForKey:@"AutoStartDownload"] ? NSControlStateValueOn
|
||||
: NSControlStateValueOff;
|
||||
self.fStartCheck.state = [NSUserDefaults.standardUserDefaults boolForKey:@"AutoStartDownload"] ? NSControlStateValueOn :
|
||||
NSControlStateValueOff;
|
||||
|
||||
self.fDeleteCheck.state = self.fDeleteTorrentEnableInitially ? NSControlStateValueOn : NSControlStateValueOff;
|
||||
self.fDeleteCheck.enabled = self.fCanToggleDelete;
|
||||
|
@ -163,7 +163,8 @@
|
|||
self.fLocationImageView.image = nil;
|
||||
}
|
||||
|
||||
self.fTimer = [NSTimer scheduledTimerWithTimeInterval:UPDATE_SECONDS target:self selector:@selector(updateFiles) userInfo:nil
|
||||
self.fTimer = [NSTimer scheduledTimerWithTimeInterval:UPDATE_SECONDS target:self selector:@selector(updateFiles)
|
||||
userInfo:nil
|
||||
repeats:YES];
|
||||
[self updateFiles];
|
||||
}
|
||||
|
|
|
@ -86,9 +86,7 @@ totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite
|
|||
});
|
||||
}
|
||||
|
||||
- (void)URLSession:(NSURLSession *)session
|
||||
task:(NSURLSessionTask *)task
|
||||
didCompleteWithError:(NSError *)error
|
||||
- (void)URLSession:(NSURLSession*)session task:(NSURLSessionTask*)task didCompleteWithError:(NSError*)error
|
||||
{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (error)
|
||||
|
@ -130,14 +128,12 @@ didFinishDownloadingToURL:(NSURL *)location
|
|||
}
|
||||
else
|
||||
{
|
||||
[self decompressFrom:[NSURL fileURLWithPath:tempFile]
|
||||
to:[NSURL fileURLWithPath:blocklistFile]
|
||||
error:nil];
|
||||
[self decompressFrom:[NSURL fileURLWithPath:tempFile] to:[NSURL fileURLWithPath:blocklistFile] error:nil];
|
||||
[NSFileManager.defaultManager removeItemAtPath:tempFile error:nil];
|
||||
}
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
const int count = tr_blocklistSetContent(((Controller*)NSApp.delegate).sessionHandle, blocklistFile.UTF8String);
|
||||
int const count = tr_blocklistSetContent(((Controller*)NSApp.delegate).sessionHandle, blocklistFile.UTF8String);
|
||||
|
||||
//delete downloaded file
|
||||
[NSFileManager.defaultManager removeItemAtPath:blocklistFile error:nil];
|
||||
|
@ -148,7 +144,8 @@ didFinishDownloadingToURL:(NSURL *)location
|
|||
}
|
||||
else
|
||||
{
|
||||
[self.viewController setFailed:NSLocalizedString(@"The specified blocklist file did not contain any valid rules.", "blocklist fail message")];
|
||||
[self.viewController
|
||||
setFailed:NSLocalizedString(@"The specified blocklist file did not contain any valid rules.", "blocklist fail message")];
|
||||
}
|
||||
|
||||
//update last updated date for schedule
|
||||
|
@ -169,8 +166,7 @@ didFinishDownloadingToURL:(NSURL *)location
|
|||
{
|
||||
self.fState = BLOCKLIST_DL_START;
|
||||
|
||||
self.fSession = [NSURLSession sessionWithConfiguration:NSURLSessionConfiguration.ephemeralSessionConfiguration
|
||||
delegate:self
|
||||
self.fSession = [NSURLSession sessionWithConfiguration:NSURLSessionConfiguration.ephemeralSessionConfiguration delegate:self
|
||||
delegateQueue:nil];
|
||||
|
||||
[BlocklistScheduler.scheduler cancelSchedule];
|
||||
|
@ -218,11 +214,7 @@ didFinishDownloadingToURL:(NSURL *)location
|
|||
NSTask* tarList = [[NSTask alloc] init];
|
||||
|
||||
tarList.launchPath = @"/usr/bin/tar";
|
||||
tarList.arguments = @[
|
||||
@"--list",
|
||||
@"--file",
|
||||
file.path
|
||||
];
|
||||
tarList.arguments = @[ @"--list", @"--file", file.path ];
|
||||
|
||||
NSPipe* pipe = [[NSPipe alloc] init];
|
||||
tarList.standardOutput = pipe;
|
||||
|
@ -242,8 +234,7 @@ didFinishDownloadingToURL:(NSURL *)location
|
|||
|
||||
NSData* data = [pipe.fileHandleForReading readDataToEndOfFile];
|
||||
|
||||
NSString* output = [[NSString alloc] initWithData:data
|
||||
encoding:NSUTF8StringEncoding];
|
||||
NSString* output = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
|
||||
|
||||
filename = [output componentsSeparatedByCharactersInSet:NSCharacterSet.newlineCharacterSet].firstObject;
|
||||
}
|
||||
|
@ -263,12 +254,7 @@ didFinishDownloadingToURL:(NSURL *)location
|
|||
NSTask* untar = [[NSTask alloc] init];
|
||||
untar.launchPath = @"/usr/bin/tar";
|
||||
untar.currentDirectoryPath = destinationDir.path;
|
||||
untar.arguments = @[
|
||||
@"--extract",
|
||||
@"--file",
|
||||
file.path,
|
||||
filename
|
||||
];
|
||||
untar.arguments = @[ @"--extract", @"--file", file.path, filename ];
|
||||
|
||||
@try
|
||||
{
|
||||
|
@ -298,10 +284,7 @@ didFinishDownloadingToURL:(NSURL *)location
|
|||
NSTask* gunzip = [[NSTask alloc] init];
|
||||
gunzip.launchPath = @"/usr/bin/gunzip";
|
||||
gunzip.currentDirectoryPath = destinationDir.path;
|
||||
gunzip.arguments = @[
|
||||
@"--keep",
|
||||
file.path
|
||||
];
|
||||
gunzip.arguments = @[ @"--keep", file.path ];
|
||||
|
||||
@try
|
||||
{
|
||||
|
@ -350,8 +333,7 @@ didFinishDownloadingToURL:(NSURL *)location
|
|||
|
||||
NSData* data = [pipe.fileHandleForReading readDataToEndOfFile];
|
||||
|
||||
NSString* output = [[NSString alloc] initWithData:data
|
||||
encoding:NSUTF8StringEncoding];
|
||||
NSString* output = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
|
||||
|
||||
filename = [output componentsSeparatedByCharactersInSet:NSCharacterSet.newlineCharacterSet].firstObject;
|
||||
}
|
||||
|
@ -371,10 +353,7 @@ didFinishDownloadingToURL:(NSURL *)location
|
|||
NSTask* unzip = [[NSTask alloc] init];
|
||||
unzip.launchPath = @"/usr/bin/unzip";
|
||||
unzip.currentDirectoryPath = destinationDir.path;
|
||||
unzip.arguments = @[
|
||||
file.path,
|
||||
filename
|
||||
];
|
||||
unzip.arguments = @[ file.path, filename ];
|
||||
|
||||
@try
|
||||
{
|
||||
|
|
|
@ -670,7 +670,6 @@ static void removeKeRangerRansomware()
|
|||
self.fTorrentHashes[torrent.hashString] = torrent;
|
||||
}
|
||||
|
||||
|
||||
//update previous transfers state by recreating a torrent from history
|
||||
//and comparing to torrents already loaded via tr_sessionLoadTorrents
|
||||
NSString* historyFile = [self.fConfigDirectory stringByAppendingPathComponent:TRANSFER_PLIST];
|
||||
|
@ -694,7 +693,8 @@ static void removeKeRangerRansomware()
|
|||
for (NSDictionary* historyItem in history)
|
||||
{
|
||||
NSString* hash = historyItem[@"TorrentHash"];
|
||||
if ([self.fTorrentHashes.allKeys containsObject:hash]) {
|
||||
if ([self.fTorrentHashes.allKeys containsObject:hash])
|
||||
{
|
||||
Torrent* torrent = self.fTorrentHashes[hash];
|
||||
[t setResumeStatusForTorrent:torrent withHistory:historyItem forcePause:self.fPauseOnLaunch];
|
||||
|
||||
|
@ -758,7 +758,8 @@ static void removeKeRangerRansomware()
|
|||
|
||||
//timer to update the interface every second
|
||||
[self updateUI];
|
||||
self.fTimer = [NSTimer scheduledTimerWithTimeInterval:UPDATE_UI_SECONDS target:self selector:@selector(updateUI) userInfo:nil
|
||||
self.fTimer = [NSTimer scheduledTimerWithTimeInterval:UPDATE_UI_SECONDS target:self selector:@selector(updateUI)
|
||||
userInfo:nil
|
||||
repeats:YES];
|
||||
[NSRunLoop.currentRunLoop addTimer:self.fTimer forMode:NSModalPanelRunLoopMode];
|
||||
[NSRunLoop.currentRunLoop addTimer:self.fTimer forMode:NSEventTrackingRunLoopMode];
|
||||
|
@ -2137,7 +2138,8 @@ static void removeKeRangerRansomware()
|
|||
[self.fInfoController updateInfoStats];
|
||||
[self.fInfoController.window orderFront:nil];
|
||||
|
||||
if (self.fInfoController.canQuickLook && [QLPreviewPanel sharedPreviewPanelExists] && [QLPreviewPanel sharedPreviewPanel].visible)
|
||||
if (self.fInfoController.canQuickLook && [QLPreviewPanel sharedPreviewPanelExists] &&
|
||||
[QLPreviewPanel sharedPreviewPanel].visible)
|
||||
{
|
||||
[[QLPreviewPanel sharedPreviewPanel] reloadData];
|
||||
}
|
||||
|
@ -2772,7 +2774,8 @@ static void removeKeRangerRansomware()
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (torrent.error) {
|
||||
else if (torrent.error)
|
||||
{
|
||||
std::atomic_fetch_add_explicit(errorRef, 1, std::memory_order_relaxed);
|
||||
if (filterStatus && !filterError)
|
||||
{
|
||||
|
@ -2847,9 +2850,7 @@ static void removeKeRangerRansomware()
|
|||
//set button tooltips
|
||||
if (self.fFilterBar)
|
||||
{
|
||||
[self.fFilterBar setCountAll:self.fTorrents.count
|
||||
active:active.load()
|
||||
downloading:downloading.load()
|
||||
[self.fFilterBar setCountAll:self.fTorrents.count active:active.load() downloading:downloading.load()
|
||||
seeding:seeding.load()
|
||||
paused:paused.load()
|
||||
error:error.load()];
|
||||
|
@ -2946,9 +2947,9 @@ static void removeKeRangerRansomware()
|
|||
[addIndexes removeIndexes:newAddIndexes];
|
||||
|
||||
[self.fDisplayedTorrents addObjectsFromArray:[allTorrents objectsAtIndexes:newAddIndexes]];
|
||||
[self.fTableView
|
||||
insertItemsAtIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(
|
||||
self.fDisplayedTorrents.count - newAddIndexes.count,
|
||||
[self.fTableView insertItemsAtIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(
|
||||
self.fDisplayedTorrents.count -
|
||||
newAddIndexes.count,
|
||||
newAddIndexes.count)]
|
||||
inParent:nil
|
||||
withAnimation:NSTableViewAnimationSlideLeft];
|
||||
|
@ -3013,7 +3014,8 @@ static void removeKeRangerRansomware()
|
|||
groupsByIndex[@(groupValue)] = newGroup;
|
||||
[self.fDisplayedTorrents addObject:newGroup];
|
||||
|
||||
[self.fTableView insertItemsAtIndexes:[NSIndexSet indexSetWithIndex:self.fDisplayedTorrents.count - 1] inParent:nil
|
||||
[self.fTableView insertItemsAtIndexes:[NSIndexSet indexSetWithIndex:self.fDisplayedTorrents.count - 1]
|
||||
inParent:nil
|
||||
withAnimation:NSTableViewAnimationEffectFade];
|
||||
[self.fTableView isGroupCollapsed:groupValue] ? [self.fTableView collapseItem:newGroup] :
|
||||
[self.fTableView expandItem:newGroup];
|
||||
|
@ -3304,7 +3306,8 @@ static void removeKeRangerRansomware()
|
|||
}
|
||||
|
||||
//check again in 10 seconds in case torrent file wasn't complete
|
||||
self.fAutoImportTimer = [NSTimer scheduledTimerWithTimeInterval:10.0 target:self selector:@selector(checkAutoImportDirectory)
|
||||
self.fAutoImportTimer = [NSTimer scheduledTimerWithTimeInterval:10.0 target:self
|
||||
selector:@selector(checkAutoImportDirectory)
|
||||
userInfo:nil
|
||||
repeats:NO];
|
||||
|
||||
|
@ -3794,7 +3797,8 @@ static void removeKeRangerRansomware()
|
|||
self.fTableView.rowHeight = makeSmall ? ROW_HEIGHT_SMALL : ROW_HEIGHT_REGULAR;
|
||||
|
||||
[self.fTableView beginUpdates];
|
||||
[self.fTableView noteHeightOfRowsWithIndexesChanged:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, self.fTableView.numberOfRows)]];
|
||||
[self.fTableView
|
||||
noteHeightOfRowsWithIndexesChanged:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, self.fTableView.numberOfRows)]];
|
||||
[self.fTableView endUpdates];
|
||||
|
||||
//resize for larger min height if not set to auto size
|
||||
|
@ -3847,7 +3851,8 @@ static void removeKeRangerRansomware()
|
|||
if (check)
|
||||
{
|
||||
//we can't call minSize, since it might be set to the current size (auto size)
|
||||
CGFloat const minHeight = self.minWindowContentSizeAllowed + (NSHeight(self.fWindow.frame) - NSHeight(self.fWindow.contentView.frame)); //contentView to window
|
||||
CGFloat const minHeight = self.minWindowContentSizeAllowed +
|
||||
(NSHeight(self.fWindow.frame) - NSHeight(self.fWindow.contentView.frame)); //contentView to window
|
||||
|
||||
if (windowSize.height <= minHeight)
|
||||
{
|
||||
|
@ -4810,8 +4815,7 @@ static void removeKeRangerRansomware()
|
|||
|
||||
if (action == @selector(toggleAvailabilityBar:))
|
||||
{
|
||||
menuItem.state = [self.fDefaults boolForKey:@"DisplayProgressBarAvailable"] ? NSControlStateValueOn
|
||||
: NSControlStateValueOff;
|
||||
menuItem.state = [self.fDefaults boolForKey:@"DisplayProgressBarAvailable"] ? NSControlStateValueOn : NSControlStateValueOff;
|
||||
return self.fWindow.visible;
|
||||
}
|
||||
|
||||
|
@ -5104,8 +5108,7 @@ static void removeKeRangerRansomware()
|
|||
if (action == @selector(setSortReverse:))
|
||||
{
|
||||
BOOL const isReverse = menuItem.tag == SORT_DESC_TAG;
|
||||
menuItem.state = (isReverse == [self.fDefaults boolForKey:@"SortReverse"]) ? NSControlStateValueOn
|
||||
: NSControlStateValueOff;
|
||||
menuItem.state = (isReverse == [self.fDefaults boolForKey:@"SortReverse"]) ? NSControlStateValueOn : NSControlStateValueOff;
|
||||
return ![[self.fDefaults stringForKey:@"Sort"] isEqualToString:SORT_ORDER];
|
||||
}
|
||||
|
||||
|
|
|
@ -192,13 +192,15 @@ NSMutableSet* creatorWindowControllerSet = nil;
|
|||
[self updatePiecesField];
|
||||
[self.fPieceSizeStepper setIntValue:(int)log2((double)self.fInfo->pieceSize)];
|
||||
|
||||
self.fLocation = [[self.fDefaults URLForKey:@"CreatorLocationURL"] URLByAppendingPathComponent:[name stringByAppendingPathExtension:@"torrent"]];
|
||||
self.fLocation = [[self.fDefaults URLForKey:@"CreatorLocationURL"]
|
||||
URLByAppendingPathComponent:[name stringByAppendingPathExtension:@"torrent"]];
|
||||
if (!self.fLocation)
|
||||
{
|
||||
//for 2.5 and earlier
|
||||
#warning we still store "CreatorLocation" in Defaults.plist, and not "CreatorLocationURL"
|
||||
NSString* location = [self.fDefaults stringForKey:@"CreatorLocation"];
|
||||
self.fLocation = [[NSURL alloc] initFileURLWithPath:[location.stringByExpandingTildeInPath
|
||||
self.fLocation = [[NSURL alloc]
|
||||
initFileURLWithPath:[location.stringByExpandingTildeInPath
|
||||
stringByAppendingPathComponent:[name stringByAppendingPathExtension:@"torrent"]]];
|
||||
}
|
||||
[self updateLocationField];
|
||||
|
@ -360,7 +362,8 @@ NSMutableSet* creatorWindowControllerSet = nil;
|
|||
- (IBAction)incrementOrDecrementPieceSize:(id)sender
|
||||
{
|
||||
uint32_t pieceSize = (uint32_t)pow(2.0, [sender intValue]);
|
||||
if (tr_metaInfoBuilderSetPieceSize(self.fInfo, pieceSize)) {
|
||||
if (tr_metaInfoBuilderSetPieceSize(self.fInfo, pieceSize))
|
||||
{
|
||||
[self updatePiecesField];
|
||||
}
|
||||
}
|
||||
|
@ -603,7 +606,8 @@ NSMutableSet* creatorWindowControllerSet = nil;
|
|||
[self.fDefaults setBool:self.fPrivateCheck.state == NSControlStateValueOn forKey:@"CreatorPrivate"];
|
||||
[self.fDefaults setObject:[self.fSource stringValue] forKey:@"CreatorSource"];
|
||||
[self.fDefaults setBool:self.fOpenCheck.state == NSControlStateValueOn forKey:@"CreatorOpen"];
|
||||
self.fOpenWhenCreated = self.fOpenCheck.state == NSControlStateValueOn; //need this since the check box might not exist, and value in prefs might have changed from another creator window
|
||||
self.fOpenWhenCreated = self.fOpenCheck.state ==
|
||||
NSControlStateValueOn; //need this since the check box might not exist, and value in prefs might have changed from another creator window
|
||||
[self.fDefaults setURL:self.fLocation.URLByDeletingLastPathComponent forKey:@"CreatorLocationURL"];
|
||||
|
||||
self.window.restorable = NO;
|
||||
|
@ -621,7 +625,8 @@ NSMutableSet* creatorWindowControllerSet = nil;
|
|||
self.fSource.stringValue.UTF8String);
|
||||
tr_free(trackerInfo);
|
||||
|
||||
self.fTimer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(checkProgress) userInfo:nil repeats:YES];
|
||||
self.fTimer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(checkProgress) userInfo:nil
|
||||
repeats:YES];
|
||||
}
|
||||
|
||||
- (void)checkProgress
|
||||
|
@ -637,7 +642,10 @@ NSMutableSet* creatorWindowControllerSet = nil;
|
|||
case TrMakemetaResult::OK:
|
||||
if (self.fOpenWhenCreated)
|
||||
{
|
||||
NSDictionary* dict = @{ @"File" : self.fLocation.path, @"Path" : self.fPath.URLByDeletingLastPathComponent.path };
|
||||
NSDictionary* dict = @{
|
||||
@"File" : self.fLocation.path,
|
||||
@"Path" : self.fPath.URLByDeletingLastPathComponent.path
|
||||
};
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:@"OpenCreatedTorrentFile" object:self userInfo:dict];
|
||||
}
|
||||
|
||||
|
|
|
@ -24,9 +24,7 @@
|
|||
|
||||
- (instancetype)initWithLib:(tr_session*)lib forWindow:(NSWindow*)window
|
||||
{
|
||||
if ((self = ([super initWithContentRect:window.frame
|
||||
styleMask:NSWindowStyleMaskBorderless
|
||||
backing:NSBackingStoreBuffered
|
||||
if ((self = ([super initWithContentRect:window.frame styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered
|
||||
defer:NO])))
|
||||
{
|
||||
_fLib = lib;
|
||||
|
|
|
@ -78,7 +78,8 @@
|
|||
{
|
||||
if (!_iconInternal)
|
||||
{
|
||||
_iconInternal = [NSWorkspace.sharedWorkspace iconForFileType:_isFolder ? NSFileTypeForHFSTypeCode(kGenericFolderIcon) : _name.pathExtension];
|
||||
_iconInternal = [NSWorkspace.sharedWorkspace
|
||||
iconForFileType:_isFolder ? NSFileTypeForHFSTypeCode(kGenericFolderIcon) : _name.pathExtension];
|
||||
}
|
||||
return _iconInternal;
|
||||
}
|
||||
|
|
|
@ -85,7 +85,8 @@
|
|||
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView*)controlView
|
||||
{
|
||||
//icon
|
||||
[self.image drawInRect:[self imageRectForBounds:cellFrame] fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0
|
||||
[self.image drawInRect:[self imageRectForBounds:cellFrame] fromRect:NSZeroRect operation:NSCompositingOperationSourceOver
|
||||
fraction:1.0
|
||||
respectFlipped:YES
|
||||
hints:nil];
|
||||
|
||||
|
|
|
@ -282,8 +282,7 @@ typedef NS_ENUM(unsigned int, filePriorityMenuTag) { //
|
|||
indexSet = ((FileListNode*)item).indexes;
|
||||
}
|
||||
|
||||
[self.torrent setFileCheckState:[object intValue] != NSControlStateValueOff ? NSControlStateValueOn
|
||||
: NSControlStateValueOff
|
||||
[self.torrent setFileCheckState:[object intValue] != NSControlStateValueOff ? NSControlStateValueOn : NSControlStateValueOff
|
||||
forIndexes:indexSet];
|
||||
self.fOutline.needsDisplay = YES;
|
||||
|
||||
|
|
|
@ -156,7 +156,8 @@
|
|||
imageSize.width,
|
||||
imageSize.height);
|
||||
|
||||
[image drawInRect:imageRect fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0 respectFlipped:YES
|
||||
[image drawInRect:imageRect fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0
|
||||
respectFlipped:YES
|
||||
hints:nil];
|
||||
|
||||
currentWidth += imageSize.width - IMAGE_OVERLAP;
|
||||
|
|
|
@ -385,9 +385,8 @@
|
|||
|
||||
if (action == @selector(setGroupFilter:))
|
||||
{
|
||||
menuItem.state = menuItem.tag == [NSUserDefaults.standardUserDefaults integerForKey:@"FilterGroup"]
|
||||
? NSControlStateValueOn
|
||||
: NSControlStateValueOff;
|
||||
menuItem.state = menuItem.tag == [NSUserDefaults.standardUserDefaults integerForKey:@"FilterGroup"] ? NSControlStateValueOn :
|
||||
NSControlStateValueOff;
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
|
|
@ -238,7 +238,8 @@ GroupsController* fGroupsInstance = nil;
|
|||
|
||||
[self.fGroups addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:@(index),
|
||||
@"Index",
|
||||
[NSColor colorWithCalibratedRed:0.0 green:0.65 blue:1.0
|
||||
[NSColor colorWithCalibratedRed:0.0 green:0.65
|
||||
blue:1.0
|
||||
alpha:1.0],
|
||||
@"Color",
|
||||
@"",
|
||||
|
|
|
@ -122,9 +122,8 @@
|
|||
NSInteger globalUseSpeedLimit = torrent.usesGlobalSpeedLimit ? NSControlStateValueOn : NSControlStateValueOff;
|
||||
|
||||
while ((torrent = [enumerator nextObject]) &&
|
||||
(uploadUseSpeedLimit != NSControlStateValueMixed || uploadSpeedLimit != INVALID ||
|
||||
downloadUseSpeedLimit != NSControlStateValueMixed || downloadSpeedLimit != INVALID ||
|
||||
globalUseSpeedLimit != NSControlStateValueMixed))
|
||||
(uploadUseSpeedLimit != NSControlStateValueMixed || uploadSpeedLimit != INVALID || downloadUseSpeedLimit != NSControlStateValueMixed ||
|
||||
downloadSpeedLimit != INVALID || globalUseSpeedLimit != NSControlStateValueMixed))
|
||||
{
|
||||
if (uploadUseSpeedLimit != NSControlStateValueMixed &&
|
||||
uploadUseSpeedLimit != ([torrent usesSpeedLimit:YES] ? NSControlStateValueOn : NSControlStateValueOff))
|
||||
|
@ -195,8 +194,7 @@
|
|||
|
||||
NSInteger checkRatio = torrent.ratioSetting;
|
||||
NSInteger checkIdle = torrent.idleSetting;
|
||||
NSInteger removeWhenFinishSeeding = torrent.removeWhenFinishSeeding ? NSControlStateValueOn
|
||||
: NSControlStateValueOff;
|
||||
NSInteger removeWhenFinishSeeding = torrent.removeWhenFinishSeeding ? NSControlStateValueOn : NSControlStateValueOff;
|
||||
CGFloat ratioLimit = torrent.ratioLimit;
|
||||
NSUInteger idleLimit = torrent.idleLimitMinutes;
|
||||
|
||||
|
@ -224,8 +222,7 @@
|
|||
}
|
||||
|
||||
if (removeWhenFinishSeeding != NSControlStateValueMixed &&
|
||||
removeWhenFinishSeeding != (torrent.removeWhenFinishSeeding ? NSControlStateValueOn
|
||||
: NSControlStateValueOff))
|
||||
removeWhenFinishSeeding != (torrent.removeWhenFinishSeeding ? NSControlStateValueOn : NSControlStateValueOff))
|
||||
{
|
||||
removeWhenFinishSeeding = NSControlStateValueMixed;
|
||||
}
|
||||
|
|
|
@ -71,7 +71,9 @@
|
|||
[self.fWebSeedTable tableColumnWithIdentifier:@"DL From"].headerCell.stringValue = NSLocalizedString(@"DL", "inspector -> web seed table -> header");
|
||||
|
||||
//set table header tool tips
|
||||
[self.fPeerTable tableColumnWithIdentifier:@"Encryption"].headerToolTip = NSLocalizedString(@"Encrypted Connection", "inspector -> peer table -> header tool tip");
|
||||
[self.fPeerTable tableColumnWithIdentifier:@"Encryption"].headerToolTip = NSLocalizedString(
|
||||
@"Encrypted Connection",
|
||||
"inspector -> peer table -> header tool tip");
|
||||
[self.fPeerTable tableColumnWithIdentifier:@"Progress"].headerToolTip = NSLocalizedString(@"Available", "inspector -> peer table -> header tool tip");
|
||||
[self.fPeerTable tableColumnWithIdentifier:@"DL From"].headerToolTip = NSLocalizedString(@"Downloading From Peer", "inspector -> peer table -> header tool tip");
|
||||
[self.fPeerTable tableColumnWithIdentifier:@"UL To"].headerToolTip = NSLocalizedString(@"Uploading To Peer", "inspector -> peer table -> header tool tip");
|
||||
|
|
|
@ -319,7 +319,9 @@
|
|||
self.fTrackerTable.trackers = self.fTrackers;
|
||||
[self.fTrackerTable reloadData];
|
||||
[self.fTrackerTable selectRowIndexes:[NSIndexSet indexSetWithIndex:self.fTrackers.count - 1] byExtendingSelection:NO];
|
||||
[self.fTrackerTable editColumn:[self.fTrackerTable columnWithIdentifier:@"Tracker"] row:self.fTrackers.count - 1 withEvent:nil select:YES];
|
||||
[self.fTrackerTable editColumn:[self.fTrackerTable columnWithIdentifier:@"Tracker"] row:self.fTrackers.count - 1
|
||||
withEvent:nil
|
||||
select:YES];
|
||||
}
|
||||
|
||||
- (void)removeTrackers
|
||||
|
|
|
@ -100,24 +100,13 @@ typedef NS_ENUM(unsigned int, tabTag) {
|
|||
[self.fTabs.cell setToolTip:NSLocalizedString(@"Files", "Inspector -> tab") forSegment:TAB_FILE_TAG];
|
||||
[self.fTabs.cell setToolTip:NSLocalizedString(@"Options", "Inspector -> tab") forSegment:TAB_OPTIONS_TAG];
|
||||
|
||||
[self.fTabs setImage:[NSImage systemSymbol:@"info.circle"
|
||||
withFallback:@"InfoGeneral"]
|
||||
forSegment:TAB_GENERAL_TAG];
|
||||
[self.fTabs setImage:[NSImage systemSymbol:@"square.grid.3x3.fill.square"
|
||||
withFallback:@"InfoActivity"]
|
||||
forSegment:TAB_ACTIVITY_TAG];
|
||||
[self.fTabs setImage:[NSImage systemSymbol:@"antenna.radiowaves.left.and.right"
|
||||
withFallback:@"InfoTracker"]
|
||||
[self.fTabs setImage:[NSImage systemSymbol:@"info.circle" withFallback:@"InfoGeneral"] forSegment:TAB_GENERAL_TAG];
|
||||
[self.fTabs setImage:[NSImage systemSymbol:@"square.grid.3x3.fill.square" withFallback:@"InfoActivity"] forSegment:TAB_ACTIVITY_TAG];
|
||||
[self.fTabs setImage:[NSImage systemSymbol:@"antenna.radiowaves.left.and.right" withFallback:@"InfoTracker"]
|
||||
forSegment:TAB_TRACKERS_TAG];
|
||||
[self.fTabs setImage:[NSImage systemSymbol:@"person.2"
|
||||
withFallback:@"InfoPeers"]
|
||||
forSegment:TAB_PEERS_TAG];
|
||||
[self.fTabs setImage:[NSImage systemSymbol:@"doc.on.doc"
|
||||
withFallback:@"InfoFiles"]
|
||||
forSegment:TAB_FILE_TAG];
|
||||
[self.fTabs setImage:[NSImage systemSymbol:@"gearshape"
|
||||
withFallback:@"InfoOptions"]
|
||||
forSegment:TAB_OPTIONS_TAG];
|
||||
[self.fTabs setImage:[NSImage systemSymbol:@"person.2" withFallback:@"InfoPeers"] forSegment:TAB_PEERS_TAG];
|
||||
[self.fTabs setImage:[NSImage systemSymbol:@"doc.on.doc" withFallback:@"InfoFiles"] forSegment:TAB_FILE_TAG];
|
||||
[self.fTabs setImage:[NSImage systemSymbol:@"gearshape" withFallback:@"InfoOptions"] forSegment:TAB_OPTIONS_TAG];
|
||||
|
||||
//set selected tab
|
||||
self.fCurrentTabTag = INVALID;
|
||||
|
|
|
@ -105,7 +105,8 @@
|
|||
filterButtonFrame.origin.x -= NSWidth(clearButtonFrame) - oldClearButtonWidth;
|
||||
self.fFilterField.frame = filterButtonFrame;
|
||||
|
||||
self.fAttributes = [[[self.fMessageTable tableColumnWithIdentifier:@"Message"].dataCell attributedStringValue] attributesAtIndex:0
|
||||
self.fAttributes = [[[self.fMessageTable tableColumnWithIdentifier:@"Message"].dataCell attributedStringValue]
|
||||
attributesAtIndex:0
|
||||
effectiveRange:NULL];
|
||||
|
||||
//select proper level in popup button
|
||||
|
@ -147,7 +148,8 @@
|
|||
{
|
||||
if (!self.fTimer)
|
||||
{
|
||||
self.fTimer = [NSTimer scheduledTimerWithTimeInterval:UPDATE_SECONDS target:self selector:@selector(updateLog:) userInfo:nil
|
||||
self.fTimer = [NSTimer scheduledTimerWithTimeInterval:UPDATE_SECONDS target:self selector:@selector(updateLog:)
|
||||
userInfo:nil
|
||||
repeats:YES];
|
||||
[self updateLog:nil];
|
||||
}
|
||||
|
@ -460,7 +462,8 @@
|
|||
|
||||
- (void)resizeColumn
|
||||
{
|
||||
[self.fMessageTable noteHeightOfRowsWithIndexesChanged:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, self.fMessageTable.numberOfRows)]];
|
||||
[self.fMessageTable
|
||||
noteHeightOfRowsWithIndexesChanged:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, self.fMessageTable.numberOfRows)]];
|
||||
}
|
||||
|
||||
- (BOOL)shouldIncludeMessageForFilter:(NSString*)filterString message:(NSDictionary*)message
|
||||
|
|
|
@ -59,7 +59,8 @@
|
|||
imageSize.width,
|
||||
imageSize.height);
|
||||
|
||||
[checkImage drawInRect:rect fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0 respectFlipped:YES
|
||||
[checkImage drawInRect:rect fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0
|
||||
respectFlipped:YES
|
||||
hints:nil];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -237,7 +237,8 @@
|
|||
self.fNatStatus = -1;
|
||||
|
||||
[self updatePortStatus];
|
||||
self.fPortStatusTimer = [NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(updatePortStatus) userInfo:nil
|
||||
self.fPortStatusTimer = [NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(updatePortStatus)
|
||||
userInfo:nil
|
||||
repeats:YES];
|
||||
|
||||
//set peer connections
|
||||
|
|
|
@ -83,7 +83,8 @@ OSStatus GeneratePreviewForURL(void* thisInterface, QLPreviewRequestRef preview,
|
|||
NSString* fileSizeString = [NSString stringForFileSize:metainfo.totalSize()];
|
||||
if (is_multifile)
|
||||
{
|
||||
NSString* fileCountString = [NSString stringWithFormat:NSLocalizedStringFromTableInBundle(@"%@ files", nil, bundle, "quicklook file count"),
|
||||
NSString* fileCountString = [NSString
|
||||
stringWithFormat:NSLocalizedStringFromTableInBundle(@"%@ files", nil, bundle, "quicklook file count"),
|
||||
[NSString formattedUInteger:n_files]];
|
||||
fileSizeString = [NSString stringWithFormat:@"%@, %@", fileCountString, fileSizeString];
|
||||
}
|
||||
|
@ -184,7 +185,8 @@ OSStatus GeneratePreviewForURL(void* thisInterface, QLPreviewRequestRef preview,
|
|||
NSMutableString* listSection = [NSMutableString string];
|
||||
[listSection appendString:@"<table>"];
|
||||
|
||||
NSString* fileTitleString = [NSString stringWithFormat:NSLocalizedStringFromTableInBundle(@"%@ Files", nil, bundle, "quicklook file header"),
|
||||
NSString* fileTitleString = [NSString
|
||||
stringWithFormat:NSLocalizedStringFromTableInBundle(@"%@ Files", nil, bundle, "quicklook file header"),
|
||||
[NSString formattedUInteger:n_files]];
|
||||
[listSection appendFormat:@"<tr><th>%@</th></tr>", fileTitleString];
|
||||
|
||||
|
|
|
@ -60,7 +60,8 @@ tr_session* fLib = NULL;
|
|||
{
|
||||
[self updateStats];
|
||||
|
||||
self.fTimer = [NSTimer scheduledTimerWithTimeInterval:UPDATE_SECONDS target:self selector:@selector(updateStats) userInfo:nil
|
||||
self.fTimer = [NSTimer scheduledTimerWithTimeInterval:UPDATE_SECONDS target:self selector:@selector(updateStats)
|
||||
userInfo:nil
|
||||
repeats:YES];
|
||||
[NSRunLoop.currentRunLoop addTimer:self.fTimer forMode:NSModalPanelRunLoopMode];
|
||||
[NSRunLoop.currentRunLoop addTimer:self.fTimer forMode:NSEventTrackingRunLoopMode];
|
||||
|
@ -79,7 +80,13 @@ tr_session* fLib = NULL;
|
|||
//size of all labels
|
||||
CGFloat const oldWidth = self.fUploadedLabelField.frame.size.width;
|
||||
|
||||
NSArray* labels = @[ self.fUploadedLabelField, self.fDownloadedLabelField, self.fRatioLabelField, self.fTimeLabelField, self.fNumOpenedLabelField ];
|
||||
NSArray* labels = @[
|
||||
self.fUploadedLabelField,
|
||||
self.fDownloadedLabelField,
|
||||
self.fRatioLabelField,
|
||||
self.fTimeLabelField,
|
||||
self.fNumOpenedLabelField
|
||||
];
|
||||
|
||||
CGFloat maxWidth = CGFLOAT_MIN;
|
||||
for (NSTextField* label in labels)
|
||||
|
|
|
@ -238,9 +238,9 @@ typedef NS_ENUM(unsigned int, statusTag) {
|
|||
statusLabel = STATUS_RATIO_TOTAL;
|
||||
}
|
||||
|
||||
menuItem.state = [statusLabel isEqualToString:[NSUserDefaults.standardUserDefaults stringForKey:@"StatusLabel"]]
|
||||
? NSControlStateValueOn
|
||||
: NSControlStateValueOff;
|
||||
menuItem.state = [statusLabel isEqualToString:[NSUserDefaults.standardUserDefaults stringForKey:@"StatusLabel"]] ?
|
||||
NSControlStateValueOn :
|
||||
NSControlStateValueOff;
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
|
|
@ -1873,7 +1873,11 @@ bool trashDataFile(char const* filename, tr_error** error)
|
|||
tempNode = [[FileListNode alloc] initWithFolderName:pathComponents[0] path:@"" torrent:self];
|
||||
}
|
||||
|
||||
[self insertPathForComponents:pathComponents withComponentIndex:1 forParent:tempNode fileSize:file.length index:i
|
||||
[self insertPathForComponents:pathComponents
|
||||
withComponentIndex:1
|
||||
forParent:tempNode
|
||||
fileSize:file.length
|
||||
index:i
|
||||
flatList:flatFileList];
|
||||
}
|
||||
|
||||
|
|
|
@ -186,10 +186,8 @@
|
|||
{
|
||||
[NSApp sendEvent:event];
|
||||
}
|
||||
event = [controlView.window nextEventMatchingMask:(NSEventMaskLeftMouseUp |
|
||||
NSEventMaskLeftMouseDragged |
|
||||
NSEventMaskMouseEntered |
|
||||
NSEventMaskMouseExited)];
|
||||
event = [controlView.window nextEventMatchingMask:(NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged |
|
||||
NSEventMaskMouseEntered | NSEventMaskMouseExited)];
|
||||
}
|
||||
|
||||
self.fTracking = NO;
|
||||
|
@ -332,7 +330,8 @@
|
|||
if (!minimal || !(!self.fTracking && self.hoverAction)) //don't show in minimal mode when hovered over
|
||||
{
|
||||
NSImage* icon = (minimal && error) ? [NSImage imageNamed:NSImageNameCaution] : torrent.icon;
|
||||
[icon drawInRect:iconRect fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0 respectFlipped:YES hints:nil];
|
||||
[icon drawInRect:iconRect fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0 respectFlipped:YES
|
||||
hints:nil];
|
||||
}
|
||||
|
||||
//error badge
|
||||
|
@ -340,7 +339,8 @@
|
|||
{
|
||||
NSImage* errorImage = [NSImage imageNamed:NSImageNameCaution];
|
||||
NSRect const errorRect = NSMakeRect(NSMaxX(iconRect) - ERROR_IMAGE_SIZE, NSMaxY(iconRect) - ERROR_IMAGE_SIZE, ERROR_IMAGE_SIZE, ERROR_IMAGE_SIZE);
|
||||
[errorImage drawInRect:errorRect fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0 respectFlipped:YES
|
||||
[errorImage drawInRect:errorRect fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0
|
||||
respectFlipped:YES
|
||||
hints:nil];
|
||||
}
|
||||
|
||||
|
@ -422,7 +422,8 @@
|
|||
}
|
||||
|
||||
NSRect const controlRect = [self controlButtonRectForBounds:cellFrame];
|
||||
[controlImage drawInRect:controlRect fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0 respectFlipped:YES
|
||||
[controlImage drawInRect:controlRect fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0
|
||||
respectFlipped:YES
|
||||
hints:nil];
|
||||
minimalTitleRightBound = MIN(minimalTitleRightBound, NSMinX(controlRect));
|
||||
|
||||
|
@ -442,7 +443,8 @@
|
|||
}
|
||||
|
||||
NSImage* revealImage = [NSImage imageNamed:revealImageString];
|
||||
[revealImage drawInRect:[self revealButtonRectForBounds:cellFrame] fromRect:NSZeroRect operation:NSCompositingOperationSourceOver
|
||||
[revealImage drawInRect:[self revealButtonRectForBounds:cellFrame] fromRect:NSZeroRect
|
||||
operation:NSCompositingOperationSourceOver
|
||||
fraction:1.0
|
||||
respectFlipped:YES
|
||||
hints:nil];
|
||||
|
@ -489,8 +491,7 @@
|
|||
PRIORITY_ICON_WIDTH,
|
||||
PRIORITY_ICON_HEIGHT);
|
||||
|
||||
NSColor* priorityColor = self.backgroundStyle == NSBackgroundStyleEmphasized ? NSColor.whiteColor
|
||||
: NSColor.labelColor;
|
||||
NSColor* priorityColor = self.backgroundStyle == NSBackgroundStyleEmphasized ? NSColor.whiteColor : NSColor.labelColor;
|
||||
|
||||
NSImage* priorityImage = [[NSImage imageNamed:(torrent.priority == TR_PRI_HIGH ? @"PriorityHighTemplate" : @"PriorityLowTemplate")]
|
||||
imageWithColor:priorityColor];
|
||||
|
|
|
@ -455,7 +455,8 @@
|
|||
return;
|
||||
}
|
||||
|
||||
BOOL const pushed = row != -1 && (self.actionButtonHoverRow == row || self.revealButtonHoverRow == row || self.controlButtonHoverRow == row);
|
||||
BOOL const pushed = row != -1 &&
|
||||
(self.actionButtonHoverRow == row || self.revealButtonHoverRow == row || self.controlButtonHoverRow == row);
|
||||
|
||||
//if pushing a button, don't change the selected rows
|
||||
if (pushed)
|
||||
|
@ -601,9 +602,7 @@
|
|||
{
|
||||
unichar const firstChar = [event.charactersIgnoringModifiers characterAtIndex:0];
|
||||
|
||||
if (firstChar == 'f' &&
|
||||
event.modifierFlags & NSEventModifierFlagOption &&
|
||||
event.modifierFlags & NSEventModifierFlagCommand)
|
||||
if (firstChar == 'f' && event.modifierFlags & NSEventModifierFlagOption && event.modifierFlags & NSEventModifierFlagCommand)
|
||||
{
|
||||
[self.fController focusFilterField];
|
||||
}
|
||||
|
|
|
@ -197,7 +197,8 @@ NSMutableSet* fTrackerIconLoading;
|
|||
return icon;
|
||||
}
|
||||
|
||||
if (@available(macOS 11.0, *)) {
|
||||
if (@available(macOS 11.0, *))
|
||||
{
|
||||
NSImage* result = [NSImage imageWithSystemSymbolName:@"globe" accessibilityDescription:nil];
|
||||
[result lockFocus];
|
||||
[NSColor.textColor set];
|
||||
|
|
|
@ -140,7 +140,8 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
peerString = [NSString stringWithFormat:NSLocalizedString(@"got %d peers", "Tracker last announce"), self.fStat.lastAnnouncePeerCount];
|
||||
peerString = [NSString stringWithFormat:NSLocalizedString(@"got %d peers", "Tracker last announce"),
|
||||
self.fStat.lastAnnouncePeerCount];
|
||||
}
|
||||
baseString = [baseString stringByAppendingFormat:@" (%@)", peerString];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue