VLCBugreporter.m 2.2 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. #import "VLC-Swift.h"
  16. @implementation VLCBugreporter
  17. #pragma mark - Initialization
  18. + (VLCBugreporter *)sharedInstance
  19. {
  20. static dispatch_once_t onceToken;
  21. static VLCBugreporter *_sharedInstance = nil;
  22. dispatch_once(&onceToken, ^{
  23. _sharedInstance = [VLCBugreporter new];
  24. });
  25. return _sharedInstance;
  26. }
  27. #pragma mark -
  28. - (void)handleBugreportRequest
  29. {
  30. NSArray<VLCAlertButton *> *buttonsAction = @[[[VLCAlertButton alloc] initWithTitle:NSLocalizedString(@"BUTTON_CANCEL", nil)
  31. action:nil],
  32. [[VLCAlertButton alloc] initWithTitle:NSLocalizedString(@"BUG_REPORT_BUTTON", nil)
  33. action: ^(UIAlertAction* action){
  34. NSURL *url = [NSURL URLWithString:@"https://trac.videolan.org/vlc/newticket"];
  35. [[UIApplication sharedApplication] openURL:url];
  36. }]
  37. ];
  38. [VLCAlertViewController alertViewManagerWithTitle:NSLocalizedString(@"BUG_REPORT_TITLE", nil)
  39. errorMessage:NSLocalizedString(@"BUG_REPORT_MESSAGE", nil)
  40. viewController:[UIApplication sharedApplication].keyWindow.rootViewController
  41. buttonsAction:buttonsAction];
  42. }
  43. @end