-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSettingsPage.qml
More file actions
executable file
·173 lines (153 loc) · 6.63 KB
/
SettingsPage.qml
File metadata and controls
executable file
·173 lines (153 loc) · 6.63 KB
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
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
Component {
id: settingsPage
Item {
id: settingsPageRectangle
//color: "transparent"
//visible: false
Component.onCompleted: {
console.log('settingsPage - onCompleted');
}
ScrollView {
id: settingsPageScrollView
anchors {
right: parent.right
top: parent.top
left: parent.left
bottom: settingsPageBottomColumnLayout.top
}
ColumnLayout {
spacing: 2
anchors.fill: parent
anchors.margins: 10
CheckBox {
id: settingsPageSynchronizeOnUpdate
text: "Upload and replace list on item save"
checked: stackView.settingsPageSynchronizeOnUpdate
}
CheckBox {
id: settingsPageShowIdInList
text: "Show id in list"
checked: stackView.settingsPageShowIdInList
}
CheckBox {
id: settingsPageShowUserInList
text: "Show user in list"
checked: stackView.settingsPageShowUserInList
}
CheckBox {
id: settingsPageShowPasswordsInList
text: "Show passwords in list"
checked: stackView.settingsPageShowPasswordInList
}
CheckBox {
id: settingsPageShowCreatedAtInList
text: "Show creation time in list"
checked: stackView.settingsPageShowCreatedAtInList
}
CheckBox {
id: settingsPageShowUpdatedAtInList
text: "Show update time in list"
checked: stackView.settingsPageShowUpdatedAtInList
}
/*
Label {
text: "Theme"
}
ComboBox {
id: settingsPageStyle
model: stackView.settingsPageStyleModel
currentIndex: stackView.settingsPageStyleCurrentIndex
}
*/
Label {
text: "Web sockets server listen ip and port"
}
RowLayout {
width: 300
Layout.minimumWidth: 300
TextField {
width: 200
id: settingsPageServerHost
placeholderText: "0.0.0.0"
text: stackView.settingsPageServerHostText
selectByMouse: true
}
TextField {
id: settingsPageServerPort
width: 100
placeholderText: "3002"
text: stackView.settingsPageServerPortText
selectByMouse: true
}
}
Label {
id: settingsPageServerStatusLabel
text: stackView.settingsPageServerStatusLabelText
}
}
}
ColumnLayout {
id: settingsPageBottomColumnLayout
anchors {
right: parent.right
bottom: parent.bottom
left: parent.left
}
RowLayout {
Button {
id: settingsPageChangePasswordButton
Layout.fillWidth: true
text: "Change master-password"
onClicked: {
stackView.changePasswordPageOldPasswordText = "";
stackView.changePasswordPageNewPasswordText = "";
stackView.push(changePasswordPage);
}
}
}
RowLayout {
Button {
id: settingsPageBackButton
Layout.minimumWidth: (stackView.width)/2
text: "Back"
onClicked: {
stackView.pop();
}
}
Button {
id: settingsPageSaveButton
Layout.minimumWidth: (stackView.width)/2
text: "Save"
onClicked: {
oSettingsModel.fnUpdateBoolValue("settingsPageSynchronizeOnUpdate", settingsPageSynchronizeOnUpdate.checked);
oSettingsModel.fnUpdateBoolValue("settingsPageShowCreatedAtInList", settingsPageShowCreatedAtInList.checked);
oSettingsModel.fnUpdateBoolValue("settingsPageShowUpdatedAtInList", settingsPageShowUpdatedAtInList.checked);
oSettingsModel.fnUpdateBoolValue("settingsPageShowIdInList", settingsPageShowIdInList.checked);
oSettingsModel.fnUpdateBoolValue("settingsPageShowUserInList", settingsPageShowUserInList.checked);
oSettingsModel.fnUpdateBoolValue("settingsPageShowPasswordInList", settingsPageShowPasswordsInList.checked);
//oSettingsModel.fnUpdateIntValue("settingsPageStyle", settingsPageStyle.currentIndex);
oSettingsModel.fnUpdateStringValue("settingsPageServerHost", settingsPageServerHost.text);
oSettingsModel.fnUpdateStringValue("settingsPageServerPort", settingsPageServerPort.text);
passwordSyncServer.onListenChanged.connect(settingsPageSaveButton.fnOnSettingsPageSaveButton);
passwordSyncServer.host = settingsPageServerHost.text;
passwordSyncServer.port = settingsPageServerPort.text;
console.log('passwordSyncServer.listen', passwordSyncServer.listen);
//oStyler.fnSetStyle(settingsPageStyle.currentText);
oPasswordListModel.fnUpdate();
oSettingsModel.fnSave();
//stackView.pop();
}
function fnOnSettingsPageSaveButton()
{
passwordSyncServer.onListenChanged.disconnect(settingsPageSaveButton.fnOnSettingsPageSaveButton);
passwordSyncServer.listen = true;
console.log('fnOnSettingsPageSaveButton passwordSyncServer.listen', passwordSyncServer.listen);
}
}
}
}
}
}