Try to fix video page (without refactoring ;))

This commit is contained in:
Sebastian Wolf 2021-02-03 23:12:24 +01:00
parent 31ee65fc98
commit 40fea18a46
No known key found for this signature in database
GPG key ID: CEA9522B5F38A90A
16 changed files with 65 additions and 58 deletions

View file

@ -218,7 +218,7 @@ MessageContentBase {
highlighted: videoMessageComponent.highlighted || down
visible: ( placeholderImage.status === Image.Ready && !videoMessageComponent.fullscreen ) ? true : false
onClicked: {
pageStack.push(Qt.resolvedUrl("../../pages/VideoPage.qml"), {"videoData": videoData});
pageStack.push(Qt.resolvedUrl("../../pages/VideoPage.qml"), {"videoData": videoData, "sourceMessage": rawMessage});
}
}
}
@ -464,7 +464,7 @@ MessageContentBase {
}
visible: ( videoComponentLoader.active && messageVideo.playbackState === MediaPlayer.PausedState ) ? true : false
onClicked: {
pageStack.push(Qt.resolvedUrl("../../pages/VideoPage.qml"), {"videoData": videoData});
pageStack.push(Qt.resolvedUrl("../../pages/VideoPage.qml"), {"videoData": videoData, "sourceMessage": rawMessage});
}
}
}

View file

