Add copy link to Feedback UI

This commit is contained in:
Andreas Linde 2012-10-18 01:08:16 +02:00
parent 3383f3a657
commit 423bc7ece7
15 changed files with 153 additions and 87 deletions

View File

@ -477,6 +477,35 @@
}
#pragma mark - BITAttributedLabelDelegate
- (void)attributedLabel:(BITAttributedLabel *)label didSelectLinkWithURL:(NSURL *)url {
if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad) {
UIActionSheet *linkAction = [[UIActionSheet alloc] initWithTitle:[url absoluteString]
delegate:self
cancelButtonTitle:BITHockeyLocalizedString(@"HockeyFeedbackListLinkActionCancel")
destructiveButtonTitle:nil
otherButtonTitles:BITHockeyLocalizedString(@"HockeyFeedbackListLinkActionOpen"), BITHockeyLocalizedString(@"HockeyFeedbackListLinkActionCopy"), nil
];
[linkAction setTag:1];
[linkAction setActionSheetStyle:UIActionSheetStyleBlackTranslucent];
[linkAction showInView:self.view];
[linkAction release];
} else {
UIAlertView *linkAction = [[UIAlertView alloc] initWithTitle:[url absoluteString]
message:nil
delegate:self
cancelButtonTitle:BITHockeyLocalizedString(@"HockeyFeedbackListLinkActionCancel")
otherButtonTitles:BITHockeyLocalizedString(@"HockeyFeedbackListLinkActionOpen"), BITHockeyLocalizedString(@"HockeyFeedbackListLinkActionCopy"), nil
];
[linkAction setTag:1];
[linkAction show];
[linkAction release];
}
}
#pragma mark - UIAlertViewDelegate
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
@ -489,7 +518,12 @@
[self deleteAllMessages];
}
} else {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:alertView.title]];
if (buttonIndex == [alertView firstOtherButtonIndex]) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:alertView.title]];
} else {
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
pasteboard.URL = [NSURL URLWithString:alertView.title];
}
}
}
@ -506,35 +540,12 @@
[self deleteAllMessages];
}
} else {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:actionSheet.title]];
}
}
#pragma mark - BITAttributedLabelDelegate
- (void)attributedLabel:(BITAttributedLabel *)label didSelectLinkWithURL:(NSURL *)url {
if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad) {
UIActionSheet *linkAction = [[UIActionSheet alloc] initWithTitle:[url absoluteString]
delegate:self
cancelButtonTitle:BITHockeyLocalizedString(@"HockeyFeedbackListCancelOpenLink")
destructiveButtonTitle:nil
otherButtonTitles:BITHockeyLocalizedString(@"HockeyFeedbackListOpenLinkInSafari"), nil
];
[linkAction setTag:1];
[linkAction setActionSheetStyle:UIActionSheetStyleBlackTranslucent];
[linkAction showInView:self.view];
[linkAction release];
} else {
UIAlertView *linkAction = [[UIAlertView alloc] initWithTitle:[url absoluteString]
message:nil
delegate:self
cancelButtonTitle:BITHockeyLocalizedString(@"HockeyFeedbackListCancelOpenLink")
otherButtonTitles:BITHockeyLocalizedString(@"HockeyFeedbackListOpenLinkInSafari"), nil];
[linkAction setTag:1];
[linkAction show];
[linkAction release];
if (buttonIndex == [actionSheet destructiveButtonIndex]) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:actionSheet.title]];
} else {
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
pasteboard.URL = [NSURL URLWithString:actionSheet.title];
}
}
}

View File

@ -177,13 +177,16 @@
"HockeyFeedbackListDeleteAllCancel" = "Cancel";
/* Open Link In Safari Action Sheet / Alert View */
/* Open/Copy Link In Safari Action Sheet / Alert View */
/* Title for the Action Sheet */
"HockeyFeedbackListCancelOpenLink" = "Cancel";
/* Button Title to cancel */
"HockeyFeedbackListLinkActionCancel" = "Cancel";
/* Title for the Action Sheet */
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
/* Button Title to Open the Link */
"HockeyFeedbackListLinkActionOpen" = "Open";
/* Button Title to Copy the Link */
"HockeyFeedbackListLinkActionCopy" = "Copy";
/* UIActivity */

