Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 1 | /* |
| 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 | |
| 19 | import QtQuick 2.15 |
| 20 | import QtQuick.Window 2.14 |
| 21 | import QtQuick.Controls 2.14 |
| 22 | import QtQuick.Controls.Universal 2.12 |
| 23 | import QtQuick.Layouts 1.3 |
| 24 | import Qt.labs.platform 1.1 |
| 25 | import QtGraphicalEffects 1.14 |
| 26 | import net.jami.Models 1.0 |
| 27 | import "../../commoncomponents" |
| 28 | |
| 29 | Rectangle { |
| 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 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 77 | Timer{ |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 78 | 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 Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 148 | property string recordPath: ClientWrapper.settingsAdaptor.getDir_Document() |
| 149 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 150 | property int preferredColumnWidth : generalSettingsScrollView.width / 2 - 50 |
| 151 | property int preferredSettingsWidth : generalSettingsScrollView.width - 100 |
| 152 | |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 153 | signal backArrowClicked |
| 154 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 155 | 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 |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 169 | Layout.maximumWidth: JamiTheme.maximumWidthSettingsView |
| 170 | anchors.centerIn: parent |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 171 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 172 | ColumnLayout { |
| 173 | anchors.fill: generalSettingsRect |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 174 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 175 | 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 Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 196 | toolTipText: qsTr("Toggle to display side panel") |
| 197 | hoverEnabled: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 198 | 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 Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 224 | |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 225 | Layout.fillHeight: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 226 | Layout.fillWidth: true |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 227 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 228 | Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 229 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 230 | width: generalSettingsRect.width |
| 231 | height: generalSettingsRect.height - generalSettingsTitle.height |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 232 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 233 | ScrollBar.horizontal.policy: ScrollBar.AlwaysOff |
| 234 | ScrollBar.vertical.policy: ScrollBar.AsNeeded |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 235 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 236 | clip: true |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 237 | |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 238 | ColumnLayout { |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 239 | Layout.fillHeight: true |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 240 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 241 | Layout.alignment: Qt.AlignHCenter |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 242 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 243 | spacing: 24 |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 244 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 245 | // system setting panel |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 246 | ColumnLayout { |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 247 | spacing: 8 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 248 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 249 | Layout.leftMargin: JamiTheme.preferredMarginSize |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 250 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 251 | Label { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 252 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 253 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 254 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 255 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 256 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 257 | text: qsTr("System") |
| 258 | font.pointSize: JamiTheme.headerFontSize |
| 259 | font.kerning: true |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 260 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 261 | horizontalAlignment: Text.AlignLeft |
| 262 | verticalAlignment: Text.AlignVCenter |
| 263 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 264 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 265 | ColumnLayout { |
| 266 | spacing: 8 |
| 267 | Layout.fillWidth: true |
| 268 | Layout.leftMargin: JamiTheme.preferredMarginSize |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 269 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 270 | ToggleSwitch { |
| 271 | id: notificationCheckBox |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 272 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 273 | labelText: desktopNotificationsElidedText.elidedText |
| 274 | fontPointSize: JamiTheme.settingsFontSize |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 275 | |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 276 | tooltipText: qsTr("toggle enable notifications") |
| 277 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 278 | onSwitchToggled: { |
| 279 | slotSetNotifications(checked) |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 280 | } |
| 281 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 282 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 283 | TextMetrics { |
| 284 | id: desktopNotificationsElidedText |
| 285 | elide: Text.ElideRight |
| 286 | elideWidth: preferredSettingsWidth |
| 287 | text: qsTr("Enable desktop notifications") |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 288 | } |
| 289 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 290 | |
| 291 | ToggleSwitch { |
| 292 | id: closeOrMinCheckBox |
| 293 | |
| 294 | labelText: keepMinimizeElidedText.elidedText |
| 295 | fontPointSize: JamiTheme.settingsFontSize |
| 296 | |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 297 | tooltipText: qsTr("toggle keep minimized on close") |
| 298 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 299 | 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 Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 318 | tooltipText: qsTr("toggle run application on system startup") |
| 319 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 320 | 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 |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 334 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 335 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 336 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 337 | ElidedTextLabel { |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 338 | |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 339 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 340 | 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 |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 347 | } |
| 348 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 349 | 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 Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 368 | toolTipText: qsTr("Press to choose download folder path") |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 369 | 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 | |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 444 | Label { |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 445 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 446 | Layout.fillWidth: true |
| 447 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 448 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 449 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 450 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 451 | text: qsTr("Quality") |
| 452 | font.pointSize: JamiTheme.settingsFontSize |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 453 | font.kerning: true |
| 454 | |
| 455 | horizontalAlignment: Text.AlignLeft |
| 456 | verticalAlignment: Text.AlignVCenter |
| 457 | } |
| 458 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 459 | 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 | } |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 497 | } |
| 498 | } |
| 499 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 500 | RowLayout { |
| 501 | spacing: 8 |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 502 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 503 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 504 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 505 | Label { |
| 506 | Layout.fillWidth: true |
| 507 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 508 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 509 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 510 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 511 | text: qsTr("Save in") |
| 512 | font.pointSize: JamiTheme.settingsFontSize |
| 513 | font.kerning: true |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 514 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 515 | horizontalAlignment: Text.AlignLeft |
| 516 | verticalAlignment: Text.AlignVCenter |
| 517 | } |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 518 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 519 | HoverableRadiusButton { |
| 520 | id: recordPathButton |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 521 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 522 | Layout.leftMargin: JamiTheme.preferredMarginSize |
| 523 | Layout.maximumWidth: preferredColumnWidth |
| 524 | Layout.preferredWidth: preferredColumnWidth |
| 525 | Layout.minimumWidth: preferredColumnWidth |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 526 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 527 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 528 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 529 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 530 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 531 | 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 Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 539 | toolTipText: qsTr("Press to choose record folder path") |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 540 | text: recordPath |
| 541 | fontPointSize: JamiTheme.buttonFontSize |
| 542 | |
| 543 | onClicked: { |
| 544 | openRecordFolderSlot() |
| 545 | } |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 546 | } |
| 547 | } |
| 548 | } |
| 549 | } |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 550 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 551 | // update setting panel |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 552 | ColumnLayout { |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 553 | spacing: 8 |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 554 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 555 | Layout.leftMargin: JamiTheme.preferredMarginSize |
| 556 | visible: Qt.platform.os == "windows"? true : false |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 557 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 558 | Label { |
| 559 | Layout.fillWidth: true |
| 560 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 561 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 562 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 563 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 564 | text: qsTr("Updates") |
| 565 | font.pointSize: JamiTheme.headerFontSize |
| 566 | font.kerning: true |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 567 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 568 | horizontalAlignment: Text.AlignLeft |
| 569 | verticalAlignment: Text.AlignVCenter |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 570 | } |
| 571 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 572 | ColumnLayout { |
| 573 | spacing: 8 |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 574 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 575 | |
| 576 | ToggleSwitch { |
| 577 | id: autoUpdateCheckBox |
| 578 | |
| 579 | labelText: autoUpdateText.elidedText |
| 580 | fontPointSize: JamiTheme.settingsFontSize |
| 581 | |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 582 | tooltipText: qsTr("toggle automatic updates") |
| 583 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 584 | 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 | } |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 595 | |
| 596 | HoverableRadiusButton { |
| 597 | id: checkUpdateButton |
| 598 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 599 | 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 |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 606 | |
| 607 | radius: height / 2 |
| 608 | |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 609 | toolTipText: qsTr("Check for updates now") |
| 610 | text: qsTr("Updates") |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 611 | fontPointSize: JamiTheme.buttonFontSize |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 612 | |
| 613 | onClicked: { |
| 614 | checkForUpdateSlot() |
| 615 | } |
| 616 | } |
| 617 | |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 618 | HoverableRadiusButton { |
| 619 | id: installBetaButton |
| 620 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 621 | 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 |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 628 | |
| 629 | radius: height / 2 |
| 630 | |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 631 | toolTipText: qsTr("Install the latest beta version") |
| 632 | text: qsTr("Beta Install") |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 633 | fontPointSize: JamiTheme.buttonFontSize |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 634 | |
| 635 | onClicked: { |
| 636 | installBetaSlot() |
| 637 | } |
| 638 | } |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 639 | } |
| 640 | } |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 641 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 642 | 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 Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 648 | } |
| 649 | } |
| 650 | } |
| 651 | } |