From 40fea18a46e94758b84b66f8baa604c6cce164df Mon Sep 17 00:00:00 2001 From: Sebastian Wolf Date: Wed, 3 Feb 2021 23:12:24 +0100 Subject: [PATCH] Try to fix video page (without refactoring ;)) --- .../messageContent/MessageVideo.qml | 4 ++-- qml/pages/VideoPage.qml | 19 +++++++++++++------ rpm/harbour-fernschreiber.spec | 2 +- rpm/harbour-fernschreiber.yaml | 2 +- translations/harbour-fernschreiber-de.ts | 8 ++++---- translations/harbour-fernschreiber-en.ts | 8 ++++---- translations/harbour-fernschreiber-es.ts | 8 ++++---- translations/harbour-fernschreiber-fi.ts | 8 ++++---- translations/harbour-fernschreiber-hu.ts | 8 ++++---- translations/harbour-fernschreiber-it.ts | 8 ++++---- translations/harbour-fernschreiber-pl.ts | 8 ++++---- translations/harbour-fernschreiber-ru.ts | 8 ++++---- translations/harbour-fernschreiber-sk.ts | 8 ++++---- translations/harbour-fernschreiber-sv.ts | 8 ++++---- translations/harbour-fernschreiber-zh_CN.ts | 8 ++++---- translations/harbour-fernschreiber.ts | 8 ++++---- 16 files changed, 65 insertions(+), 58 deletions(-) diff --git a/qml/components/messageContent/MessageVideo.qml b/qml/components/messageContent/MessageVideo.qml index 2ee9ec4..b7f0d54 100644 --- a/qml/components/messageContent/MessageVideo.qml +++ b/qml/components/messageContent/MessageVideo.qml @@ -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}); } } } diff --git a/qml/pages/VideoPage.qml b/qml/pages/VideoPage.qml index ee4922d..c3089af 100644 --- a/qml/pages/VideoPage.qml +++ b/qml/pages/VideoPage.qml @@ -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 } } diff --git a/rpm/harbour-fernschreiber.spec b/rpm/harbour-fernschreiber.spec index 288d1de..cf08d73 100644 --- a/rpm/harbour-fernschreiber.spec +++ b/rpm/harbour-fernschreiber.spec @@ -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/ diff --git a/rpm/harbour-fernschreiber.yaml b/rpm/harbour-fernschreiber.yaml index 32ac71a..ce19853 100644 --- a/rpm/harbour-fernschreiber.yaml +++ b/rpm/harbour-fernschreiber.yaml @@ -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 diff --git a/translations/harbour-fernschreiber-de.ts b/translations/harbour-fernschreiber-de.ts index 3d23001..e48ffc1 100644 --- a/translations/harbour-fernschreiber-de.ts +++ b/translations/harbour-fernschreiber-de.ts @@ -1664,10 +1664,6 @@ VideoPage - - Download Video - Video herunterladen - Download of %1 successful. Download von %1 erfolgreich. @@ -1676,6 +1672,10 @@ Download failed. Download fehlgeschlagen. + + Copy video to gallery + Video in die Galerie kopieren + VoiceNoteOverlay diff --git a/translations/harbour-fernschreiber-en.ts b/translations/harbour-fernschreiber-en.ts index e37a4f8..f565fee 100644 --- a/translations/harbour-fernschreiber-en.ts +++ b/translations/harbour-fernschreiber-en.ts @@ -1664,10 +1664,6 @@ VideoPage - - Download Video - Download Video - Download of %1 successful. Download of %1 successful. @@ -1676,6 +1672,10 @@ Download failed. Download failed. + + Copy video to gallery + Copy video to gallery + VoiceNoteOverlay diff --git a/translations/harbour-fernschreiber-es.ts b/translations/harbour-fernschreiber-es.ts index 1c03de4..db93556 100644 --- a/translations/harbour-fernschreiber-es.ts +++ b/translations/harbour-fernschreiber-es.ts @@ -1664,10 +1664,6 @@ VideoPage - - Download Video - Bajar Vídeo - Download of %1 successful. Bajada de %1 exitosa. @@ -1676,6 +1672,10 @@ Download failed. Error al bajar + + Copy video to gallery + + VoiceNoteOverlay diff --git a/translations/harbour-fernschreiber-fi.ts b/translations/harbour-fernschreiber-fi.ts index ab59784..f9b573e 100644 --- a/translations/harbour-fernschreiber-fi.ts +++ b/translations/harbour-fernschreiber-fi.ts @@ -1665,10 +1665,6 @@ VideoPage - - Download Video - Lataa video - Download of %1 successful. Videon %1 lataus onnistui. @@ -1677,6 +1673,10 @@ Download failed. Lataus epäonnistui. + + Copy video to gallery + + VoiceNoteOverlay diff --git a/translations/harbour-fernschreiber-hu.ts b/translations/harbour-fernschreiber-hu.ts index 3cf3ffd..4fb69dd 100644 --- a/translations/harbour-fernschreiber-hu.ts +++ b/translations/harbour-fernschreiber-hu.ts @@ -1637,10 +1637,6 @@ VideoPage - - Download Video - Videó letöltése - Download of %1 successful. A %1 letöltése sikerült. @@ -1649,6 +1645,10 @@ Download failed. A letöltés nem sikerült. + + Copy video to gallery + + VoiceNoteOverlay diff --git a/translations/harbour-fernschreiber-it.ts b/translations/harbour-fernschreiber-it.ts index c7b1f48..ba88914 100644 --- a/translations/harbour-fernschreiber-it.ts +++ b/translations/harbour-fernschreiber-it.ts @@ -1664,10 +1664,6 @@ VideoPage - - Download Video - Scarica video - Download of %1 successful. Download di %1 completato. @@ -1676,6 +1672,10 @@ Download failed. Download non riuscito. + + Copy video to gallery + + VoiceNoteOverlay diff --git a/translations/harbour-fernschreiber-pl.ts b/translations/harbour-fernschreiber-pl.ts index ea0cef3..2fc370f 100644 --- a/translations/harbour-fernschreiber-pl.ts +++ b/translations/harbour-fernschreiber-pl.ts @@ -1691,10 +1691,6 @@ VideoPage - - Download Video - Pobierz film - Download of %1 successful. Pobieranie %1 zakończone sukcesem @@ -1703,6 +1699,10 @@ Download failed. Nieudane pobieranie + + Copy video to gallery + + VoiceNoteOverlay diff --git a/translations/harbour-fernschreiber-ru.ts b/translations/harbour-fernschreiber-ru.ts index 0148249..1b268e7 100644 --- a/translations/harbour-fernschreiber-ru.ts +++ b/translations/harbour-fernschreiber-ru.ts @@ -1691,10 +1691,6 @@ VideoPage - - Download Video - Скачать видео - Download of %1 successful. Успешно скачано %1. @@ -1703,6 +1699,10 @@ Download failed. Ошибка скачивания. + + Copy video to gallery + + VoiceNoteOverlay diff --git a/translations/harbour-fernschreiber-sk.ts b/translations/harbour-fernschreiber-sk.ts index 8a0a3ac..5406d12 100644 --- a/translations/harbour-fernschreiber-sk.ts +++ b/translations/harbour-fernschreiber-sk.ts @@ -1691,10 +1691,6 @@ VideoPage - - Download Video - Sťahovať video - Download of %1 successful. Sťahovanie %1 bolo úspešné. @@ -1703,6 +1699,10 @@ Download failed. Sťahovanie zlyhalo. + + Copy video to gallery + + VoiceNoteOverlay diff --git a/translations/harbour-fernschreiber-sv.ts b/translations/harbour-fernschreiber-sv.ts index c10829f..15f2fd3 100644 --- a/translations/harbour-fernschreiber-sv.ts +++ b/translations/harbour-fernschreiber-sv.ts @@ -1664,10 +1664,6 @@ VideoPage - - Download Video - Ladda ner video - Download of %1 successful. Nerladdning av %1 slutförd. @@ -1676,6 +1672,10 @@ Download failed. Nerladdning misslyckades. + + Copy video to gallery + + VoiceNoteOverlay diff --git a/translations/harbour-fernschreiber-zh_CN.ts b/translations/harbour-fernschreiber-zh_CN.ts index 1c57c59..5a0416d 100644 --- a/translations/harbour-fernschreiber-zh_CN.ts +++ b/translations/harbour-fernschreiber-zh_CN.ts @@ -1637,10 +1637,6 @@ VideoPage - - Download Video - 下载视频 - Download of %1 successful. 已成功下载 %1 。 @@ -1649,6 +1645,10 @@ Download failed. 下载失败 + + Copy video to gallery + + VoiceNoteOverlay diff --git a/translations/harbour-fernschreiber.ts b/translations/harbour-fernschreiber.ts index 40662b9..a87b35c 100644 --- a/translations/harbour-fernschreiber.ts +++ b/translations/harbour-fernschreiber.ts @@ -1664,10 +1664,6 @@ VideoPage - - Download Video - Download Video - Download of %1 successful. Download of %1 successful. @@ -1676,6 +1672,10 @@ Download failed. Download failed. + + Copy video to gallery + + VoiceNoteOverlay