File tree 3 files changed +45
-2
lines changed 3 files changed +45
-2
lines changed Original file line number Diff line number Diff line change @@ -21,25 +21,28 @@ ColumnLayout {
21
21
ButtonGroup .group : group
22
22
text: qsTr (" Default" )
23
23
description: qsTr (" Your application directory." )
24
+ customDir: optionsModel .getDefaultDataDirString
24
25
recommended: true
25
26
checked: true
26
27
}
27
28
OptionButton {
29
+ id: customDirOption
28
30
Layout .fillWidth : true
29
31
ButtonGroup .group : group
30
32
text: qsTr (" Custom" )
31
33
description: qsTr (" Choose the directory and storage device." )
34
+ customDir: fileDialog .folder
32
35
onClicked: fileDialog .open ()
33
36
}
34
37
FileDialog {
35
38
id: fileDialog
36
39
selectFolder: true
37
- folder: optionsModel . getDefaultDataDirectory
40
+ folder: shortcuts . home
38
41
onAccepted: {
39
42
optionsModel .setCustomDataDirString (fileDialog .fileUrls [0 ].toString ())
40
43
var customDataDir = fileDialog .fileUrl .toString ();
41
44
if (customDataDir !== " " ) {
42
- optionsModel .setCustomDataDirArgs (customDataDir);
45
+ customDirOption . customDir = optionsModel .setCustomDataDirArgs (customDataDir);
43
46
}
44
47
}
45
48
onRejected: {
Original file line number Diff line number Diff line change @@ -58,4 +58,21 @@ ColumnLayout {
58
58
loadedItem .forceActiveFocus ()
59
59
}
60
60
}
61
+ Separator { Layout .fillWidth : true }
62
+ Setting {
63
+ id: customDataDirSetting
64
+ Layout .fillWidth : true
65
+ header: qsTr (" Data Directory" )
66
+ actionItem: ValueInput {
67
+ parentState: " DISABLED"
68
+ description: optionsModel .getCustomDataDirString ()
69
+ filled: true
70
+ descriptionSize: 18
71
+ textColor: Theme .color .neutral5
72
+ validator: null
73
+ maximumLength: 100
74
+ width: 300
75
+ wrapMode: Text .WrapAtWordBoundaryOrAnywhere
76
+ }
77
+ }
61
78
}
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ Button {
11
11
property string description
12
12
property bool recommended: false
13
13
property string image: " "
14
+ property string customDir: " "
14
15
padding: 15
15
16
checkable: true
16
17
implicitWidth: 450
@@ -80,6 +81,28 @@ Button {
80
81
}
81
82
}
82
83
}
84
+ Loader {
85
+ Layout .topMargin : 12
86
+ Layout .fillWidth : true
87
+ active: button .customDir .length > 0
88
+ visible: active
89
+ sourceComponent: Button {
90
+ id: container
91
+ background: Rectangle {
92
+ color: Theme .color .neutral2
93
+ radius: 5
94
+ }
95
+ font .family : " Inter"
96
+ font .styleName : " Semi Bold"
97
+ font .pixelSize : (Qt .platform .os === " android" ) ? Math .max (12 , Qt .screenDpi / 100 ) : 13
98
+ contentItem: Text {
99
+ font: container .font
100
+ color: Theme .color .neutral9
101
+ text: button .customDir
102
+ wrapMode: Text .WordWrap
103
+ }
104
+ }
105
+ }
83
106
}
84
107
Item {
85
108
height: parent .height
You can’t perform that action at this time.
0 commit comments