1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-21 23:32:35 +00:00

fix: torrentTableView crash after superview.superview.superview (#6207)

This commit is contained in:
Cœur 2023-11-05 21:35:22 +01:00 committed by GitHub
parent d49b4a9997
commit 5d56e9039a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 100 additions and 59 deletions

View file

@ -33,6 +33,7 @@ AboutWindowController* fAboutBoxInstance = nil;
- (void)awakeFromNib
{
[super awakeFromNib];
self.fVersionField.stringValue = @(LONG_VERSION_STRING);
self.fCopyrightField.stringValue = [NSBundle.mainBundle localizedStringForKey:@"NSHumanReadableCopyright" value:nil

View file

@ -52,6 +52,7 @@ typedef NS_ENUM(NSUInteger, PopupPriority) {
- (void)awakeFromNib
{
[super awakeFromNib];
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(updateGroupMenu:) name:@"UpdateGroups" object:nil];
NSString* name = self.torrent.name;

View file

@ -87,6 +87,7 @@ typedef NS_ENUM(NSUInteger, PopupPriority) {
- (void)awakeFromNib
{
[super awakeFromNib];
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(updateCheckButtons:) name:@"TorrentFileCheckChange"
object:self.torrent];

View file

@ -76,7 +76,7 @@
</constraints>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="UpArrowTemplate" id="M11-HA-ONH"/>
</imageView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="JAO-DI-vbm">
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="JAO-DI-vbm">
<rect key="frame" x="351" y="2" width="64" height="14"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="60" id="MR1-WF-Gcs"/>
@ -87,7 +87,7 @@
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="kLh-dT-fWl">
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="kLh-dT-fWl">
<rect key="frame" x="435" y="2" width="64" height="14"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="60" id="FLW-3y-3Ft"/>
@ -98,7 +98,7 @@
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="XfM-wG-Zxc">
<textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="XfM-wG-Zxc">
<rect key="frame" x="28" y="2" width="311" height="14"/>
<textFieldCell key="cell" lineBreakMode="truncatingMiddle" sendsActionOnEndEditing="YES" title="Group Title" id="zIM-6D-jsa">
<font key="font" metaFont="smallSystemBold"/>
@ -154,7 +154,7 @@
<stackView distribution="fill" orientation="horizontal" alignment="centerY" spacing="4" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="vYS-eL-CGb">
<rect key="frame" x="72" y="44" width="41" height="15"/>
<subviews>
<textField horizontalHuggingPriority="1000" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="gIX-h2-fIl">
<textField focusRingType="none" horizontalHuggingPriority="1000" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="gIX-h2-fIl">
<rect key="frame" x="-2" y="0.0" width="29" height="15"/>
<textFieldCell key="cell" lineBreakMode="truncatingMiddle" title="Title" id="y9O-gd-sXA">
<font key="font" metaFont="cellTitle"/>
@ -180,7 +180,7 @@
<real value="3.4028234663852886e+38"/>
</customSpacing>
</stackView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7sy-Kk-M9Y">
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7sy-Kk-M9Y">
<rect key="frame" x="70" y="30" width="377" height="13"/>
<textFieldCell key="cell" controlSize="small" lineBreakMode="truncatingMiddle" allowsUndo="NO" title="Progress" id="oSz-TE-8jj">
<font key="font" metaFont="system" size="10"/>
@ -188,7 +188,7 @@
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="J4v-0p-u4L">
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="J4v-0p-u4L">
<rect key="frame" x="70" y="1" width="377" height="13"/>
<textFieldCell key="cell" controlSize="small" lineBreakMode="truncatingMiddle" allowsUndo="NO" title="Status" id="lmp-Y3-ZQO">
<font key="font" metaFont="system" size="10"/>
@ -202,17 +202,23 @@
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<outlet property="torrentCell" destination="7Ic-8y-f3v" id="BrY-70-Qul"/>
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Rxb-qW-x6p" customClass="TorrentCellActionButton">
<rect key="frame" x="25" y="23" width="16" height="16"/>
<constraints>
<constraint firstAttribute="width" constant="16" id="WLP-JK-i9A"/>
<constraint firstAttribute="height" constant="16" id="bMb-uB-fO6"/>
</constraints>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="ActionHover" imagePosition="only" alignment="center" lineBreakMode="truncatingTail" state="on" imageScaling="proportionallyDown" inset="2" id="9Xz-qo-fuz">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<constraints>
<constraint firstAttribute="width" constant="16" id="WLP-JK-i9A"/>
<constraint firstAttribute="height" constant="16" id="bMb-uB-fO6"/>
</constraints>
<connections>
<outlet property="torrentCell" destination="7Ic-8y-f3v" id="sNJ-lh-B90"/>
</connections>
</button>
<button horizontalHuggingPriority="1000" verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="k5I-MN-hYk" customClass="TorrentCellRevealButton">
<rect key="frame" x="483" y="15" width="14" height="14"/>
@ -220,6 +226,9 @@
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<outlet property="torrentCell" destination="7Ic-8y-f3v" id="npT-CF-ee4"/>
</connections>
</button>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="Ifq-ub-ay4">
<rect key="frame" x="72" y="15" width="373" height="14"/>
@ -289,19 +298,22 @@
</imageView>
<button translatesAutoresizingMaskIntoConstraints="NO" id="9Cg-Nh-Hcr" customClass="TorrentCellActionButton">
<rect key="frame" x="18" y="3" width="16" height="16"/>
<constraints>
<constraint firstAttribute="width" constant="16" id="B01-Zu-gNh"/>
<constraint firstAttribute="height" constant="16" id="dNQ-J3-27z"/>
</constraints>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="ActionHover" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="ejE-Yu-JNS">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<constraints>
<constraint firstAttribute="width" constant="16" id="B01-Zu-gNh"/>
<constraint firstAttribute="height" constant="16" id="dNQ-J3-27z"/>
</constraints>
<connections>
<outlet property="torrentCell" destination="ouH-H8-Otv" id="r2c-b8-jcH"/>
</connections>
</button>
<stackView distribution="fill" orientation="horizontal" alignment="centerY" spacing="4" horizontalStackHuggingPriority="250" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="dPU-vz-fnz">
<rect key="frame" x="54" y="4" width="41" height="15"/>
<subviews>
<textField horizontalHuggingPriority="1000" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="nyW-bO-2kN">
<textField focusRingType="none" horizontalHuggingPriority="1000" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="nyW-bO-2kN">
<rect key="frame" x="-2" y="0.0" width="29" height="15"/>
<textFieldCell key="cell" lineBreakMode="truncatingMiddle" allowsUndo="NO" title="Title" id="kbX-Av-eP4">
<font key="font" metaFont="cellTitle"/>
@ -333,7 +345,7 @@
<constraint firstAttribute="height" constant="18" id="UN3-pW-1Yw"/>
</constraints>
</customView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="ExW-pe-aKm">
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="ExW-pe-aKm">
<rect key="frame" x="98" y="4" width="398" height="14"/>
<textFieldCell key="cell" lineBreakMode="truncatingMiddle" allowsUndo="NO" alignment="right" title="Status String" id="Zmj-A9-NPf">
<font key="font" metaFont="smallSystem"/>
@ -343,25 +355,31 @@
</textField>
<button translatesAutoresizingMaskIntoConstraints="NO" id="bGq-Kc-jWE" customClass="TorrentCellControlButton">
<rect key="frame" x="463" y="4" width="14" height="14"/>
<constraints>
<constraint firstAttribute="width" constant="14" id="hQW-cC-Lp7"/>
<constraint firstAttribute="height" constant="14" id="jWF-m2-n6g"/>
</constraints>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="ResumeOff" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="DmO-My-6OF">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<constraints>
<constraint firstAttribute="width" constant="14" id="hQW-cC-Lp7"/>
<constraint firstAttribute="height" constant="14" id="jWF-m2-n6g"/>
</constraints>
<connections>
<outlet property="torrentCell" destination="ouH-H8-Otv" id="1mw-p3-MDP"/>
</connections>
</button>
<button translatesAutoresizingMaskIntoConstraints="NO" id="Hyt-Uv-vDm" customClass="TorrentCellRevealButton">
<rect key="frame" x="480" y="4" width="14" height="14"/>
<constraints>
<constraint firstAttribute="height" constant="14" id="CYn-n4-Daq"/>
<constraint firstAttribute="width" constant="14" id="P9R-Cw-RJF"/>
</constraints>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="RevealOff" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="dWx-5q-ABk">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<constraints>
<constraint firstAttribute="height" constant="14" id="CYn-n4-Daq"/>
<constraint firstAttribute="width" constant="14" id="P9R-Cw-RJF"/>
</constraints>
<connections>
<outlet property="torrentCell" destination="ouH-H8-Otv" id="zlt-Qk-E34"/>
</connections>
</button>
</subviews>
<constraints>
@ -428,7 +446,7 @@
<customView verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="JCm-xb-Dpw">
<rect key="frame" x="0.0" y="0.0" width="524" height="24"/>
<subviews>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="2700">
<textField focusRingType="none" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="2700">
<rect key="frame" x="258" y="5" width="8" height="14"/>
<textFieldCell key="cell" controlSize="small" lineBreakMode="truncatingTail" allowsUndo="NO" sendsActionOnEndEditing="YES" alignment="center" usesSingleLineMode="YES" id="3049">
<font key="font" metaFont="smallSystem"/>

View file

@ -32,6 +32,7 @@ BlocklistDownloaderViewController* fBLViewController = nil;
- (void)awakeFromNib
{
[super awakeFromNib];
self.fButton.title = NSLocalizedString(@"Cancel", "Blocklist -> cancel button");
CGFloat const oldWidth = NSWidth(self.fButton.frame);

View file

@ -8,6 +8,8 @@
- (void)awakeFromNib
{
[super awakeFromNib];
self.enabled = self.enabled;
}

View file

@ -599,6 +599,8 @@ void onTorrentCompletenessChanged(tr_torrent* tor, tr_completeness status, bool
- (void)awakeFromNib
{
[super awakeFromNib];
Toolbar* toolbar = [[Toolbar alloc] initWithIdentifier:@"TRMainToolbar"];
toolbar.delegate = self;
toolbar.allowsUserCustomization = YES;

View file

@ -158,6 +158,7 @@ NSMutableSet* creatorWindowControllerSet = nil;
- (void)awakeFromNib
{
[super awakeFromNib];
self.window.restorationClass = [self class];
NSString* name = self.fPath.lastPathComponent;

View file

@ -38,6 +38,7 @@ typedef NS_ENUM(NSUInteger, FilePriorityMenuTag) { //
- (void)awakeFromNib
{
[super awakeFromNib];
self.fFileList = [[NSMutableArray alloc] init];
//set table header tool tips

View file

@ -19,6 +19,7 @@
- (void)awakeFromNib
{
[super awakeFromNib];
FileNameCell* nameCell = [[FileNameCell alloc] init];
[self tableColumnWithIdentifier:@"Name"].dataCell = nameCell;

View file

@ -50,6 +50,7 @@ typedef NS_ENUM(NSInteger, FilterTypeTag) {
- (void)awakeFromNib
{
[super awakeFromNib];
//localizations
self.fNoFilterButton.title = NSLocalizedString(@"All", "Filter Bar -> filter button");
self.fActiveFilterButton.title = NSLocalizedString(@"Active", "Filter Bar -> filter button");

View file

@ -12,6 +12,7 @@
- (void)awakeFromNib
{
[super awakeFromNib];
_searchFieldVerticalConstraint.constant = -.5;
}

View file

@ -35,6 +35,7 @@
- (void)awakeFromNib
{
[super awakeFromNib];
self.fUploadLimitField.integerValue = [self.fDefaults integerForKey:@"UploadLimit"];
self.fDownloadLimitField.integerValue = [self.fDefaults integerForKey:@"DownloadLimit"];

View file

@ -39,6 +39,7 @@ typedef NS_ENUM(NSInteger, SegmentTag) {
- (void)awakeFromNib
{
[super awakeFromNib];
[self.fTableView registerForDraggedTypes:@[ kGroupTableViewDataType ]];
[self.fSelectedColorView addObserver:self forKeyPath:@"color" options:0 context:NULL];

View file

@ -66,6 +66,7 @@ static CGFloat const kStackViewVerticalSpacing = 8.0;
- (void)awakeFromNib
{
[super awakeFromNib];
[self checkWindowSize];
}

View file

@ -36,6 +36,7 @@
- (void)awakeFromNib
{
[super awakeFromNib];
CGFloat const height = [NSUserDefaults.standardUserDefaults floatForKey:@"InspectorContentHeightFiles"];
if (height != 0.0)
{

View file

@ -74,6 +74,7 @@ static CGFloat const kStackViewSpacing = 8.0;
- (void)awakeFromNib
{
[super awakeFromNib];
[self checkWindowSize];
[self setGlobalLabels];

View file

@ -49,6 +49,7 @@ static NSString* const kWebSeedAnimationId = @"webSeed";
- (void)awakeFromNib
{
[super awakeFromNib];
CGFloat const height = [NSUserDefaults.standardUserDefaults floatForKey:@"InspectorContentHeightPeers"];
if (height != 0.0)
{

View file

@ -46,6 +46,7 @@ typedef NS_ENUM(NSInteger, TrackerSegmentTag) {
- (void)awakeFromNib
{
[super awakeFromNib];
[self.fTrackerAddRemoveControl.cell setToolTip:NSLocalizedString(@"Add a tracker", "Inspector view -> tracker buttons")
forSegment:TrackerSegmentTagAdd];
[self.fTrackerAddRemoveControl.cell setToolTip:NSLocalizedString(@"Remove selected trackers", "Inspector view -> tracker buttons")

View file

@ -70,6 +70,7 @@ typedef NS_ENUM(NSUInteger, TabTag) {
- (void)awakeFromNib
{
[super awakeFromNib];
self.fNoneSelectedField.stringValue = NSLocalizedString(@"No Torrents Selected", "Inspector -> selected torrents");
//window location and size

View file

@ -50,6 +50,7 @@ static NSTimeInterval const kUpdateSeconds = 0.75;
- (void)awakeFromNib
{
[super awakeFromNib];
NSWindow* window = self.window;
window.frameAutosaveName = @"MessageWindowFrame";
[window setFrameUsingName:@"MessageWindowFrame"];

View file

@ -110,6 +110,7 @@ typedef struct PieceInfo
- (void)awakeFromNib
{
[super awakeFromNib];
self.torrent = nil;
}

View file

@ -197,6 +197,7 @@ static NSString* const kWebUIURLFormat = @"http://localhost:%ld/";
- (void)awakeFromNib
{
[super awakeFromNib];
self.fHasLoaded = YES;
self.window.restorationClass = [self class];

View file

@ -53,6 +53,7 @@ tr_session* fLib = NULL;
- (void)awakeFromNib
{
[super awakeFromNib];
[self updateStats];
self.fTimer = [NSTimer scheduledTimerWithTimeInterval:kUpdateSeconds target:self selector:@selector(updateStats)

View file

@ -54,6 +54,7 @@ typedef NS_ENUM(NSUInteger, StatusTag) {
- (void)awakeFromNib
{
[super awakeFromNib];
//localize menu items
[self.fStatusButton.menu itemWithTag:StatusTagTotalRatio].title = NSLocalizedString(@"Total Ratio", "Status Bar -> status menu");
[self.fStatusButton.menu itemWithTag:StatusTagSessionRatio].title = NSLocalizedString(@"Session Ratio", "Status Bar -> status menu");

View file

@ -5,19 +5,27 @@
#import "TorrentCellActionButton.h"
#import "TorrentTableView.h"
#import "Torrent.h"
#import "TorrentCell.h"
@interface TorrentCellActionButton ()
@property(nonatomic) NSTrackingArea* fTrackingArea;
@property(nonatomic) NSImage* fImage;
@property(nonatomic) NSImage* fAlternativeImage;
@property(nonatomic) TorrentTableView* torrentTableView;
@property(nonatomic) IBOutlet TorrentCell* torrentCell;
@property(nonatomic, readonly) TorrentTableView* torrentTableView;
@property(nonatomic) NSUserDefaults* fDefaults;
@end
@implementation TorrentCellActionButton
- (TorrentTableView*)torrentTableView
{
return self.torrentCell.fTorrentTableView;
}
- (void)awakeFromNib
{
[super awakeFromNib];
self.fDefaults = NSUserDefaults.standardUserDefaults;
self.fImage = self.image;
@ -29,21 +37,12 @@
[self.cell setHighlightsBy:NSNoCellMask];
}
- (void)setupTorrentTableView
{
if (!self.torrentTableView)
{
self.torrentTableView = (TorrentTableView*)[[[self superview] superview] superview];
}
}
- (void)mouseEntered:(NSEvent*)event
{
[super mouseEntered:event];
self.image = self.fImage;
[self setupTorrentTableView];
[self.torrentTableView hoverEventBeganForView:self];
}
@ -53,7 +52,6 @@
self.image = self.fAlternativeImage;
[self setupTorrentTableView];
[self.torrentTableView hoverEventEndedForView:self];
}
@ -67,7 +65,6 @@
BOOL minimal = [self.fDefaults boolForKey:@"SmallView"];
if (!minimal)
{
[self setupTorrentTableView];
[self.torrentTableView hoverEventEndedForView:self];
}
}

View file

@ -5,17 +5,26 @@
#import "TorrentCellControlButton.h"
#import "TorrentTableView.h"
#import "Torrent.h"
#import "TorrentCell.h"
@interface TorrentCellControlButton ()
@property(nonatomic) NSTrackingArea* fTrackingArea;
@property(nonatomic, copy) NSString* controlImageSuffix;
@property(nonatomic) TorrentTableView* torrentTableView;
@property(nonatomic) IBOutlet TorrentCell* torrentCell;
@property(nonatomic, readonly) TorrentTableView* torrentTableView;
@end
@implementation TorrentCellControlButton
- (TorrentTableView*)torrentTableView
{
return self.torrentCell.fTorrentTableView;
}
- (void)awakeFromNib
{
[super awakeFromNib];
self.controlImageSuffix = @"Off";
[self updateImage];
}
@ -26,14 +35,6 @@
[self updateImage];
}
- (void)setupTorrentTableView
{
if (!self.torrentTableView)
{
self.torrentTableView = (TorrentTableView*)[[[self superview] superview] superview];
}
}
- (void)mouseEntered:(NSEvent*)event
{
[super mouseEntered:event];
@ -66,8 +67,6 @@
- (void)updateImage
{
[self setupTorrentTableView];
NSImage* controlImage;
Torrent* torrent = [self.torrentTableView itemAtRow:[self.torrentTableView rowForView:self]];
if (torrent.active)

View file

@ -4,27 +4,28 @@
#import "TorrentCellRevealButton.h"
#import "TorrentTableView.h"
#import "TorrentCell.h"
@interface TorrentCellRevealButton ()
@property(nonatomic) NSTrackingArea* fTrackingArea;
@property(nonatomic, copy) NSString* revealImageString;
@property(nonatomic) TorrentTableView* torrentTableView;
@property(nonatomic) IBOutlet TorrentCell* torrentCell;
@property(nonatomic, readonly) TorrentTableView* torrentTableView;
@end
@implementation TorrentCellRevealButton
- (void)awakeFromNib
- (TorrentTableView*)torrentTableView
{
self.revealImageString = @"RevealOff";
[self updateImage];
return self.torrentCell.fTorrentTableView;
}
- (void)setupTorrentTableView
- (void)awakeFromNib
{
if (!self.torrentTableView)
{
self.torrentTableView = (TorrentTableView*)[[[self superview] superview] superview];
}
[super awakeFromNib];
self.revealImageString = @"RevealOff";
[self updateImage];
}
- (void)mouseEntered:(NSEvent*)event
@ -57,8 +58,6 @@
- (void)updateImage
{
[self setupTorrentTableView];
NSImage* revealImage = [NSImage imageNamed:self.revealImageString];
self.image = revealImage;
self.needsDisplay = YES;

View file

@ -114,6 +114,7 @@ static NSTimeInterval const kToggleProgressSeconds = 0.175;
- (void)awakeFromNib
{
[super awakeFromNib];
[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(refreshTorrentTable) name:@"RefreshTorrentTable"
object:nil];
}

View file

@ -24,6 +24,7 @@
- (void)awakeFromNib
{
[super awakeFromNib];
self.fLabelField.stringValue = NSLocalizedString(@"Internet address of torrent file:", "URL sheet label");
self.fOpenButton.title = NSLocalizedString(@"Open", "URL sheet button");
self.fCancelButton.title = NSLocalizedString(@"Cancel", "URL sheet button");