2
import Ubuntu.Components 1.1
3
import Ubuntu.Content 0.1
6
\brief MainView with a Label and Button elements.
11
// objectName for functional testing purposes (autopilot-qt5)
12
objectName: "mainView"
14
// Note! applicationName needs to match the "name" field of the click manifest
15
applicationName: "imageviewer.mhall119"
18
This property enables the application to change orientation
19
when the device is rotated. The default is false.
21
//automaticOrientation: true
23
// Removes the old toolbar and enables new features of the new header.
24
useDeprecatedToolbar: false
34
help: i18n.tr("Image to open")
49
Component.onCompleted: {
50
if (args.values.url) {
51
openImage(args.values.url)
54
function openImage(url) {
55
console.log("Opening image: "+url)
56
var filepath = url.replace("file://", "");
57
var fileparts = filepath.split("/");
58
var filename = fileparts.pop();
59
mainStack.push(Qt.resolvedUrl("ImageViewPage.qml"), {"name": filename, "source": filepath})
64
property list<ContentItem> selectedItems
68
// show content picker
69
mainStack.push(Qt.resolvedUrl("ExportPage.qml"), {"activeTransfer": transfer})
73
if (transfer.state === ContentTransfer.Charged) {
74
openImage(transfer.items[0].url.toString())