View File

@ -176,11 +176,15 @@
/* Open Link In Safari Action Sheet / Alert View */
/* Title for the Action Sheet */
"HockeyFeedbackListCancelOpenLink" = "Cancel";
/* Button Title to cancel */
"HockeyFeedbackListLinkActionCancel" = "Cancel";
/* Button Title to Open the Link */
"HockeyFeedbackListLinkActionOpen" = "Open";
/* Button Title to Copy the Link */
"HockeyFeedbackListLinkActionCopy" = "Copy";
/* Title for the Action Sheet */
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
/* UIActivity */

View File

@ -177,11 +177,15 @@
/* Open Link In Safari Action Sheet / Alert View */
/* Title for the Action Sheet */
"HockeyFeedbackListCancelOpenLink" = "Cancel";
/* Button Title to cancel */
"HockeyFeedbackListLinkActionCancel" = "Cancel";
/* Button Title to Open the Link */
"HockeyFeedbackListLinkActionOpen" = "Open";
/* Button Title to Copy the Link */
"HockeyFeedbackListLinkActionCopy" = "Copy";
/* Title for the Action Sheet */
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
/* UIActivity */

View File

@ -177,11 +177,15 @@
/* Open Link In Safari Action Sheet / Alert View */
/* Title for the Action Sheet */
"HockeyFeedbackListCancelOpenLink" = "Cancel";
/* Button Title to cancel */
"HockeyFeedbackListLinkActionCancel" = "Cancel";
/* Button Title to Open the Link */
"HockeyFeedbackListLinkActionOpen" = "Open";
/* Button Title to Copy the Link */
"HockeyFeedbackListLinkActionCopy" = "Copy";
/* Title for the Action Sheet */
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
/* UIActivity */

View File

@ -177,11 +177,15 @@
/* Open Link In Safari Action Sheet / Alert View */
/* Title for the Action Sheet */
"HockeyFeedbackListCancelOpenLink" = "Cancel";
/* Button Title to cancel */
"HockeyFeedbackListLinkActionCancel" = "Cancel";
/* Button Title to Open the Link */
"HockeyFeedbackListLinkActionOpen" = "Open";
/* Button Title to Copy the Link */
"HockeyFeedbackListLinkActionCopy" = "Copy";
/* Title for the Action Sheet */
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
/* UIActivity */

View File

@ -177,11 +177,15 @@
/* Open Link In Safari Action Sheet / Alert View */
/* Title for the Action Sheet */
"HockeyFeedbackListCancelOpenLink" = "Cancel";
/* Button Title to cancel */
"HockeyFeedbackListLinkActionCancel" = "Cancel";
/* Button Title to Open the Link */
"HockeyFeedbackListLinkActionOpen" = "Open";
/* Button Title to Copy the Link */
"HockeyFeedbackListLinkActionCopy" = "Copy";
/* Title for the Action Sheet */
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
/* UIActivity */

View File

@ -177,11 +177,15 @@
/* Open Link In Safari Action Sheet / Alert View */
/* Title for the Action Sheet */
"HockeyFeedbackListCancelOpenLink" = "Cancel";
/* Button Title to cancel */
"HockeyFeedbackListLinkActionCancel" = "Cancel";
/* Button Title to Open the Link */
"HockeyFeedbackListLinkActionOpen" = "Open";
/* Button Title to Copy the Link */
"HockeyFeedbackListLinkActionCopy" = "Copy";
/* Title for the Action Sheet */
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
/* UIActivity */

View File

