a little code cleanup
This commit is contained in:
parent
0fb5d03514
commit
08879e11f3
|
@ -545,10 +545,10 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
|||
[fAutoImportTimer release];
|
||||
}
|
||||
|
||||
//save history and stop running torrents
|
||||
//save history
|
||||
[self updateTorrentHistory];
|
||||
|
||||
//make sure torrent is closed
|
||||
//make sure torrents are closed
|
||||
enumerator = [fTorrents objectEnumerator];
|
||||
Torrent * torrent;
|
||||
while ((torrent = [enumerator nextObject]))
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
fInfo = tr_metaInfoBuilderCreate(handle, [fPath UTF8String]);
|
||||
if (fInfo->fileCount == 0)
|
||||
{
|
||||
NSAlert * alert = [[[NSAlert alloc] init] autorelease];
|
||||
NSAlert * alert = [[NSAlert alloc] init];
|
||||
[alert addButtonWithTitle: NSLocalizedString(@"OK", "Create torrent -> no files -> button")];
|
||||
[alert setMessageText: NSLocalizedString(@"This folder contains no files.",
|
||||
"Create torrent -> no files -> title")];
|
||||
|
@ -72,6 +72,7 @@
|
|||
[alert setAlertStyle: NSWarningAlertStyle];
|
||||
|
||||
[alert runModal];
|
||||
[alert release];
|
||||
|
||||
[self release];
|
||||
return nil;
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
- (void) setFile: (NSString *) file;
|
||||
- (void) setURL: (NSString *) url;
|
||||
|
||||
- (void) fadeIn;
|
||||
- (void) fadeOut;
|
||||
|
||||
@end
|
||||
|
|
|
@ -125,32 +125,15 @@
|
|||
secondString = [secondString stringByAppendingString: @" Total"];
|
||||
}
|
||||
|
||||
[[self contentView] setOverlay: icon mainLine: name subLine: secondString];
|
||||
|
||||
//stop other animation and set to same progress
|
||||
if ([fFadeOutAnimation isAnimating])
|
||||
{
|
||||
[fFadeOutAnimation stopAnimation];
|
||||
[fFadeInAnimation setCurrentProgress: 1.0 - [fFadeOutAnimation currentProgress]];
|
||||
}
|
||||
[self setFrame: [[self parentWindow] frame] display: YES];
|
||||
[fFadeInAnimation startAnimation];
|
||||
[self fadeIn];
|
||||
}
|
||||
|
||||
- (void) setFile: (NSString *) file
|
||||
{
|
||||
|
||||
[[self contentView] setOverlay: [NSImage imageNamed: @"CreateLarge.png"]
|
||||
mainLine: NSLocalizedString(@"Create a Torrent File", "Drag overlay -> file") subLine: file];
|
||||
|
||||
//stop other animation and set to same progress
|
||||
if ([fFadeOutAnimation isAnimating])
|
||||
{
|
||||
[fFadeOutAnimation stopAnimation];
|
||||
[fFadeInAnimation setCurrentProgress: 1.0 - [fFadeOutAnimation currentProgress]];
|
||||
}
|
||||
[self setFrame: [[self parentWindow] frame] display: YES];
|
||||
[fFadeInAnimation startAnimation];
|
||||
[self fadeIn];
|
||||
}
|
||||
|
||||
|
||||
|
@ -159,6 +142,11 @@
|
|||
[[self contentView] setOverlay: [NSImage imageNamed: @"Globe.png"]
|
||||
mainLine: NSLocalizedString(@"Web Address", "Drag overlay -> url") subLine: url];
|
||||
|
||||
[self fadeIn];
|
||||
}
|
||||
|
||||
- (void) fadeIn
|
||||
{
|
||||
//stop other animation and set to same progress
|
||||
if ([fFadeOutAnimation isAnimating])
|
||||
{
|
||||
|
|
|
@ -192,7 +192,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
|||
|
||||
- (void) dealloc
|
||||
{
|
||||
# warning cleanup
|
||||
#warning cleanup
|
||||
if (fHandle)
|
||||
{
|
||||
if (fDownloadFolder)
|
||||
|
|
Loading…
Reference in New Issue