blob: c36148ff856a83a7d6e12905f79f6f370f7c8f80 [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
Sébastien Blinacb1cf02020-08-17 22:38:19 -0400349 MaterialButton {
ababi6fa08612020-08-10 19:13:28 +0200350 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
Yang Wangb97bde42020-08-07 11:24:18 -0400362 toolTipText: qsTr("Press to choose download folder path")
ababi6fa08612020-08-10 19:13:28 +0200363 text: downloadPath
Sébastien Blinacb1cf02020-08-17 22:38:19 -0400364 source: "qrc:/images/icons/round-folder-24px.svg"
365 color: JamiTheme.buttonTintedGrey
366 hoveredColor: JamiTheme.buttonTintedGreyHovered
367 pressedColor: JamiTheme.buttonTintedGreyPressed
ababi6fa08612020-08-10 19:13:28 +0200368
369 onClicked: {
370 openDownloadFolderSlot()
371 }
372 }
373 }
374 }
375 }
376
377 // call recording setting panel
378 ColumnLayout {
379 spacing: 8
380 Layout.fillWidth: true
381 Layout.leftMargin: JamiTheme.preferredMarginSize
382
383 ElidedTextLabel {
384 Layout.fillWidth: true
385 Layout.minimumHeight: JamiTheme.preferredFieldHeight
386 Layout.preferredHeight: JamiTheme.preferredFieldHeight
387 Layout.maximumHeight: JamiTheme.preferredFieldHeight
388
389 eText: qsTr("Call Recording")
390 font.pointSize: JamiTheme.headerFontSize
391 maxWidth: preferredSettingsWidth
392 }
393
394 ColumnLayout {
395 spacing: 8
396 Layout.fillWidth: true
397 Layout.leftMargin: JamiTheme.preferredMarginSize
398
399 ToggleSwitch {
400 id: alwaysRecordingCheckBox
401
402 labelText: alwaysRecordElidedText.elidedText
403 fontPointSize: JamiTheme.settingsFontSize
404
405 onSwitchToggled: {
406 slotAlwaysRecordingClicked(checked)
407 }
408 }
409
410 TextMetrics {
411 id: alwaysRecordElidedText
412 elide: Text.ElideRight
413 elideWidth: preferredSettingsWidth
414 text: qsTr("Always record calls")
415 }
416
417
418 ToggleSwitch {
419 id: recordPreviewCheckBox
420
421 labelText: recordPreviewElidedText.elidedText
422 fontPointSize: JamiTheme.settingsFontSize
423
424 onSwitchToggled: {
425 slotRecordPreviewClicked(checked)
426 }
427 }
428
429 TextMetrics {
430 id: recordPreviewElidedText
431 elide: Text.ElideRight
432 elideWidth: preferredSettingsWidth
433 text: qsTr("Record preview video for a call")
434 }
435
436 RowLayout {
437 spacing: 8
438 Layout.fillWidth: true
439 Layout.maximumHeight: JamiTheme.preferredFieldHeight
440
ababia284cae2020-08-10 12:33:34 +0200441 Label {
ababia284cae2020-08-10 12:33:34 +0200442
ababi6fa08612020-08-10 19:13:28 +0200443 Layout.fillWidth: true
444 Layout.maximumHeight: JamiTheme.preferredFieldHeight
445 Layout.preferredHeight: JamiTheme.preferredFieldHeight
446 Layout.minimumHeight: JamiTheme.preferredFieldHeight
ababia284cae2020-08-10 12:33:34 +0200447
ababi6fa08612020-08-10 19:13:28 +0200448 text: qsTr("Quality")
449 font.pointSize: JamiTheme.settingsFontSize
ababia284cae2020-08-10 12:33:34 +0200450 font.kerning: true
451
452 horizontalAlignment: Text.AlignLeft
453 verticalAlignment: Text.AlignVCenter
454 }
455
ababi6fa08612020-08-10 19:13:28 +0200456 Label {
457 id: recordQualityValueLabel
458
459 Layout.minimumWidth: 50
460 Layout.preferredWidth: 50
461 Layout.maximumWidth: 50
462
463 Layout.minimumHeight: JamiTheme.preferredFieldHeight
464 Layout.preferredHeight: JamiTheme.preferredFieldHeight
465 Layout.maximumHeight: JamiTheme.preferredFieldHeight
466
467 text: qsTr("VALUE ")
468
469 font.pointSize: JamiTheme.settingsFontSize
470 font.kerning: true
471
472 horizontalAlignment: Text.AlignLeft
473 verticalAlignment: Text.AlignVCenter
474 }
475
476 Slider{
477 id: recordQualitySlider
478
479 Layout.maximumWidth: preferredColumnWidth
480 Layout.preferredWidth: preferredColumnWidth
481 Layout.minimumWidth: preferredColumnWidth
482
483 Layout.minimumHeight: JamiTheme.preferredFieldHeight
484 Layout.preferredHeight: JamiTheme.preferredFieldHeight
485 Layout.maximumHeight: JamiTheme.preferredFieldHeight
486
487 from: 0
488 to: 500
489 stepSize: 1
490
491 onMoved: {
492 slotRecordQualitySliderValueChanged(value)
493 }
ababia284cae2020-08-10 12:33:34 +0200494 }
495 }
496
ababi6fa08612020-08-10 19:13:28 +0200497 RowLayout {
498 spacing: 8
ababia284cae2020-08-10 12:33:34 +0200499 Layout.fillWidth: true
ababi6fa08612020-08-10 19:13:28 +0200500 Layout.maximumHeight: JamiTheme.preferredFieldHeight
ababia284cae2020-08-10 12:33:34 +0200501
ababi6fa08612020-08-10 19:13:28 +0200502 Label {
503 Layout.fillWidth: true
504 Layout.minimumHeight: JamiTheme.preferredFieldHeight
505 Layout.preferredHeight: JamiTheme.preferredFieldHeight
506 Layout.maximumHeight: JamiTheme.preferredFieldHeight
ababia284cae2020-08-10 12:33:34 +0200507
ababi6fa08612020-08-10 19:13:28 +0200508 text: qsTr("Save in")
509 font.pointSize: JamiTheme.settingsFontSize
510 font.kerning: true
ababia284cae2020-08-10 12:33:34 +0200511
ababi6fa08612020-08-10 19:13:28 +0200512 horizontalAlignment: Text.AlignLeft
513 verticalAlignment: Text.AlignVCenter
514 }
ababia284cae2020-08-10 12:33:34 +0200515
Sébastien Blinacb1cf02020-08-17 22:38:19 -0400516 MaterialButton {
ababi6fa08612020-08-10 19:13:28 +0200517 id: recordPathButton
ababia284cae2020-08-10 12:33:34 +0200518
ababi6fa08612020-08-10 19:13:28 +0200519 Layout.maximumWidth: preferredColumnWidth
520 Layout.preferredWidth: preferredColumnWidth
521 Layout.minimumWidth: preferredColumnWidth
ababia284cae2020-08-10 12:33:34 +0200522
ababi6fa08612020-08-10 19:13:28 +0200523 Layout.minimumHeight: JamiTheme.preferredFieldHeight
524 Layout.preferredHeight: JamiTheme.preferredFieldHeight
525 Layout.maximumHeight: JamiTheme.preferredFieldHeight
ababia284cae2020-08-10 12:33:34 +0200526
ababi6fa08612020-08-10 19:13:28 +0200527 Layout.alignment: Qt.AlignRight
528
Yang Wangb97bde42020-08-07 11:24:18 -0400529 toolTipText: qsTr("Press to choose record folder path")
ababi6fa08612020-08-10 19:13:28 +0200530 text: recordPath
Sébastien Blinacb1cf02020-08-17 22:38:19 -0400531 source: "qrc:/images/icons/round-folder-24px.svg"
532 color: JamiTheme.buttonTintedGrey
533 hoveredColor: JamiTheme.buttonTintedGreyHovered
534 pressedColor: JamiTheme.buttonTintedGreyPressed
ababi6fa08612020-08-10 19:13:28 +0200535
536 onClicked: {
537 openRecordFolderSlot()
538 }
ababia284cae2020-08-10 12:33:34 +0200539 }
540 }
541 }
542 }
ababia284cae2020-08-10 12:33:34 +0200543
ababi6fa08612020-08-10 19:13:28 +0200544 // update setting panel
ababia284cae2020-08-10 12:33:34 +0200545 ColumnLayout {
ababi6fa08612020-08-10 19:13:28 +0200546 spacing: 8
ababia284cae2020-08-10 12:33:34 +0200547 Layout.fillWidth: true
ababi6fa08612020-08-10 19:13:28 +0200548 Layout.leftMargin: JamiTheme.preferredMarginSize
549 visible: Qt.platform.os == "windows"? true : false
ababia284cae2020-08-10 12:33:34 +0200550
ababi6fa08612020-08-10 19:13:28 +0200551 Label {
552 Layout.fillWidth: true
553 Layout.minimumHeight: JamiTheme.preferredFieldHeight
554 Layout.preferredHeight: JamiTheme.preferredFieldHeight
555 Layout.maximumHeight: JamiTheme.preferredFieldHeight
ababia284cae2020-08-10 12:33:34 +0200556
ababi6fa08612020-08-10 19:13:28 +0200557 text: qsTr("Updates")
558 font.pointSize: JamiTheme.headerFontSize
559 font.kerning: true
ababia284cae2020-08-10 12:33:34 +0200560
ababi6fa08612020-08-10 19:13:28 +0200561 horizontalAlignment: Text.AlignLeft
562 verticalAlignment: Text.AlignVCenter
ababia284cae2020-08-10 12:33:34 +0200563 }
564
ababi6fa08612020-08-10 19:13:28 +0200565 ColumnLayout {
566 spacing: 8
ababia284cae2020-08-10 12:33:34 +0200567 Layout.fillWidth: true
ababi6fa08612020-08-10 19:13:28 +0200568
569 ToggleSwitch {
570 id: autoUpdateCheckBox
571
572 labelText: autoUpdateText.elidedText
573 fontPointSize: JamiTheme.settingsFontSize
574
Yang Wangb97bde42020-08-07 11:24:18 -0400575 tooltipText: qsTr("toggle automatic updates")
576
ababi6fa08612020-08-10 19:13:28 +0200577 onSwitchToggled: {
578 slotSetUpdateAutomatic(checked)
579 }
580 }
581
582 TextMetrics {
583 id: autoUpdateText
584 elide: Text.ElideRight
585 elideWidth: preferredSettingsWidth
586 text: qsTr("Check for updates automatically")
587 }
ababia284cae2020-08-10 12:33:34 +0200588
589 HoverableRadiusButton {
590 id: checkUpdateButton
591
ababi6fa08612020-08-10 19:13:28 +0200592 Layout.alignment: Qt.AlignHCenter
Sébastien Blinacb1cf02020-08-17 22:38:19 -0400593 Layout.maximumWidth: JamiTheme.preferredFieldWidth
594 Layout.preferredWidth: JamiTheme.preferredFieldWidth
595 Layout.minimumWidth: JamiTheme.preferredFieldWidth
ababi6fa08612020-08-10 19:13:28 +0200596 Layout.minimumHeight: JamiTheme.preferredFieldHeight
597 Layout.preferredHeight: JamiTheme.preferredFieldHeight
598 Layout.maximumHeight: JamiTheme.preferredFieldHeight
ababia284cae2020-08-10 12:33:34 +0200599
600 radius: height / 2
601
Yang Wangb97bde42020-08-07 11:24:18 -0400602 toolTipText: qsTr("Check for updates now")
603 text: qsTr("Updates")
ababi6fa08612020-08-10 19:13:28 +0200604 fontPointSize: JamiTheme.buttonFontSize
ababia284cae2020-08-10 12:33:34 +0200605
606 onClicked: {
607 checkForUpdateSlot()
608 }
609 }
610
ababia284cae2020-08-10 12:33:34 +0200611 HoverableRadiusButton {
612 id: installBetaButton
613
ababi6fa08612020-08-10 19:13:28 +0200614 Layout.alignment: Qt.AlignHCenter
Sébastien Blinacb1cf02020-08-17 22:38:19 -0400615 Layout.maximumWidth: JamiTheme.preferredFieldWidth
616 Layout.preferredWidth: JamiTheme.preferredFieldWidth
617 Layout.minimumWidth: JamiTheme.preferredFieldWidth
ababi6fa08612020-08-10 19:13:28 +0200618 Layout.minimumHeight: JamiTheme.preferredFieldHeight
619 Layout.preferredHeight: JamiTheme.preferredFieldHeight
620 Layout.maximumHeight: JamiTheme.preferredFieldHeight
ababia284cae2020-08-10 12:33:34 +0200621
622 radius: height / 2
623
Yang Wangb97bde42020-08-07 11:24:18 -0400624 toolTipText: qsTr("Install the latest beta version")
625 text: qsTr("Beta Install")
ababi6fa08612020-08-10 19:13:28 +0200626 fontPointSize: JamiTheme.buttonFontSize
ababia284cae2020-08-10 12:33:34 +0200627
628 onClicked: {
629 installBetaSlot()
630 }
631 }
ababia284cae2020-08-10 12:33:34 +0200632 }
633 }
ababia284cae2020-08-10 12:33:34 +0200634
ababi6fa08612020-08-10 19:13:28 +0200635 Item {
636 Layout.preferredWidth: generalSettingsRect.width - 32
637 Layout.minimumWidth: generalSettingsRect.width - 32
638 Layout.maximumWidth: JamiTheme.maximumWidthSettingsView - 32
639 Layout.fillHeight: true
640 }
Sébastien Blin1f915762020-08-03 13:27:42 -0400641 }
642 }
643 }
644}