@ -177,11 +177,15 @@
/* Open Link In Safari Action Sheet / Alert View */
/* Title for the Action Sheet */
"HockeyFeedbackListCancelOpenLink" = "Cancel";
/* Button Title to cancel */
"HockeyFeedbackListLinkActionCancel" = "Cancel";
/* Button Title to Open the Link */
"HockeyFeedbackListLinkActionOpen" = "Open";
/* Button Title to Copy the Link */
"HockeyFeedbackListLinkActionCopy" = "Copy";
/* Title for the Action Sheet */
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
/* UIActivity */

View File

@ -177,11 +177,15 @@
/* Open Link In Safari Action Sheet / Alert View */
/* Title for the Action Sheet */
"HockeyFeedbackListCancelOpenLink" = "Cancel";
/* Button Title to cancel */
"HockeyFeedbackListLinkActionCancel" = "Cancel";
/* Button Title to Open the Link */
"HockeyFeedbackListLinkActionOpen" = "Open";
/* Button Title to Copy the Link */
"HockeyFeedbackListLinkActionCopy" = "Copy";
/* Title for the Action Sheet */
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
/* UIActivity */

View File

@ -177,11 +177,15 @@
/* Open Link In Safari Action Sheet / Alert View */
/* Title for the Action Sheet */
"HockeyFeedbackListCancelOpenLink" = "Cancel";
/* Button Title to cancel */
"HockeyFeedbackListLinkActionCancel" = "Cancel";
/* Button Title to Open the Link */
"HockeyFeedbackListLinkActionOpen" = "Open";
/* Button Title to Copy the Link */
"HockeyFeedbackListLinkActionCopy" = "Copy";
/* Title for the Action Sheet */
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
/* UIActivity */

View File

@ -177,11 +177,15 @@
/* Open Link In Safari Action Sheet / Alert View */
/* Title for the Action Sheet */
"HockeyFeedbackListCancelOpenLink" = "Cancel";
/* Button Title to cancel */
"HockeyFeedbackListLinkActionCancel" = "Cancel";
/* Button Title to Open the Link */
"HockeyFeedbackListLinkActionOpen" = "Open";
/* Button Title to Copy the Link */
"HockeyFeedbackListLinkActionCopy" = "Copy";
/* Title for the Action Sheet */
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
/* UIActivity */

View File

@ -177,11 +177,15 @@
/* Open Link In Safari Action Sheet / Alert View */
/* Title for the Action Sheet */
"HockeyFeedbackListCancelOpenLink" = "Cancel";
/* Button Title to cancel */
"HockeyFeedbackListLinkActionCancel" = "Cancel";
/* Button Title to Open the Link */
"HockeyFeedbackListLinkActionOpen" = "Open";
/* Button Title to Copy the Link */
"HockeyFeedbackListLinkActionCopy" = "Copy";
/* Title for the Action Sheet */
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
/* UIActivity */

View File

@ -177,11 +177,15 @@
/* Open Link In Safari Action Sheet / Alert View */
/* Title for the Action Sheet */
"HockeyFeedbackListCancelOpenLink" = "Cancel";
/* Button Title to cancel */
"HockeyFeedbackListLinkActionCancel" = "Cancel";
/* Button Title to Open the Link */
"HockeyFeedbackListLinkActionOpen" = "Open";
/* Button Title to Copy the Link */
"HockeyFeedbackListLinkActionCopy" = "Copy";
/* Title for the Action Sheet */
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
/* UIActivity */

View File

@ -177,11 +177,15 @@
/* Open Link In Safari Action Sheet / Alert View */
/* Title for the Action Sheet */
"HockeyFeedbackListCancelOpenLink" = "Cancel";
/* Button Title to cancel */
"HockeyFeedbackListLinkActionCancel" = "Cancel";
/* Button Title to Open the Link */
"HockeyFeedbackListLinkActionOpen" = "Open";
/* Button Title to Copy the Link */
"HockeyFeedbackListLinkActionCopy" = "Copy";
/* Title for the Action Sheet */
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
/* UIActivity */