2 import Sailfish.Silica 1.0
3 import "functions.js" as Functions
7 property string path: ""
10 property string errorMessage: ""
11 property string newPath: ""
14 allowedOrientations: Orientation.All
15 canAccept: newName.text !== ""
18 var res = engine.rename(path, newName.text);
23 Component.onCompleted: {
24 newName.text = Functions.lastPartOfPath(path)
30 contentHeight: column.height
31 VerticalScrollDecorator { flickable: flickable }
35 anchors.left: parent.left
36 anchors.right: parent.right
41 acceptText: qsTr("Rename")
45 anchors.left: parent.left
46 anchors.right: parent.right
47 anchors.leftMargin: Theme.paddingLarge
48 anchors.rightMargin: Theme.paddingLarge
49 text: qsTr("Give a new name for\n%1").arg(path)
50 color: Theme.secondaryColor
61 placeholderText: qsTr("New name")
62 label: qsTr("New name")
65 // return key on virtual keyboard accepts the dialog
66 EnterKey.enabled: newName.text.length > 0
67 EnterKey.iconSource: "image://theme/icon-m-enter-accept"
68 EnterKey.onClicked: dialog.accept()