2 import Sailfish.Silica 1.0
3 import harbour.file.browser.FileInfo 1.0
7 property string path: ""
10 property string errorMessage: ""
13 allowedOrientations: Orientation.All
15 property int _executeWidth: executeLabel.width
17 onAccepted: errorMessage = engine.chmod(path,
18 ownerRead.checked, ownerWrite.checked, ownerExecute.checked,
19 groupRead.checked, groupWrite.checked, groupExecute.checked,
20 othersRead.checked, othersWrite.checked, othersExecute.checked);
27 // copy values to fields when page shows up
28 Component.onCompleted: {
29 ownerName.text = fileInfo.owner
30 groupName.text = fileInfo.group
31 var permissions = fileInfo.permissions
32 if (permissions.charAt(0) !== '-') ownerRead.checked = true;
33 if (permissions.charAt(1) !== '-') ownerWrite.checked = true;
34 if (permissions.charAt(2) !== '-') ownerExecute.checked = true;
35 if (permissions.charAt(3) !== '-') groupRead.checked = true;
36 if (permissions.charAt(4) !== '-') groupWrite.checked = true;
37 if (permissions.charAt(5) !== '-') groupExecute.checked = true;
38 if (permissions.charAt(6) !== '-') othersRead.checked = true;
39 if (permissions.charAt(7) !== '-') othersWrite.checked = true;
40 if (permissions.charAt(8) !== '-') othersExecute.checked = true;
46 contentHeight: column.height
47 VerticalScrollDecorator { flickable: flickable }
51 anchors.left: parent.left
52 anchors.right: parent.right
56 title: qsTr("Change Permissions")
57 acceptText: qsTr("Change")
61 anchors.left: parent.left
62 anchors.right: parent.right
63 anchors.leftMargin: Theme.paddingLarge
64 anchors.rightMargin: Theme.paddingLarge
65 text: qsTr("Change permissions for\n%1").arg(path)
66 color: Theme.secondaryColor
74 // read, write, execute small labels
84 width: executeLabel.width
86 font.pixelSize: Theme.fontSizeExtraSmall
87 color: Theme.secondaryColor
88 horizontalAlignment: Text.AlignHCenter
92 width: executeLabel.width
94 font.pixelSize: Theme.fontSizeExtraSmall
95 color: Theme.secondaryColor
96 horizontalAlignment: Text.AlignHCenter
100 text: qsTr("Execute")
101 font.pixelSize: Theme.fontSizeExtraSmall
102 color: Theme.secondaryColor
103 horizontalAlignment: Text.AlignHCenter
111 width: parent.width/2
114 width: parent.width-20
116 color: Theme.highlightColor
117 horizontalAlignment: Text.AlignRight
120 width: parent.width-20
122 font.pixelSize: Theme.fontSizeExtraSmall
123 color: Theme.secondaryColor
124 horizontalAlignment: Text.AlignRight
149 width: parent.width/2
152 width: parent.width-20
154 color: Theme.highlightColor
155 horizontalAlignment: Text.AlignRight
158 width: parent.width-20
160 font.pixelSize: Theme.fontSizeExtraSmall
161 color: Theme.secondaryColor
162 horizontalAlignment: Text.AlignRight
185 height: groupRow.height
187 width: parent.width/2
188 height: parent.height
190 width: parent.width-20
191 height: parent.height
193 color: Theme.highlightColor
194 horizontalAlignment: Text.AlignRight
195 verticalAlignment: Text.AlignVCenter