gpt4all

Форк
0
/
StartupDialog.qml 
341 строка · 13.2 Кб
1
import QtCore
2
import QtQuick
3
import QtQuick.Controls
4
import QtQuick.Controls.Basic
5
import QtQuick.Layouts
6
import download
7
import network
8
import llm
9
import mysettings
10

11
MyDialog {
12
    id: startupDialog
13
    anchors.centerIn: parent
14
    modal: true
15
    padding: 10
16
    width: 1024
17
    height: column.height + 20
18
    closePolicy: !optInStatisticsRadio.choiceMade || !optInNetworkRadio.choiceMade ? Popup.NoAutoClose : (Popup.CloseOnEscape | Popup.CloseOnPressOutside)
19

20
    Theme {
21
        id: theme
22
    }
23

24
    Column {
25
        id: column
26
        spacing: 20
27
        Item {
28
            width: childrenRect.width
29
            height: childrenRect.height
30
            Image {
31
                id: img
32
                anchors.top: parent.top
33
                anchors.left: parent.left
34
                width: 60
35
                height: 60
36
                source: "qrc:/gpt4all/icons/logo.svg"
37
            }
38
            Text {
39
                anchors.left: img.right
40
                anchors.leftMargin: 30
41
                anchors.verticalCenter: img.verticalCenter
42
                text: qsTr("Welcome!")
43
                color: theme.textColor
44
                font.pixelSize: theme.fontSizeLarge
45
            }
46
        }
47

48
        ScrollView {
49
            clip: true
50
            height: 200
51
            width: 1024 - 40
52
            ScrollBar.vertical.policy: ScrollBar.AlwaysOn
53
            ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
54

55
            MyTextArea {
56
                id: welcome
57
                width: 1024 - 40
58
                textFormat: TextEdit.MarkdownText
59
                text: qsTr("### Release notes\n")
60
                    + Download.releaseInfo.notes
61
                    + qsTr("### Contributors\n")
62
                    + Download.releaseInfo.contributors
63
                focus: false
64
                readOnly: true
65
                Accessible.role: Accessible.Paragraph
66
                Accessible.name: qsTr("Release notes")
67
                Accessible.description: qsTr("Release notes for this version")
68
            }
69
        }
70

71
        ScrollView {
72
            clip: true
73
            height: 150
74
            width: 1024 - 40
75
            ScrollBar.vertical.policy: ScrollBar.AlwaysOn
76
            ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
77

78
            MyTextArea {
79
                id: optInTerms
80
                width: 1024 - 40
81
                textFormat: TextEdit.MarkdownText
82
                text: qsTr(
83
"### Opt-ins for anonymous usage analytics and datalake
84
By enabling these features, you will be able to participate in the democratic process of training a
85
large language model by contributing data for future model improvements.
86

87
When a GPT4All model responds to you and you have opted-in, your conversation will be sent to the GPT4All
88
Open Source Datalake. Additionally, you can like/dislike its response. If you dislike a response, you
89
can suggest an alternative response. This data will be collected and aggregated in the GPT4All Datalake.
90

91
NOTE: By turning on this feature, you will be sending your data to the GPT4All Open Source Datalake.
92
You should have no expectation of chat privacy when this feature is enabled. You should; however, have
93
an expectation of an optional attribution if you wish. Your chat data will be openly available for anyone
94
to download and will be used by Nomic AI to improve future GPT4All models. Nomic AI will retain all
95
attribution information attached to your data and you will be credited as a contributor to any GPT4All
96
model release that uses your data!")
97

98
                focus: false
99
                readOnly: true
100
                Accessible.role: Accessible.Paragraph
101
                Accessible.name: qsTr("Terms for opt-in")
102
                Accessible.description: qsTr("Describes what will happen when you opt-in")
103
            }
104
        }
105

106
        GridLayout {
107
            columns: 2
108
            rowSpacing: 10
109
            columnSpacing: 10
110
            anchors.right: parent.right
111
            Label {
112
                id: optInStatistics
113
                text: "Opt-in to anonymous usage analytics used to improve GPT4All"
114
                Layout.row: 0
115
                Layout.column: 0
116
                color: theme.textColor
117
                font.pixelSize: theme.fontSizeLarge
118
                Accessible.role: Accessible.Paragraph
119
                Accessible.name: qsTr("Opt-in for anonymous usage statistics")
120
            }
121

122
            ButtonGroup {
123
                buttons: optInStatisticsRadio.children
124
                onClicked: {
125
                    MySettings.networkUsageStatsActive = optInStatisticsRadio.checked
126
                    if (!optInStatisticsRadio.checked)
127
                        Network.sendOptOut();
128
                    if (optInNetworkRadio.choiceMade && optInStatisticsRadio.choiceMade)
129
                        startupDialog.close();
130
                }
131
            }
132

133
            RowLayout {
134
                id: optInStatisticsRadio
135
                Layout.alignment: Qt.AlignVCenter
136
                Layout.row: 0
137
                Layout.column: 1
138
                property alias checked: optInStatisticsRadioYes.checked
139
                property bool choiceMade: optInStatisticsRadioYes.checked || optInStatisticsRadioNo.checked
140

141
                RadioButton {
142
                    id: optInStatisticsRadioYes
143
                    checked: false
144
                    text: qsTr("Yes")
145
                    font.pixelSize: theme.fontSizeLarge
146
                    Accessible.role: Accessible.RadioButton
147
                    Accessible.name: qsTr("Opt-in for anonymous usage statistics")
148
                    Accessible.description: qsTr("Allow opt-in for anonymous usage statistics")
149

150
                    background: Rectangle {
151
                        color: "transparent"
152
                    }
153

154
                    indicator: Rectangle {
155
                        implicitWidth: 26
156
                        implicitHeight: 26
157
                        x: optInStatisticsRadioYes.leftPadding
158
                        y: parent.height / 2 - height / 2
159
                        radius: 13
160
                        border.color: theme.dialogBorder
161
                        color: "transparent"
162

163
                        Rectangle {
164
                            width: 14
165
                            height: 14
166
                            x: 6
167
                            y: 6
168
                            radius: 7
169
                            color: theme.textColor
170
                            visible: optInStatisticsRadioYes.checked
171
                        }
172
                    }
173

174
                    contentItem: Text {
175
                        text: optInStatisticsRadioYes.text
176
                        font: optInStatisticsRadioYes.font
177
                        opacity: enabled ? 1.0 : 0.3
178
                        color: theme.textColor
179
                        verticalAlignment: Text.AlignVCenter
180
                        leftPadding: optInStatisticsRadioYes.indicator.width + optInStatisticsRadioYes.spacing
181
                    }
182
                }
183
                RadioButton {
184
                    id: optInStatisticsRadioNo
185
                    text: qsTr("No")
186
                    font.pixelSize: theme.fontSizeLarge
187
                    Accessible.role: Accessible.RadioButton
188
                    Accessible.name: qsTr("Opt-out for anonymous usage statistics")
189
                    Accessible.description: qsTr("Allow opt-out for anonymous usage statistics")
190

191
                    background: Rectangle {
192
                        color: "transparent"
193
                    }
194

195
                    indicator: Rectangle {
196
                        implicitWidth: 26
197
                        implicitHeight: 26
198
                        x: optInStatisticsRadioNo.leftPadding
199
                        y: parent.height / 2 - height / 2
200
                        radius: 13
201
                        border.color: theme.dialogBorder
202
                        color: "transparent"
203

204
                        Rectangle {
205
                            width: 14
206
                            height: 14
207
                            x: 6
208
                            y: 6
209
                            radius: 7
210
                            color: theme.textColor
211
                            visible: optInStatisticsRadioNo.checked
212
                        }
213
                    }
214

215
                    contentItem: Text {
216
                        text: optInStatisticsRadioNo.text
217
                        font: optInStatisticsRadioNo.font
218
                        opacity: enabled ? 1.0 : 0.3
219
                        color: theme.textColor
220
                        verticalAlignment: Text.AlignVCenter
221
                        leftPadding: optInStatisticsRadioNo.indicator.width + optInStatisticsRadioNo.spacing
222
                    }
223
                }
224
            }
225

226
            Label {
227
                id: optInNetwork
228
                text: "Opt-in to anonymous sharing of chats to the GPT4All Datalake"
229
                Layout.row: 1
230
                Layout.column: 0
231
                color: theme.textColor
232
                font.pixelSize: theme.fontSizeLarge
233
                Accessible.role: Accessible.Paragraph
234
                Accessible.name: qsTr("Opt-in for network")
235
                Accessible.description: qsTr("Allow opt-in for network")
236
            }
237

238
            ButtonGroup {
239
                buttons: optInNetworkRadio.children
240
                onClicked: {
241
                    MySettings.networkIsActive = optInNetworkRadio.checked
242
                    if (optInNetworkRadio.choiceMade && optInStatisticsRadio.choiceMade)
243
                        startupDialog.close();
244
                }
245
            }
246

247
            RowLayout {
248
                id: optInNetworkRadio
249
                Layout.alignment: Qt.AlignVCenter
250
                Layout.row: 1
251
                Layout.column: 1
252
                property alias checked: optInNetworkRadioYes.checked
253
                property bool choiceMade: optInNetworkRadioYes.checked || optInNetworkRadioNo.checked
254

255
                RadioButton {
256
                    id: optInNetworkRadioYes
257
                    checked: false
258
                    text: qsTr("Yes")
259
                    font.pixelSize: theme.fontSizeLarge
260
                    Accessible.role: Accessible.RadioButton
261
                    Accessible.name: qsTr("Opt-in for network")
262
                    Accessible.description: qsTr("Allow opt-in anonymous sharing of chats to the GPT4All Datalake")
263

264
                    background: Rectangle {
265
                        color: "transparent"
266
                    }
267

268
                    indicator: Rectangle {
269
                        implicitWidth: 26
270
                        implicitHeight: 26
271
                        x: optInNetworkRadioYes.leftPadding
272
                        y: parent.height / 2 - height / 2
273
                        radius: 13
274
                        border.color: theme.dialogBorder
275
                        color: "transparent"
276

277
                        Rectangle {
278
                            width: 14
279
                            height: 14
280
                            x: 6
281
                            y: 6
282
                            radius: 7
283
                            color: theme.textColor
284
                            visible: optInNetworkRadioYes.checked
285
                        }
286
                    }
287

288
                    contentItem: Text {
289
                        text: optInNetworkRadioYes.text
290
                        font: optInNetworkRadioYes.font
291
                        opacity: enabled ? 1.0 : 0.3
292
                        color: theme.textColor
293
                        verticalAlignment: Text.AlignVCenter
294
                        leftPadding: optInNetworkRadioYes.indicator.width + optInNetworkRadioYes.spacing
295
                    }
296
                }
297
                RadioButton {
298
                    id: optInNetworkRadioNo
299
                    text: qsTr("No")
300
                    font.pixelSize: theme.fontSizeLarge
301
                    Accessible.role: Accessible.RadioButton
302
                    Accessible.name: qsTr("Opt-out for network")
303
                    Accessible.description: qsTr("Allow opt-out anonymous sharing of chats to the GPT4All Datalake")
304

305
                    background: Rectangle {
306
                        color: "transparent"
307
                    }
308

309
                    indicator: Rectangle {
310
                        implicitWidth: 26
311
                        implicitHeight: 26
312
                        x: optInNetworkRadioNo.leftPadding
313
                        y: parent.height / 2 - height / 2
314
                        radius: 13
315
                        border.color: theme.dialogBorder
316
                        color: "transparent"
317

318
                        Rectangle {
319
                            width: 14
320
                            height: 14
321
                            x: 6
322
                            y: 6
323
                            radius: 7
324
                            color: theme.textColor
325
                            visible: optInNetworkRadioNo.checked
326
                        }
327
                    }
328

329
                    contentItem: Text {
330
                        text: optInNetworkRadioNo.text
331
                        font: optInNetworkRadioNo.font
332
                        opacity: enabled ? 1.0 : 0.3
333
                        color: theme.textColor
334
                        verticalAlignment: Text.AlignVCenter
335
                        leftPadding: optInNetworkRadioNo.indicator.width + optInNetworkRadioNo.spacing
336
                    }
337
                }
338
            }
339
        }
340
    }
341
}
342

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.