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