Commit 7b21794c authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: split StringUtility from VLCMain and move it to a separate class where it belongs

parent a16d7de0
...@@ -657,6 +657,8 @@ ...@@ -657,6 +657,8 @@
CC206B6B14AD0A5D007935C6 /* window-fullscreen-on.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "window-fullscreen-on.png"; path = "Resources/mainwindow_dark/window-fullscreen-on.png"; sourceTree = "<group>"; }; CC206B6B14AD0A5D007935C6 /* window-fullscreen-on.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "window-fullscreen-on.png"; path = "Resources/mainwindow_dark/window-fullscreen-on.png"; sourceTree = "<group>"; };
CC206B6C14AD0A5D007935C6 /* window-fullscreen-over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "window-fullscreen-over.png"; path = "Resources/mainwindow_dark/window-fullscreen-over.png"; sourceTree = "<group>"; }; CC206B6C14AD0A5D007935C6 /* window-fullscreen-over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "window-fullscreen-over.png"; path = "Resources/mainwindow_dark/window-fullscreen-over.png"; sourceTree = "<group>"; };
CC206B6D14AD0A5D007935C6 /* window-fullscreen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "window-fullscreen.png"; path = "Resources/mainwindow_dark/window-fullscreen.png"; sourceTree = "<group>"; }; CC206B6D14AD0A5D007935C6 /* window-fullscreen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "window-fullscreen.png"; path = "Resources/mainwindow_dark/window-fullscreen.png"; sourceTree = "<group>"; };
CC269A4615E7947F00F2FDC9 /* StringUtility.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StringUtility.h; path = ../../../modules/gui/macosx/StringUtility.h; sourceTree = "<group>"; };
CC269A4715E7947F00F2FDC9 /* StringUtility.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = StringUtility.m; path = ../../../modules/gui/macosx/StringUtility.m; sourceTree = "<group>"; };
CC3DC89B0A7CDB9600B53F32 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = "<absolute>"; }; CC3DC89B0A7CDB9600B53F32 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = "<absolute>"; };
CC3F9F851350B2A000B0E885 /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Growl.framework; path = ../../../contrib/Growl.framework; sourceTree = "<absolute>"; }; CC3F9F851350B2A000B0E885 /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Growl.framework; path = ../../../contrib/Growl.framework; sourceTree = "<absolute>"; };
CC402F4B0E00ABBB006A4BA4 /* VLC.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = VLC.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; CC402F4B0E00ABBB006A4BA4 /* VLC.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = VLC.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
...@@ -1018,6 +1020,8 @@ ...@@ -1018,6 +1020,8 @@
CCCE366E13817E4500694F2A /* VideoEffects.m */, CCCE366E13817E4500694F2A /* VideoEffects.m */,
CC0663341566C34C003A411C /* ConvertAndSave.h */, CC0663341566C34C003A411C /* ConvertAndSave.h */,
CC0663351566C34C003A411C /* ConvertAndSave.m */, CC0663351566C34C003A411C /* ConvertAndSave.m */,
CC269A4615E7947F00F2FDC9 /* StringUtility.h */,
CC269A4715E7947F00F2FDC9 /* StringUtility.m */,
CC017A0E14A4C8B600C09A4F /* custom UI code */, CC017A0E14A4C8B600C09A4F /* custom UI code */,
CC0CD0E513DE0FC600B0D90D /* Imported Code */, CC0CD0E513DE0FC600B0D90D /* Imported Code */,
); );
......
...@@ -128,7 +128,7 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -128,7 +128,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
NSString* o_key; NSString* o_key;
playlist_t *p_playlist; playlist_t *p_playlist;
vlc_value_t val; vlc_value_t val;
id o_vlcmain = [VLCMain sharedInstance]; id o_vlcstringutility = [VLCStringUtility sharedInstance];
char * key; char * key;
/* Check if we already did this once. Opening the other nibs calls it too, /* Check if we already did this once. Opening the other nibs calls it too,
...@@ -143,98 +143,98 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -143,98 +143,98 @@ static VLCMainMenu *_o_sharedInstance = nil;
key = config_GetPsz( p_intf, "key-quit" ); key = config_GetPsz( p_intf, "key-quit" );
o_key = [NSString stringWithFormat:@"%s", key]; o_key = [NSString stringWithFormat:@"%s", key];
[o_mi_quit setKeyEquivalent: [o_vlcmain VLCKeyToString: o_key]]; [o_mi_quit setKeyEquivalent: [o_vlcstringutility VLCKeyToString: o_key]];
[o_mi_quit setKeyEquivalentModifierMask: [o_vlcmain VLCModifiersToCocoa:o_key]]; [o_mi_quit setKeyEquivalentModifierMask: [o_vlcstringutility VLCModifiersToCocoa:o_key]];
FREENULL( key ); FREENULL( key );
key = config_GetPsz( p_intf, "key-play-pause" ); key = config_GetPsz( p_intf, "key-play-pause" );
o_key = [NSString stringWithFormat:@"%s", key]; o_key = [NSString stringWithFormat:@"%s", key];
[o_mi_play setKeyEquivalent: [o_vlcmain VLCKeyToString: o_key]]; [o_mi_play setKeyEquivalent: [o_vlcstringutility VLCKeyToString: o_key]];
[o_mi_play setKeyEquivalentModifierMask: [o_vlcmain VLCModifiersToCocoa:o_key]]; [o_mi_play setKeyEquivalentModifierMask: [o_vlcstringutility VLCModifiersToCocoa:o_key]];
FREENULL( key ); FREENULL( key );
key = config_GetPsz( p_intf, "key-stop" ); key = config_GetPsz( p_intf, "key-stop" );
o_key = [NSString stringWithFormat:@"%s", key]; o_key = [NSString stringWithFormat:@"%s", key];
[o_mi_stop setKeyEquivalent: [o_vlcmain VLCKeyToString: o_key]]; [o_mi_stop setKeyEquivalent: [o_vlcstringutility VLCKeyToString: o_key]];
[o_mi_stop setKeyEquivalentModifierMask: [o_vlcmain VLCModifiersToCocoa:o_key]]; [o_mi_stop setKeyEquivalentModifierMask: [o_vlcstringutility VLCModifiersToCocoa:o_key]];
FREENULL( key ); FREENULL( key );
key = config_GetPsz( p_intf, "key-prev" ); key = config_GetPsz( p_intf, "key-prev" );
o_key = [NSString stringWithFormat:@"%s", key]; o_key = [NSString stringWithFormat:@"%s", key];
[o_mi_previous setKeyEquivalent: [o_vlcmain VLCKeyToString: o_key]]; [o_mi_previous setKeyEquivalent: [o_vlcstringutility VLCKeyToString: o_key]];
[o_mi_previous setKeyEquivalentModifierMask: [o_vlcmain VLCModifiersToCocoa:o_key]]; [o_mi_previous setKeyEquivalentModifierMask: [o_vlcstringutility VLCModifiersToCocoa:o_key]];
FREENULL( key ); FREENULL( key );
key = config_GetPsz( p_intf, "key-next" ); key = config_GetPsz( p_intf, "key-next" );
o_key = [NSString stringWithFormat:@"%s", key]; o_key = [NSString stringWithFormat:@"%s", key];
[o_mi_next setKeyEquivalent: [o_vlcmain VLCKeyToString: o_key]]; [o_mi_next setKeyEquivalent: [o_vlcstringutility VLCKeyToString: o_key]];
[o_mi_next setKeyEquivalentModifierMask: [o_vlcmain VLCModifiersToCocoa:o_key]]; [o_mi_next setKeyEquivalentModifierMask: [o_vlcstringutility VLCModifiersToCocoa:o_key]];
FREENULL( key ); FREENULL( key );
key = config_GetPsz( p_intf, "key-jump+short" ); key = config_GetPsz( p_intf, "key-jump+short" );
o_key = [NSString stringWithFormat:@"%s", key]; o_key = [NSString stringWithFormat:@"%s", key];
[o_mi_fwd setKeyEquivalent: [o_vlcmain VLCKeyToString: o_key]]; [o_mi_fwd setKeyEquivalent: [o_vlcstringutility VLCKeyToString: o_key]];
[o_mi_fwd setKeyEquivalentModifierMask: [o_vlcmain VLCModifiersToCocoa:o_key]]; [o_mi_fwd setKeyEquivalentModifierMask: [o_vlcstringutility VLCModifiersToCocoa:o_key]];
FREENULL( key ); FREENULL( key );
key = config_GetPsz( p_intf, "key-jump-short" ); key = config_GetPsz( p_intf, "key-jump-short" );
o_key = [NSString stringWithFormat:@"%s", key]; o_key = [NSString stringWithFormat:@"%s", key];
[o_mi_bwd setKeyEquivalent: [o_vlcmain VLCKeyToString: o_key]]; [o_mi_bwd setKeyEquivalent: [o_vlcstringutility VLCKeyToString: o_key]];
[o_mi_bwd setKeyEquivalentModifierMask: [o_vlcmain VLCModifiersToCocoa:o_key]]; [o_mi_bwd setKeyEquivalentModifierMask: [o_vlcstringutility VLCModifiersToCocoa:o_key]];
FREENULL( key ); FREENULL( key );
key = config_GetPsz( p_intf, "key-vol-up" ); key = config_GetPsz( p_intf, "key-vol-up" );
o_key = [NSString stringWithFormat:@"%s", key]; o_key = [NSString stringWithFormat:@"%s", key];
[o_mi_vol_up setKeyEquivalent: [o_vlcmain VLCKeyToString: o_key]]; [o_mi_vol_up setKeyEquivalent: [o_vlcstringutility VLCKeyToString: o_key]];
[o_mi_vol_up setKeyEquivalentModifierMask: [o_vlcmain VLCModifiersToCocoa:o_key]]; [o_mi_vol_up setKeyEquivalentModifierMask: [o_vlcstringutility VLCModifiersToCocoa:o_key]];
FREENULL( key ); FREENULL( key );
key = config_GetPsz( p_intf, "key-vol-down" ); key = config_GetPsz( p_intf, "key-vol-down" );
o_key = [NSString stringWithFormat:@"%s", key]; o_key = [NSString stringWithFormat:@"%s", key];
[o_mi_vol_down setKeyEquivalent: [o_vlcmain VLCKeyToString: o_key]]; [o_mi_vol_down setKeyEquivalent: [o_vlcstringutility VLCKeyToString: o_key]];
[o_mi_vol_down setKeyEquivalentModifierMask: [o_vlcmain VLCModifiersToCocoa:o_key]]; [o_mi_vol_down setKeyEquivalentModifierMask: [o_vlcstringutility VLCModifiersToCocoa:o_key]];
FREENULL( key ); FREENULL( key );
key = config_GetPsz( p_intf, "key-vol-mute" ); key = config_GetPsz( p_intf, "key-vol-mute" );
o_key = [NSString stringWithFormat:@"%s", key]; o_key = [NSString stringWithFormat:@"%s", key];
[o_mi_mute setKeyEquivalent: [o_vlcmain VLCKeyToString: o_key]]; [o_mi_mute setKeyEquivalent: [o_vlcstringutility VLCKeyToString: o_key]];
[o_mi_mute setKeyEquivalentModifierMask: [o_vlcmain VLCModifiersToCocoa:o_key]]; [o_mi_mute setKeyEquivalentModifierMask: [o_vlcstringutility VLCModifiersToCocoa:o_key]];
FREENULL( key ); FREENULL( key );
key = config_GetPsz( p_intf, "key-toggle-fullscreen" ); key = config_GetPsz( p_intf, "key-toggle-fullscreen" );
o_key = [NSString stringWithFormat:@"%s", key]; o_key = [NSString stringWithFormat:@"%s", key];
[o_mi_fullscreen setKeyEquivalent: [o_vlcmain VLCKeyToString: o_key]]; [o_mi_fullscreen setKeyEquivalent: [o_vlcstringutility VLCKeyToString: o_key]];
[o_mi_fullscreen setKeyEquivalentModifierMask: [o_vlcmain VLCModifiersToCocoa:o_key]]; [o_mi_fullscreen setKeyEquivalentModifierMask: [o_vlcstringutility VLCModifiersToCocoa:o_key]];
FREENULL( key ); FREENULL( key );
key = config_GetPsz( p_intf, "key-snapshot" ); key = config_GetPsz( p_intf, "key-snapshot" );
o_key = [NSString stringWithFormat:@"%s", key]; o_key = [NSString stringWithFormat:@"%s", key];
[o_mi_snapshot setKeyEquivalent: [o_vlcmain VLCKeyToString: o_key]]; [o_mi_snapshot setKeyEquivalent: [o_vlcstringutility VLCKeyToString: o_key]];
[o_mi_snapshot setKeyEquivalentModifierMask: [o_vlcmain VLCModifiersToCocoa:o_key]]; [o_mi_snapshot setKeyEquivalentModifierMask: [o_vlcstringutility VLCModifiersToCocoa:o_key]];
FREENULL( key ); FREENULL( key );
key = config_GetPsz( p_intf, "key-random" ); key = config_GetPsz( p_intf, "key-random" );
o_key = [NSString stringWithFormat:@"%s", key]; o_key = [NSString stringWithFormat:@"%s", key];
[o_mi_random setKeyEquivalent: [o_vlcmain VLCKeyToString: o_key]]; [o_mi_random setKeyEquivalent: [o_vlcstringutility VLCKeyToString: o_key]];
[o_mi_random setKeyEquivalentModifierMask: [o_vlcmain VLCModifiersToCocoa:o_key]]; [o_mi_random setKeyEquivalentModifierMask: [o_vlcstringutility VLCModifiersToCocoa:o_key]];
FREENULL( key ); FREENULL( key );
key = config_GetPsz( p_intf, "key-zoom-half" ); key = config_GetPsz( p_intf, "key-zoom-half" );
o_key = [NSString stringWithFormat:@"%s", key]; o_key = [NSString stringWithFormat:@"%s", key];
[o_mi_half_window setKeyEquivalent: [o_vlcmain VLCKeyToString: o_key]]; [o_mi_half_window setKeyEquivalent: [o_vlcstringutility VLCKeyToString: o_key]];
[o_mi_half_window setKeyEquivalentModifierMask: [o_vlcmain VLCModifiersToCocoa:o_key]]; [o_mi_half_window setKeyEquivalentModifierMask: [o_vlcstringutility VLCModifiersToCocoa:o_key]];
FREENULL( key ); FREENULL( key );
key = config_GetPsz( p_intf, "key-zoom-original" ); key = config_GetPsz( p_intf, "key-zoom-original" );
o_key = [NSString stringWithFormat:@"%s", key]; o_key = [NSString stringWithFormat:@"%s", key];
[o_mi_normal_window setKeyEquivalent: [o_vlcmain VLCKeyToString: o_key]]; [o_mi_normal_window setKeyEquivalent: [o_vlcstringutility VLCKeyToString: o_key]];
[o_mi_normal_window setKeyEquivalentModifierMask: [o_vlcmain VLCModifiersToCocoa:o_key]]; [o_mi_normal_window setKeyEquivalentModifierMask: [o_vlcstringutility VLCModifiersToCocoa:o_key]];
FREENULL( key ); FREENULL( key );
key = config_GetPsz( p_intf, "key-zoom-double" ); key = config_GetPsz( p_intf, "key-zoom-double" );
o_key = [NSString stringWithFormat:@"%s", key]; o_key = [NSString stringWithFormat:@"%s", key];
[o_mi_double_window setKeyEquivalent: [o_vlcmain VLCKeyToString: o_key]]; [o_mi_double_window setKeyEquivalent: [o_vlcstringutility VLCKeyToString: o_key]];
[o_mi_double_window setKeyEquivalentModifierMask: [o_vlcmain VLCModifiersToCocoa:o_key]]; [o_mi_double_window setKeyEquivalentModifierMask: [o_vlcstringutility VLCModifiersToCocoa:o_key]];
FREENULL( key ); FREENULL( key );
[self setSubmenusEnabled: FALSE]; [self setSubmenusEnabled: FALSE];
......
...@@ -131,11 +131,11 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -131,11 +131,11 @@ static VLCMainWindow *_o_sharedInstance = nil;
o_key = [NSString stringWithFormat:@"%s", key]; o_key = [NSString stringWithFormat:@"%s", key];
FREENULL( key ); FREENULL( key );
unsigned int i_keyModifiers = [[VLCMain sharedInstance] VLCModifiersToCocoa:o_key]; unsigned int i_keyModifiers = [[VLCStringUtility sharedInstance] VLCModifiersToCocoa:o_key];
NSString * characters = [o_event charactersIgnoringModifiers]; NSString * characters = [o_event charactersIgnoringModifiers];
if ([characters length] > 0) { if ([characters length] > 0) {
return [[characters lowercaseString] isEqualToString: [[VLCMain sharedInstance] VLCKeyToString: o_key]] && return [[characters lowercaseString] isEqualToString: [[VLCStringUtility sharedInstance] VLCKeyToString: o_key]] &&
(i_keyModifiers & NSShiftKeyMask) == ([o_event modifierFlags] & NSShiftKeyMask) && (i_keyModifiers & NSShiftKeyMask) == ([o_event modifierFlags] & NSShiftKeyMask) &&
(i_keyModifiers & NSControlKeyMask) == ([o_event modifierFlags] & NSControlKeyMask) && (i_keyModifiers & NSControlKeyMask) == ([o_event modifierFlags] & NSControlKeyMask) &&
(i_keyModifiers & NSAlternateKeyMask) == ([o_event modifierFlags] & NSAlternateKeyMask) && (i_keyModifiers & NSAlternateKeyMask) == ([o_event modifierFlags] & NSAlternateKeyMask) &&
......
...@@ -5,6 +5,8 @@ LIBTOOL=@LIBTOOL@ --tag=CC ...@@ -5,6 +5,8 @@ LIBTOOL=@LIBTOOL@ --tag=CC
SOURCES_macosx = \ SOURCES_macosx = \
CompatibilityFixes.h \ CompatibilityFixes.h \
StringUtility.h \
StringUtility.m \
AppleRemote.h \ AppleRemote.h \
AppleRemote.m \ AppleRemote.m \
SPInvocationGrabbing.h \ SPInvocationGrabbing.h \
......
/*****************************************************************************
* StringUtility.h: MacOS X interface module
*****************************************************************************
* Copyright (C) 2002-2012 VLC authors and VideoLAN
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
* Derk-Jan Hartman <hartman at videolan dot org>
* Felix Paul Kühne <fkuehne at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#import <Cocoa/Cocoa.h>
#define _NS(s) [[VLCStringUtility sharedInstance] localizedString: s]
/* Get an alternate version of the string.
* This string is stored as '1:string' but when displayed it only displays
* the translated string. the translation should be '1:translatedstring' though */
#define _ANS(s) [[[VLCStringUtility sharedInstance] localizedString: _(s)] substringFromIndex:2]
@interface VLCStringUtility : NSObject
+ (VLCStringUtility *)sharedInstance;
- (NSString *)localizedString:(const char *)psz;
- (char *)delocalizeString:(NSString *)psz;
- (NSString *)wrapString: (NSString *)o_in_string toWidth: (int)i_width;
- (NSString *)VLCKeyToString:(NSString *)theString;
- (unsigned int)VLCModifiersToCocoa:(NSString *)theString;
@end
This diff is collapsed.
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#import "SPMediaKeyTap.h" /* for the media key support */ #import "SPMediaKeyTap.h" /* for the media key support */
#import "misc.h" #import "misc.h"
#import "MainWindow.h" #import "MainWindow.h"
#import "StringUtility.h"
#import <IOKit/pwr_mgt/IOPMLib.h> /* for sleep prevention */ #import <IOKit/pwr_mgt/IOPMLib.h> /* for sleep prevention */
...@@ -50,13 +51,6 @@ unsigned int CocoaKeyToVLC( unichar i_key ); ...@@ -50,13 +51,6 @@ unsigned int CocoaKeyToVLC( unichar i_key );
#define VLCIntf [[VLCMain sharedInstance] intf] #define VLCIntf [[VLCMain sharedInstance] intf]
#define _NS(s) [[VLCMain sharedInstance] localizedString: s]
/* Get an alternate version of the string.
* This string is stored as '1:string' but when displayed it only displays
* the translated string. the translation should be '1:translatedstring' though */
#define _ANS(s) [[[VLCMain sharedInstance] localizedString: _(s)] substringFromIndex:2]
// You need to release those objects after use // You need to release those objects after use
input_thread_t *getInput(void); input_thread_t *getInput(void);
vout_thread_t *getVout(void); vout_thread_t *getVout(void);
...@@ -175,14 +169,9 @@ struct intf_sys_t ...@@ -175,14 +169,9 @@ struct intf_sys_t
- (void)setActiveVideoPlayback:(BOOL)b_value; - (void)setActiveVideoPlayback:(BOOL)b_value;
- (BOOL)activeVideoPlayback; - (BOOL)activeVideoPlayback;
- (void)applicationWillTerminate:(NSNotification *)notification; - (void)applicationWillTerminate:(NSNotification *)notification;
- (NSString *)localizedString:(const char *)psz;
- (char *)delocalizeString:(NSString *)psz;
- (NSString *)wrapString: (NSString *)o_in_string toWidth: (int)i_width;
- (BOOL)hasDefinedShortcutKey:(NSEvent *)o_event force:(BOOL)b_force;
- (NSString *)VLCKeyToString:(NSString *)theString;
- (unsigned int)VLCModifiersToCocoa:(NSString *)theString;
- (void)updateCurrentlyUsedHotkeys; - (void)updateCurrentlyUsedHotkeys;
- (void)fullscreenChanged; - (void)fullscreenChanged;
- (BOOL)hasDefinedShortcutKey:(NSEvent *)o_event force:(BOOL)b_force;
- (void)checkFullscreenChange:(NSNumber *)o_full; - (void)checkFullscreenChange:(NSNumber *)o_full;
- (void)PlaylistItemChanged; - (void)PlaylistItemChanged;
- (void)playbackStatusUpdated; - (void)playbackStatusUpdated;
......
This diff is collapsed.
...@@ -977,7 +977,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \ ...@@ -977,7 +977,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
else else
i_view_type = CONFIG_ITEM_STRING; i_view_type = CONFIG_ITEM_STRING;
o_textfieldTooltip = [[VLCMain sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP]; o_textfieldTooltip = [[VLCStringUtility sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
/* add the label */ /* add the label */
if( p_item->psz_text ) if( p_item->psz_text )
...@@ -1034,7 +1034,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \ ...@@ -1034,7 +1034,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
- (char *)stringValue - (char *)stringValue
{ {
return [[VLCMain sharedInstance] delocalizeString: return [[VLCStringUtility sharedInstance] delocalizeString:
[o_textfield stringValue]]; [o_textfield stringValue]];
} }
...@@ -1067,7 +1067,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \ ...@@ -1067,7 +1067,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
int i_index; int i_index;
i_view_type = CONFIG_ITEM_STRING_LIST; i_view_type = CONFIG_ITEM_STRING_LIST;
o_textfieldTooltip = [[VLCMain sharedInstance] wrapString: _NS(p_item->psz_longtext) toWidth: PREFS_WRAP]; o_textfieldTooltip = [[VLCStringUtility sharedInstance] wrapString: _NS(p_item->psz_longtext) toWidth: PREFS_WRAP];
/* add the label */ /* add the label */
if( p_item->psz_text ) if( p_item->psz_text )
...@@ -1121,8 +1121,8 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \ ...@@ -1121,8 +1121,8 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
if( p_item->list.psz[[o_combo indexOfSelectedItem]] != NULL ) if( p_item->list.psz[[o_combo indexOfSelectedItem]] != NULL )
return strdup( p_item->list.psz[[o_combo indexOfSelectedItem]] ); return strdup( p_item->list.psz[[o_combo indexOfSelectedItem]] );
} else { } else {
if( [[VLCMain sharedInstance] delocalizeString: [o_combo stringValue]] != NULL ) if( [[VLCStringUtility sharedInstance] delocalizeString: [o_combo stringValue]] != NULL )
return strdup( [[VLCMain sharedInstance] delocalizeString: [o_combo stringValue]] ); return strdup( [[VLCStringUtility sharedInstance] delocalizeString: [o_combo stringValue]] );
} }
return NULL; return NULL;
} }
...@@ -1178,8 +1178,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \ ...@@ -1178,8 +1178,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
{ {
i_view_type = CONFIG_ITEM_LOADFILE; i_view_type = CONFIG_ITEM_LOADFILE;
o_itemTooltip = [[VLCMain sharedInstance] o_itemTooltip = [[VLCStringUtility sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
/* is it a directory */ /* is it a directory */
b_directory = ( [self type] == CONFIG_ITEM_DIRECTORY ) ? YES : NO; b_directory = ( [self type] == CONFIG_ITEM_DIRECTORY ) ? YES : NO;
...@@ -1281,7 +1280,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \ ...@@ -1281,7 +1280,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
{ {
i_view_type = CONFIG_ITEM_MODULE; i_view_type = CONFIG_ITEM_MODULE;
o_popupTooltip = [[VLCMain sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP]; o_popupTooltip = [[VLCStringUtility sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
/* add the label */ /* add the label */
if( p_item->psz_text ) if( p_item->psz_text )
...@@ -1451,7 +1450,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \ ...@@ -1451,7 +1450,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
{ {
i_view_type = CONFIG_ITEM_INTEGER; i_view_type = CONFIG_ITEM_INTEGER;
o_tooltip = [[VLCMain sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP]; o_tooltip = [[VLCStringUtility sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
/* add the label */ /* add the label */
if( p_item->psz_text ) if( p_item->psz_text )
...@@ -1546,7 +1545,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \ ...@@ -1546,7 +1545,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
int i_index; int i_index;
i_view_type = CONFIG_ITEM_STRING_LIST; i_view_type = CONFIG_ITEM_STRING_LIST;
o_textfieldTooltip = [[VLCMain sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP]; o_textfieldTooltip = [[VLCStringUtility sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
/* add the label */ /* add the label */
if( p_item->psz_text ) if( p_item->psz_text )
...@@ -1646,7 +1645,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \ ...@@ -1646,7 +1645,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
{ {
i_view_type = CONFIG_ITEM_RANGED_INTEGER; i_view_type = CONFIG_ITEM_RANGED_INTEGER;
o_tooltip = [[VLCMain sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP]; o_tooltip = [[VLCStringUtility sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
/* add the label */ /* add the label */
if( p_item->psz_text ) if( p_item->psz_text )
...@@ -1762,7 +1761,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \ ...@@ -1762,7 +1761,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
{ {
i_view_type = CONFIG_ITEM_INTEGER; i_view_type = CONFIG_ITEM_INTEGER;
o_tooltip = [[VLCMain sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP]; o_tooltip = [[VLCStringUtility sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
/* add the label */ /* add the label */
if( p_item->psz_text ) if( p_item->psz_text )
...@@ -1855,7 +1854,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \ ...@@ -1855,7 +1854,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
{ {
i_view_type = CONFIG_ITEM_RANGED_INTEGER; i_view_type = CONFIG_ITEM_RANGED_INTEGER;
o_tooltip = [[VLCMain sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP]; o_tooltip = [[VLCStringUtility sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
/* add the label */ /* add the label */
if( p_item->psz_text ) if( p_item->psz_text )
...@@ -1972,7 +1971,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \ ...@@ -1972,7 +1971,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
i_view_type = CONFIG_ITEM_BOOL; i_view_type = CONFIG_ITEM_BOOL;
/* add the checkbox */ /* add the checkbox */
o_tooltip = [[VLCMain sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP]; o_tooltip = [[VLCStringUtility sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
ADD_CHECKBOX( o_checkbox, mainFrame, 0, ADD_CHECKBOX( o_checkbox, mainFrame, 0,
0, @"", o_tooltip, p_item->value.i, NSImageLeft) 0, @"", o_tooltip, p_item->value.i, NSImageLeft)
[o_checkbox setAutoresizingMask:NSViewNotSizable ]; [o_checkbox setAutoresizingMask:NSViewNotSizable ];
...@@ -2022,7 +2021,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \ ...@@ -2022,7 +2021,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
{ {
i_view_type = CONFIG_ITEM_KEY; i_view_type = CONFIG_ITEM_KEY;
o_tooltip = [[VLCMain sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP]; o_tooltip = [[VLCStringUtility sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
/* add the label */ /* add the label */
if( p_item->psz_text ) if( p_item->psz_text )
...@@ -2159,7 +2158,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \ ...@@ -2159,7 +2158,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
{ {
i_view_type = CONFIG_ITEM_MODULE_LIST; i_view_type = CONFIG_ITEM_MODULE_LIST;
o_tooltip = [[VLCMain sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP]; o_tooltip = [[VLCStringUtility sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
/* add the label */ /* add the label */
if( p_item->psz_text ) if( p_item->psz_text )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment