forked from organicmaps/organicmaps
[ios] implement bug report alert
Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
This commit is contained in:
parent
603fa2dbf9
commit
497153d161
6 changed files with 23 additions and 1 deletions
|
@ -43,6 +43,7 @@
|
|||
callback:(nonnull MWMCheckStringBlock)callback;
|
||||
|
||||
- (void)presentBookmarkConversionErrorAlert;
|
||||
- (void)presentBugReportAlertWithTitle:(nonnull NSString *)title;
|
||||
|
||||
- (void)presentDefaultAlertWithTitle:(nonnull NSString *)title
|
||||
message:(nullable NSString *)message
|
||||
|
|
|
@ -192,6 +192,10 @@ static NSString *const kAlertControllerNibIdentifier = @"MWMAlertViewController"
|
|||
[self displayAlert:[MWMAlert tagsLoadingErrorAlertWithOkBlock:okBlock cancelBlock:cancelBlock]];
|
||||
}
|
||||
|
||||
- (void)presentBugReportAlertWithTitle:(nonnull NSString *)title {
|
||||
[self displayAlert:[MWMAlert bugReportAlertWithTitle:title]];
|
||||
}
|
||||
|
||||
- (void)presentDefaultAlertWithTitle:(nonnull NSString *)title
|
||||
message:(nullable NSString *)message
|
||||
rightButtonTitle:(nonnull NSString *)rightButtonTitle
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
+ (MWMAlert *)spinnerAlertWithTitle:(NSString *)title cancel:(MWMVoidBlock)cancel;
|
||||
+ (MWMAlert *)bookmarkConversionErrorAlert;
|
||||
+ (MWMAlert *)tagsLoadingErrorAlertWithOkBlock:okBlock cancelBlock:cancelBlock;
|
||||
+ (MWMAlert *)bugReportAlertWithTitle:(NSString *)title;
|
||||
|
||||
+ (MWMAlert *)defaultAlertWithTitle:(NSString *)title
|
||||
message:(NSString *)message
|
||||
|
|
|
@ -171,6 +171,10 @@
|
|||
return [MWMDefaultAlert tagsLoadingErrorAlertWithOkBlock:okBlock cancelBlock:cancelBlock];
|
||||
}
|
||||
|
||||
+ (MWMAlert *)bugReportAlertWithTitle:(NSString *)title {
|
||||
return [MWMDefaultAlert bugReportAlertWithTitle:title];
|
||||
}
|
||||
|
||||
+ (MWMAlert *)defaultAlertWithTitle:(NSString *)title
|
||||
message:(NSString *)message
|
||||
rightButtonTitle:(NSString *)rightButtonTitle
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
+ (instancetype)infoAlert:(NSString *)title text:(NSString *)text;
|
||||
+ (instancetype)convertBookmarksWithCount:(NSUInteger)count okBlock:(MWMVoidBlock)okBlock;
|
||||
+ (instancetype)bookmarkConversionErrorAlert;
|
||||
|
||||
+ (instancetype)tagsLoadingErrorAlertWithOkBlock:(MWMVoidBlock)okBlock cancelBlock:(MWMVoidBlock)cancelBlock;
|
||||
+ (instancetype)bugReportAlertWithTitle:(NSString *)title;
|
||||
|
||||
+ (instancetype)defaultAlertWithTitle:(NSString *)title
|
||||
message:(NSString *)message
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#import "MWMDefaultAlert.h"
|
||||
#import "SwiftBridge.h"
|
||||
|
||||
#include <CoreApi/Framework.h>
|
||||
|
||||
|
@ -347,6 +348,17 @@ static NSString *const kDefaultAlertNibName = @"MWMDefaultAlert";
|
|||
return alert;
|
||||
}
|
||||
|
||||
+ (instancetype)bugReportAlertWithTitle:(NSString *)title {
|
||||
MWMDefaultAlert *alert = [self defaultAlertWithTitle:title
|
||||
message:L(@"bugreport_alert_message")
|
||||
rightButtonTitle:L(@"report_a_bug")
|
||||
leftButtonTitle:L(@"cancel")
|
||||
rightButtonAction:^{ [MailComposer sendBugReport]; }
|
||||
log:nil];
|
||||
[alert setNeedsCloseAlertAfterEnterBackground];
|
||||
return alert;
|
||||
}
|
||||
|
||||
+ (instancetype)defaultAlertWithTitle:(NSString *)title
|
||||
message:(NSString *)message
|
||||
rightButtonTitle:(NSString *)rightButtonTitle
|
||||
|
|
Loading…
Add table
Reference in a new issue