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 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 232 | InfoLineEdit { |
| 233 | id: displaySIPNameLineEdit |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 234 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 235 | Layout.maximumWidth: JamiTheme.preferredButtonWidth |
| 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 |
| 247 | |
| 248 | onEditingFinished: { |
| 249 | ClientWrapper.accountAdaptor.setCurrAccDisplayName( |
| 250 | displaySIPNameLineEdit.text) |
| 251 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 252 | } |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 253 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 254 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 255 | |
| 256 | ColumnLayout { |
| 257 | Layout.fillWidth: true |
| 258 | Layout.alignment: Qt.AlignHCenter |
| 259 | Layout.leftMargin: JamiTheme.preferredMarginSize |
| 260 | spacing: 8 |
| 261 | |
| 262 | ElidedTextLabel { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 263 | Layout.fillWidth: true |
| 264 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 265 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 266 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 267 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 268 | |
| 269 | eText: qsTr("Identity") |
| 270 | maxWidth: sipAccountViewRect.width - 72 |
| 271 | fontSize: JamiTheme.headerFontSize |
| 272 | } |
| 273 | |
| 274 | |
| 275 | GridLayout { |
| 276 | rows: 4 |
| 277 | columns: 2 |
| 278 | flow: GridLayout.LeftToRight |
| 279 | rowSpacing: 8 |
| 280 | columnSpacing: 6 |
| 281 | |
| 282 | Layout.fillWidth: true |
| 283 | Layout.leftMargin: JamiTheme.preferredMarginSize |
| 284 | |
| 285 | // user name |
| 286 | ElidedTextLabel { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 287 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 288 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 289 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 290 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 291 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 292 | eText: qsTr("Username") |
| 293 | fontSize: JamiTheme.settingsFontSize |
| 294 | maxWidth: preferredColumnWidth |
| 295 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 296 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 297 | InfoLineEdit { |
| 298 | id: usernameSIP |
| 299 | |
| 300 | fieldLayoutWidth: preferredColumnWidth |
| 301 | |
| 302 | font.pointSize: JamiTheme.settingsFontSize // Albert: buttonSize? |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 303 | font.kerning: true |
| 304 | |
| 305 | horizontalAlignment: Text.AlignLeft |
| 306 | verticalAlignment: Text.AlignVCenter |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 307 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 308 | onEditingFinished: { |
| 309 | ClientWrapper.settingsAdaptor.setAccountConfig_Username( |
| 310 | usernameSIP.text) |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 311 | } |
| 312 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 313 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 314 | // host name |
| 315 | ElidedTextLabel { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 316 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 317 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 318 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 319 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
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 | eText: qsTr("Hostname") |
| 322 | fontSize: JamiTheme.settingsFontSize |
| 323 | maxWidth: preferredColumnWidth |
| 324 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 325 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 326 | InfoLineEdit { |
| 327 | id: hostnameSIP |
| 328 | |
| 329 | fieldLayoutWidth: preferredColumnWidth |
| 330 | |
| 331 | font.pointSize: JamiTheme.settingsFontSize // Albert: button? |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 332 | font.kerning: true |
| 333 | |
| 334 | horizontalAlignment: Text.AlignLeft |
| 335 | verticalAlignment: Text.AlignVCenter |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 336 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 337 | onEditingFinished: { |
| 338 | ClientWrapper.settingsAdaptor.setAccountConfig_Hostname( |
| 339 | hostnameSIP.text) |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 340 | } |
| 341 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 342 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 343 | // proxy |
| 344 | ElidedTextLabel { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 345 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 346 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 347 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 348 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 349 | |
| 350 | text: qsTr("Proxy") |
| 351 | font.pointSize: JamiTheme.settingsFontSize |
| 352 | maxWidth: preferredColumnWidth |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 353 | } |
| 354 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 355 | InfoLineEdit { |
| 356 | id: proxySIP |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 357 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 358 | fieldLayoutWidth: preferredColumnWidth |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 359 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 360 | font.pointSize: JamiTheme.settingsFontSize // Albert |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 361 | font.kerning: true |
| 362 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 363 | horizontalAlignment: Text.AlignLeft |
| 364 | verticalAlignment: Text.AlignVCenter |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 365 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 366 | onEditingFinished: { |
| 367 | ClientWrapper.settingsAdaptor.setAccountConfig_ProxyServer( |
| 368 | proxySIP.text) |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 369 | } |
| 370 | } |
| 371 | |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 372 | // password |
| 373 | ElidedTextLabel { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 374 | Layout.fillWidth: true |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 375 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 376 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 377 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 378 | |
| 379 | eText: qsTr("Password") |
| 380 | fontSize: JamiTheme.settingsFontSize |
| 381 | maxWidth: preferredColumnWidth |
| 382 | } |
| 383 | |
| 384 | InfoLineEdit { |
| 385 | id: passSIPlineEdit |
| 386 | |
| 387 | fieldLayoutWidth: preferredColumnWidth |
| 388 | |
| 389 | font.pointSize: JamiTheme.settingsFontSize |
| 390 | font.kerning: true |
| 391 | |
| 392 | echoMode: TextInput.Password |
| 393 | horizontalAlignment: Text.AlignLeft |
| 394 | verticalAlignment: Text.AlignVCenter |
| 395 | |
| 396 | onEditingFinished: { |
| 397 | ClientWrapper.settingsAdaptor.setAccountConfig_Password( |
| 398 | passSIPlineEdit.text) |
| 399 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 400 | } |
| 401 | } |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 402 | |
| 403 | |
| 404 | HoverableButtonTextItem { |
| 405 | id: btnDeletAccount |
| 406 | |
| 407 | backgroundColor: "red" |
| 408 | onEnterColor: Qt.rgba(150 / 256, 0, 0, 0.7) |
| 409 | onDisabledBackgroundColor: Qt.rgba( |
| 410 | 255 / 256, |
| 411 | 0, 0, 0.8) |
| 412 | onPressColor: backgroundColor |
| 413 | textColor: "white" |
| 414 | |
| 415 | Layout.alignment: Qt.AlignHCenter |
| 416 | Layout.minimumWidth: JamiTheme.preferredButtonWidth |
| 417 | Layout.preferredWidth: JamiTheme.preferredButtonWidth |
| 418 | Layout.maximumWidth: JamiTheme.preferredButtonWidth |
| 419 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 420 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 421 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 422 | |
| 423 | text: qsTr("Delete Account") |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 424 | toolTipText: qsTr("Delete this account") |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 425 | font.pointSize: JamiTheme.textFontSize |
| 426 | font.kerning: true |
| 427 | radius: height / 2 |
| 428 | |
| 429 | onClicked: { |
| 430 | delAccountSlot() |
| 431 | } |
| 432 | } |
| 433 | } |
| 434 | |
| 435 | RowLayout { |
| 436 | id: rowAdvancedSettingsBtn |
| 437 | Layout.fillWidth: true |
| 438 | Layout.leftMargin: JamiTheme.preferredMarginSize |
| 439 | |
| 440 | ElidedTextLabel { |
| 441 | |
| 442 | id: lblAdvancedAccountSettings |
| 443 | |
| 444 | Layout.fillWidth: true |
| 445 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 446 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 447 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 448 | |
| 449 | eText: qsTr("Advanced Account Settings") |
| 450 | fontSize: JamiTheme.headerFontSize |
| 451 | maxWidth: sipAccountViewRect.width - advancedAccountSettingsSIPButton.width - 80 |
| 452 | } |
| 453 | |
| 454 | HoverableRadiusButton { |
| 455 | id: advancedAccountSettingsSIPButton |
| 456 | |
| 457 | Layout.leftMargin: JamiTheme.preferredMarginSize |
| 458 | |
| 459 | Layout.minimumWidth: JamiTheme.preferredFieldHeight |
| 460 | Layout.preferredWidth: JamiTheme.preferredFieldHeight |
| 461 | Layout.maximumWidth: JamiTheme.preferredFieldHeight |
| 462 | Layout.minimumHeight: JamiTheme.preferredFieldHeight |
| 463 | Layout.preferredHeight: JamiTheme.preferredFieldHeight |
| 464 | Layout.maximumHeight: JamiTheme.preferredFieldHeight |
| 465 | |
| 466 | Layout.alignment: Qt.AlignHCenter |
| 467 | |
| 468 | radius: height / 2 |
| 469 | |
| 470 | icon.source: { |
| 471 | if (advanceSIPSettingsView.visible) { |
| 472 | return "qrc:/images/icons/round-arrow_drop_up-24px.svg" |
| 473 | } else { |
| 474 | return "qrc:/images/icons/round-arrow_drop_down-24px.svg" |
| 475 | } |
| 476 | } |
| 477 | |
| 478 | onClicked: { |
| 479 | advanceSIPSettingsView.visible = !advanceSIPSettingsView.visible |
| 480 | if(advanceSIPSettingsView.visible){ |
| 481 | advanceSIPSettingsView.updateAccountInfoDisplayedAdvanceSIP() |
| 482 | sipAccountScrollView.vScrollBar.position = rowAdvancedSettingsBtn.y / accountSIPLayout.height |
| 483 | } else { |
| 484 | sipAccountScrollView.vScrollBar.position = 0 |
| 485 | } |
| 486 | } |
| 487 | } |
| 488 | } |
| 489 | |
| 490 | // instantiate advance setting page |
| 491 | AdvancedSIPSettingsView { |
| 492 | id: advanceSIPSettingsView |
| 493 | Layout.leftMargin: JamiTheme.preferredMarginSize |
| 494 | visible: false |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 495 | } |
| 496 | |
| 497 | Item { |
ababi | 6fa0861 | 2020-08-10 19:13:28 +0200 | [diff] [blame] | 498 | Layout.preferredWidth: sipAccountViewRect.width - 32 |
| 499 | Layout.minimumWidth: sipAccountViewRect.width - 32 |
| 500 | Layout.maximumWidth: JamiTheme.maximumWidthSettingsView - 32 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 501 | Layout.fillHeight: true |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 502 | } |
| 503 | } |
| 504 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 505 | } |
| 506 | } |