VLCBugreporter.m 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. UIAlertView *alert = [[UIAlertView alloc]
  30. initWithTitle:NSLocalizedString(@"BUG_REPORT_TITLE", @"")
  31. message:NSLocalizedString(@"BUG_REPORT_MESSAGE", @"") delegate:self
  32. cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", @"")
  33. otherButtonTitles:NSLocalizedString(@"BUG_REPORT_BUTTON", @""), nil];;
  34. [alert show];
  35. }
  36. - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
  37. {
  38. if (buttonIndex == 1) {
  39. NSURL *url = [NSURL URLWithString:@"https://trac.videolan.org/vlc/newticket"];
  40. [[UIApplication sharedApplication] openURL:url];
  41. }
  42. }
  43. @end