Changeset 6045


Ignore:
Timestamp:
Jun 5, 2008, 2:46:39 AM (15 years ago)
Author:
livings124
Message:

some small simplifications to the group code

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r6033 r6045  
    22662266    NSImage * icon;
    22672267    NSString * toolTip;
    2268     switch (groupIndex)
    2269     {
    2270         case GROUP_FILTER_ALL_TAG:
    2271             icon = [NSImage imageNamed: @"PinTemplate.png"];
    2272             toolTip = NSLocalizedString(@"All Groups", "Groups -> Button");
    2273             break;
    2274         case -1:
    2275             icon = [NSImage imageNamed: @"GroupsNoneTemplate.png"];
    2276             toolTip = [NSString stringWithFormat: @"%@: %@", NSLocalizedString(@"Group", "Groups -> Button"),
    2277                         NSLocalizedString(@"No Label", "Groups -> Button")];
    2278             break;
    2279         default:
    2280             icon = [[GroupsController groups] imageForIndex: groupIndex];
    2281             toolTip = [NSString stringWithFormat: @"%@: %@", NSLocalizedString(@"Group", "Groups -> Button"),
    2282                         [[GroupsController groups] nameForIndex: groupIndex]];
     2268    if (groupIndex == GROUP_FILTER_ALL_TAG)
     2269    {
     2270        icon = [NSImage imageNamed: @"PinTemplate.png"];
     2271        toolTip = NSLocalizedString(@"All Groups", "Groups -> Button");
     2272    }
     2273    else
     2274    {
     2275        icon = [[GroupsController groups] imageForIndex: groupIndex];
     2276        NSString * groupName = groupIndex != -1 ? [[GroupsController groups] nameForIndex: groupIndex]
     2277                                                : NSLocalizedString(@"None", "Groups -> Button");
     2278        toolTip = [NSString stringWithFormat: @"%@: %@", NSLocalizedString(@"Group", "Groups -> Button"), groupName];
    22832279    }
    22842280   
     
    25432539- (id) outlineView: (NSOutlineView *) outlineView objectValueForTableColumn: (NSTableColumn *) tableColumn byItem: (id) item
    25442540{
    2545     if (![item isKindOfClass: [Torrent class]])
     2541    if ([item isKindOfClass: [Torrent class]])
     2542        return [item hashString];
     2543    else
    25462544    {
    25472545        NSString * ident = [tableColumn identifier];
     
    25552553        {
    25562554            int group = [[item objectForKey: @"Group"] intValue];
    2557             return group != -1 ? [[GroupsController groups] imageForIndex: group]
    2558                                 : [NSImage imageNamed: @"GroupsNoneTemplate.png"];
     2555            return [[GroupsController groups] imageForIndex: group];
    25592556        }
    25602557        else if ([ident isEqualToString: @"DL Image"])
     
    25922589        }
    25932590    }
    2594     else
    2595         return [item hashString];
    25962591}
    25972592
  • trunk/macosx/English.lproj/Localizable.strings

    r6040 r6045  
    461461"No Group" = "No Group";
    462462
    463 /* Groups -> Button */
    464 "No Label" = "No Label";
    465 
    466463/* Inspector -> selected torrents */
    467464"No Torrents Selected" = "No Torrents Selected";
    468465
    469 /* Groups -> Menu */
     466/* Groups -> Menu
     467   Groups -> Button */
    470468"None" = "None";
    471469
     
    512510"Open Torrent Address" = "Open Torrent Address";
    513511
     512/* Open toolbar item -> tooltip */
     513"Open torrent files" = "Open torrent files";
     514
    514515/* Open toolbar item -> palette label */
    515516"Open Torrent Files" = "Open Torrent Files";
    516 
    517 /* Open toolbar item -> tooltip */
    518 "Open torrent files" = "Open torrent files";
    519517
    520518/* Open address toolbar item -> tooltip */
  • trunk/macosx/GroupsController.m

    r5992 r6045  
    147147{
    148148    int orderIndex = [self rowValueForIndex: index];
    149     return orderIndex != -1 ? [self imageForGroup: [fGroups objectAtIndex: orderIndex]] : nil;
     149    return orderIndex != -1 ? [self imageForGroup: [fGroups objectAtIndex: orderIndex]]
     150                            : [NSImage imageNamed: @"GroupsNoneTemplate.png"];
    150151}
    151152
Note: See TracChangeset for help on using the changeset viewer.