From 2183ae27094bc022c40d8d06e52bb8d609d10352 Mon Sep 17 00:00:00 2001 From: David Fuhrmann Date: Sun, 15 Apr 2018 18:25:20 +0200 Subject: [PATCH] macosx: Fix localization issues in effects panels The "apply at next startup" box did not have a localization at all. The tab views localication was not applied correctly to due to the panels redesign. (partly cherry picked from commit 2f27b7f9c75c935e518b7716f7a3c0680d58649c) (manual merge in xib) Signed-off-by: David Fuhrmann --- modules/gui/macosx/UI/AudioEffects.xib | 150 +++++++++--------- modules/gui/macosx/UI/CoreDialogs.xib | 2 +- modules/gui/macosx/UI/VideoEffects.xib | 34 ++-- .../macosx/VLCAudioEffectsWindowController.h | 2 +- .../macosx/VLCAudioEffectsWindowController.m | 10 +- .../macosx/VLCVideoEffectsWindowController.h | 2 +- .../macosx/VLCVideoEffectsWindowController.m | 13 +- 7 files changed, 107 insertions(+), 106 deletions(-) diff --git a/modules/gui/macosx/UI/AudioEffects.xib b/modules/gui/macosx/UI/AudioEffects.xib index 057e16d8a2..1b751e35ed 100644 --- a/modules/gui/macosx/UI/AudioEffects.xib +++ b/modules/gui/macosx/UI/AudioEffects.xib @@ -1,5 +1,5 @@ - + @@ -58,6 +58,7 @@ + @@ -76,7 +77,6 @@ - @@ -92,7 +92,7 @@ - + @@ -504,7 +504,7 @@ - + - + - + @@ -1609,7 +1609,7 @@ - + @@ -1626,7 +1626,7 @@ - + @@ -1657,7 +1657,7 @@ - + - + @@ -1697,7 +1697,7 @@ - + @@ -1708,14 +1708,14 @@ - + - + diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.h b/modules/gui/macosx/VLCAudioEffectsWindowController.h index ead4d711c4..03dacbf0e7 100644 --- a/modules/gui/macosx/VLCAudioEffectsWindowController.h +++ b/modules/gui/macosx/VLCAudioEffectsWindowController.h @@ -30,7 +30,7 @@ @interface VLCAudioEffectsWindowController : NSWindowController /* generic */ -@property (readwrite, weak) IBOutlet NSTabView *tabView; +@property (readwrite, weak) IBOutlet NSSegmentedControl *segmentView; @property (readwrite, weak) IBOutlet NSPopUpButton *profilePopup; @property (readwrite, weak) IBOutlet NSButton *applyProfileCheckbox; diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.m b/modules/gui/macosx/VLCAudioEffectsWindowController.m index 1f630cc661..424323394e 100644 --- a/modules/gui/macosx/VLCAudioEffectsWindowController.m +++ b/modules/gui/macosx/VLCAudioEffectsWindowController.m @@ -208,6 +208,7 @@ - (void)windowDidLoad { [_applyProfileCheckbox setState:[[NSUserDefaults standardUserDefaults] boolForKey:@"AudioEffectApplyProfileOnStartup"]]; + [_applyProfileCheckbox setTitle:_NS("Apply profile at next launch")]; /* setup the user's language */ /* Equalizer */ @@ -267,10 +268,11 @@ "thereby widening the stereo effect.")]; /* generic */ - [[_tabView tabViewItemAtIndex:[_tabView indexOfTabViewItemWithIdentifier:@"equalizer"]] setLabel:_NS("Equalizer")]; - [[_tabView tabViewItemAtIndex:[_tabView indexOfTabViewItemWithIdentifier:@"compressor"]] setLabel:_NS("Compressor")]; - [[_tabView tabViewItemAtIndex:[_tabView indexOfTabViewItemWithIdentifier:@"spatializer"]] setLabel:_NS("Spatializer")]; - [[_tabView tabViewItemAtIndex:[_tabView indexOfTabViewItemWithIdentifier:@"filter"]] setLabel:_NS("Filter")]; + [_segmentView setLabel:_NS("Equalizer") forSegment:0]; + [_segmentView setLabel:_NS("Compressor") forSegment:1]; + [_segmentView setLabel:_NS("Spatializer") forSegment:2]; + [_segmentView setLabel:_NS("Filter") forSegment:3]; + [self.window setTitle:_NS("Audio Effects")]; [self.window setExcludedFromWindowsMenu:YES]; [self.window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary]; diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.h b/modules/gui/macosx/VLCVideoEffectsWindowController.h index f09a5ada2a..1954ab84aa 100644 --- a/modules/gui/macosx/VLCVideoEffectsWindowController.h +++ b/modules/gui/macosx/VLCVideoEffectsWindowController.h @@ -29,7 +29,7 @@ @interface VLCVideoEffectsWindowController : NSWindowController /* generic */ -@property (readwrite, weak) IBOutlet NSTabView *tabView; +@property (readwrite, weak) IBOutlet NSSegmentedControl *segmentView; @property (readwrite, weak) IBOutlet NSPopUpButton *profilePopup; @property (readwrite, weak) IBOutlet NSButton *applyProfileCheckbox; diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.m b/modules/gui/macosx/VLCVideoEffectsWindowController.m index e5ef7e1832..e5904eb81c 100644 --- a/modules/gui/macosx/VLCVideoEffectsWindowController.m +++ b/modules/gui/macosx/VLCVideoEffectsWindowController.m @@ -189,13 +189,14 @@ [self.window setExcludedFromWindowsMenu:YES]; [self.window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary]; - [[_tabView tabViewItemAtIndex:[_tabView indexOfTabViewItemWithIdentifier:@"basic"]] setLabel:_NS("Basic")]; - [[_tabView tabViewItemAtIndex:[_tabView indexOfTabViewItemWithIdentifier:@"crop"]] setLabel:_NS("Crop")]; - [[_tabView tabViewItemAtIndex:[_tabView indexOfTabViewItemWithIdentifier:@"geometry"]] setLabel:_NS("Geometry")]; - [[_tabView tabViewItemAtIndex:[_tabView indexOfTabViewItemWithIdentifier:@"color"]] setLabel:_NS("Color")]; - [[_tabView tabViewItemAtIndex:[_tabView indexOfTabViewItemWithIdentifier:@"misc"]] setLabel:_NS("Miscellaneous")]; + [_segmentView setLabel:_NS("Basic") forSegment:0]; + [_segmentView setLabel:_NS("Crop") forSegment:1]; + [_segmentView setLabel:_NS("Geometry") forSegment:2]; + [_segmentView setLabel:_NS("Color") forSegment:3]; + [_segmentView setLabel:_NS("Miscellaneous") forSegment:4]; [_applyProfileCheckbox setState:[[NSUserDefaults standardUserDefaults] boolForKey:@"VideoEffectApplyProfileOnStartup"]]; + [_applyProfileCheckbox setTitle:_NS("Apply profile at next launch")]; [self resetProfileSelector]; @@ -327,8 +328,6 @@ [[_addLogoPositionPopup lastItem] setTag: 10]; [_addLogoTransparencyLabel setStringValue:_NS("Transparency")]; - [_tabView selectFirstTabViewItem:self]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(inputChangedEvent:) name:VLCInputChangedNotification