@ -20,13 +20,18 @@ import QtQuick 2.6
import Sailfish.Silica 1.0
import QtMultimedia 5.6
import "../components"
import "../components/messageContent"
import "../js/functions.js" as Functions
import "../js/debug.js" as Debug
Page {
id: videoPage
allowedOrientations: Orientation.All
property var videoData;
property alias videoType: myVideoComponent.videoType
property alias isVideoNote: myVideoComponent.isVideoNote
property var sourceMessage;
property int videoWidth : videoData.width
property int videoHeight : videoData.height
@ -42,8 +47,8 @@ Page {
function updateVideoData() {
if (typeof videoData === "object") {
if (videoData.video.local.is_downloading_completed) {
videoPage.videoUrl = videoData.video.local.path;
if (videoData[videoType].local.is_downloading_completed) {
videoPage.videoUrl = videoData[videoType].local.path;
}
}
}
@ -55,7 +60,7 @@ Page {
id: videoPagePullDownMenu
visible: (videoPage.videoUrl !== "")
MenuItem {
text: qsTr("Download Video")
text: qsTr("Copy video to gallery")
onClicked: {
tdLibWrapper.copyFileToDownloads(videoPage.videoUrl);
}
@ -65,9 +70,8 @@ Page {
Connections {
target: tdLibWrapper
onFileUpdated: {
if (fileId === videoPage.video.id) {
if (fileId === videoPage.videoData[videoType].id) {
if (fileInformation.local.is_downloading_completed) {
videoPage.video = fileInformation;
videoPage.videoUrl = fileInformation.local.path;
videoPagePullDownMenu.visible = true;
}
@ -87,10 +91,13 @@ Page {
height: videoPage.videoHeight * videoPage.sizingFactor
anchors.centerIn: parent
VideoPreview {
MessageVideo {
id: myVideoComponent
videoData: videoPage.videoData
fullscreen: true
onScreen: videoPage.status === PageStatus.Active
rawMessage: sourceMessage
anchors.fill: parent
}
}

View file

@ -12,7 +12,7 @@ Name: harbour-fernschreiber
Summary: Fernschreiber is a Telegram client for Sailfish OS
Version: 0.7
Release: 2
Release: 3
Group: Qt/Qt
License: LICENSE
URL: http://werkwolf.eu/

View file

@ -1,7 +1,7 @@
Name: harbour-fernschreiber
Summary: Fernschreiber is a Telegram client for Sailfish OS
Version: 0.7
Release: 2
Release: 3
# The contents of the Group field should be one of the groups listed here:
# https://github.com/mer-tools/spectacle/blob/master/data/GROUPS
Group: Qt/Qt

View file

@ -1664,10 +1664,6 @@
</context>
<context>
<name>VideoPage</name>
<message>
<source>Download Video</source>
<translation>Video herunterladen</translation>
</message>
<message>
<source>Download of %1 successful.</source>
<translation>Download von %1 erfolgreich.</translation>
@ -1676,6 +1672,10 @@
<source>Download failed.</source>
<translation>Download fehlgeschlagen.</translation>
</message>
<message>
<source>Copy video to gallery</source>
<translation>Video in die Galerie kopieren</translation>
</message>
</context>
<context>
<name>VoiceNoteOverlay</name>

View file

@ -1664,10 +1664,6 @@
</context>
<context>
<name>VideoPage</name>
<message>
<source>Download Video</source>
<translation>Download Video</translation>
</message>
<message>
<source>Download of %1 successful.</source>
<translation>Download of %1 successful.</translation>
@ -1676,6 +1672,10 @@
<source>Download failed.</source>
<translation>Download failed.</translation>
</message>
<message>
<source>Copy video to gallery</source>
<translation>Copy video to gallery</translation>
</message>
</context>
<context>
<name>VoiceNoteOverlay</name>

View file

@ -1664,10 +1664,6 @@
</context>
<context>
<name>VideoPage</name>
<message>
<source>Download Video</source>
<translation>Bajar Vídeo</translation>
</message>
<message>
<source>Download of %1 successful.</source>
<translation>Bajada de %1 exitosa.</translation>
@ -1676,6 +1672,10 @@
<source>Download failed.</source>
<translation>Error al bajar</translation>
</message>
<message>
<source>Copy video to gallery</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VoiceNoteOverlay</name>

View file

@ -1665,10 +1665,6 @@
</context>
<context>
<name>VideoPage</name>
<message>
<source>Download Video</source>
<translation>Lataa video</translation>
</message>
<message>
<source>Download of %1 successful.</source>
<translation>Videon %1 lataus onnistui.</translation>
@ -1677,6 +1673,10 @@
<source>Download failed.</source>
<translation>Lataus epäonnistui.</translation>
</message>
<message>
<source>Copy video to gallery</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VoiceNoteOverlay</name>

View file

@ -1637,10 +1637,6 @@
</context>
<context>
<name>VideoPage</name>
<message>
<source>Download Video</source>
<translation>Videó letöltése</translation>
</message>
<message>
<source>Download of %1 successful.</source>
<translation>A %1 letöltése sikerült.</translation>
@ -1649,6 +1645,10 @@
<source>Download failed.</source>
<translation>A letöltés nem sikerült.</translation>
</message>
<message>
<source>Copy video to gallery</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VoiceNoteOverlay</name>

View file

@ -1664,10 +1664,6 @@
</context>
<context>
<name>VideoPage</name>
<message>
<source>Download Video</source>
<translation>Scarica video</translation>
</message>
<message>
<source>Download of %1 successful.</source>
<translation>Download di %1 completato.</translation>
@ -1676,6 +1672,10 @@
<source>Download failed.</source>
<translation>Download non riuscito.</translation>
</message>
<message>
<source>Copy video to gallery</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VoiceNoteOverlay</name>

View file

@ -1691,10 +1691,6 @@
</context>
<context>
<name>VideoPage</name>
<message>
<source>Download Video</source>
<translation>Pobierz film</translation>
</message>
<message>
<source>Download of %1 successful.</source>
<translation>Pobieranie %1 zakończone sukcesem</translation>
@ -1703,6 +1699,10 @@
<source>Download failed.</source>
<translation>Nieudane pobieranie</translation>
</message>
<message>
<source>Copy video to gallery</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VoiceNoteOverlay</name>

View file

@ -1691,10 +1691,6 @@
</context>
<context>
<name>VideoPage</name>
<message>
<source>Download Video</source>
<translation>Скачать видео</translation>
</message>
<message>
<source>Download of %1 successful.</source>
<translation>Успешно скачано %1.</translation>
@ -1703,6 +1699,10 @@
<source>Download failed.</source>
<translation>Ошибка скачивания.</translation>
</message>
<message>
<source>Copy video to gallery</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VoiceNoteOverlay</name>

View file

@ -1691,10 +1691,6 @@
</context>
<context>
<name>VideoPage</name>
<message>
<source>Download Video</source>
<translation>Sťahovať video</translation>
</message>
<message>
<source>Download of %1 successful.</source>
<translation>Sťahovanie %1 bolo úspešné.</translation>
@ -1703,6 +1699,10 @@
<source>Download failed.</source>
<translation>Sťahovanie zlyhalo.</translation>
</message>
<message>
<source>Copy video to gallery</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VoiceNoteOverlay</name>

View file

@ -1664,10 +1664,6 @@
</context>
<context>
<name>VideoPage</name>
<message>
<source>Download Video</source>
<translation>Ladda ner video</translation>
</message>
<message>
<source>Download of %1 successful.</source>
<translation>Nerladdning av %1 slutförd.</translation>
@ -1676,6 +1672,10 @@
<source>Download failed.</source>
<translation>Nerladdning misslyckades.</translation>
</message>
<message>
<source>Copy video to gallery</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VoiceNoteOverlay</name>

View file

@ -1637,10 +1637,6 @@
</context>
<context>
<name>VideoPage</name>
<message>
<source>Download Video</source>
<translation></translation>
</message>
<message>
<source>Download of %1 successful.</source>
<translation> %1 </translation>
@ -1649,6 +1645,10 @@
<source>Download failed.</source>
<translation></translation>
</message>
<message>
<source>Copy video to gallery</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VoiceNoteOverlay</name>

View file

@ -1664,10 +1664,6 @@
</context>
<context>
<name>VideoPage</name>
<message>
<source>Download Video</source>
<translation>Download Video</translation>
</message>
<message>
<source>Download of %1 successful.</source>
<translation>Download of %1 successful.</translation>
@ -1676,6 +1672,10 @@
<source>Download failed.</source>
<translation>Download failed.</translation>
</message>
<message>
<source>Copy video to gallery</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VoiceNoteOverlay</name>