/*****************************************************************************
* simple_prefs.m: Simple Preferences for Mac OS X
*****************************************************************************
-* Copyright (C) 2008-2011 the VideoLAN team
+* Copyright (C) 2008-2011 VLC authors and VideoLAN
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne at videolan dot org>
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#import "CompatibilityFixes.h"
#import "simple_prefs.h"
#import "misc.h"
#import "intf.h"
#import "AppleRemote.h"
-#import <Sparkle/Sparkle.h> //for o_intf_last_update_lbl
+
+#ifdef HAVE_SPARKLE_H
+# import <Sparkle/Sparkle.h> //for o_intf_last_update_lbl
+#endif
static NSString* VLCSPrefsToolbarIdentifier = @"Our Simple Preferences Toolbar Identifier";
static NSString* VLCIntfSettingToolbarIdentifier = @"Intf Settings Item Identifier";
- (NSString *)OSXStringKeyToString:(NSString *)theString
{
if (![theString isEqualToString:@""]) {
+ /* remove cruft */
+ if ([theString characterAtIndex:([theString length] - 1)] != 0x2b)
+ theString = [theString stringByReplacingOccurrencesOfString:@"+" withString:@""];
+ else
+ {
+ theString = [theString stringByReplacingOccurrencesOfString:@"+" withString:@""];
+ theString = [NSString stringWithFormat:@"%@+", theString];
+ }
+ if ([theString characterAtIndex:([theString length] - 1)] != 0x2d)
+ theString = [theString stringByReplacingOccurrencesOfString:@"-" withString:@""];
+ else
+ {
+ theString = [theString stringByReplacingOccurrencesOfString:@"-" withString:@""];
+ theString = [NSString stringWithFormat:@"%@-", theString];
+ }
/* modifiers */
theString = [theString stringByReplacingOccurrencesOfString:@"Command" withString: [NSString stringWithUTF8String: "\xE2\x8C\x98"]];
theString = [theString stringByReplacingOccurrencesOfString:@"Alt" withString: [NSString stringWithUTF8String: "\xE2\x8C\xA5"]];
theString = [theString stringByReplacingOccurrencesOfString:@"Shift" withString: [NSString stringWithUTF8String: "\xE2\x87\xA7"]];
theString = [theString stringByReplacingOccurrencesOfString:@"Ctrl" withString: [NSString stringWithUTF8String: "\xE2\x8C\x83"]];
- /* remove cruft */
- theString = [theString stringByReplacingOccurrencesOfString:@"+" withString:@""];
- theString = [theString stringByReplacingOccurrencesOfString:@"-" withString:@""];
/* show non-character keys correctly */
theString = [theString stringByReplacingOccurrencesOfString:@"Right" withString:[NSString stringWithUTF8String:"\xE2\x86\x92"]];
theString = [theString stringByReplacingOccurrencesOfString:@"Left" withString:[NSString stringWithUTF8String:"\xE2\x86\x90"]];
[self setupButton: o_intf_embedded_ckb forBoolValue: "embedded-video"];
[self setupButton: o_intf_appleremote_ckb forBoolValue: "macosx-appleremote"];
[self setupButton: o_intf_mediakeys_ckb forBoolValue: "macosx-mediakeys"];
+#ifdef HAVE_SPARKLE_H
if( [[SUUpdater sharedUpdater] lastUpdateCheckDate] != NULL )
[o_intf_last_update_lbl setStringValue: [NSString stringWithFormat: _NS("Last check on: %@"), [[[SUUpdater sharedUpdater] lastUpdateCheckDate] descriptionWithLocale: [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]]]];
else
+#endif
[o_intf_last_update_lbl setStringValue: _NS("No check was performed yet.")];
psz_tmp = config_GetPsz( p_intf, "control" );
if (psz_tmp) {