Changeset 672


Ignore:
Timestamp:
Jul 23, 2006, 4:28:33 PM (16 years ago)
Author:
livings124
Message:

Use constants for growl notifications

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r671 r672  
    4040#define TOOLBAR_PAUSE_SELECTED  @"Toolbar Pause Selected"
    4141#define TOOLBAR_RESUME_SELECTED @"Toolbar Resume Selected"
    42 #define TOOLBAR_FILTER   @"Toolbar Toggle Filter"
     42#define TOOLBAR_FILTER          @"Toolbar Toggle Filter"
     43
     44#define GROWL_DOWNLOAD_COMPLETE @"Download Complete"
     45#define GROWL_SEEDING_COMPLETE  @"Seeding Complete"
     46#define GROWL_AUTO_ADD          @"Torrent Auto Added"
    4347
    4448#define TORRENT_TABLE_VIEW_DATA_TYPE    @"TorrentTableViewDataType"
     
    875879       
    876880            [GrowlApplicationBridge notifyWithTitle: @"Download Complete"
    877                 description: [torrent name] notificationName: @"Download Complete" iconData: nil
     881                description: [torrent name] notificationName: GROWL_DOWNLOAD_COMPLETE iconData: nil
    878882                priority: 0 isSticky: NO clickContext: nil];
    879883
     
    13231327   
    13241328    [GrowlApplicationBridge notifyWithTitle: @"Seeding Complete"
    1325                 description: [[notification object] name] notificationName: @"Seeding Complete"
     1329                description: [[notification object] name] notificationName: GROWL_SEEDING_COMPLETE
    13261330                iconData: nil priority: 0 isSticky: NO clickContext: nil];
    13271331}
     
    14321436            if (oldCount < [fTorrents count])
    14331437                [GrowlApplicationBridge notifyWithTitle: @"Torrent File Auto Added"
    1434                     description: file notificationName: @"Torrent Auto Added" iconData: nil
     1438                    description: file notificationName: GROWL_AUTO_ADD iconData: nil
    14351439                    priority: 0 isSticky: NO clickContext: nil];
    14361440        }
     
    15891593    [fWindow setContentMinSize: contentMinSize];
    15901594   
    1591     [self setWindowSizeToFit];
    1592    
    15931595    //resize for larger min height if not set to auto size
    1594     if (!makeSmall && ![fDefaults boolForKey: @"AutoSize"] && contentSize.height < contentMinSize.height)
    1595     {
    1596         NSRect frame = [fWindow frame];
    1597         float heightChange = contentMinSize.height - contentSize.height;
    1598         frame.size.height += heightChange;
    1599         frame.origin.y -= heightChange;
    1600        
    1601         [fWindow setFrame: frame display: YES];
    1602         [fTableView reloadData];
    1603     }
     1596    if (![fDefaults boolForKey: @"AutoSize"])
     1597    {
     1598        if (!makeSmall && contentSize.height < contentMinSize.height)
     1599        {
     1600            NSRect frame = [fWindow frame];
     1601            float heightChange = contentMinSize.height - contentSize.height;
     1602            frame.size.height += heightChange;
     1603            frame.origin.y -= heightChange;
     1604           
     1605            [fWindow setFrame: frame display: YES];
     1606            [fTableView reloadData];
     1607        }
     1608    }
     1609    else
     1610        [self setWindowSizeToFit];
    16041611}
    16051612
     
    22172224- (NSDictionary *) registrationDictionaryForGrowl
    22182225{
    2219     NSArray * notifications = [NSArray arrayWithObjects: @"Download Complete",
    2220                                 @"Seeding Complete", @"Torrent Auto Added", nil];
     2226    NSArray * notifications = [NSArray arrayWithObjects: GROWL_DOWNLOAD_COMPLETE,
     2227                                        GROWL_SEEDING_COMPLETE, GROWL_AUTO_ADD, nil];
    22212228    return [NSDictionary dictionaryWithObjectsAndKeys: notifications, GROWL_NOTIFICATIONS_ALL,
    22222229                                notifications, GROWL_NOTIFICATIONS_DEFAULT, nil];
Note: See TracChangeset for help on using the changeset viewer.