Skip to content

Commit

Permalink
[foilpics] Support for out-of-process sharing
Browse files Browse the repository at this point in the history
  • Loading branch information
monich committed Oct 24, 2021
1 parent d5d7081 commit 33724fb
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 2 deletions.
21 changes: 19 additions & 2 deletions qml/GalleryFullscreenPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Page {
property var currentImageItem: model ? model.get(currentIndex) : null

readonly property string _sharingApiVersion: HarbourSystemInfo.packageVersion("declarative-transferengine-qt5")
readonly property bool _sharingBroken: HarbourSystemInfo.compareVersions(_sharingApiVersion, "0.4.0") >= 0 // QML API break
readonly property bool _sailfishShare: HarbourSystemInfo.compareVersions(_sharingApiVersion, "0.4.0") >= 0 // QML API break

signal encryptItem(int index)
signal deleteItem(int index)
Expand Down Expand Up @@ -84,6 +84,23 @@ Page {
text: qsTrId("foilpics-menu-delete")
onClicked: page.deleteItem(page.currentIndex)
}
MenuItem {
//: Generic menu item
//% "Share"
text: qsTrId("foilpics-menu-share")
visible: _sailfishShare
onClicked: {
if (!shareAction) {
shareAction = Qt.createQmlObject("import Sailfish.Share 1.0;ShareAction {}",
page, "SailfishShare")
}
if (shareAction) {
shareAction.resources = [ currentImageItem.url ]
shareAction.trigger()
}
}
property var shareAction
}
MenuItem {
//: Generic menu item
//% "Encrypt"
Expand Down Expand Up @@ -129,7 +146,7 @@ Page {

background: Loader {
anchors.fill: parent
sourceComponent: _sharingBroken ? detailsBackgroundComponent : sharingBackgroundComponent
sourceComponent: _sailfishShare ? detailsBackgroundComponent : sharingBackgroundComponent
}

foreground: FlickableImageView {
Expand Down
5 changes: 5 additions & 0 deletions translations/harbour-foilpics-de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<extracomment>Application title</extracomment>
<translation>Foil Pics</translation>
</message>
<message id="foilpics-menu-share">
<source>Share</source>
<extracomment>Generic menu item</extracomment>
<translation type="unfinished">Teilen</translation>
</message>
<message id="foilpics-menu-details">
<source>Image details</source>
<extracomment>Generic menu item</extracomment>
Expand Down
5 changes: 5 additions & 0 deletions translations/harbour-foilpics-es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<extracomment>Application title</extracomment>
<translation>Foil Pics</translation>
</message>
<message id="foilpics-menu-share">
<source>Share</source>
<extracomment>Generic menu item</extracomment>
<translation type="unfinished">Compartir</translation>
</message>
<message id="foilpics-menu-details">
<source>Image details</source>
<extracomment>Generic menu item</extracomment>
Expand Down
5 changes: 5 additions & 0 deletions translations/harbour-foilpics-fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<extracomment>Application title</extracomment>
<translation>Foil Pics</translation>
</message>
<message id="foilpics-menu-share">
<source>Share</source>
<extracomment>Generic menu item</extracomment>
<translation type="unfinished">Partager</translation>
</message>
<message id="foilpics-menu-details">
<source>Image details</source>
<extracomment>Generic menu item</extracomment>
Expand Down
5 changes: 5 additions & 0 deletions translations/harbour-foilpics-hu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<extracomment>Application title</extracomment>
<translation>Foil Pics</translation>
</message>
<message id="foilpics-menu-share">
<source>Share</source>
<extracomment>Generic menu item</extracomment>
<translation type="unfinished">Megosztás</translation>
</message>
<message id="foilpics-menu-details">
<source>Image details</source>
<extracomment>Generic menu item</extracomment>
Expand Down
5 changes: 5 additions & 0 deletions translations/harbour-foilpics-nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<extracomment>Application title</extracomment>
<translation>Foil Pics</translation>
</message>
<message id="foilpics-menu-share">
<source>Share</source>
<extracomment>Generic menu item</extracomment>
<translation type="unfinished">Delen</translation>
</message>
<message id="foilpics-menu-details">
<source>Image details</source>
<extracomment>Generic menu item</extracomment>
Expand Down
5 changes: 5 additions & 0 deletions translations/harbour-foilpics-pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<extracomment>Application title</extracomment>
<translation>Foil Pics</translation>
</message>
<message id="foilpics-menu-share">
<source>Share</source>
<extracomment>Generic menu item</extracomment>
<translation type="unfinished">Udostępnij</translation>
</message>
<message id="foilpics-menu-details">
<source>Image details</source>
<extracomment>Generic menu item</extracomment>
Expand Down
5 changes: 5 additions & 0 deletions translations/harbour-foilpics-ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<extracomment>Application title</extracomment>
<translation>Foil Pics</translation>
</message>
<message id="foilpics-menu-share">
<source>Share</source>
<extracomment>Generic menu item</extracomment>
<translation>Поделиться</translation>
</message>
<message id="foilpics-menu-details">
<source>Image details</source>
<extracomment>Generic menu item</extracomment>
Expand Down
5 changes: 5 additions & 0 deletions translations/harbour-foilpics-sv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<extracomment>Application title</extracomment>
<translation>Foil Pics</translation>
</message>
<message id="foilpics-menu-share">
<source>Share</source>
<extracomment>Generic menu item</extracomment>
<translation type="unfinished">Dela</translation>
</message>
<message id="foilpics-menu-details">
<source>Image details</source>
<extracomment>Generic menu item</extracomment>
Expand Down
5 changes: 5 additions & 0 deletions translations/harbour-foilpics-zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<extracomment>Application title</extracomment>
<translation>Foil Pics</translation>
</message>
<message id="foilpics-menu-share">
<source>Share</source>
<extracomment>Generic menu item</extracomment>
<translation type="unfinished">分享</translation>
</message>
<message id="foilpics-menu-details">
<source>Image details</source>
<extracomment>Generic menu item</extracomment>
Expand Down
5 changes: 5 additions & 0 deletions translations/harbour-foilpics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<extracomment>Application title</extracomment>
<translation>Foil Pics</translation>
</message>
<message id="foilpics-menu-share">
<source>Share</source>
<extracomment>Generic menu item</extracomment>
<translation>Share</translation>
</message>
<message id="foilpics-menu-details">
<source>Image details</source>
<extracomment>Generic menu item</extracomment>
Expand Down

0 comments on commit 33724fb

Please sign in to comment.