mirror of
https://github.com/QuasarApp/QtDeployer.git
synced 2025-04-26 13:34:32 +00:00
71 lines
1.3 KiB
QML
Executable File
71 lines
1.3 KiB
QML
Executable File
import QtQuick 2.7
|
|
import QtQuick.Controls 2.0
|
|
import QtQuick.Controls.Material 2.0
|
|
import QtQuick.Layouts 1.3
|
|
import QtQuick.Dialogs 1.2
|
|
|
|
ColumnLayout {
|
|
id: root
|
|
Layout.fillHeight: false
|
|
|
|
property string title
|
|
property bool isdir: true
|
|
property bool confirmed: false
|
|
property alias content: field.text
|
|
|
|
Label {
|
|
text: title
|
|
elide: Text.ElideRight
|
|
Layout.fillWidth: true
|
|
font.pointSize: mediumFont
|
|
}
|
|
|
|
RowLayout {
|
|
Layout.fillHeight: false
|
|
|
|
TextField {
|
|
id: field
|
|
Layout.fillWidth: true
|
|
placeholderText: qsTr("Enter path or browse")
|
|
|
|
onTextChanged: {
|
|
if (!MainManager.pathExists(isdir, text))
|
|
{
|
|
wlabel.text = qsTr("Path doesn't exist")
|
|
confirmed = false
|
|
}
|
|
else if (!MainManager.hasPrems(text))
|
|
{
|
|
wlabel.text = qsTr("I don't have permission to access this path")
|
|
confirmed = false
|
|
}
|
|
else
|
|
{
|
|
wlabel.text = qsTr("This path is OK")
|
|
confirmed = true
|
|
}
|
|
}
|
|
}
|
|
|
|
Button {
|
|
text: qsTr("Browse")
|
|
onClicked: fd.open()
|
|
Material.background: buttonColor
|
|
}
|
|
}
|
|
|
|
Label {
|
|
id: wlabel
|
|
elide: Text.ElideRight
|
|
Layout.fillWidth: true
|
|
}
|
|
|
|
FileDialog {
|
|
id: fd
|
|
selectFolder: isdir
|
|
selectMultiple: false
|
|
|
|
onAccepted: field.text = MainManager.stringFromUrl(isdir ? folder:fileUrl)
|
|
}
|
|
}
|