VLCBugreporter.m 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. static VLCBugreporter *_sharedInstance = nil;
  13. + (VLCBugreporter *)sharedInstance
  14. {
  15. return _sharedInstance ? _sharedInstance : [[self alloc] init];
  16. }
  17. #pragma mark -
  18. #pragma mark Initialization
  19. - (id)init
  20. {
  21. if (_sharedInstance) {
  22. self = nil;
  23. return _sharedInstance;
  24. } else
  25. _sharedInstance = [super init];
  26. return _sharedInstance;
  27. }
  28. - (void)handleBugreportRequest
  29. {
  30. UIAlertView *alert = [[UIAlertView alloc]
  31. initWithTitle:NSLocalizedString(@"BUG_REPORT_TITLE", @"")
  32. message:NSLocalizedString(@"BUG_REPORT_MESSAGE", @"") delegate:self
  33. cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", @"")
  34. otherButtonTitles:NSLocalizedString(@"BUG_REPORT_BUTTON", @""), nil];;
  35. [alert show];
  36. }
  37. - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
  38. {
  39. if (buttonIndex == 1) {
  40. NSURL *url = [NSURL URLWithString:@"https://trac.videolan.org/vlc/newticket"];
  41. [[UIApplication sharedApplication] openURL:url];
  42. }
  43. }
  44. @end