From b9e7cc8990c696e757e141540001a9d07232fed5 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sun, 14 Mar 2010 03:09:12 +0000 Subject: [PATCH] set the inspector views' titles in each view's class --- macosx/InfoActivityViewController.m | 6 +++++- macosx/InfoFileViewController.m | 6 +++++- macosx/InfoGeneralViewController.m | 6 +++++- macosx/InfoOptionsViewController.m | 6 +++++- macosx/InfoPeersViewController.m | 6 +++++- macosx/InfoTrackersViewController.m | 2 ++ macosx/InfoWindowController.m | 12 +++--------- 7 files changed, 30 insertions(+), 14 deletions(-) diff --git a/macosx/InfoActivityViewController.m b/macosx/InfoActivityViewController.m index cd2de04ec..4efd7aacf 100644 --- a/macosx/InfoActivityViewController.m +++ b/macosx/InfoActivityViewController.m @@ -41,7 +41,11 @@ - (id) init { - self = [super initWithNibName: @"InfoActivityView" bundle: nil]; + if ((self = [super initWithNibName: @"InfoActivityView" bundle: nil])) + { + [self setTitle: NSLocalizedString(@"Activity", "Inspector view -> title")]; + } + return self; } diff --git a/macosx/InfoFileViewController.m b/macosx/InfoFileViewController.m index c23856c7d..cad87778f 100644 --- a/macosx/InfoFileViewController.m +++ b/macosx/InfoFileViewController.m @@ -40,7 +40,11 @@ - (id) init { - self = [super initWithNibName: @"InfoFileView" bundle: nil]; + if ((self = [super initWithNibName: @"InfoFileView" bundle: nil])) + { + [self setTitle: NSLocalizedString(@"Files", "Inspector view -> title")]; + } + return self; } diff --git a/macosx/InfoGeneralViewController.m b/macosx/InfoGeneralViewController.m index 4d39190cf..b6f38a45c 100644 --- a/macosx/InfoGeneralViewController.m +++ b/macosx/InfoGeneralViewController.m @@ -37,7 +37,11 @@ - (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; } diff --git a/macosx/InfoOptionsViewController.m b/macosx/InfoOptionsViewController.m index f625deb81..c9dd44925 100644 --- a/macosx/InfoOptionsViewController.m +++ b/macosx/InfoOptionsViewController.m @@ -45,7 +45,11 @@ - (id) init { - self = [super initWithNibName: @"InfoOptionsView" bundle: nil]; + if ((self = [super initWithNibName: @"InfoOptionsView" bundle: nil])) + { + [self setTitle: NSLocalizedString(@"Options", "Inspector view -> title")]; + } + return self; } diff --git a/macosx/InfoPeersViewController.m b/macosx/InfoPeersViewController.m index edd62c0e6..a70433c7b 100644 --- a/macosx/InfoPeersViewController.m +++ b/macosx/InfoPeersViewController.m @@ -41,7 +41,11 @@ - (id) init { - self = [super initWithNibName: @"InfoPeersView" bundle: nil]; + if ((self = [super initWithNibName: @"InfoPeersView" bundle: nil])) + { + [self setTitle: NSLocalizedString(@"Peers", "Inspector view -> title")]; + } + return self; } diff --git a/macosx/InfoTrackersViewController.m b/macosx/InfoTrackersViewController.m index a16c939da..cea4b184d 100644 --- a/macosx/InfoTrackersViewController.m +++ b/macosx/InfoTrackersViewController.m @@ -50,6 +50,8 @@ { if ((self = [super initWithNibName: @"InfoTrackersView" bundle: nil])) { + [self setTitle: NSLocalizedString(@"Trackers", "Inspector view -> title")]; + fTrackerCell = [[TrackerCell alloc] init]; } diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index 2c1c933f7..0b26f6bd4 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -219,8 +219,7 @@ typedef enum } //set new tab item - #warning get titles from view controller? - NSString * identifier, * title; + NSString * identifier; switch (fCurrentTabTag) { case TAB_GENERAL_TAG: @@ -232,7 +231,6 @@ typedef enum fViewController = fGeneralViewController; identifier = TAB_INFO_IDENT; - title = NSLocalizedString(@"General Info", "Inspector -> title"); break; case TAB_ACTIVITY_TAG: if (!fActivityViewController) @@ -243,7 +241,6 @@ typedef enum fViewController = fActivityViewController; identifier = TAB_ACTIVITY_IDENT; - title = NSLocalizedString(@"Activity", "Inspector -> title"); break; case TAB_TRACKERS_TAG: if (!fTrackersViewController) @@ -254,7 +251,6 @@ typedef enum fViewController = fTrackersViewController; identifier = TAB_TRACKER_IDENT; - title = NSLocalizedString(@"Trackers", "Inspector -> title"); break; case TAB_PEERS_TAG: if (!fPeersViewController) @@ -265,7 +261,6 @@ typedef enum fViewController = fPeersViewController; identifier = TAB_PEERS_IDENT; - title = NSLocalizedString(@"Peers", "Inspector -> title"); break; case TAB_FILE_TAG: if (!fFileViewController) @@ -276,7 +271,6 @@ typedef enum fViewController = fFileViewController; identifier = TAB_FILES_IDENT; - title = NSLocalizedString(@"Files", "Inspector -> title"); break; case TAB_OPTIONS_TAG: if (!fOptionsViewController) @@ -287,7 +281,6 @@ typedef enum fViewController = fOptionsViewController; identifier = TAB_OPTIONS_IDENT; - title = NSLocalizedString(@"Options", "Inspector -> title"); break; default: NSAssert1(NO, @"Unknown info tab selected: %d", fCurrentTabTag); @@ -298,7 +291,8 @@ typedef enum 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 [(InfoTabButtonCell *)[fTabMatrix selectedCell] setSelectedTab: YES];