VLCBugreporter.m 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // VLCBugreporter.m
  3. // VLC for iOS
  4. //
  5. // Created by Felix Paul Kühne on 21.07.13.
  6. // Copyright (c) 2013 VideoLAN. All rights reserved.
  7. //
  8. // Refer to the COPYING file of the official project for license.
  9. //
  10. #import "VLCBugreporter.h"
  11. @implementation VLCBugreporter
  12. #pragma mark - Initialization
  13. + (VLCBugreporter *)sharedInstance
  14. {
  15. static dispatch_once_t onceToken;
  16. static VLCBugreporter *_sharedInstance = nil;
  17. dispatch_once(&onceToken, ^{
  18. _sharedInstance = [VLCBugreporter new];
  19. });
  20. return _sharedInstance;
  21. }
  22. #pragma mark -
  23. - (void)handleBugreportRequest
  24. {
  25. UIAlertView *alert = [[UIAlertView alloc]
  26. initWithTitle:NSLocalizedString(@"BUG_REPORT_TITLE", @"")
  27. message:NSLocalizedString(@"BUG_REPORT_MESSAGE", @"") delegate:self
  28. cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", @"")
  29. otherButtonTitles:NSLocalizedString(@"BUG_REPORT_BUTTON", @""), nil];;
  30. [alert show];
  31. }
  32. - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
  33. {
  34. if (buttonIndex == 1) {
  35. NSURL *url = [NSURL URLWithString:@"https://trac.videolan.org/vlc/newticket"];
  36. [[UIApplication sharedApplication] openURL:url];
  37. }
  38. }
  39. @end