Преглед изворни кода

About: add contribute button linking to our contribute page

Full l10n except for id - needs review by native speakers
Felix Paul Kühne пре 12 година
родитељ
комит
73430c913d

+ 16 - 1
AspenProject/VLCAboutViewController.m

@@ -17,7 +17,17 @@
 {
     [super viewDidLoad];
 
-    self.navigationItem.title = NSLocalizedString(@"ABOUT_APP", @"");
+    self.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"title"]];
+
+    UIBarButtonItem *contributeButton = [[UIBarButtonItem alloc] initWithTitle:@"Contribute" style:UIBarButtonItemStyleBordered target:self action:@selector(openContributePage:)];
+    [contributeButton setBackgroundImage:[UIImage imageNamed:@"button"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
+    [contributeButton setBackgroundImage:[UIImage imageNamed:@"buttonHighlight"] forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault];
+
+    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
+        self.navigationItem.rightBarButtonItem = contributeButton;
+    else
+        self.navigationItem.leftBarButtonItem = contributeButton;
+
     NSMutableString *htmlContent = [NSMutableString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"About Contents" ofType:@"html"] encoding:NSUTF8StringEncoding error:nil];
     [htmlContent replaceOccurrencesOfString:@"ASPENVERSION" withString:[[NSString stringWithFormat:NSLocalizedString(@"VERSION_FORMAT",@""), [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]] stringByAppendingFormat:@" %@", kVLCVersionCodename] options:NSLiteralSearch range:NSMakeRange(0, 1000)];
     [htmlContent replaceOccurrencesOfString:@"MOBILEVLCKITVERSION" withString:[NSString stringWithFormat:NSLocalizedString(@"BASED_ON_FORMAT",@""),[[VLCLibrary sharedLibrary] version]] options:NSLiteralSearch range:NSMakeRange(0, 1000)];
@@ -51,4 +61,9 @@
     [UIView animateWithDuration:.3 animations:animationBlock completion:completionBlock];
 }
 
+- (IBAction)openContributePage:(id)sender
+{
+    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.videolan.org/contribute.html"]];
+}
+
 @end

BIN
Resources/de.lproj/Localizable.strings


BIN
Resources/en.lproj/Localizable.strings


BIN
Resources/es.lproj/Localizable.strings


BIN
Resources/fi.lproj/Localizable.strings


BIN
Resources/fr.lproj/Localizable.strings


BIN
Resources/id.lproj/Localizable.strings


BIN
Resources/it.lproj/Localizable.strings


BIN
Resources/ja.lproj/Localizable.strings


BIN
Resources/ru.lproj/Localizable.strings