blob: 8a7847a74f0aa39733d14fb5f29068776dbb7a62 [file] [log] [blame]
Sébastien Blin1f915762020-08-03 13:27:42 -04001/*
2 * Copyright (C) 2019-2020 by Savoir-faire Linux
3 * Author: Yang Wang <yang.wang@savoirfairelinux.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19import QtQuick 2.15
20import QtQuick.Window 2.14
21import QtQuick.Controls 2.14
22import QtQuick.Controls.Universal 2.12
23import QtQuick.Layouts 1.3
24import Qt.labs.platform 1.1
25import QtGraphicalEffects 1.14
26import net.jami.Models 1.0
27import "../../commoncomponents"
28
29Rectangle {
30 id: generalSettingsRect
31
32 function populateGeneralSettings(){
33 // settings
34 closeOrMinCheckBox.checked = ClientWrapper.settingsAdaptor.getSettingsValue_CloseOrMinimized()
35 applicationOnStartUpCheckBox.checked = ClientWrapper.utilsAdaptor.checkStartupLink()
36 notificationCheckBox.checked = ClientWrapper.settingsAdaptor.getSettingsValue_EnableNotifications()
37
38 alwaysRecordingCheckBox.checked = ClientWrapper.avmodel.getAlwaysRecord()
39 recordPreviewCheckBox.checked = ClientWrapper.avmodel.getRecordPreview()
40 recordQualityValueLabel.text = ClientWrapper.utilsAdaptor.getRecordQualityString(ClientWrapper.avmodel.getRecordQuality() / 100)
41 recordQualitySlider.value = ClientWrapper.avmodel.getRecordQuality() / 100
42
43 ClientWrapper.avmodel.setRecordPath(ClientWrapper.settingsAdaptor.getDir_Document())
44
45 autoUpdateCheckBox.checked = ClientWrapper.settingsAdaptor.getSettingsValue_AutoUpdate()
46 }
47
48 function slotSetNotifications(state){
49 ClientWrapper.settingsAdaptor.setNotifications(state)
50 }
51
52 function slotSetClosedOrMin(state){
53 ClientWrapper.settingsAdaptor.setClosedOrMin(state)
54 }
55
56 function slotSetRunOnStartUp(state){
57 ClientWrapper.settingsAdaptor.setRunOnStartUp(state)
58 }
59
60 function slotSetUpdateAutomatic(state){
61 ClientWrapper.settingsAdaptor.setUpdateAutomatic(state)
62 }
63
64 function slotAlwaysRecordingClicked(state){
65 ClientWrapper.avmodel.setAlwaysRecord(state)
66 }
67
68 function slotRecordPreviewClicked(state){
69 ClientWrapper.avmodel.setRecordPreview(state)
70 }
71
72 function slotRecordQualitySliderValueChanged(value){
73 recordQualityValueLabel.text = ClientWrapper.utilsAdaptor.getRecordQualityString(value)
74 updateRecordQualityTimer.restart()
75 }
76
ababi6fa08612020-08-10 19:13:28 +020077 Timer{
Sébastien Blin1f915762020-08-03 13:27:42 -040078 id: updateRecordQualityTimer
79
80 interval: 500
81
82 onTriggered: {
83 slotRecordQualitySliderSliderReleased()
84 }
85 }
86
87 function slotRecordQualitySliderSliderReleased(){
88 var value = recordQualitySlider.value
89 ClientWrapper.avmodel.setRecordQuality(value * 100)
90 }
91
92 function openDownloadFolderSlot(){
93 downloadPathDialog.open()
94 }
95
96 FolderDialog {
97 id: downloadPathDialog
98
99 title: qsTr("Select A Folder For Your Downloads")
100 currentFolder: StandardPaths.writableLocation(StandardPaths.DownloadLocation)
101
102 onAccepted: {
103 var dir = ClientWrapper.utilsAdaptor.getAbsPath(folder.toString())
104 downloadPath = dir
105 }
106
107 onRejected: {}
108
109 onVisibleChanged: {
110 if (!visible) {
111 rejected()
112 }
113 }
114 }
115
116 function openRecordFolderSlot(){
117 recordPathDialog.open()
118 }
119
120 FolderDialog {
121 id: recordPathDialog
122
123 title: qsTr("Select A Folder For Your Recordings")
124 currentFolder: StandardPaths.writableLocation(StandardPaths.HomeLocation)
125
126 onAccepted: {
127 var dir = ClientWrapper.utilsAdaptor.getAbsPath(folder.toString())
128 recordPath = dir
129 }
130
131 onRejected: {}
132
133 onVisibleChanged: {
134 if (!visible) {
135 rejected()
136 }
137 }
138 }
139
140 //TODO: complete check for update and check for Beta slot functions
141 function checkForUpdateSlot(){}
142 function installBetaSlot(){}
143
144 // settings
145 property string downloadPath: ClientWrapper.settingsAdaptor.getDir_Download()
146
147 // recording
Sébastien Blin1f915762020-08-03 13:27:42 -0400148 property string recordPath: ClientWrapper.settingsAdaptor.getDir_Document()
149
ababi6fa08612020-08-10 19:13:28 +0200150 property int preferredColumnWidth : generalSettingsScrollView.width / 2 - 50
151 property int preferredSettingsWidth : generalSettingsScrollView.width - 100
152
ababia284cae2020-08-10 12:33:34 +0200153 signal backArrowClicked
154
Sébastien Blin1f915762020-08-03 13:27:42 -0400155 onDownloadPathChanged: {
156 if(downloadPath === "") return
157 ClientWrapper.settingsAdaptor.setDownloadPath(downloadPath)
158 }
159
160 onRecordPathChanged: {
161 if(recordPath === "") return
162
163 if(ClientWrapper.avmodel){
164 ClientWrapper.avmodel.setRecordPath(recordPath)
165 }
166 }
167
168 Layout.fillHeight: true
ababi6fa08612020-08-10 19:13:28 +0200169 Layout.maximumWidth: JamiTheme.maximumWidthSettingsView
170 anchors.centerIn: parent
Sébastien Blin1f915762020-08-03 13:27:42 -0400171
ababi6fa08612020-08-10 19:13:28 +0200172 ColumnLayout {
173 anchors.fill: generalSettingsRect
Sébastien Blin1f915762020-08-03 13:27:42 -0400174
ababi6fa08612020-08-10 19:13:28 +0200175 RowLayout {
176 id: generalSettingsTitle
177 Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
178 Layout.leftMargin: JamiTheme.preferredMarginSize
179 Layout.fillWidth: true
180 Layout.maximumHeight: 64
181 Layout.minimumHeight: 64
182 Layout.preferredHeight: 64
183
184 HoverableButton {
185 id: backToSettingsMenuButton
186
187 Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
188 Layout.preferredWidth: JamiTheme.preferredFieldHeight
189 Layout.preferredHeight: JamiTheme.preferredFieldHeight
190 Layout.rightMargin: JamiTheme.preferredMarginSize
191
192 radius: 32
193 source: "qrc:/images/icons/ic_arrow_back_24px.svg"
194 backgroundColor: "white"
195 onExitColor: "white"
Yang Wangb97bde42020-08-07 11:24:18 -0400196 toolTipText: qsTr("Toggle to display side panel")
197 hoverEnabled: true
ababi6fa08612020-08-10 19:13:28 +0200198 visible: mainViewWindow.sidePanelHidden
199
200 onClicked: {
201 backArrowClicked()
202 }
203 }
204
205 Label {
206 Layout.fillWidth: true
207 Layout.minimumHeight: JamiTheme.preferredFieldHeight
208 Layout.preferredHeight: JamiTheme.preferredFieldHeight
209 Layout.maximumHeight: JamiTheme.preferredFieldHeight
210
211 text: qsTr("General")
212 font.pointSize: JamiTheme.titleFontSize
213 font.kerning: true
214
215 horizontalAlignment: Text.AlignLeft
216 verticalAlignment: Text.AlignVCenter
217 }
218
219 }
220
221 ScrollView{
222 id: generalSettingsScrollView
223 property ScrollBar vScrollBar: ScrollBar.vertical
Sébastien Blin1f915762020-08-03 13:27:42 -0400224
ababia284cae2020-08-10 12:33:34 +0200225 Layout.fillHeight: true
ababi6fa08612020-08-10 19:13:28 +0200226 Layout.fillWidth: true
Sébastien Blin1f915762020-08-03 13:27:42 -0400227
ababi6fa08612020-08-10 19:13:28 +0200228 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Sébastien Blin1f915762020-08-03 13:27:42 -0400229
ababi6fa08612020-08-10 19:13:28 +0200230 width: generalSettingsRect.width
231 height: generalSettingsRect.height - generalSettingsTitle.height
Sébastien Blin1f915762020-08-03 13:27:42 -0400232
ababi6fa08612020-08-10 19:13:28 +0200233 ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
234 ScrollBar.vertical.policy: ScrollBar.AsNeeded
Sébastien Blin1f915762020-08-03 13:27:42 -0400235
ababi6fa08612020-08-10 19:13:28 +0200236 clip: true
ababia284cae2020-08-10 12:33:34 +0200237
ababia284cae2020-08-10 12:33:34 +0200238 ColumnLayout {
ababi6fa08612020-08-10 19:13:28 +0200239 Layout.fillHeight: true
ababia284cae2020-08-10 12:33:34 +0200240 Layout.fillWidth: true
ababi6fa08612020-08-10 19:13:28 +0200241 Layout.alignment: Qt.AlignHCenter
ababia284cae2020-08-10 12:33:34 +0200242
ababi6fa08612020-08-10 19:13:28 +0200243 spacing: 24
ababia284cae2020-08-10 12:33:34 +0200244
ababi6fa08612020-08-10 19:13:28 +0200245 // system setting panel
Sébastien Blin1f915762020-08-03 13:27:42 -0400246 ColumnLayout {
ababi6fa08612020-08-10 19:13:28 +0200247 spacing: 8
Sébastien Blin1f915762020-08-03 13:27:42 -0400248 Layout.fillWidth: true
ababi6fa08612020-08-10 19:13:28 +0200249 Layout.leftMargin: JamiTheme.preferredMarginSize
Sébastien Blin1f915762020-08-03 13:27:42 -0400250
ababi6fa08612020-08-10 19:13:28 +0200251 Label {
Sébastien Blin1f915762020-08-03 13:27:42 -0400252 Layout.fillWidth: true
ababi6fa08612020-08-10 19:13:28 +0200253 Layout.minimumHeight: JamiTheme.preferredFieldHeight
254 Layout.preferredHeight: JamiTheme.preferredFieldHeight
255 Layout.maximumHeight: JamiTheme.preferredFieldHeight
Sébastien Blin1f915762020-08-03 13:27:42 -0400256
ababi6fa08612020-08-10 19:13:28 +0200257 text: qsTr("System")
258 font.pointSize: JamiTheme.headerFontSize
259 font.kerning: true
Sébastien Blin1f915762020-08-03 13:27:42 -0400260
ababi6fa08612020-08-10 19:13:28 +0200261 horizontalAlignment: Text.AlignLeft
262 verticalAlignment: Text.AlignVCenter
263 }
Sébastien Blin1f915762020-08-03 13:27:42 -0400264
ababi6fa08612020-08-10 19:13:28 +0200265 ColumnLayout {
266 spacing: 8
267 Layout.fillWidth: true
268 Layout.leftMargin: JamiTheme.preferredMarginSize
Sébastien Blin1f915762020-08-03 13:27:42 -0400269
ababi6fa08612020-08-10 19:13:28 +0200270 ToggleSwitch {
271 id: notificationCheckBox
Sébastien Blin1f915762020-08-03 13:27:42 -0400272
ababi6fa08612020-08-10 19:13:28 +0200273 labelText: desktopNotificationsElidedText.elidedText
274 fontPointSize: JamiTheme.settingsFontSize
ababia284cae2020-08-10 12:33:34 +0200275
Yang Wangb97bde42020-08-07 11:24:18 -0400276 tooltipText: qsTr("toggle enable notifications")
277
ababi6fa08612020-08-10 19:13:28 +0200278 onSwitchToggled: {
279 slotSetNotifications(checked)
Sébastien Blin1f915762020-08-03 13:27:42 -0400280 }
281 }
Sébastien Blin1f915762020-08-03 13:27:42 -0400282
ababi6fa08612020-08-10 19:13:28 +0200283 TextMetrics {
284 id: desktopNotificationsElidedText
285 elide: Text.ElideRight
286 elideWidth: preferredSettingsWidth
287 text: qsTr("Enable desktop notifications")
ababia284cae2020-08-10 12:33:34 +0200288 }
289
ababi6fa08612020-08-10 19:13:28 +0200290
291 ToggleSwitch {
292 id: closeOrMinCheckBox
293
294 labelText: keepMinimizeElidedText.elidedText
295 fontPointSize: JamiTheme.settingsFontSize
296
Yang Wangb97bde42020-08-07 11:24:18 -0400297 tooltipText: qsTr("toggle keep minimized on close")
298
ababi6fa08612020-08-10 19:13:28 +0200299 onSwitchToggled: {
300 slotSetClosedOrMin(checked)
301 }
302 }
303
304 TextMetrics {
305 id: keepMinimizeElidedText
306 elide: Text.ElideRight
307 elideWidth: preferredSettingsWidth
308 text: qsTr("Keep minimize on close")
309 }
310
311
312 ToggleSwitch {
313 id: applicationOnStartUpCheckBox
314
315 labelText: runOnStartupElidedText.elidedText
316 fontPointSize: JamiTheme.settingsFontSize
317
Yang Wangb97bde42020-08-07 11:24:18 -0400318 tooltipText: qsTr("toggle run application on system startup")
319
ababi6fa08612020-08-10 19:13:28 +0200320 onSwitchToggled: {
321 slotSetRunOnStartUp(checked)
322 }
323 }
324
325 TextMetrics {
326 id: runOnStartupElidedText
327 elide: Text.ElideRight
328 elideWidth: preferredSettingsWidth
329 text: qsTr("Run On Startup")
330 }
331
332 RowLayout {
333 spacing: 8
ababia284cae2020-08-10 12:33:34 +0200334 Layout.fillWidth: true
ababi6fa08612020-08-10 19:13:28 +0200335 Layout.maximumHeight: JamiTheme.preferredFieldHeight
ababia284cae2020-08-10 12:33:34 +0200336
ababi6fa08612020-08-10 19:13:28 +0200337 ElidedTextLabel {
ababia284cae2020-08-10 12:33:34 +0200338
ababia284cae2020-08-10 12:33:34 +0200339 Layout.fillWidth: true
ababi6fa08612020-08-10 19:13:28 +0200340 Layout.minimumHeight: JamiTheme.preferredFieldHeight
341 Layout.maximumHeight: JamiTheme.preferredFieldHeight
342 Layout.preferredHeight: JamiTheme.preferredFieldHeight
343
344 eText: qsTr("Downloads folder")
345 font.pointSize: JamiTheme.settingsFontSize
346 maxWidth: preferredColumnWidth
ababia284cae2020-08-10 12:33:34 +0200347 }
348
ababi6fa08612020-08-10 19:13:28 +0200349 HoverableRadiusButton {
350 id: downloadButton
351
352 Layout.maximumWidth: preferredColumnWidth
353 Layout.preferredWidth: preferredColumnWidth
354 Layout.minimumWidth: preferredColumnWidth
355
356 Layout.minimumHeight: JamiTheme.preferredFieldHeight
357 Layout.preferredHeight: JamiTheme.preferredFieldHeight
358 Layout.maximumHeight: JamiTheme.preferredFieldHeight
359
360 Layout.alignment: Qt.AlignRight
361
362 radius: height / 2
363
364 icon.source: "qrc:/images/icons/round-folder-24px.svg"
365 icon.height: 24
366 icon.width: 24
367
Yang Wangb97bde42020-08-07 11:24:18 -0400368 toolTipText: qsTr("Press to choose download folder path")
ababi6fa08612020-08-10 19:13:28 +0200369 text: downloadPath
370 fontPointSize: JamiTheme.buttonFontSize
371
372 onClicked: {
373 openDownloadFolderSlot()
374 }
375 }
376 }
377 }
378 }
379
380 // call recording setting panel
381 ColumnLayout {
382 spacing: 8
383 Layout.fillWidth: true
384 Layout.leftMargin: JamiTheme.preferredMarginSize
385
386 ElidedTextLabel {
387 Layout.fillWidth: true
388 Layout.minimumHeight: JamiTheme.preferredFieldHeight
389 Layout.preferredHeight: JamiTheme.preferredFieldHeight
390 Layout.maximumHeight: JamiTheme.preferredFieldHeight
391
392 eText: qsTr("Call Recording")
393 font.pointSize: JamiTheme.headerFontSize
394 maxWidth: preferredSettingsWidth
395 }
396
397 ColumnLayout {
398 spacing: 8
399 Layout.fillWidth: true
400 Layout.leftMargin: JamiTheme.preferredMarginSize
401
402 ToggleSwitch {
403 id: alwaysRecordingCheckBox
404
405 labelText: alwaysRecordElidedText.elidedText
406 fontPointSize: JamiTheme.settingsFontSize
407
408 onSwitchToggled: {
409 slotAlwaysRecordingClicked(checked)
410 }
411 }
412
413 TextMetrics {
414 id: alwaysRecordElidedText
415 elide: Text.ElideRight
416 elideWidth: preferredSettingsWidth
417 text: qsTr("Always record calls")
418 }
419
420
421 ToggleSwitch {
422 id: recordPreviewCheckBox
423
424 labelText: recordPreviewElidedText.elidedText
425 fontPointSize: JamiTheme.settingsFontSize
426
427 onSwitchToggled: {
428 slotRecordPreviewClicked(checked)
429 }
430 }
431
432 TextMetrics {
433 id: recordPreviewElidedText
434 elide: Text.ElideRight
435 elideWidth: preferredSettingsWidth
436 text: qsTr("Record preview video for a call")
437 }
438
439 RowLayout {
440 spacing: 8
441 Layout.fillWidth: true
442 Layout.maximumHeight: JamiTheme.preferredFieldHeight
443
ababia284cae2020-08-10 12:33:34 +0200444 Label {
ababia284cae2020-08-10 12:33:34 +0200445
ababi6fa08612020-08-10 19:13:28 +0200446 Layout.fillWidth: true
447 Layout.maximumHeight: JamiTheme.preferredFieldHeight
448 Layout.preferredHeight: JamiTheme.preferredFieldHeight
449 Layout.minimumHeight: JamiTheme.preferredFieldHeight
ababia284cae2020-08-10 12:33:34 +0200450
ababi6fa08612020-08-10 19:13:28 +0200451 text: qsTr("Quality")
452 font.pointSize: JamiTheme.settingsFontSize
ababia284cae2020-08-10 12:33:34 +0200453 font.kerning: true
454
455 horizontalAlignment: Text.AlignLeft
456 verticalAlignment: Text.AlignVCenter
457 }
458
ababi6fa08612020-08-10 19:13:28 +0200459 Label {
460 id: recordQualityValueLabel
461
462 Layout.minimumWidth: 50
463 Layout.preferredWidth: 50
464 Layout.maximumWidth: 50
465
466 Layout.minimumHeight: JamiTheme.preferredFieldHeight
467 Layout.preferredHeight: JamiTheme.preferredFieldHeight
468 Layout.maximumHeight: JamiTheme.preferredFieldHeight
469
470 text: qsTr("VALUE ")
471
472 font.pointSize: JamiTheme.settingsFontSize
473 font.kerning: true
474
475 horizontalAlignment: Text.AlignLeft
476 verticalAlignment: Text.AlignVCenter
477 }
478
479 Slider{
480 id: recordQualitySlider
481
482 Layout.maximumWidth: preferredColumnWidth
483 Layout.preferredWidth: preferredColumnWidth
484 Layout.minimumWidth: preferredColumnWidth
485
486 Layout.minimumHeight: JamiTheme.preferredFieldHeight
487 Layout.preferredHeight: JamiTheme.preferredFieldHeight
488 Layout.maximumHeight: JamiTheme.preferredFieldHeight
489
490 from: 0
491 to: 500
492 stepSize: 1
493
494 onMoved: {
495 slotRecordQualitySliderValueChanged(value)
496 }
ababia284cae2020-08-10 12:33:34 +0200497 }
498 }
499
ababi6fa08612020-08-10 19:13:28 +0200500 RowLayout {
501 spacing: 8
ababia284cae2020-08-10 12:33:34 +0200502 Layout.fillWidth: true
ababi6fa08612020-08-10 19:13:28 +0200503 Layout.maximumHeight: JamiTheme.preferredFieldHeight
ababia284cae2020-08-10 12:33:34 +0200504
ababi6fa08612020-08-10 19:13:28 +0200505 Label {
506 Layout.fillWidth: true
507 Layout.minimumHeight: JamiTheme.preferredFieldHeight
508 Layout.preferredHeight: JamiTheme.preferredFieldHeight
509 Layout.maximumHeight: JamiTheme.preferredFieldHeight
ababia284cae2020-08-10 12:33:34 +0200510
ababi6fa08612020-08-10 19:13:28 +0200511 text: qsTr("Save in")
512 font.pointSize: JamiTheme.settingsFontSize
513 font.kerning: true
ababia284cae2020-08-10 12:33:34 +0200514
ababi6fa08612020-08-10 19:13:28 +0200515 horizontalAlignment: Text.AlignLeft
516 verticalAlignment: Text.AlignVCenter
517 }
ababia284cae2020-08-10 12:33:34 +0200518
ababi6fa08612020-08-10 19:13:28 +0200519 HoverableRadiusButton {
520 id: recordPathButton
ababia284cae2020-08-10 12:33:34 +0200521
ababi6fa08612020-08-10 19:13:28 +0200522 Layout.leftMargin: JamiTheme.preferredMarginSize
523 Layout.maximumWidth: preferredColumnWidth
524 Layout.preferredWidth: preferredColumnWidth
525 Layout.minimumWidth: preferredColumnWidth
ababia284cae2020-08-10 12:33:34 +0200526
ababi6fa08612020-08-10 19:13:28 +0200527 Layout.minimumHeight: JamiTheme.preferredFieldHeight
528 Layout.preferredHeight: JamiTheme.preferredFieldHeight
529 Layout.maximumHeight: JamiTheme.preferredFieldHeight
ababia284cae2020-08-10 12:33:34 +0200530
ababi6fa08612020-08-10 19:13:28 +0200531 Layout.alignment: Qt.AlignRight
532
533 radius: height / 2
534
535 icon.source: "qrc:/images/icons/round-folder-24px.svg"
536 icon.height: 24
537 icon.width: 24
538
Yang Wangb97bde42020-08-07 11:24:18 -0400539 toolTipText: qsTr("Press to choose record folder path")
ababi6fa08612020-08-10 19:13:28 +0200540 text: recordPath
541 fontPointSize: JamiTheme.buttonFontSize
542
543 onClicked: {
544 openRecordFolderSlot()
545 }
ababia284cae2020-08-10 12:33:34 +0200546 }
547 }
548 }
549 }
ababia284cae2020-08-10 12:33:34 +0200550
ababi6fa08612020-08-10 19:13:28 +0200551 // update setting panel
ababia284cae2020-08-10 12:33:34 +0200552 ColumnLayout {
ababi6fa08612020-08-10 19:13:28 +0200553 spacing: 8
ababia284cae2020-08-10 12:33:34 +0200554 Layout.fillWidth: true
ababi6fa08612020-08-10 19:13:28 +0200555 Layout.leftMargin: JamiTheme.preferredMarginSize
556 visible: Qt.platform.os == "windows"? true : false
ababia284cae2020-08-10 12:33:34 +0200557
ababi6fa08612020-08-10 19:13:28 +0200558 Label {
559 Layout.fillWidth: true
560 Layout.minimumHeight: JamiTheme.preferredFieldHeight
561 Layout.preferredHeight: JamiTheme.preferredFieldHeight
562 Layout.maximumHeight: JamiTheme.preferredFieldHeight
ababia284cae2020-08-10 12:33:34 +0200563
ababi6fa08612020-08-10 19:13:28 +0200564 text: qsTr("Updates")
565 font.pointSize: JamiTheme.headerFontSize
566 font.kerning: true
ababia284cae2020-08-10 12:33:34 +0200567
ababi6fa08612020-08-10 19:13:28 +0200568 horizontalAlignment: Text.AlignLeft
569 verticalAlignment: Text.AlignVCenter
ababia284cae2020-08-10 12:33:34 +0200570 }
571
ababi6fa08612020-08-10 19:13:28 +0200572 ColumnLayout {
573 spacing: 8
ababia284cae2020-08-10 12:33:34 +0200574 Layout.fillWidth: true
ababi6fa08612020-08-10 19:13:28 +0200575
576 ToggleSwitch {
577 id: autoUpdateCheckBox
578
579 labelText: autoUpdateText.elidedText
580 fontPointSize: JamiTheme.settingsFontSize
581
Yang Wangb97bde42020-08-07 11:24:18 -0400582 tooltipText: qsTr("toggle automatic updates")
583
ababi6fa08612020-08-10 19:13:28 +0200584 onSwitchToggled: {
585 slotSetUpdateAutomatic(checked)
586 }
587 }
588
589 TextMetrics {
590 id: autoUpdateText
591 elide: Text.ElideRight
592 elideWidth: preferredSettingsWidth
593 text: qsTr("Check for updates automatically")
594 }
ababia284cae2020-08-10 12:33:34 +0200595
596 HoverableRadiusButton {
597 id: checkUpdateButton
598
ababi6fa08612020-08-10 19:13:28 +0200599 Layout.alignment: Qt.AlignHCenter
600 Layout.maximumWidth: JamiTheme.preferredButtonWidth
601 Layout.preferredWidth: JamiTheme.preferredButtonWidth
602 Layout.minimumWidth: JamiTheme.preferredButtonWidth
603 Layout.minimumHeight: JamiTheme.preferredFieldHeight
604 Layout.preferredHeight: JamiTheme.preferredFieldHeight
605 Layout.maximumHeight: JamiTheme.preferredFieldHeight
ababia284cae2020-08-10 12:33:34 +0200606
607 radius: height / 2
608
Yang Wangb97bde42020-08-07 11:24:18 -0400609 toolTipText: qsTr("Check for updates now")
610 text: qsTr("Updates")
ababi6fa08612020-08-10 19:13:28 +0200611 fontPointSize: JamiTheme.buttonFontSize
ababia284cae2020-08-10 12:33:34 +0200612
613 onClicked: {
614 checkForUpdateSlot()
615 }
616 }
617
ababia284cae2020-08-10 12:33:34 +0200618 HoverableRadiusButton {
619 id: installBetaButton
620
ababi6fa08612020-08-10 19:13:28 +0200621 Layout.alignment: Qt.AlignHCenter
622 Layout.maximumWidth: JamiTheme.preferredButtonWidth
623 Layout.preferredWidth: JamiTheme.preferredButtonWidth
624 Layout.minimumWidth: JamiTheme.preferredButtonWidth
625 Layout.minimumHeight: JamiTheme.preferredFieldHeight
626 Layout.preferredHeight: JamiTheme.preferredFieldHeight
627 Layout.maximumHeight: JamiTheme.preferredFieldHeight
ababia284cae2020-08-10 12:33:34 +0200628
629 radius: height / 2
630
Yang Wangb97bde42020-08-07 11:24:18 -0400631 toolTipText: qsTr("Install the latest beta version")
632 text: qsTr("Beta Install")
ababi6fa08612020-08-10 19:13:28 +0200633 fontPointSize: JamiTheme.buttonFontSize
ababia284cae2020-08-10 12:33:34 +0200634
635 onClicked: {
636 installBetaSlot()
637 }
638 }
ababia284cae2020-08-10 12:33:34 +0200639 }
640 }
ababia284cae2020-08-10 12:33:34 +0200641
ababi6fa08612020-08-10 19:13:28 +0200642 Item {
643 Layout.preferredWidth: generalSettingsRect.width - 32
644 Layout.minimumWidth: generalSettingsRect.width - 32
645 Layout.maximumWidth: JamiTheme.maximumWidthSettingsView - 32
646 Layout.fillHeight: true
647 }
Sébastien Blin1f915762020-08-03 13:27:42 -0400648 }
649 }
650 }
651}