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 QtGraphicalEffects 1.14 |
| 25 | import net.jami.Models 1.0 |
| 26 | |
| 27 | import "../../commoncomponents" |
| 28 | |
| 29 | Rectangle { |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 30 | id: sipAccountViewRect |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 31 | signal navigateToMainView |
| 32 | signal navigateToNewWizardView |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 33 | signal backArrowClicked |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 34 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 35 | property int preferredColumnWidth : sipAccountViewRect.width / 2 - 50 |
| 36 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 37 | function updateAccountInfoDisplayed() { |
| 38 | displaySIPNameLineEdit.text = ClientWrapper.settingsAdaptor.getCurrentAccount_Profile_Info_Alias() |
| 39 | usernameSIP.text = ClientWrapper.settingsAdaptor.getAccountConfig_Username() |
| 40 | hostnameSIP.text = ClientWrapper.settingsAdaptor.getAccountConfig_Hostname() |
| 41 | passSIPlineEdit.text = ClientWrapper.settingsAdaptor.getAccountConfig_Password() |
| 42 | proxySIP.text = ClientWrapper.settingsAdaptor.getAccountConfig_ProxyServer() |
| 43 | |
| 44 | accountSIPEnableCheckBox.checked = ClientWrapper.settingsAdaptor.get_CurrentAccountInfo_Enabled() |
| 45 | |
| 46 | setAvatar() |
| 47 | |
| 48 | if (advanceSIPSettingsView.visible) { |
| 49 | advanceSIPSettingsView.updateAccountInfoDisplayedAdvanceSIP() |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | function isPhotoBoothOpened() { |
| 54 | return currentSIPAccountAvatar.takePhotoState |
| 55 | } |
| 56 | |
| 57 | function setAvatar() { |
| 58 | currentSIPAccountAvatar.setAvatarPixmap( |
| 59 | ClientWrapper.settingsAdaptor.getAvatarImage_Base64( |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 60 | currentSIPAccountAvatar.boothWidth), |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 61 | ClientWrapper.settingsAdaptor.getIsDefaultAvatar()) |
| 62 | } |
| 63 | |
| 64 | function stopBooth() { |
| 65 | currentSIPAccountAvatar.stopBooth() |
| 66 | } |
| 67 | |
| 68 | // slots |
| 69 | function setAccEnableSlot(state) { |
| 70 | ClientWrapper.accountModel.setAccountEnabled(ClientWrapper.utilsAdaptor.getCurrAccId(), state) |
| 71 | } |
| 72 | |
| 73 | function delAccountSlot() { |
| 74 | deleteAccountDialog_SIP.open() |
| 75 | } |
| 76 | |
| 77 | DeleteAccountDialog{ |
| 78 | id: deleteAccountDialog_SIP |
| 79 | |
| 80 | anchors.centerIn: parent.Center |
| 81 | x: (parent.width - width) / 2 |
| 82 | y: (parent.height - height) / 2 |
| 83 | |
| 84 | onAccepted: { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 85 | ClientWrapper.accountAdaptor.setSelectedConvId() |
| 86 | |
| 87 | if(ClientWrapper.utilsAdaptor.getAccountListSize() > 0){ |
| 88 | navigateToMainView() |
| 89 | } else { |
| 90 | navigateToNewWizardView() |
| 91 | } |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | Layout.fillHeight: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 96 | Layout.maximumWidth: JamiTheme.maximumWidthSettingsView |
| 97 | anchors.centerIn: parent |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 98 | |
| 99 | ColumnLayout { |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 100 | anchors.fill: sipAccountViewRect |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 101 | |
| 102 | RowLayout { |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 103 | id: sipAccountPageTitle |
| 104 | Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter |
| 105 | Layout.leftMargin: JamiTheme.preferredMarginSize |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 106 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 107 | Layout.maximumHeight: 64 |
| 108 | Layout.minimumHeight: 64 |
| 109 | Layout.preferredHeight: 64 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 110 | |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 111 | HoverableButton { |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 112 | id: backToSettingsMenuButton |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 113 | |
| 114 | Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 115 | Layout.preferredWidth: JamiTheme.preferredFieldHeight |
| 116 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 117 | Layout.rightMargin: JamiTheme.preferredMarginSize |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 118 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 119 | radius: 32 |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 120 | source: "qrc:/images/icons/ic_arrow_back_24px.svg" |
| 121 | backgroundColor: "white" |
| 122 | onExitColor: "white" |
| 123 | |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 124 | toolTipText: qsTr("Toggle to display side panel") |
| 125 | hoverEnabled: true |
ababi | a284cae | 2020-08-10 12:33:34 +0200 | [diff] [blame] | 126 | visible: mainViewWindow.sidePanelHidden |
| 127 | |
| 128 | onClicked: { |
| 129 | backArrowClicked() |
| 130 | } |
| 131 | } |
| 132 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 133 | ElidedTextLabel { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 134 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 135 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 136 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 137 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 138 | |
| 139 | eText: qsTr("Account Settings") |
| 140 | fontSize: JamiTheme.titleFontSize |
| 141 | maxWidth: !backToSettingsMenuButton.visible ? sipAccountViewRect.width - 100 : |
| 142 | sipAccountViewRect.width - backToSettingsMenuButton.width - 100 |
| 143 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 144 | } |
| 145 | } |
| 146 | |
| 147 | ScrollView { |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 148 | id: sipAccountScrollView |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 149 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 150 | property ScrollBar vScrollBar: ScrollBar.vertical |
| 151 | |
| 152 | Layout.fillHeight: true |
| 153 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 154 | Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 155 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 156 | width: sipAccountViewRect.width |
| 157 | height: sipAccountViewRect.height - sipAccountPageTitle.height |
| 158 | |
| 159 | ScrollBar.horizontal.policy: ScrollBar.AlwaysOff |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 160 | ScrollBar.vertical.policy: ScrollBar.AsNeeded |
| 161 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 162 | clip: true |
| 163 | |
| 164 | ColumnLayout { |
| 165 | id: accountSIPLayout |
| 166 | |
| 167 | Layout.fillHeight: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 168 | Layout.preferredWidth: sipAccountViewRect.width |
| 169 | Layout.alignment: Qt.AlignHCenter |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 170 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 171 | spacing: 24 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 172 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 173 | ToggleSwitch { |
| 174 | id: accountSIPEnableCheckBox |
| 175 | |
| 176 | Layout.topMargin: JamiTheme.preferredMarginSize |
| 177 | Layout.leftMargin: JamiTheme.preferredMarginSize |
| 178 | |
| 179 | labelText: qsTr("Enable") |
| 180 | fontPointSize: JamiTheme.headerFontSize |
| 181 | |
| 182 | onSwitchToggled: { |
| 183 | setAccEnableSlot(checked) |
| 184 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 185 | } |
| 186 | |
| 187 | ColumnLayout { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 188 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 189 | Layout.fillHeight: true |
| 190 | Layout.leftMargin: JamiTheme.preferredMarginSize |
| 191 | spacing: 8 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 192 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 193 | Label { |
| 194 | Layout.fillWidth: true |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 195 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 196 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 197 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 198 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 199 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 200 | text: qsTr("Profile") |
| 201 | font.pointSize: JamiTheme.headerFontSize |
| 202 | font.kerning: true |
| 203 | |
| 204 | horizontalAlignment: Text.AlignLeft |
| 205 | verticalAlignment: Text.AlignVCenter |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 206 | } |
| 207 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 208 | PhotoboothView { |
| 209 | id: currentSIPAccountAvatar |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 210 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 211 | Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 212 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 213 | boothWidth: Math.min(224, sipAccountViewRect.width - 100) |
| 214 | |
| 215 | Layout.maximumWidth: boothWidth+50 |
| 216 | Layout.preferredWidth: boothWidth+50 |
| 217 | Layout.minimumWidth: boothWidth+50 |
| 218 | Layout.maximumHeight: boothWidth+50 |
| 219 | Layout.preferredHeight: boothWidth+50 |
| 220 | Layout.minimumHeight: boothWidth+50 |
| 221 | |
| 222 | onImageAcquired: { |
| 223 | ClientWrapper.settingsAdaptor.setCurrAccAvatar(imgBase64) |
| 224 | } |
| 225 | |
| 226 | onImageCleared: { |
| 227 | ClientWrapper.settingsAdaptor.clearCurrentAvatar() |
| 228 | setAvatar() |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 229 | } |
| 230 | } |
| 231 | |
Sébastien Blin | acb1cf0 | 2020-08-17 22:38:19 -0400 | [diff] [blame] | 232 | MaterialLineEdit { |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 233 | id: displaySIPNameLineEdit |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 234 | |
Sébastien Blin | acb1cf0 | 2020-08-17 22:38:19 -0400 | [diff] [blame] | 235 | Layout.maximumWidth: JamiTheme.preferredFieldWidth |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 236 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 237 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 238 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 239 | |
| 240 | Layout.alignment: Qt.AlignHCenter |
| 241 | |
| 242 | font.pointSize: JamiTheme.textFontSize |
| 243 | font.kerning: true |
| 244 | |
| 245 | horizontalAlignment: Text.AlignHCenter |
| 246 | verticalAlignment: Text.AlignVCenter |
Sébastien Blin | acb1cf0 | 2020-08-17 22:38:19 -0400 | [diff] [blame] | 247 | padding: 8 |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 248 | |
| 249 | onEditingFinished: { |
| 250 | ClientWrapper.accountAdaptor.setCurrAccDisplayName( |
| 251 | displaySIPNameLineEdit.text) |
| 252 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 253 | } |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 254 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 255 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 256 | |
| 257 | ColumnLayout { |
| 258 | Layout.fillWidth: true |
| 259 | Layout.alignment: Qt.AlignHCenter |
| 260 | Layout.leftMargin: JamiTheme.preferredMarginSize |
| 261 | spacing: 8 |
| 262 | |
| 263 | ElidedTextLabel { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 264 | Layout.fillWidth: true |
| 265 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 266 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 267 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 268 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 269 | |
| 270 | eText: qsTr("Identity") |
| 271 | maxWidth: sipAccountViewRect.width - 72 |
| 272 | fontSize: JamiTheme.headerFontSize |
| 273 | } |
| 274 | |
| 275 | |
| 276 | GridLayout { |
| 277 | rows: 4 |
| 278 | columns: 2 |
| 279 | flow: GridLayout.LeftToRight |
| 280 | rowSpacing: 8 |
| 281 | columnSpacing: 6 |
| 282 | |
| 283 | Layout.fillWidth: true |
| 284 | Layout.leftMargin: JamiTheme.preferredMarginSize |
| 285 | |
| 286 | // user name |
| 287 | ElidedTextLabel { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 288 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 289 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 290 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 291 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 292 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 293 | eText: qsTr("Username") |
| 294 | fontSize: JamiTheme.settingsFontSize |
| 295 | maxWidth: preferredColumnWidth |
| 296 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 297 | |
Sébastien Blin | acb1cf0 | 2020-08-17 22:38:19 -0400 | [diff] [blame] | 298 | MaterialLineEdit { |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 299 | id: usernameSIP |
| 300 | |
| 301 | fieldLayoutWidth: preferredColumnWidth |
| 302 | |
| 303 | font.pointSize: JamiTheme.settingsFontSize // Albert: buttonSize? |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 304 | font.kerning: true |
| 305 | |
| 306 | horizontalAlignment: Text.AlignLeft |
| 307 | verticalAlignment: Text.AlignVCenter |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 308 | |
Sébastien Blin | acb1cf0 | 2020-08-17 22:38:19 -0400 | [diff] [blame] | 309 | Layout.maximumWidth: preferredColumnWidth |
| 310 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 311 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 312 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 313 | padding: 8 |
| 314 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 315 | onEditingFinished: { |
| 316 | ClientWrapper.settingsAdaptor.setAccountConfig_Username( |
| 317 | usernameSIP.text) |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 318 | } |
| 319 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 320 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 321 | // host name |
| 322 | ElidedTextLabel { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 323 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 324 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 325 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 326 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 327 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 328 | eText: qsTr("Hostname") |
| 329 | fontSize: JamiTheme.settingsFontSize |
| 330 | maxWidth: preferredColumnWidth |
| 331 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 332 | |
Sébastien Blin | acb1cf0 | 2020-08-17 22:38:19 -0400 | [diff] [blame] | 333 | MaterialLineEdit { |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 334 | id: hostnameSIP |
| 335 | |
| 336 | fieldLayoutWidth: preferredColumnWidth |
| 337 | |
Sébastien Blin | acb1cf0 | 2020-08-17 22:38:19 -0400 | [diff] [blame] | 338 | font.pointSize: JamiTheme.settingsFontSize |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 339 | font.kerning: true |
| 340 | |
| 341 | horizontalAlignment: Text.AlignLeft |
| 342 | verticalAlignment: Text.AlignVCenter |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 343 | |
Sébastien Blin | acb1cf0 | 2020-08-17 22:38:19 -0400 | [diff] [blame] | 344 | Layout.maximumWidth: preferredColumnWidth |
| 345 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 346 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 347 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 348 | padding: 8 |
| 349 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 350 | onEditingFinished: { |
| 351 | ClientWrapper.settingsAdaptor.setAccountConfig_Hostname( |
| 352 | hostnameSIP.text) |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 353 | } |
| 354 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 355 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 356 | // proxy |
| 357 | ElidedTextLabel { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 358 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 359 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 360 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 361 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 362 | |
| 363 | text: qsTr("Proxy") |
| 364 | font.pointSize: JamiTheme.settingsFontSize |
| 365 | maxWidth: preferredColumnWidth |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 366 | } |
| 367 | |
Sébastien Blin | acb1cf0 | 2020-08-17 22:38:19 -0400 | [diff] [blame] | 368 | MaterialLineEdit { |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 369 | id: proxySIP |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 370 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 371 | fieldLayoutWidth: preferredColumnWidth |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 372 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 373 | font.pointSize: JamiTheme.settingsFontSize // Albert |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 374 | font.kerning: true |
| 375 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 376 | horizontalAlignment: Text.AlignLeft |
| 377 | verticalAlignment: Text.AlignVCenter |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 378 | |
Sébastien Blin | acb1cf0 | 2020-08-17 22:38:19 -0400 | [diff] [blame] | 379 | Layout.maximumWidth: preferredColumnWidth |
| 380 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 381 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 382 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 383 | padding: 8 |
| 384 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 385 | onEditingFinished: { |
| 386 | ClientWrapper.settingsAdaptor.setAccountConfig_ProxyServer( |
| 387 | proxySIP.text) |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 388 | } |
| 389 | } |
| 390 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 391 | // password |
| 392 | ElidedTextLabel { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 393 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 394 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 395 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 396 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 397 | |
| 398 | eText: qsTr("Password") |
| 399 | fontSize: JamiTheme.settingsFontSize |
| 400 | maxWidth: preferredColumnWidth |
| 401 | } |
| 402 | |
Sébastien Blin | acb1cf0 | 2020-08-17 22:38:19 -0400 | [diff] [blame] | 403 | MaterialLineEdit { |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 404 | id: passSIPlineEdit |
| 405 | |
| 406 | fieldLayoutWidth: preferredColumnWidth |
| 407 | |
| 408 | font.pointSize: JamiTheme.settingsFontSize |
| 409 | font.kerning: true |
| 410 | |
| 411 | echoMode: TextInput.Password |
| 412 | horizontalAlignment: Text.AlignLeft |
| 413 | verticalAlignment: Text.AlignVCenter |
| 414 | |
Sébastien Blin | acb1cf0 | 2020-08-17 22:38:19 -0400 | [diff] [blame] | 415 | Layout.maximumWidth: preferredColumnWidth |
| 416 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 417 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 418 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 419 | padding: 8 |
| 420 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 421 | onEditingFinished: { |
| 422 | ClientWrapper.settingsAdaptor.setAccountConfig_Password( |
| 423 | passSIPlineEdit.text) |
| 424 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 425 | } |
| 426 | } |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 427 | |
| 428 | |
Sébastien Blin | acb1cf0 | 2020-08-17 22:38:19 -0400 | [diff] [blame] | 429 | MaterialButton { |
| 430 | color: JamiTheme.buttonTintedRed |
| 431 | hoveredColor: JamiTheme.buttonTintedRedHovered |
| 432 | pressedColor: JamiTheme.buttonTintedRedPressed |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 433 | |
| 434 | Layout.alignment: Qt.AlignHCenter |
Sébastien Blin | acb1cf0 | 2020-08-17 22:38:19 -0400 | [diff] [blame] | 435 | |
| 436 | Layout.minimumWidth: JamiTheme.preferredFieldWidth |
| 437 | Layout.preferredWidth: JamiTheme.preferredFieldWidth |
| 438 | Layout.maximumWidth: JamiTheme.preferredFieldWidth |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 439 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 440 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 441 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 442 | |
Sébastien Blin | acb1cf0 | 2020-08-17 22:38:19 -0400 | [diff] [blame] | 443 | toolTipText: qsTr("Press this button to delete this account") |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 444 | text: qsTr("Delete Account") |
Sébastien Blin | acb1cf0 | 2020-08-17 22:38:19 -0400 | [diff] [blame] | 445 | |
| 446 | source: "qrc:/images/icons/delete_forever-24px.svg" |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 447 | |
| 448 | onClicked: { |
| 449 | delAccountSlot() |
| 450 | } |
| 451 | } |
| 452 | } |
| 453 | |
| 454 | RowLayout { |
| 455 | id: rowAdvancedSettingsBtn |
| 456 | Layout.fillWidth: true |
| 457 | Layout.leftMargin: JamiTheme.preferredMarginSize |
| 458 | |
| 459 | ElidedTextLabel { |
| 460 | |
| 461 | id: lblAdvancedAccountSettings |
| 462 | |
| 463 | Layout.fillWidth: true |
| 464 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 465 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 466 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 467 | |
| 468 | eText: qsTr("Advanced Account Settings") |
| 469 | fontSize: JamiTheme.headerFontSize |
| 470 | maxWidth: sipAccountViewRect.width - advancedAccountSettingsSIPButton.width - 80 |
| 471 | } |
| 472 | |
| 473 | HoverableRadiusButton { |
| 474 | id: advancedAccountSettingsSIPButton |
| 475 | |
| 476 | Layout.leftMargin: JamiTheme.preferredMarginSize |
| 477 | |
| 478 | Layout.minimumWidth: JamiTheme.preferredFieldHeight |
| 479 | Layout.preferredWidth: JamiTheme.preferredFieldHeight |
| 480 | Layout.maximumWidth: JamiTheme.preferredFieldHeight |
| 481 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 482 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 483 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 484 | |
| 485 | Layout.alignment: Qt.AlignHCenter |
| 486 | |
| 487 | radius: height / 2 |
| 488 | |
| 489 | icon.source: { |
| 490 | if (advanceSIPSettingsView.visible) { |
| 491 | return "qrc:/images/icons/round-arrow_drop_up-24px.svg" |
| 492 | } else { |
| 493 | return "qrc:/images/icons/round-arrow_drop_down-24px.svg" |
| 494 | } |
| 495 | } |
| 496 | |
| 497 | onClicked: { |
| 498 | advanceSIPSettingsView.visible = !advanceSIPSettingsView.visible |
| 499 | if(advanceSIPSettingsView.visible){ |
| 500 | advanceSIPSettingsView.updateAccountInfoDisplayedAdvanceSIP() |
| 501 | sipAccountScrollView.vScrollBar.position = rowAdvancedSettingsBtn.y / accountSIPLayout.height |
| 502 | } else { |
| 503 | sipAccountScrollView.vScrollBar.position = 0 |
| 504 | } |
| 505 | } |
| 506 | } |
| 507 | } |
| 508 | |
| 509 | // instantiate advance setting page |
| 510 | AdvancedSIPSettingsView { |
| 511 | id: advanceSIPSettingsView |
| 512 | Layout.leftMargin: JamiTheme.preferredMarginSize |
| 513 | visible: false |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 514 | } |
| 515 | |
| 516 | Item { |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 517 | Layout.preferredWidth: sipAccountViewRect.width - 32 |
| 518 | Layout.minimumWidth: sipAccountViewRect.width - 32 |
| 519 | Layout.maximumWidth: JamiTheme.maximumWidthSettingsView - 32 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 520 | Layout.fillHeight: true |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 521 | } |
| 522 | } |
| 523 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 524 | } |
| 525 | } |