forked from nostar/DroidStar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HostsTab.qml
66 lines (61 loc) · 1.72 KB
/
HostsTab.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
Copyright (C) 2019-2021 Doug McLain
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import QtQuick 2.10
import QtQuick.Controls 2.3
Item {
id: hostsTab
property alias hostsTextEdit: hostsTxtEdit
Rectangle{
id: hostsList
x: 20
y: 20
width: parent.width - 40
height: parent.height - 40
color: "#252424"
Flickable{
anchors.fill: parent
contentWidth: parent.width
contentHeight: hostsTxtEdit.y +
hostsTxtEdit.height
flickableDirection: Flickable.VerticalFlick
clip: true
Text {
id: hostsText
width: hostsText.width
wrapMode: Text.WordWrap
color: "white"
text: qsTr("Custom hostfile format:\n" +
"<mode> <name> <host> <port> <password (optional)>\n" +
"Example: REF REF123 192.168.1.1 20001\n" +
"Example: DMR MyNet 192.168.1.1 62030 passw0rd")
}
TextArea {
id: hostsTxtEdit
x: 0
y: hostsText.height + 5
width: hostsList.width
height: 500
background: Rectangle {
color: "#000000"
radius: 5
}
wrapMode: TextArea.WordWrap
text: qsTr("")
onEditingFinished: {
droidstar.update_custom_hosts(hostsTxtEdit.text);
}
}
}
}
}