blob: e3dc44bd4fc7b9ff40251ac79f062f5513eab693 [file] [log] [blame]
Sébastien Blin1f915762020-08-03 13:27:42 -04001/*
2 * Copyright (C) 2019-2020 by Savoir-faire Linux
3 * Author: Yang Wang <yang.wang@savoirfairelinux.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19import QtQuick 2.15
20import QtQuick.Window 2.14
21import QtQuick.Controls 2.14
22import QtQuick.Controls.Universal 2.12
23import QtQuick.Layouts 1.3
24import QtGraphicalEffects 1.14
25import net.jami.Models 1.0
26
27import "../../commoncomponents"
28
29Rectangle {
ababi6fa08612020-08-10 19:13:28 +020030 id: sipAccountViewRect
Sébastien Blin1f915762020-08-03 13:27:42 -040031 signal navigateToMainView
32 signal navigateToNewWizardView
ababia284cae2020-08-10 12:33:34 +020033 signal backArrowClicked
Sébastien Blin1f915762020-08-03 13:27:42 -040034
ababi6fa08612020-08-10 19:13:28 +020035 property int preferredColumnWidth : sipAccountViewRect.width / 2 - 50
36
Sébastien Blin1f915762020-08-03 13:27:42 -040037 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(
ababi6fa08612020-08-10 19:13:28 +020060 currentSIPAccountAvatar.boothWidth),
Sébastien Blin1f915762020-08-03 13:27:42 -040061 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 Blin1f915762020-08-03 13:27:42 -040085 ClientWrapper.accountAdaptor.setSelectedConvId()
86
87 if(ClientWrapper.utilsAdaptor.getAccountListSize() > 0){
88 navigateToMainView()
89 } else {
90 navigateToNewWizardView()
91 }
92 }
93 }
94
95 Layout.fillHeight: true
ababi6fa08612020-08-10 19:13:28 +020096 Layout.maximumWidth: JamiTheme.maximumWidthSettingsView
97 anchors.centerIn: parent
Sébastien Blin1f915762020-08-03 13:27:42 -040098
99 ColumnLayout {
ababi6fa08612020-08-10 19:13:28 +0200100 anchors.fill: sipAccountViewRect
Sébastien Blin1f915762020-08-03 13:27:42 -0400101
102 RowLayout {
ababi6fa08612020-08-10 19:13:28 +0200103 id: sipAccountPageTitle
104 Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
105 Layout.leftMargin: JamiTheme.preferredMarginSize
Sébastien Blin1f915762020-08-03 13:27:42 -0400106 Layout.fillWidth: true
ababi6fa08612020-08-10 19:13:28 +0200107 Layout.maximumHeight: 64
108 Layout.minimumHeight: 64
109 Layout.preferredHeight: 64
Sébastien Blin1f915762020-08-03 13:27:42 -0400110
ababia284cae2020-08-10 12:33:34 +0200111 HoverableButton {
ababi6fa08612020-08-10 19:13:28 +0200112 id: backToSettingsMenuButton
ababia284cae2020-08-10 12:33:34 +0200113
114 Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
ababi6fa08612020-08-10 19:13:28 +0200115 Layout.preferredWidth: JamiTheme.preferredFieldHeight
116 Layout.preferredHeight: JamiTheme.preferredFieldHeight
117 Layout.rightMargin: JamiTheme.preferredMarginSize
ababia284cae2020-08-10 12:33:34 +0200118
ababi6fa08612020-08-10 19:13:28 +0200119 radius: 32
ababia284cae2020-08-10 12:33:34 +0200120 source: "qrc:/images/icons/ic_arrow_back_24px.svg"
121 backgroundColor: "white"
122 onExitColor: "white"
123
Yang Wangb97bde42020-08-07 11:24:18 -0400124 toolTipText: qsTr("Toggle to display side panel")
125 hoverEnabled: true
ababia284cae2020-08-10 12:33:34 +0200126 visible: mainViewWindow.sidePanelHidden
127
128 onClicked: {
129 backArrowClicked()
130 }
131 }
132
ababi6fa08612020-08-10 19:13:28 +0200133 ElidedTextLabel {
Sébastien Blin1f915762020-08-03 13:27:42 -0400134 Layout.fillWidth: true
ababi6fa08612020-08-10 19:13:28 +0200135 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 Blin1f915762020-08-03 13:27:42 -0400144 }
145 }
146
147 ScrollView {
ababi6fa08612020-08-10 19:13:28 +0200148 id: sipAccountScrollView
Sébastien Blin1f915762020-08-03 13:27:42 -0400149
Sébastien Blin1f915762020-08-03 13:27:42 -0400150 property ScrollBar vScrollBar: ScrollBar.vertical
151
152 Layout.fillHeight: true
153 Layout.fillWidth: true
ababi6fa08612020-08-10 19:13:28 +0200154 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Sébastien Blin1f915762020-08-03 13:27:42 -0400155
ababi6fa08612020-08-10 19:13:28 +0200156 width: sipAccountViewRect.width
157 height: sipAccountViewRect.height - sipAccountPageTitle.height
158
159 ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
Sébastien Blin1f915762020-08-03 13:27:42 -0400160 ScrollBar.vertical.policy: ScrollBar.AsNeeded
161
Sébastien Blin1f915762020-08-03 13:27:42 -0400162 clip: true
163
164 ColumnLayout {
165 id: accountSIPLayout
166
167 Layout.fillHeight: true
ababi6fa08612020-08-10 19:13:28 +0200168 Layout.preferredWidth: sipAccountViewRect.width
169 Layout.alignment: Qt.AlignHCenter
Sébastien Blin1f915762020-08-03 13:27:42 -0400170
ababi6fa08612020-08-10 19:13:28 +0200171 spacing: 24
Sébastien Blin1f915762020-08-03 13:27:42 -0400172
ababi6fa08612020-08-10 19:13:28 +0200173 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 Blin1f915762020-08-03 13:27:42 -0400185 }
186
187 ColumnLayout {
Sébastien Blin1f915762020-08-03 13:27:42 -0400188 Layout.fillWidth: true
ababi6fa08612020-08-10 19:13:28 +0200189 Layout.fillHeight: true
190 Layout.leftMargin: JamiTheme.preferredMarginSize
191 spacing: 8
Sébastien Blin1f915762020-08-03 13:27:42 -0400192
ababi6fa08612020-08-10 19:13:28 +0200193 Label {
194 Layout.fillWidth: true
Sébastien Blin1f915762020-08-03 13:27:42 -0400195
ababi6fa08612020-08-10 19:13:28 +0200196 Layout.maximumHeight: JamiTheme.preferredFieldHeight
197 Layout.preferredHeight: JamiTheme.preferredFieldHeight
198 Layout.minimumHeight: JamiTheme.preferredFieldHeight
Sébastien Blin1f915762020-08-03 13:27:42 -0400199
ababi6fa08612020-08-10 19:13:28 +0200200 text: qsTr("Profile")
201 font.pointSize: JamiTheme.headerFontSize
202 font.kerning: true
203
204 horizontalAlignment: Text.AlignLeft
205 verticalAlignment: Text.AlignVCenter
Sébastien Blin1f915762020-08-03 13:27:42 -0400206 }
207
ababi6fa08612020-08-10 19:13:28 +0200208 PhotoboothView {
209 id: currentSIPAccountAvatar
Sébastien Blin1f915762020-08-03 13:27:42 -0400210
ababi6fa08612020-08-10 19:13:28 +0200211 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Sébastien Blin1f915762020-08-03 13:27:42 -0400212
ababi6fa08612020-08-10 19:13:28 +0200213 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 Blin1f915762020-08-03 13:27:42 -0400229 }
230 }
231
Sébastien Blinacb1cf02020-08-17 22:38:19 -0400232 MaterialLineEdit {
ababi6fa08612020-08-10 19:13:28 +0200233 id: displaySIPNameLineEdit
Sébastien Blin1f915762020-08-03 13:27:42 -0400234
Sébastien Blinacb1cf02020-08-17 22:38:19 -0400235 Layout.maximumWidth: JamiTheme.preferredFieldWidth
ababi6fa08612020-08-10 19:13:28 +0200236 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 Blinacb1cf02020-08-17 22:38:19 -0400247 padding: 8
ababi6fa08612020-08-10 19:13:28 +0200248
249 onEditingFinished: {
250 ClientWrapper.accountAdaptor.setCurrAccDisplayName(
251 displaySIPNameLineEdit.text)
252 }
Sébastien Blin1f915762020-08-03 13:27:42 -0400253 }
ababi6fa08612020-08-10 19:13:28 +0200254 }
Sébastien Blin1f915762020-08-03 13:27:42 -0400255
ababi6fa08612020-08-10 19:13:28 +0200256
257 ColumnLayout {
258 Layout.fillWidth: true
259 Layout.alignment: Qt.AlignHCenter
260 Layout.leftMargin: JamiTheme.preferredMarginSize
261 spacing: 8
262
263 ElidedTextLabel {
Sébastien Blin1f915762020-08-03 13:27:42 -0400264 Layout.fillWidth: true
265
ababi6fa08612020-08-10 19:13:28 +0200266 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 Blin1f915762020-08-03 13:27:42 -0400288 Layout.fillWidth: true
ababi6fa08612020-08-10 19:13:28 +0200289 Layout.maximumHeight: JamiTheme.preferredFieldHeight
290 Layout.preferredHeight: JamiTheme.preferredFieldHeight
291 Layout.minimumHeight: JamiTheme.preferredFieldHeight
Sébastien Blin1f915762020-08-03 13:27:42 -0400292
ababi6fa08612020-08-10 19:13:28 +0200293 eText: qsTr("Username")
294 fontSize: JamiTheme.settingsFontSize
295 maxWidth: preferredColumnWidth
296 }
Sébastien Blin1f915762020-08-03 13:27:42 -0400297
Sébastien Blinacb1cf02020-08-17 22:38:19 -0400298 MaterialLineEdit {
ababi6fa08612020-08-10 19:13:28 +0200299 id: usernameSIP
300
301 fieldLayoutWidth: preferredColumnWidth
302
303 font.pointSize: JamiTheme.settingsFontSize // Albert: buttonSize?
Sébastien Blin1f915762020-08-03 13:27:42 -0400304 font.kerning: true
305
306 horizontalAlignment: Text.AlignLeft
307 verticalAlignment: Text.AlignVCenter
Sébastien Blin1f915762020-08-03 13:27:42 -0400308
Sébastien Blinacb1cf02020-08-17 22:38:19 -0400309 Layout.maximumWidth: preferredColumnWidth
310 Layout.minimumHeight: JamiTheme.preferredFieldHeight
311 Layout.preferredHeight: JamiTheme.preferredFieldHeight
312 Layout.maximumHeight: JamiTheme.preferredFieldHeight
313 padding: 8
314
ababi6fa08612020-08-10 19:13:28 +0200315 onEditingFinished: {
316 ClientWrapper.settingsAdaptor.setAccountConfig_Username(
317 usernameSIP.text)
Sébastien Blin1f915762020-08-03 13:27:42 -0400318 }
319 }
Sébastien Blin1f915762020-08-03 13:27:42 -0400320
ababi6fa08612020-08-10 19:13:28 +0200321 // host name
322 ElidedTextLabel {
Sébastien Blin1f915762020-08-03 13:27:42 -0400323 Layout.fillWidth: true
ababi6fa08612020-08-10 19:13:28 +0200324 Layout.maximumHeight: JamiTheme.preferredFieldHeight
325 Layout.preferredHeight: JamiTheme.preferredFieldHeight
326 Layout.minimumHeight: JamiTheme.preferredFieldHeight
Sébastien Blin1f915762020-08-03 13:27:42 -0400327
ababi6fa08612020-08-10 19:13:28 +0200328 eText: qsTr("Hostname")
329 fontSize: JamiTheme.settingsFontSize
330 maxWidth: preferredColumnWidth
331 }
Sébastien Blin1f915762020-08-03 13:27:42 -0400332
Sébastien Blinacb1cf02020-08-17 22:38:19 -0400333 MaterialLineEdit {
ababi6fa08612020-08-10 19:13:28 +0200334 id: hostnameSIP
335
336 fieldLayoutWidth: preferredColumnWidth
337
Sébastien Blinacb1cf02020-08-17 22:38:19 -0400338 font.pointSize: JamiTheme.settingsFontSize
Sébastien Blin1f915762020-08-03 13:27:42 -0400339 font.kerning: true
340
341 horizontalAlignment: Text.AlignLeft
342 verticalAlignment: Text.AlignVCenter
Sébastien Blin1f915762020-08-03 13:27:42 -0400343
Sébastien Blinacb1cf02020-08-17 22:38:19 -0400344 Layout.maximumWidth: preferredColumnWidth
345 Layout.minimumHeight: JamiTheme.preferredFieldHeight
346 Layout.preferredHeight: JamiTheme.preferredFieldHeight
347 Layout.maximumHeight: JamiTheme.preferredFieldHeight
348 padding: 8
349
ababi6fa08612020-08-10 19:13:28 +0200350 onEditingFinished: {
351 ClientWrapper.settingsAdaptor.setAccountConfig_Hostname(
352 hostnameSIP.text)
Sébastien Blin1f915762020-08-03 13:27:42 -0400353 }
354 }
Sébastien Blin1f915762020-08-03 13:27:42 -0400355
ababi6fa08612020-08-10 19:13:28 +0200356 // proxy
357 ElidedTextLabel {
Sébastien Blin1f915762020-08-03 13:27:42 -0400358 Layout.fillWidth: true
ababi6fa08612020-08-10 19:13:28 +0200359 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 Blin1f915762020-08-03 13:27:42 -0400366 }
367
Sébastien Blinacb1cf02020-08-17 22:38:19 -0400368 MaterialLineEdit {
ababi6fa08612020-08-10 19:13:28 +0200369 id: proxySIP
Sébastien Blin1f915762020-08-03 13:27:42 -0400370
ababi6fa08612020-08-10 19:13:28 +0200371 fieldLayoutWidth: preferredColumnWidth
Sébastien Blin1f915762020-08-03 13:27:42 -0400372
ababi6fa08612020-08-10 19:13:28 +0200373 font.pointSize: JamiTheme.settingsFontSize // Albert
Sébastien Blin1f915762020-08-03 13:27:42 -0400374 font.kerning: true
375
ababi6fa08612020-08-10 19:13:28 +0200376 horizontalAlignment: Text.AlignLeft
377 verticalAlignment: Text.AlignVCenter
Sébastien Blin1f915762020-08-03 13:27:42 -0400378
Sébastien Blinacb1cf02020-08-17 22:38:19 -0400379 Layout.maximumWidth: preferredColumnWidth
380 Layout.minimumHeight: JamiTheme.preferredFieldHeight
381 Layout.preferredHeight: JamiTheme.preferredFieldHeight
382 Layout.maximumHeight: JamiTheme.preferredFieldHeight
383 padding: 8
384
ababi6fa08612020-08-10 19:13:28 +0200385 onEditingFinished: {
386 ClientWrapper.settingsAdaptor.setAccountConfig_ProxyServer(
387 proxySIP.text)
Sébastien Blin1f915762020-08-03 13:27:42 -0400388 }
389 }
390
ababi6fa08612020-08-10 19:13:28 +0200391 // password
392 ElidedTextLabel {
Sébastien Blin1f915762020-08-03 13:27:42 -0400393 Layout.fillWidth: true
ababi6fa08612020-08-10 19:13:28 +0200394 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 Blinacb1cf02020-08-17 22:38:19 -0400403 MaterialLineEdit {
ababi6fa08612020-08-10 19:13:28 +0200404 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 Blinacb1cf02020-08-17 22:38:19 -0400415 Layout.maximumWidth: preferredColumnWidth
416 Layout.minimumHeight: JamiTheme.preferredFieldHeight
417 Layout.preferredHeight: JamiTheme.preferredFieldHeight
418 Layout.maximumHeight: JamiTheme.preferredFieldHeight
419 padding: 8
420
ababi6fa08612020-08-10 19:13:28 +0200421 onEditingFinished: {
422 ClientWrapper.settingsAdaptor.setAccountConfig_Password(
423 passSIPlineEdit.text)
424 }
Sébastien Blin1f915762020-08-03 13:27:42 -0400425 }
426 }
ababi6fa08612020-08-10 19:13:28 +0200427
428
Sébastien Blinacb1cf02020-08-17 22:38:19 -0400429 MaterialButton {
430 color: JamiTheme.buttonTintedRed
431 hoveredColor: JamiTheme.buttonTintedRedHovered
432 pressedColor: JamiTheme.buttonTintedRedPressed
ababi6fa08612020-08-10 19:13:28 +0200433
434 Layout.alignment: Qt.AlignHCenter
Sébastien Blinacb1cf02020-08-17 22:38:19 -0400435
436 Layout.minimumWidth: JamiTheme.preferredFieldWidth
437 Layout.preferredWidth: JamiTheme.preferredFieldWidth
438 Layout.maximumWidth: JamiTheme.preferredFieldWidth
ababi6fa08612020-08-10 19:13:28 +0200439 Layout.minimumHeight: JamiTheme.preferredFieldHeight
440 Layout.preferredHeight: JamiTheme.preferredFieldHeight
441 Layout.maximumHeight: JamiTheme.preferredFieldHeight
442
Sébastien Blinacb1cf02020-08-17 22:38:19 -0400443 toolTipText: qsTr("Press this button to delete this account")
ababi6fa08612020-08-10 19:13:28 +0200444 text: qsTr("Delete Account")
Sébastien Blinacb1cf02020-08-17 22:38:19 -0400445
446 source: "qrc:/images/icons/delete_forever-24px.svg"
ababi6fa08612020-08-10 19:13:28 +0200447
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 Blin1f915762020-08-03 13:27:42 -0400514 }
515
516 Item {
ababi6fa08612020-08-10 19:13:28 +0200517 Layout.preferredWidth: sipAccountViewRect.width - 32
518 Layout.minimumWidth: sipAccountViewRect.width - 32
519 Layout.maximumWidth: JamiTheme.maximumWidthSettingsView - 32
Sébastien Blin1f915762020-08-03 13:27:42 -0400520 Layout.fillHeight: true
Sébastien Blin1f915762020-08-03 13:27:42 -0400521 }
522 }
523 }
Sébastien Blin1f915762020-08-03 13:27:42 -0400524 }
525}