set the inspector views' titles in each view's class

This commit is contained in:
Mitchell Livingston 2010-03-14 03:09:12 +00:00
parent 14d06e0ef3
commit b9e7cc8990
7 changed files with 30 additions and 14 deletions

View File

@ -41,7 +41,11 @@
- (id) init - (id) init
{ {
self = [super initWithNibName: @"InfoActivityView" bundle: nil]; if ((self = [super initWithNibName: @"InfoActivityView" bundle: nil]))
{
[self setTitle: NSLocalizedString(@"Activity", "Inspector view -> title")];
}
return self; return self;
} }

View File

@ -40,7 +40,11 @@
- (id) init - (id) init
{ {
self = [super initWithNibName: @"InfoFileView" bundle: nil]; if ((self = [super initWithNibName: @"InfoFileView" bundle: nil]))
{
[self setTitle: NSLocalizedString(@"Files", "Inspector view -> title")];
}
return self; return self;
} }

View File

@ -37,7 +37,11 @@
- (id) init - (id) init
{ {
self = [super initWithNibName: @"InfoGeneralView" bundle: nil]; if ((self = [super initWithNibName: @"InfoGeneralView" bundle: nil]))
{
[self setTitle: NSLocalizedString(@"General Info", "Inspector view -> title")];
}
return self; return self;
} }

View File

@ -45,7 +45,11 @@
- (id) init - (id) init
{ {
self = [super initWithNibName: @"InfoOptionsView" bundle: nil]; if ((self = [super initWithNibName: @"InfoOptionsView" bundle: nil]))
{
[self setTitle: NSLocalizedString(@"Options", "Inspector view -> title")];
}
return self; return self;
} }

View File

@ -41,7 +41,11 @@
- (id) init - (id) init
{ {
self = [super initWithNibName: @"InfoPeersView" bundle: nil]; if ((self = [super initWithNibName: @"InfoPeersView" bundle: nil]))
{
[self setTitle: NSLocalizedString(@"Peers", "Inspector view -> title")];
}
return self; return self;
} }

View File

@ -50,6 +50,8 @@
{ {
if ((self = [super initWithNibName: @"InfoTrackersView" bundle: nil])) if ((self = [super initWithNibName: @"InfoTrackersView" bundle: nil]))
{ {
[self setTitle: NSLocalizedString(@"Trackers", "Inspector view -> title")];
fTrackerCell = [[TrackerCell alloc] init]; fTrackerCell = [[TrackerCell alloc] init];
} }

View File

@ -219,8 +219,7 @@ typedef enum
} }
//set new tab item //set new tab item
#warning get titles from view controller? NSString * identifier;
NSString * identifier, * title;
switch (fCurrentTabTag) switch (fCurrentTabTag)
{ {
case TAB_GENERAL_TAG: case TAB_GENERAL_TAG:
@ -232,7 +231,6 @@ typedef enum
fViewController = fGeneralViewController; fViewController = fGeneralViewController;
identifier = TAB_INFO_IDENT; identifier = TAB_INFO_IDENT;
title = NSLocalizedString(@"General Info", "Inspector -> title");
break; break;
case TAB_ACTIVITY_TAG: case TAB_ACTIVITY_TAG:
if (!fActivityViewController) if (!fActivityViewController)
@ -243,7 +241,6 @@ typedef enum
fViewController = fActivityViewController; fViewController = fActivityViewController;
identifier = TAB_ACTIVITY_IDENT; identifier = TAB_ACTIVITY_IDENT;
title = NSLocalizedString(@"Activity", "Inspector -> title");
break; break;
case TAB_TRACKERS_TAG: case TAB_TRACKERS_TAG:
if (!fTrackersViewController) if (!fTrackersViewController)
@ -254,7 +251,6 @@ typedef enum
fViewController = fTrackersViewController; fViewController = fTrackersViewController;
identifier = TAB_TRACKER_IDENT; identifier = TAB_TRACKER_IDENT;
title = NSLocalizedString(@"Trackers", "Inspector -> title");
break; break;
case TAB_PEERS_TAG: case TAB_PEERS_TAG:
if (!fPeersViewController) if (!fPeersViewController)
@ -265,7 +261,6 @@ typedef enum
fViewController = fPeersViewController; fViewController = fPeersViewController;
identifier = TAB_PEERS_IDENT; identifier = TAB_PEERS_IDENT;
title = NSLocalizedString(@"Peers", "Inspector -> title");
break; break;
case TAB_FILE_TAG: case TAB_FILE_TAG:
if (!fFileViewController) if (!fFileViewController)
@ -276,7 +271,6 @@ typedef enum
fViewController = fFileViewController; fViewController = fFileViewController;
identifier = TAB_FILES_IDENT; identifier = TAB_FILES_IDENT;
title = NSLocalizedString(@"Files", "Inspector -> title");
break; break;
case TAB_OPTIONS_TAG: case TAB_OPTIONS_TAG:
if (!fOptionsViewController) if (!fOptionsViewController)
@ -287,7 +281,6 @@ typedef enum
fViewController = fOptionsViewController; fViewController = fOptionsViewController;
identifier = TAB_OPTIONS_IDENT; identifier = TAB_OPTIONS_IDENT;
title = NSLocalizedString(@"Options", "Inspector -> title");
break; break;
default: default:
NSAssert1(NO, @"Unknown info tab selected: %d", fCurrentTabTag); NSAssert1(NO, @"Unknown info tab selected: %d", fCurrentTabTag);
@ -298,7 +291,8 @@ typedef enum
NSWindow * window = [self window]; NSWindow * window = [self window];
[window setTitle: [NSString stringWithFormat: @"%@ - %@", title, NSLocalizedString(@"Torrent Inspector", "Inspector -> title")]]; [window setTitle: [NSString stringWithFormat: @"%@ - %@", [fViewController title],
NSLocalizedString(@"Torrent Inspector", "Inspector -> title")]];
//selected tab item //selected tab item
[(InfoTabButtonCell *)[fTabMatrix selectedCell] setSelectedTab: YES]; [(InfoTabButtonCell *)[fTabMatrix selectedCell] setSelectedTab: YES];