mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-01 16:06:59 +00:00
Use AlertView instead of ActionSheet when asking to delete all feedback messages on the iPad
This commit is contained in:
parent
147b5ec621
commit
795381d72f
@ -32,7 +32,7 @@
|
||||
#import "BITHockeyBaseViewController.h"
|
||||
|
||||
|
||||
@interface BITFeedbackListViewController : BITHockeyBaseViewController <UITableViewDelegate, UITableViewDataSource, UIActionSheetDelegate> {
|
||||
@interface BITFeedbackListViewController : BITHockeyBaseViewController <UITableViewDelegate, UITableViewDataSource, UIActionSheetDelegate, UIAlertViewDelegate> {
|
||||
}
|
||||
|
||||
@end
|
@ -210,15 +210,27 @@
|
||||
}
|
||||
|
||||
- (void)deleteAllMessagesAction:(id)sender {
|
||||
UIActionSheet *deleteAction = [[UIActionSheet alloc] initWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackListDeleteAllTitle")
|
||||
delegate:self
|
||||
cancelButtonTitle:BITHockeyLocalizedString(@"HockeyFeedbackListDeleteAllCancel")
|
||||
destructiveButtonTitle:BITHockeyLocalizedString(@"HockeyFeedbackListDeleteAllDelete")
|
||||
otherButtonTitles:nil
|
||||
];
|
||||
[deleteAction setActionSheetStyle:UIActionSheetStyleBlackTranslucent];
|
||||
[deleteAction showInView:self.view];
|
||||
[deleteAction release];
|
||||
if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad) {
|
||||
UIActionSheet *deleteAction = [[UIActionSheet alloc] initWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackListDeleteAllTitle")
|
||||
delegate:self
|
||||
cancelButtonTitle:BITHockeyLocalizedString(@"HockeyFeedbackListDeleteAllCancel")
|
||||
destructiveButtonTitle:BITHockeyLocalizedString(@"HockeyFeedbackListDeleteAllDelete")
|
||||
otherButtonTitles:nil
|
||||
];
|
||||
[deleteAction setActionSheetStyle:UIActionSheetStyleBlackTranslucent];
|
||||
[deleteAction showInView:self.view];
|
||||
[deleteAction release];
|
||||
} else {
|
||||
UIAlertView *deleteAction = [[UIAlertView alloc] initWithTitle:BITHockeyLocalizedString(@"HockeyFeedbackListButonDeleteAllMessages")
|
||||
message:BITHockeyLocalizedString(@"HockeyFeedbackListDeleteAllTitle")
|
||||
delegate:self
|
||||
cancelButtonTitle:BITHockeyLocalizedString(@"HockeyFeedbackListDeleteAllCancel")
|
||||
otherButtonTitles:BITHockeyLocalizedString(@"HockeyFeedbackListDeleteAllDelete"), nil];
|
||||
|
||||
[deleteAction show];
|
||||
[deleteAction release];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -480,6 +492,14 @@
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - UIAlertViewDelegate
|
||||
|
||||
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
|
||||
if (buttonIndex == [alertView firstOtherButtonIndex]) {
|
||||
[self deleteAllMessages];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - UIActionSheetDelegate
|
||||
|
||||
@ -489,4 +509,5 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
Loading…
x
Reference in New Issue
Block a user