forked from Xplatforms/mbseedkey
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainPage.qml
227 lines (192 loc) · 6.42 KB
/
MainPage.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import xplatforms.mbseedkey.exutils 1.0
import xplatforms.mbseedkey.ecuseedkeydll 1.0
Page
{
title: qsTr("Select Window")
function searchFor(text)
{
exutils.searchFor(text);
}
ColumnLayout
{
anchors.fill: parent
anchors.margins: 15
spacing: 12
RowLayout
{
Layout.fillWidth: true
Label
{
id: labeldllfolder
text: qsTr("SeedKey DLL's folder: ")
}
Rectangle
{
Layout.fillWidth: true
Layout.preferredWidth: dllloadfoldertext.implicitWidth
Layout.preferredHeight: 25
Layout.minimumWidth: 25
Layout.maximumWidth: dllloadfoldertext.implicitWidth
Label
{
id: dllloadfoldertext
anchors.fill: parent
font.weight: Font.DemiBold
elide: Text.ElideMiddle
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
text: exutils.foldername
}
}
}
Button
{
text: qsTr("Change DLL folder")
Layout.minimumWidth: 240
font.weight: Font.DemiBold
onClicked:
{
dllselect.open();
}
Connections
{
target: dllselect
function onAccepted()
{
var ordner = dllselect.folder.toString();
ordner = ordner.replace("file:///", "")
console.log("User has selected " + ordner);
exutils.foldername = ordner
}
}
}
RowLayout
{
Layout.topMargin: 15
Layout.fillWidth: true
TextField
{
id: searchfield
Layout.fillWidth: true
placeholderText: qsTr("Search in DLL's Name")
selectByMouse: true
onTextChanged: {
searchFor(text);
}
}
Button
{
text: qsTr("OK")
onClicked: {searchFor(searchfield.text)}
}
}
RowLayout
{
Rectangle
{
Layout.fillHeight: true
Layout.fillWidth: true
//color: "red"
border.width: 1
border.color: "lightgrey"
//color: "red"
ListView
{
id: listView
anchors.fill: parent
anchors.margins: 5
model: exutils.dlls
focus: true
highlight: Rectangle { color: "#cfdbeb"; radius: 2 }
highlightFollowsCurrentItem: true
clip: true
delegate: ItemDelegate
{
text: modelData
width: listView.width
MouseArea
{
anchors.fill: parent
onClicked:
{
//console.log("Current listview index:" + index)
listView.currentIndex = index;
exutils.selectDll(index)
}
}
}
}
Component.onCompleted:
{
exutils.selectDll(listView.currentIndex);
}
}
Rectangle
{
Layout.fillHeight: true
Layout.fillWidth: true
//color: "green"
//visible: exutils.seedkeydll != null
ColumnLayout
{
anchors.fill: parent
Label
{
text: qsTr("ECU Name:")
font.weight: Font.DemiBold
}
Label
{
text: exutils.seedkeydll?exutils.seedkeydll.ECUName:qsTr("not loaded")
}
Label
{
text: qsTr("Access Levels:")
font.weight: Font.DemiBold
}
Label
{
text: exutils.seedkeydll?exutils.seedkeydll.AccessTypesString:qsTr("not loaded")
}
Label
{
text: qsTr("Comment:")
font.weight: Font.DemiBold
}
Text
{
Layout.fillHeight: true
Layout.fillWidth: true
wrapMode: Text.WordWrap
text: exutils.seedkeydll?exutils.seedkeydll.Comment:qsTr("not loaded")
onLinkActivated: Qt.openUrlExternally(link)
}
Rectangle
{
height: 5
}
Button
{
Layout.alignment: Qt.AlignBottom
Layout.minimumWidth: 180
enabled: exutils.seedkeydll !== null
font.weight: Font.DemiBold
text: qsTr(" Select this DLL ")
onClicked:
{
// stackView.push("ProfilePage.qml", {"currentprofile": appsettings.getProfileByID(appsettings.defaultProfileID())})
stackView.push("ECUPage.qml", {"ecu": exutils.seedkeydll})
}
}
}
}
}
Rectangle
{
height: 1
}
}
}