VLCBugreporter.m 1.6 KB

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