mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Change media saving option strings
This commit is contained in:
@@ -6569,6 +6569,9 @@ Sorry for the inconvenience.";
|
|||||||
"Gallery.VideoSaved" = "Video Saved";
|
"Gallery.VideoSaved" = "Video Saved";
|
||||||
"Gallery.WaitForVideoDownoad" = "Please wait for the video to be fully downloaded.";
|
"Gallery.WaitForVideoDownoad" = "Please wait for the video to be fully downloaded.";
|
||||||
|
|
||||||
|
"Gallery.SaveImage" = "Save Image";
|
||||||
|
"Gallery.SaveVideo" = "Save Video";
|
||||||
|
|
||||||
"VoiceChat.VideoParticipantsLimitExceededExtended" = "The voice chat is over %@ members.\nNew participants only have access to audio stream. ";
|
"VoiceChat.VideoParticipantsLimitExceededExtended" = "The voice chat is over %@ members.\nNew participants only have access to audio stream. ";
|
||||||
|
|
||||||
"PlaybackSpeed.Title" = "Playback Speed";
|
"PlaybackSpeed.Title" = "Playback Speed";
|
||||||
|
|||||||
@@ -2089,7 +2089,7 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
|
|||||||
c.setItems(strongSelf.contextMenuSpeedItems())
|
c.setItems(strongSelf.contextMenuSpeedItems())
|
||||||
})))
|
})))
|
||||||
if let (message, maybeFile, _) = strongSelf.contentInfo(), let file = maybeFile {
|
if let (message, maybeFile, _) = strongSelf.contentInfo(), let file = maybeFile {
|
||||||
items.append(.action(ContextMenuActionItem(text: strongSelf.presentationData.strings.Gallery_SaveToGallery, icon: { theme in generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Download"), color: theme.actionSheet.primaryTextColor) }, action: { _, f in
|
items.append(.action(ContextMenuActionItem(text: strongSelf.presentationData.strings.Gallery_SaveVideo, icon: { theme in generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Download"), color: theme.actionSheet.primaryTextColor) }, action: { _, f in
|
||||||
f(.default)
|
f(.default)
|
||||||
|
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
|
|||||||
@@ -387,20 +387,22 @@ public final class ShareController: ViewController {
|
|||||||
break
|
break
|
||||||
case let .image(representations):
|
case let .image(representations):
|
||||||
if case .saveToCameraRoll = preferredAction {
|
if case .saveToCameraRoll = preferredAction {
|
||||||
self.defaultAction = ShareControllerAction(title: self.presentationData.strings.Preview_SaveToCameraRoll, action: { [weak self] in
|
self.defaultAction = ShareControllerAction(title: self.presentationData.strings.Gallery_SaveImage, action: { [weak self] in
|
||||||
self?.saveToCameraRoll(representations: representations)
|
self?.saveToCameraRoll(representations: representations)
|
||||||
self?.actionCompleted?()
|
self?.actionCompleted?()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
case let .media(mediaReference):
|
case let .media(mediaReference):
|
||||||
var canSave = false
|
var canSave = false
|
||||||
|
var isVideo = false
|
||||||
if mediaReference.media is TelegramMediaImage {
|
if mediaReference.media is TelegramMediaImage {
|
||||||
canSave = true
|
canSave = true
|
||||||
} else if mediaReference.media is TelegramMediaFile {
|
} else if let file = mediaReference.media as? TelegramMediaFile {
|
||||||
canSave = true
|
canSave = true
|
||||||
|
isVideo = file.isVideo
|
||||||
}
|
}
|
||||||
if case .saveToCameraRoll = preferredAction, canSave {
|
if case .saveToCameraRoll = preferredAction, canSave {
|
||||||
self.defaultAction = ShareControllerAction(title: self.presentationData.strings.Preview_SaveToCameraRoll, action: { [weak self] in
|
self.defaultAction = ShareControllerAction(title: isVideo ? self.presentationData.strings.Gallery_SaveVideo : self.presentationData.strings.Gallery_SaveImage, action: { [weak self] in
|
||||||
self?.saveToCameraRoll(mediaReference: mediaReference)
|
self?.saveToCameraRoll(mediaReference: mediaReference)
|
||||||
self?.actionCompleted?()
|
self?.actionCompleted?()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -955,8 +955,6 @@ final class ShareControllerNode: ViewControllerTracingNode, UIScrollViewDelegate
|
|||||||
}
|
}
|
||||||
if let status = status {
|
if let status = status {
|
||||||
contentNode.state = .progress(status)
|
contentNode.state = .progress(status)
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}, completed: { [weak self] in
|
}, completed: { [weak self] in
|
||||||
guard let strongSelf = self, let contentNode = strongSelf.contentNode as? ShareLoadingContainerNode else {
|
guard let strongSelf = self, let contentNode = strongSelf.contentNode as? ShareLoadingContainerNode else {
|
||||||
|
|||||||
@@ -615,17 +615,19 @@ func contextMenuForChatPresentationInterfaceState(chatPresentationInterfaceState
|
|||||||
}
|
}
|
||||||
if resourceAvailable, !message.containsSecretMedia {
|
if resourceAvailable, !message.containsSecretMedia {
|
||||||
var mediaReference: AnyMediaReference?
|
var mediaReference: AnyMediaReference?
|
||||||
|
var isVideo = false
|
||||||
for media in message.media {
|
for media in message.media {
|
||||||
if let image = media as? TelegramMediaImage, let _ = largestImageRepresentation(image.representations) {
|
if let image = media as? TelegramMediaImage, let _ = largestImageRepresentation(image.representations) {
|
||||||
mediaReference = ImageMediaReference.standalone(media: image).abstract
|
mediaReference = ImageMediaReference.standalone(media: image).abstract
|
||||||
break
|
break
|
||||||
} else if let file = media as? TelegramMediaFile, file.isVideo {
|
} else if let file = media as? TelegramMediaFile, file.isVideo {
|
||||||
mediaReference = FileMediaReference.standalone(media: file).abstract
|
mediaReference = FileMediaReference.standalone(media: file).abstract
|
||||||
|
isVideo = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let mediaReference = mediaReference {
|
if let mediaReference = mediaReference {
|
||||||
actions.append(.action(ContextMenuActionItem(text: chatPresentationInterfaceState.strings.Preview_SaveToCameraRoll, icon: { theme in
|
actions.append(.action(ContextMenuActionItem(text: isVideo ? chatPresentationInterfaceState.strings.Gallery_SaveVideo : chatPresentationInterfaceState.strings.Gallery_SaveImage, icon: { theme in
|
||||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Save"), color: theme.actionSheet.primaryTextColor)
|
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Save"), color: theme.actionSheet.primaryTextColor)
|
||||||
}, action: { _, f in
|
}, action: { _, f in
|
||||||
let _ = (saveToCameraRoll(context: context, postbox: context.account.postbox, mediaReference: mediaReference)
|
let _ = (saveToCameraRoll(context: context, postbox: context.account.postbox, mediaReference: mediaReference)
|
||||||
|
|||||||
Reference in New Issue
Block a user