forked from ToonSoftwareCollective/postnl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPostnlConfigurationScreen.qml
141 lines (117 loc) · 2.71 KB
/
PostnlConfigurationScreen.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
import QtQuick 2.1
import qb.components 1.0
import BasicUIControls 1.0;
Screen {
id: postnlConfigurationScreen
screenTitle: "Instellingen PostNL app"
onShown: {
enableSystrayToggle.isSwitchedOn = app.enableSystray;
postnlUseridLabel.inputText = app.postnlUserid;
postnlPassword.inputText = "**********";
addCustomTopRightButton("Opslaan");
}
onCustomButtonClicked: {
app.saveSettings();
app.refreshPostNLData();
hide();
}
function savePostnlUserid(text) {
if (text) {
app.postnlUserid = text;
postnlUseridLabel.inputText = text;
}
}
function savePostnlPassword(text) {
if (text) {
app.postnlPassword = text;
}
}
EditTextLabel4421 {
id: postnlUseridLabel
width: isNxt ? 550 : 440
height: isNxt ? 44 : 35
leftTextAvailableWidth: isNxt ? 200 : 160
leftText: "PostNL Userid:"
x: isNxt ? 38 : 30
y: 10
anchors {
left: isNxt ? 20 : 16
top: parent.top
topMargin: isNxt ? 30 : 24
}
onClicked: {
qkeyboard.open("Voer het userid in van uw PostNL account", postnlUseridLabel.inputText, savePostnlUserid)
}
}
IconButton {
id: postnlUseridButton;
width: isNxt ? 50 : 40
iconSource: "qrc:/tsc/edit.png"
anchors {
left: postnlUseridLabel.right
leftMargin: 6
top: postnlUseridLabel.top
}
bottomClickMargin: 3
onClicked: {
qkeyboard.open("Voer het userid in van uw PostNL account", postnlUseridLabel.inputText, savePostnlUserid)
}
}
EditTextLabel4421 {
id: postnlPassword
width: postnlUseridLabel.width
height: isNxt ? 44 : 35
leftTextAvailableWidth: isNxt ? 200 : 160
leftText: "Password:"
anchors {
left: postnlUseridLabel.left
top: postnlUseridLabel.bottom
topMargin: 6
}
onClicked: {
qkeyboard.open("Voer het wachtwoord in:", postnlPassword.inputText, savePostnlPassword)
}
}
Text {
id: enableSystrayLabel
width: isNxt ? 200 : 160
height: isNxt ? 45 : 36
text: "Icon in systray"
font.family: qfont.semiBold.name
font.pixelSize: isNxt ? 25 : 20
anchors {
left: postnlUseridButton.right
leftMargin: isNxt ? 10 : 8
top: postnlUseridLabel.top
}
}
OnOffToggle {
id: enableSystrayToggle
height: isNxt ? 45 : 36
anchors.left: enableSystrayLabel.right
anchors.leftMargin: 10
anchors.top: enableSystrayLabel.top
leftIsSwitchedOn: false
onSelectedChangedByUser: {
if (isSwitchedOn) {
app.enableSystray = true;
} else {
app.enableSystray = false;
}
}
}
IconButton {
id: postnlPasswordButton;
width: isNxt ? 50 : 40
iconSource: "qrc:/tsc/edit.png"
anchors {
left: postnlPassword.right
leftMargin: 6
top: postnlPassword.top
}
topClickMargin: 3
onClicked: {
qkeyboard.open("Voer het wachtwoord in:", postnlPassword.inputText, savePostnlPassword)
}
}
}