mirror of
https://github.com/transmission/transmission
synced 2025-02-20 13:16:53 +00:00
display file count in inspector next to total size, instead of under the file table
This commit is contained in:
parent
bd2de0888e
commit
e49ca41f2c
8 changed files with 36 additions and 25 deletions
|
@ -115,7 +115,7 @@
|
|||
fileString = NSLocalizedString(@"1 File, ", "Drag overlay -> torrents");
|
||||
else
|
||||
fileString= [NSString stringWithFormat: NSLocalizedString(@"%d Files, ", "Drag overlay -> torrents"), fileCount];
|
||||
secondString = [fileString stringByAppendingString: secondString];
|
||||
secondString = [fileString stringByAppendingString: secondString];
|
||||
}
|
||||
|
||||
if (count == 1)
|
||||
|
|
6
macosx/English.lproj/InfoWindow.nib/classes.nib
generated
6
macosx/English.lproj/InfoWindow.nib/classes.nib
generated
|
@ -120,6 +120,8 @@
|
|||
<dict>
|
||||
<key>fActivityView</key>
|
||||
<string>NSView</string>
|
||||
<key>fBasicInfoField</key>
|
||||
<string>NSTextField</string>
|
||||
<key>fCommentView</key>
|
||||
<string>NSTextView</string>
|
||||
<key>fCompletedFromTrackerField</key>
|
||||
|
@ -162,8 +164,6 @@
|
|||
<string>NSMenuItem</string>
|
||||
<key>fFilePriorityNormal</key>
|
||||
<string>NSMenuItem</string>
|
||||
<key>fFileTableStatusField</key>
|
||||
<string>NSTextField</string>
|
||||
<key>fFileUncheckItem</key>
|
||||
<string>NSMenuItem</string>
|
||||
<key>fFilesView</key>
|
||||
|
@ -212,8 +212,6 @@
|
|||
<string>NSTextField</string>
|
||||
<key>fSeedersField</key>
|
||||
<string>NSTextField</string>
|
||||
<key>fSizeField</key>
|
||||
<string>NSTextField</string>
|
||||
<key>fStateField</key>
|
||||
<string>NSTextField</string>
|
||||
<key>fSwarmSpeedField</key>
|
||||
|
|
2
macosx/English.lproj/InfoWindow.nib/info.nib
generated
2
macosx/English.lproj/InfoWindow.nib/info.nib
generated
|
@ -10,7 +10,7 @@
|
|||
<integer>5</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>995</integer>
|
||||
<integer>6</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>9B18</string>
|
||||
|
|
BIN
macosx/English.lproj/InfoWindow.nib/keyedobjects.nib
generated
BIN
macosx/English.lproj/InfoWindow.nib/keyedobjects.nib
generated
Binary file not shown.
|
@ -37,8 +37,9 @@
|
|||
IBOutlet NSMatrix * fTabMatrix;
|
||||
|
||||
IBOutlet NSImageView * fImageView;
|
||||
IBOutlet NSTextField * fNameField, * fSizeField, * fTrackerField,
|
||||
* fPiecesField, * fHashField, * fSecureField,
|
||||
IBOutlet NSTextField * fNameField, * fBasicInfoField;
|
||||
|
||||
IBOutlet NSTextField * fTrackerField, * fPiecesField, * fHashField, * fSecureField,
|
||||
* fTorrentLocationField, * fDataLocationField,
|
||||
* fDateAddedField, * fDateCompletedField, * fDateActivityField,
|
||||
* fCreatorField, * fDateCreatedField,
|
||||
|
@ -56,7 +57,6 @@
|
|||
IBOutlet NSSegmentedControl * fPiecesControl;
|
||||
|
||||
IBOutlet FileOutlineView * fFileOutline;
|
||||
IBOutlet NSTextField * fFileTableStatusField;
|
||||
IBOutlet NSMenuItem * fFileCheckItem, * fFileUncheckItem,
|
||||
* fFilePriorityNormal, * fFilePriorityHigh, * fFilePriorityLow;
|
||||
|
||||
|
|
|
@ -195,20 +195,24 @@ typedef enum
|
|||
"Inspector -> above tabs -> selected torrents"), numberSelected]];
|
||||
|
||||
uint64_t size = 0;
|
||||
int fileCount = 0;
|
||||
NSEnumerator * enumerator = [torrents objectEnumerator];
|
||||
Torrent * torrent;
|
||||
while ((torrent = [enumerator nextObject]))
|
||||
{
|
||||
size += [torrent size];
|
||||
fileCount += [torrent fileCount];
|
||||
}
|
||||
|
||||
[fSizeField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%@ Total",
|
||||
"Inspector -> above tabs -> total size (several torrents selected)"), [NSString stringForFileSize: size]]];
|
||||
[fBasicInfoField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%d Files, %@ Total",
|
||||
"Inspector -> torrents"), fileCount, [NSString stringForFileSize: size]]];
|
||||
}
|
||||
else
|
||||
{
|
||||
[fImageView setImage: [NSImage imageNamed: @"NSApplicationIcon"]];
|
||||
|
||||
[fNameField setStringValue: NSLocalizedString(@"No Torrents Selected", "Inspector -> above tabs -> selected torrents")];
|
||||
[fSizeField setStringValue: @""];
|
||||
[fBasicInfoField setStringValue: @""];
|
||||
|
||||
[fHaveField setStringValue: @""];
|
||||
[fDownloadedTotalField setStringValue: @""];
|
||||
|
@ -305,8 +309,6 @@ typedef enum
|
|||
[fFiles release];
|
||||
fFiles = nil;
|
||||
}
|
||||
[fFileTableStatusField setStringValue: NSLocalizedString(@"info not available",
|
||||
"Inspector -> Files tab -> bottom text (number of files)")];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -322,7 +324,20 @@ typedef enum
|
|||
NSString * name = [torrent name];
|
||||
[fNameField setStringValue: name];
|
||||
[fNameField setToolTip: name];
|
||||
[fSizeField setStringValue: [NSString stringForFileSize: [torrent size]]];
|
||||
|
||||
NSString * basicString = [NSString stringForFileSize: [torrent size]];
|
||||
if ([torrent folder])
|
||||
{
|
||||
NSString * fileString;
|
||||
int fileCount = [torrent fileCount];
|
||||
if (fileCount == 1)
|
||||
fileString = NSLocalizedString(@"1 File, ", "Inspector -> above tabs -> selected torrents");
|
||||
else
|
||||
fileString= [NSString stringWithFormat: NSLocalizedString(@"%d Files, ",
|
||||
"Inspector -> above tabs -> selected torrents"), fileCount];
|
||||
basicString = [fileString stringByAppendingString: basicString];
|
||||
}
|
||||
[fBasicInfoField setStringValue: basicString];
|
||||
|
||||
NSArray * allTrackers = [torrent allTrackers], * subTrackers;
|
||||
NSMutableArray * trackerStrings = [NSMutableArray arrayWithCapacity: [allTrackers count]];
|
||||
|
@ -381,14 +396,6 @@ typedef enum
|
|||
[fFileOutline deselectAll: nil];
|
||||
[fFiles release];
|
||||
fFiles = [[torrent fileList] retain];
|
||||
|
||||
int fileCount = [torrent fileCount];
|
||||
if (fileCount != 1)
|
||||
[fFileTableStatusField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%d files total",
|
||||
"Inspector -> Files tab -> bottom text (number of files)"), fileCount]];
|
||||
else
|
||||
[fFileTableStatusField setStringValue: NSLocalizedString(@"1 file total",
|
||||
"Inspector -> Files tab -> bottom text (number of files)")];
|
||||
}
|
||||
|
||||
//update stats and settings
|
||||
|
|
|
@ -129,6 +129,7 @@ typedef enum
|
|||
- (NSImage *) icon;
|
||||
|
||||
- (NSString *) name;
|
||||
- (BOOL) folder;
|
||||
- (uint64_t) size;
|
||||
- (uint64_t) sizeLeft;
|
||||
- (NSString *) trackerAddress;
|
||||
|
|
|
@ -593,7 +593,7 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
|
|||
{
|
||||
if (!fIcon)
|
||||
{
|
||||
fIcon = [[[NSWorkspace sharedWorkspace] iconForFileType: fInfo->isMultifile ? NSFileTypeForHFSTypeCode('fldr')
|
||||
fIcon = [[[NSWorkspace sharedWorkspace] iconForFileType: [self folder] ? NSFileTypeForHFSTypeCode('fldr')
|
||||
: [[self name] pathExtension]] retain];
|
||||
[fIcon setFlipped: YES];
|
||||
}
|
||||
|
@ -605,6 +605,11 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
|
|||
return [NSString stringWithUTF8String: fInfo->name];
|
||||
}
|
||||
|
||||
- (BOOL) folder
|
||||
{
|
||||
return fInfo->isMultifile;
|
||||
}
|
||||
|
||||
- (uint64_t) size
|
||||
{
|
||||
return fInfo->totalSize;
|
||||
|
@ -1515,7 +1520,7 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
|
|||
file = &fInfo->files[i];
|
||||
|
||||
pathComponents = [[[NSString stringWithUTF8String: file->name] pathComponents] mutableCopy];
|
||||
if (fInfo->isMultifile)
|
||||
if ([self folder])
|
||||
{
|
||||
path = [pathComponents objectAtIndex: 0];
|
||||
[pathComponents removeObjectAtIndex: 0];
|
||||
|
|
Loading…
Reference in a new issue