add an optional clearView method to the InfoViewController protocol
This commit is contained in:
parent
efce4e9759
commit
c5a3856e4f
|
@ -50,6 +50,6 @@
|
||||||
|
|
||||||
- (void) setPiecesView: (id) sender;
|
- (void) setPiecesView: (id) sender;
|
||||||
- (void) setPiecesViewForAvailable: (BOOL) available;
|
- (void) setPiecesViewForAvailable: (BOOL) available;
|
||||||
- (void) clearPiecesView;
|
- (void) clearView;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -148,7 +148,7 @@
|
||||||
[fPiecesView updateView];
|
[fPiecesView updateView];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) clearPiecesView
|
- (void) clearView
|
||||||
{
|
{
|
||||||
[fPiecesView clearView];
|
[fPiecesView clearView];
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
- (void) setInfoForTorrents: (NSArray *) torrents;
|
- (void) setInfoForTorrents: (NSArray *) torrents;
|
||||||
- (void) updateInfo;
|
- (void) updateInfo;
|
||||||
|
|
||||||
- (void) clearPeers;
|
- (void) clearView;
|
||||||
- (void) stopWebSeedAnimation;
|
- (void) stopWebSeedAnimation;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -221,7 +221,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) clearPeers
|
- (void) clearView
|
||||||
{
|
{
|
||||||
//if in the middle of animating, just stop and resize immediately
|
//if in the middle of animating, just stop and resize immediately
|
||||||
if (fWebSeedTableAnimation)
|
if (fWebSeedTableAnimation)
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
- (void) setInfoForTorrents: (NSArray *) torrents;
|
- (void) setInfoForTorrents: (NSArray *) torrents;
|
||||||
- (void) updateInfo;
|
- (void) updateInfo;
|
||||||
|
|
||||||
- (void) clearTrackers;
|
- (void) clearView;
|
||||||
|
|
||||||
- (void) addRemoveTracker: (id) sender;
|
- (void) addRemoveTracker: (id) sender;
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) clearTrackers
|
- (void) clearView
|
||||||
{
|
{
|
||||||
[fTrackers release];
|
[fTrackers release];
|
||||||
fTrackers = nil;
|
fTrackers = nil;
|
||||||
|
|
|
@ -30,4 +30,7 @@
|
||||||
- (void) setInfoForTorrents: (NSArray *) torrents;
|
- (void) setInfoForTorrents: (NSArray *) torrents;
|
||||||
- (void) updateInfo;
|
- (void) updateInfo;
|
||||||
|
|
||||||
|
@optional
|
||||||
|
- (void) clearView;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -213,31 +213,24 @@ typedef enum
|
||||||
//deselect old tab item
|
//deselect old tab item
|
||||||
[(InfoTabButtonCell *)[fTabMatrix cellWithTag: oldTabTag] setSelectedTab: NO];
|
[(InfoTabButtonCell *)[fTabMatrix cellWithTag: oldTabTag] setSelectedTab: NO];
|
||||||
|
|
||||||
|
if ([fViewController respondsToSelector: @selector(clearView)])
|
||||||
|
[fViewController clearView];
|
||||||
|
|
||||||
switch (oldTabTag)
|
switch (oldTabTag)
|
||||||
{
|
{
|
||||||
case TAB_ACTIVITY_TAG:
|
|
||||||
[fActivityViewController clearPiecesView];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case TAB_TRACKERS_TAG:
|
case TAB_TRACKERS_TAG:
|
||||||
[fTrackersViewController clearTrackers];
|
|
||||||
|
|
||||||
oldResizeSaveKey = @"InspectorContentHeightTracker";
|
oldResizeSaveKey = @"InspectorContentHeightTracker";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TAB_PEERS_TAG:
|
case TAB_PEERS_TAG:
|
||||||
[fPeersViewController clearPeers];
|
|
||||||
|
|
||||||
oldResizeSaveKey = @"InspectorContentHeightPeers";
|
oldResizeSaveKey = @"InspectorContentHeightPeers";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TAB_FILE_TAG:
|
case TAB_FILE_TAG:
|
||||||
oldResizeSaveKey = @"InspectorContentHeightFiles";
|
oldResizeSaveKey = @"InspectorContentHeightFiles";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSView * oldView = [fViewController view];
|
NSView * oldView = [fViewController view];
|
||||||
oldHeight = [oldView frame].size.height;
|
oldHeight = NSHeight([oldView frame]);
|
||||||
if (oldResizeSaveKey)
|
if (oldResizeSaveKey)
|
||||||
[[NSUserDefaults standardUserDefaults] setFloat: oldHeight forKey: oldResizeSaveKey];
|
[[NSUserDefaults standardUserDefaults] setFloat: oldHeight forKey: oldResizeSaveKey];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue