Ignore:
Timestamp:
Jun 18, 2007, 2:30:08 AM (15 years ago)
Author:
livings124
Message:

don't allow creating torrents with no url

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/file_selection/macosx/CreatorWindowController.m

    r2141 r2145  
    166166            NSAlert * alert = [[[NSAlert alloc] init] autorelease];
    167167            [alert addButtonWithTitle: NSLocalizedString(@"OK", "Create torrent -> http warning -> button")];
    168             [alert setMessageText: NSLocalizedString(@"Tracker address must begin with \"http://\".",
     168            [alert setMessageText: NSLocalizedString(@"The tracker address must begin with \"http://\".",
    169169                                                    "Create torrent -> http warning -> title")];
    170170            [alert setInformativeText: NSLocalizedString(@"Change the tracker address to create the torrent.",
     
    178178    else
    179179        trackerString = [@"http://" stringByAppendingString: trackerString];
     180   
     181    //don't allow blank addresses
     182    if ([trackerString length] <= 7)
     183    {
     184        NSAlert * alert = [[[NSAlert alloc] init] autorelease];
     185        [alert addButtonWithTitle: NSLocalizedString(@"OK", "Create torrent -> no url warning -> button")];
     186        [alert setMessageText: NSLocalizedString(@"The tracker address cannot be blank.",
     187                                                "Create torrent -> no url warning -> title")];
     188        [alert setInformativeText: NSLocalizedString(@"Change the tracker address to create the torrent.",
     189                                                    "Create torrent -> no url warning -> warning")];
     190        [alert setAlertStyle: NSWarningAlertStyle];
     191       
     192        [alert beginSheetModalForWindow: [self window] modalDelegate: self didEndSelector: nil contextInfo: nil];
     193        return;
     194    }
    180195   
    181196    fOpenTorrent = [fOpenCheck state] == NSOnState;
Note: See TracChangeset for help on using the changeset viewer.