VLCBugreporter.m 1.27 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
//
//  VLCBugreporter.m
//  VLC for iOS
//
//  Created by Felix Paul Kühne on 21.07.13.
//  Copyright (c) 2013 VideoLAN. All rights reserved.
//
//  Refer to the COPYING file of the official project for license.
//

#import "VLCBugreporter.h"

@implementation VLCBugreporter

Gleb Pinigin's avatar
Gleb Pinigin committed
15
#pragma mark - Initialization
16 17 18

+ (VLCBugreporter *)sharedInstance
{
Gleb Pinigin's avatar
Gleb Pinigin committed
19 20 21 22 23
    static dispatch_once_t onceToken;
    static VLCBugreporter *_sharedInstance = nil;
    dispatch_once(&onceToken, ^{
        _sharedInstance = [VLCBugreporter new];
    });
24 25 26 27

    return _sharedInstance;
}

Gleb Pinigin's avatar
Gleb Pinigin committed
28 29
#pragma mark -

30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
- (void)handleBugreportRequest
{
    UIAlertView *alert = [[UIAlertView alloc]
                          initWithTitle:NSLocalizedString(@"BUG_REPORT_TITLE", @"")
                          message:NSLocalizedString(@"BUG_REPORT_MESSAGE", @"") delegate:self
                          cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", @"")
                          otherButtonTitles:NSLocalizedString(@"BUG_REPORT_BUTTON", @""), nil];;
    [alert show];
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    if (buttonIndex == 1) {
        NSURL *url = [NSURL URLWithString:@"https://trac.videolan.org/vlc/newticket"];
        [[UIApplication sharedApplication] openURL:url];
    }
}

@end