gpt4all
341 строка · 13.2 Кб
1import QtCore
2import QtQuick
3import QtQuick.Controls
4import QtQuick.Controls.Basic
5import QtQuick.Layouts
6import download
7import network
8import llm
9import mysettings
10
11MyDialog {
12id: startupDialog
13anchors.centerIn: parent
14modal: true
15padding: 10
16width: 1024
17height: column.height + 20
18closePolicy: !optInStatisticsRadio.choiceMade || !optInNetworkRadio.choiceMade ? Popup.NoAutoClose : (Popup.CloseOnEscape | Popup.CloseOnPressOutside)
19
20Theme {
21id: theme
22}
23
24Column {
25id: column
26spacing: 20
27Item {
28width: childrenRect.width
29height: childrenRect.height
30Image {
31id: img
32anchors.top: parent.top
33anchors.left: parent.left
34width: 60
35height: 60
36source: "qrc:/gpt4all/icons/logo.svg"
37}
38Text {
39anchors.left: img.right
40anchors.leftMargin: 30
41anchors.verticalCenter: img.verticalCenter
42text: qsTr("Welcome!")
43color: theme.textColor
44font.pixelSize: theme.fontSizeLarge
45}
46}
47
48ScrollView {
49clip: true
50height: 200
51width: 1024 - 40
52ScrollBar.vertical.policy: ScrollBar.AlwaysOn
53ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
54
55MyTextArea {
56id: welcome
57width: 1024 - 40
58textFormat: TextEdit.MarkdownText
59text: qsTr("### Release notes\n")
60+ Download.releaseInfo.notes
61+ qsTr("### Contributors\n")
62+ Download.releaseInfo.contributors
63focus: false
64readOnly: true
65Accessible.role: Accessible.Paragraph
66Accessible.name: qsTr("Release notes")
67Accessible.description: qsTr("Release notes for this version")
68}
69}
70
71ScrollView {
72clip: true
73height: 150
74width: 1024 - 40
75ScrollBar.vertical.policy: ScrollBar.AlwaysOn
76ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
77
78MyTextArea {
79id: optInTerms
80width: 1024 - 40
81textFormat: TextEdit.MarkdownText
82text: qsTr(
83"### Opt-ins for anonymous usage analytics and datalake
84By enabling these features, you will be able to participate in the democratic process of training a
85large language model by contributing data for future model improvements.
86
87When a GPT4All model responds to you and you have opted-in, your conversation will be sent to the GPT4All
88Open Source Datalake. Additionally, you can like/dislike its response. If you dislike a response, you
89can suggest an alternative response. This data will be collected and aggregated in the GPT4All Datalake.
90
91NOTE: By turning on this feature, you will be sending your data to the GPT4All Open Source Datalake.
92You should have no expectation of chat privacy when this feature is enabled. You should; however, have
93an expectation of an optional attribution if you wish. Your chat data will be openly available for anyone
94to download and will be used by Nomic AI to improve future GPT4All models. Nomic AI will retain all
95attribution information attached to your data and you will be credited as a contributor to any GPT4All
96model release that uses your data!")
97
98focus: false
99readOnly: true
100Accessible.role: Accessible.Paragraph
101Accessible.name: qsTr("Terms for opt-in")
102Accessible.description: qsTr("Describes what will happen when you opt-in")
103}
104}
105
106GridLayout {
107columns: 2
108rowSpacing: 10
109columnSpacing: 10
110anchors.right: parent.right
111Label {
112id: optInStatistics
113text: "Opt-in to anonymous usage analytics used to improve GPT4All"
114Layout.row: 0
115Layout.column: 0
116color: theme.textColor
117font.pixelSize: theme.fontSizeLarge
118Accessible.role: Accessible.Paragraph
119Accessible.name: qsTr("Opt-in for anonymous usage statistics")
120}
121
122ButtonGroup {
123buttons: optInStatisticsRadio.children
124onClicked: {
125MySettings.networkUsageStatsActive = optInStatisticsRadio.checked
126if (!optInStatisticsRadio.checked)
127Network.sendOptOut();
128if (optInNetworkRadio.choiceMade && optInStatisticsRadio.choiceMade)
129startupDialog.close();
130}
131}
132
133RowLayout {
134id: optInStatisticsRadio
135Layout.alignment: Qt.AlignVCenter
136Layout.row: 0
137Layout.column: 1
138property alias checked: optInStatisticsRadioYes.checked
139property bool choiceMade: optInStatisticsRadioYes.checked || optInStatisticsRadioNo.checked
140
141RadioButton {
142id: optInStatisticsRadioYes
143checked: false
144text: qsTr("Yes")
145font.pixelSize: theme.fontSizeLarge
146Accessible.role: Accessible.RadioButton
147Accessible.name: qsTr("Opt-in for anonymous usage statistics")
148Accessible.description: qsTr("Allow opt-in for anonymous usage statistics")
149
150background: Rectangle {
151color: "transparent"
152}
153
154indicator: Rectangle {
155implicitWidth: 26
156implicitHeight: 26
157x: optInStatisticsRadioYes.leftPadding
158y: parent.height / 2 - height / 2
159radius: 13
160border.color: theme.dialogBorder
161color: "transparent"
162
163Rectangle {
164width: 14
165height: 14
166x: 6
167y: 6
168radius: 7
169color: theme.textColor
170visible: optInStatisticsRadioYes.checked
171}
172}
173
174contentItem: Text {
175text: optInStatisticsRadioYes.text
176font: optInStatisticsRadioYes.font
177opacity: enabled ? 1.0 : 0.3
178color: theme.textColor
179verticalAlignment: Text.AlignVCenter
180leftPadding: optInStatisticsRadioYes.indicator.width + optInStatisticsRadioYes.spacing
181}
182}
183RadioButton {
184id: optInStatisticsRadioNo
185text: qsTr("No")
186font.pixelSize: theme.fontSizeLarge
187Accessible.role: Accessible.RadioButton
188Accessible.name: qsTr("Opt-out for anonymous usage statistics")
189Accessible.description: qsTr("Allow opt-out for anonymous usage statistics")
190
191background: Rectangle {
192color: "transparent"
193}
194
195indicator: Rectangle {
196implicitWidth: 26
197implicitHeight: 26
198x: optInStatisticsRadioNo.leftPadding
199y: parent.height / 2 - height / 2
200radius: 13
201border.color: theme.dialogBorder
202color: "transparent"
203
204Rectangle {
205width: 14
206height: 14
207x: 6
208y: 6
209radius: 7
210color: theme.textColor
211visible: optInStatisticsRadioNo.checked
212}
213}
214
215contentItem: Text {
216text: optInStatisticsRadioNo.text
217font: optInStatisticsRadioNo.font
218opacity: enabled ? 1.0 : 0.3
219color: theme.textColor
220verticalAlignment: Text.AlignVCenter
221leftPadding: optInStatisticsRadioNo.indicator.width + optInStatisticsRadioNo.spacing
222}
223}
224}
225
226Label {
227id: optInNetwork
228text: "Opt-in to anonymous sharing of chats to the GPT4All Datalake"
229Layout.row: 1
230Layout.column: 0
231color: theme.textColor
232font.pixelSize: theme.fontSizeLarge
233Accessible.role: Accessible.Paragraph
234Accessible.name: qsTr("Opt-in for network")
235Accessible.description: qsTr("Allow opt-in for network")
236}
237
238ButtonGroup {
239buttons: optInNetworkRadio.children
240onClicked: {
241MySettings.networkIsActive = optInNetworkRadio.checked
242if (optInNetworkRadio.choiceMade && optInStatisticsRadio.choiceMade)
243startupDialog.close();
244}
245}
246
247RowLayout {
248id: optInNetworkRadio
249Layout.alignment: Qt.AlignVCenter
250Layout.row: 1
251Layout.column: 1
252property alias checked: optInNetworkRadioYes.checked
253property bool choiceMade: optInNetworkRadioYes.checked || optInNetworkRadioNo.checked
254
255RadioButton {
256id: optInNetworkRadioYes
257checked: false
258text: qsTr("Yes")
259font.pixelSize: theme.fontSizeLarge
260Accessible.role: Accessible.RadioButton
261Accessible.name: qsTr("Opt-in for network")
262Accessible.description: qsTr("Allow opt-in anonymous sharing of chats to the GPT4All Datalake")
263
264background: Rectangle {
265color: "transparent"
266}
267
268indicator: Rectangle {
269implicitWidth: 26
270implicitHeight: 26
271x: optInNetworkRadioYes.leftPadding
272y: parent.height / 2 - height / 2
273radius: 13
274border.color: theme.dialogBorder
275color: "transparent"
276
277Rectangle {
278width: 14
279height: 14
280x: 6
281y: 6
282radius: 7
283color: theme.textColor
284visible: optInNetworkRadioYes.checked
285}
286}
287
288contentItem: Text {
289text: optInNetworkRadioYes.text
290font: optInNetworkRadioYes.font
291opacity: enabled ? 1.0 : 0.3
292color: theme.textColor
293verticalAlignment: Text.AlignVCenter
294leftPadding: optInNetworkRadioYes.indicator.width + optInNetworkRadioYes.spacing
295}
296}
297RadioButton {
298id: optInNetworkRadioNo
299text: qsTr("No")
300font.pixelSize: theme.fontSizeLarge
301Accessible.role: Accessible.RadioButton
302Accessible.name: qsTr("Opt-out for network")
303Accessible.description: qsTr("Allow opt-out anonymous sharing of chats to the GPT4All Datalake")
304
305background: Rectangle {
306color: "transparent"
307}
308
309indicator: Rectangle {
310implicitWidth: 26
311implicitHeight: 26
312x: optInNetworkRadioNo.leftPadding
313y: parent.height / 2 - height / 2
314radius: 13
315border.color: theme.dialogBorder
316color: "transparent"
317
318Rectangle {
319width: 14
320height: 14
321x: 6
322y: 6
323radius: 7
324color: theme.textColor
325visible: optInNetworkRadioNo.checked
326}
327}
328
329contentItem: Text {
330text: optInNetworkRadioNo.text
331font: optInNetworkRadioNo.font
332opacity: enabled ? 1.0 : 0.3
333color: theme.textColor
334verticalAlignment: Text.AlignVCenter
335leftPadding: optInNetworkRadioNo.indicator.width + optInNetworkRadioNo.spacing
336}
337}
338}
339}
340}
341}
342