Skip to content

Commit d231a6a

Browse files
committed
more work on implementation of Cards - Share - Open in...
Signed-off-by: ekkes-corner <ekke@ekkes-corner.org>
1 parent 86a2718 commit d231a6a

File tree

3 files changed

+70
-33
lines changed

3 files changed

+70
-33
lines changed

assets/main.qml

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,50 @@ Page {
3737
onFileSelected: {
3838
selectedFile = selectedFiles[0]
3939
fileLabel.text = selectedFile
40+
cloudAction.enabled = true
41+
shareAction.enabled = true
4042
}
4143
}
4244
]
4345
actions: [
4446
ActionItem {
45-
title: qsTr("OpenDataSpace") + Retranslate.onLanguageChanged
47+
id: cloudAction
48+
title: qsTr("ODS") + Retranslate.onLanguageChanged
4649
imageSource: "asset:///images/ics/4-collections-cloud_newLabel81.png"
50+
enabled: false
4751
ActionBar.placement: ActionBarPlacement.OnBar
4852
onTriggered: {
49-
// TODO Bound Invocation
53+
app.invokeBoundODSPreviewer(picker.selectedFile)
54+
}
55+
},
56+
InvokeActionItem {
57+
id: shareAction
58+
enabled: false
59+
ActionBar.placement: ActionBarPlacement.OnBar
60+
query {
61+
// little trick: always use same mime type, because query needs a mime type
62+
// ODS then takes a look at file path suffix to see if file is supported
63+
mimeType: "image/png"
64+
invokeActionId: "bb.action.SHARE"
65+
invokeTargetId: "io.ods.bb10.card.upload.previewer"
66+
}
67+
onTriggered: {
68+
// next trick: all properties from query are read-only
69+
// but we can use the data, which is read-write
70+
data = picker.selectedFile
71+
}
72+
},
73+
InvokeActionItem {
74+
ActionBar.placement: ActionBarPlacement.OnBar
75+
query {
76+
// little trick: always use same mime type, because query needs a mime type
77+
// ODS then takes a look at file path suffix to see if file is supported
78+
mimeType: "image/png"
79+
invokeActionId: "bb.action.OPEN"
80+
invokeTargetId: "io.ods.bb10.invoke"
81+
}
82+
onTriggered: {
83+
// we dont need the file - the app is only opened
5084
}
5185
},
5286
ActionItem {
@@ -98,20 +132,23 @@ Page {
98132
}
99133
}
100134
]
101-
titleBar: TitleBar {
102-
id: theBar
103-
title: qsTr("Upload Files to ODS")
104-
visibility: ChromeVisibility.Visible
135+
titleBar: {
136+
title: qsTr("Invoke ODS as Card vs App") + Retranslate.onLanguageChanged
105137
}
106138
Container {
107139
layout: DockLayout {
108140
}
109-
Label {
141+
TextArea {
110142
id: fileLabel
143+
editable: false
111144
text: qsTr("[selected file]")
112145
textStyle.base: SystemDefaults.TextStyles.BodyText
113146
verticalAlignment: VerticalAlignment.Center
114147
horizontalAlignment: HorizontalAlignment.Center
115148
}
116149
}
150+
onCreationCompleted: {
151+
// support all orientations
152+
OrientationSupport.supportedDisplayOrientation = SupportedDisplayOrientation.All;
153+
}
117154
}

translations/FileUpload2ODS.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,49 @@
99
<translation type="unfinished"></translation>
1010
</message>
1111
<message>
12-
<location filename="../assets/main.qml" line="45"/>
13-
<source>OpenDataSpace</source>
12+
<location filename="../assets/main.qml" line="48"/>
13+
<source>ODS</source>
1414
<translation type="unfinished"></translation>
1515
</message>
1616
<message>
17-
<location filename="../assets/main.qml" line="53"/>
18-
<location filename="../assets/main.qml" line="57"/>
17+
<location filename="../assets/main.qml" line="87"/>
18+
<location filename="../assets/main.qml" line="91"/>
1919
<source>Select Document</source>
2020
<translation type="unfinished"></translation>
2121
</message>
2222
<message>
23-
<location filename="../assets/main.qml" line="65"/>
23+
<location filename="../assets/main.qml" line="99"/>
2424
<source>Select | Capture Image</source>
2525
<translation type="unfinished"></translation>
2626
</message>
2727
<message>
28-
<location filename="../assets/main.qml" line="69"/>
28+
<location filename="../assets/main.qml" line="103"/>
2929
<source>Select Image</source>
3030
<translation type="unfinished"></translation>
3131
</message>
3232
<message>
33-
<location filename="../assets/main.qml" line="77"/>
33+
<location filename="../assets/main.qml" line="111"/>
3434
<source>Select | Capture Video</source>
3535
<translation type="unfinished"></translation>
3636
</message>
3737
<message>
38-
<location filename="../assets/main.qml" line="81"/>
38+
<location filename="../assets/main.qml" line="115"/>
3939
<source>Select Video</source>
4040
<translation type="unfinished"></translation>
4141
</message>
4242
<message>
43-
<location filename="../assets/main.qml" line="89"/>
44-
<location filename="../assets/main.qml" line="93"/>
43+
<location filename="../assets/main.qml" line="123"/>
44+
<location filename="../assets/main.qml" line="127"/>
4545
<source>Select Music</source>
4646
<translation type="unfinished"></translation>
4747
</message>
4848
<message>
49-
<location filename="../assets/main.qml" line="103"/>
50-
<source>Upload Files to ODS</source>
49+
<location filename="../assets/main.qml" line="136"/>
50+
<source>Invoke ODS as Card vs App</source>
5151
<translation type="unfinished"></translation>
5252
</message>
5353
<message>
54-
<location filename="../assets/main.qml" line="111"/>
54+
<location filename="../assets/main.qml" line="144"/>
5555
<source>[selected file]</source>
5656
<translation type="unfinished"></translation>
5757
</message>

translations/FileUpload2ODS_de.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,49 @@
99
<translation type="unfinished"></translation>
1010
</message>
1111
<message>
12-
<location filename="../assets/main.qml" line="45"/>
13-
<source>OpenDataSpace</source>
12+
<location filename="../assets/main.qml" line="48"/>
13+
<source>ODS</source>
1414
<translation type="unfinished"></translation>
1515
</message>
1616
<message>
17-
<location filename="../assets/main.qml" line="53"/>
18-
<location filename="../assets/main.qml" line="57"/>
17+
<location filename="../assets/main.qml" line="87"/>
18+
<location filename="../assets/main.qml" line="91"/>
1919
<source>Select Document</source>
2020
<translation type="unfinished"></translation>
2121
</message>
2222
<message>
23-
<location filename="../assets/main.qml" line="65"/>
23+
<location filename="../assets/main.qml" line="99"/>
2424
<source>Select | Capture Image</source>
2525
<translation type="unfinished"></translation>
2626
</message>
2727
<message>
28-
<location filename="../assets/main.qml" line="69"/>
28+
<location filename="../assets/main.qml" line="103"/>
2929
<source>Select Image</source>
3030
<translation type="unfinished"></translation>
3131
</message>
3232
<message>
33-
<location filename="../assets/main.qml" line="77"/>
33+
<location filename="../assets/main.qml" line="111"/>
3434
<source>Select | Capture Video</source>
3535
<translation type="unfinished"></translation>
3636
</message>
3737
<message>
38-
<location filename="../assets/main.qml" line="81"/>
38+
<location filename="../assets/main.qml" line="115"/>
3939
<source>Select Video</source>
4040
<translation type="unfinished"></translation>
4141
</message>
4242
<message>
43-
<location filename="../assets/main.qml" line="89"/>
44-
<location filename="../assets/main.qml" line="93"/>
43+
<location filename="../assets/main.qml" line="123"/>
44+
<location filename="../assets/main.qml" line="127"/>
4545
<source>Select Music</source>
4646
<translation type="unfinished"></translation>
4747
</message>
4848
<message>
49-
<location filename="../assets/main.qml" line="103"/>
50-
<source>Upload Files to ODS</source>
49+
<location filename="../assets/main.qml" line="136"/>
50+
<source>Invoke ODS as Card vs App</source>
5151
<translation type="unfinished"></translation>
5252
</message>
5353
<message>
54-
<location filename="../assets/main.qml" line="111"/>
54+
<location filename="../assets/main.qml" line="144"/>
5555
<source>[selected file]</source>
5656
<translation type="unfinished"></translation>
5757
</message>

0 commit comments

Comments
 (0)