Add button to copy document to Downloads folder

This commit is contained in:
Sebastian Wolf 2021-01-10 20:26:29 +01:00
parent d4935a4968
commit be2f08553b
No known key found for this signature in database
GPG key ID: CEA9522B5F38A90A
12 changed files with 79 additions and 12 deletions

View file

@ -41,9 +41,9 @@ Item {
if (documentData) {
if (documentData.document.local.is_downloading_completed) {
downloadDocumentButton.visible = false;
openDocumentButton.visible = true;
openDocumentArea.visible = true;
} else {
openDocumentButton.visible = false;
openDocumentArea.visible = false;
downloadDocumentButton.visible = true;
}
}
@ -57,7 +57,7 @@ Item {
downloadingProgressBar.visible = false;
documentData.document = fileInformation;
downloadDocumentButton.visible = false;
openDocumentButton.visible = true;
openDocumentArea.visible = true;
if (documentPreviewItem.openRequested) {
documentPreviewItem.openRequested = false;
tdLibWrapper.openFileOnDevice(documentData.document.local.path);
@ -95,17 +95,40 @@ Item {
anchors.centerIn: parent
}
Button {
id: openDocumentButton
preferredWidth: Theme.buttonWidthMedium
anchors.centerIn: parent
text: qsTr("Open Document")
Column {
id: openDocumentArea
visible: false
highlighted: documentPreviewItem.highlighted || down
onClicked: {
documentPreviewItem.openRequested = true;
tdLibWrapper.openFileOnDevice(documentData.document.local.path);
spacing: Theme.paddingMedium
width: parent.width
onVisibleChanged: {
visible ? (documentPreviewItem.height = openDocumentArea.height) : (documentPreviewItem.height = Theme.itemSizeLarge);
}
Button {
id: openDocumentButton
preferredWidth: Theme.buttonWidthMedium
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Open Document")
highlighted: documentPreviewItem.highlighted || down
onClicked: {
documentPreviewItem.openRequested = true;
tdLibWrapper.openFileOnDevice(documentData.document.local.path);
}
}
Button {
id: copyDocumentButton
preferredWidth: Theme.buttonWidthMedium
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Copy Document to Downloads")
highlighted: documentPreviewItem.highlighted || down
onClicked: {
tdLibWrapper.copyFileToDownloads(documentData.document.local.path);
}
}
}
}

View file

@ -492,6 +492,10 @@
<source>Open Document</source>
<translation>Dokument öffnen</translation>
</message>
<message>
<source>Copy Document to Downloads</source>
<translation>Dokument zu Downloads kopieren</translation>
</message>
</context>
<context>
<name>EditGroupChatPermissionsColumn</name>

View file

@ -492,6 +492,10 @@
<source>Open Document</source>
<translation>Open Document</translation>
</message>
<message>
<source>Copy Document to Downloads</source>
<translation>Copy Document to Downloads</translation>
</message>
</context>
<context>
<name>EditGroupChatPermissionsColumn</name>

View file

@ -482,6 +482,10 @@
<source>Open Document</source>
<translation>Abrir Documento</translation>
</message>
<message>
<source>Copy Document to Downloads</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditGroupChatPermissionsColumn</name>

View file

@ -493,6 +493,10 @@
<source>Open Document</source>
<translation>Avaa dokumentti</translation>
</message>
<message>
<source>Copy Document to Downloads</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditGroupChatPermissionsColumn</name>

View file

@ -482,6 +482,10 @@
<source>Open Document</source>
<translation>Dokumentum megyitása</translation>
</message>
<message>
<source>Copy Document to Downloads</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditGroupChatPermissionsColumn</name>

View file

@ -492,6 +492,10 @@
<source>Open Document</source>
<translation>Apri documento</translation>
</message>
<message>
<source>Copy Document to Downloads</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditGroupChatPermissionsColumn</name>

View file

@ -502,6 +502,10 @@
<source>Open Document</source>
<translation>Otwórz dokument</translation>
</message>
<message>
<source>Copy Document to Downloads</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditGroupChatPermissionsColumn</name>

View file

@ -502,6 +502,10 @@
<source>Open Document</source>
<translation>Открыть документ</translation>
</message>
<message>
<source>Copy Document to Downloads</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditGroupChatPermissionsColumn</name>

View file

@ -492,6 +492,10 @@
<source>Open Document</source>
<translation>Öppna dokument</translation>
</message>
<message>
<source>Copy Document to Downloads</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditGroupChatPermissionsColumn</name>

View file

@ -483,6 +483,10 @@
<source>Open Document</source>
<translation></translation>
</message>
<message>
<source>Copy Document to Downloads</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditGroupChatPermissionsColumn</name>

View file

@ -492,6 +492,10 @@
<source>Open Document</source>
<translation>Open Document</translation>
</message>
<message>
<source>Copy Document to Downloads</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditGroupChatPermissionsColumn</name>