settings: code clean up

Correct Layout and Anchors emplacement
Erase inutile code
Fix binding loop warnings
Replace magic numbers by JamiTheme values
Remove multiline comments from qml files

Change-Id: Icdde094750ccc39fa3b3c9fb9368f8609eb8981d
Gitlab: #5
This commit is contained in:
agsantos
2020-09-03 21:19:10 -04:00
committed by Aline Gondim Santos
parent 3fdd3916a8
commit c5687508cd
67 changed files with 1553 additions and 3001 deletions

View File

@@ -135,9 +135,7 @@ ApplicationWindow {
source: root.contentItem
color: "transparent"
/*
* Color animation for overlay when pop up is shown.
*/
// Color animation for overlay when pop up is shown.
ColorAnimation on color {
to: Qt.rgba(0, 0, 0, 0.33)
duration: 500

View File

@@ -26,9 +26,8 @@ import net.jami.Models 1.0
import "../constant"
import "../wizardview/components"
/*
* Account Migration Dialog for migrating account
*/
// Account Migration Dialog for migrating account
Window{
id: accountMigrationDialog

View File

@@ -19,10 +19,8 @@
import QtQuick 2.14
/*
* Inspired by
* https://stackoverflow.com/questions/16534489/qml-control-border-width-and-color-on-any-one-side-of-rectangle-element
*/
// Inspired by
// https://stackoverflow.com/questions/16534489/qml-control-border-width-and-color-on-any-one-side-of-rectangle-element
Rectangle {
property bool commonBorder: true

View File

@@ -22,9 +22,10 @@ import QtQuick.Layouts 1.14
import QtQuick.Controls.Styles 1.4
import net.jami.Models 1.0
import net.jami.Adapters 1.0
import "../constant"
Dialog {
id: deleteAccountDialog
id: root
property int profileType: SettingsAdapter.getCurrentAccount_Profile_Info_Type()
@@ -49,139 +50,113 @@ Dialog {
}
}
visible: false
title: qsTr("Account deletion")
header : Rectangle {
width: parent.width
height: 64
color: "transparent"
Text {
anchors.fill: parent
anchors.leftMargin: JamiTheme.preferredMarginSize
anchors.topMargin: JamiTheme.preferredMarginSize
contentItem: Rectangle{
implicitWidth: 400
implicitHeight: 300
text: qsTr("Account deletion")
font.pointSize: JamiTheme.headerFontSize
wrapMode: Text.Wrap
}
}
visible: false
x: (parent.width - width) / 2
y: (parent.height - height) / 2
contentItem: Rectangle {
implicitHeight: contentLayout.implicitHeight + 64 + JamiTheme.preferredMarginSize
implicitWidth: 350
ColumnLayout{
id: contentLayout
anchors.fill: parent
spacing: 7
anchors.centerIn: parent
Layout.alignment: Qt.AlignCenter
Label{
Label {
id: labelDeletion
Layout.topMargin: 11
Layout.leftMargin: 11
Layout.rightMargin: 11
Layout.fillWidth: true
Layout.preferredHeight: 30
Layout.alignment: Qt.AlignHCenter
font.pointSize: 8
font.pointSize: JamiTheme.textFontSize
font.kerning: true
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
wrapMode: Text.Wrap
text:qsTr("Do you really want to delete the following account?")
}
Label{
Label {
id: labelBestId
Layout.leftMargin: 11
Layout.rightMargin: 11
Layout.topMargin: 5
Layout.fillWidth: true
Layout.preferredHeight: 30
Layout.alignment: Qt.AlignHCenter
font.pointSize: 8
font.pointSize: JamiTheme.textFontSize
font.kerning: true
font.bold: true
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
wrapMode: Text.Wrap
text: SettingsAdapter.getAccountBestName()
}
Label{
Label {
id: labelAccountHash
Layout.leftMargin: 11
Layout.rightMargin: 11
Layout.alignment: Qt.AlignHCenter
font.pointSize: 8
Layout.preferredHeight: 30
font.pointSize: JamiTheme.textFontSize
font.kerning: true
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
wrapMode: Text.Wrap
text: SettingsAdapter.getCurrentAccount_Profile_Info_Uri()
}
Item{
Layout.fillWidth: true
Layout.leftMargin: 11
Layout.rightMargin: 11
Layout.maximumHeight: 5
Layout.preferredHeight: 5
Layout.minimumHeight: 5
}
Label{
Label {
id: labelWarning
Layout.leftMargin: 11
Layout.rightMargin: 11
Layout.preferredWidth: 300
Layout.topMargin: 5
Layout.preferredHeight: 30
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
visible: ! isSIP
Layout.alignment: Qt.AlignHCenter
wrapMode: Text.Wrap
text: qsTr("If this account hasn't been exported, or added to another device, it will be irrevocably lost.")
font.pointSize: 8
font.pointSize: JamiTheme.textFontSize
font.kerning: true
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: "red"
}
Item{
RowLayout {
Layout.topMargin: JamiTheme.preferredMarginSize / 2
Layout.bottomMargin: 5
Layout.preferredHeight: 30
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.leftMargin: 11
Layout.rightMargin: 11
Layout.maximumHeight: 10
Layout.preferredHeight: 10
Layout.minimumHeight: 10
}
RowLayout{
spacing: 7
Layout.leftMargin: 11
Layout.rightMargin: 11
Item{
Layout.fillWidth: true
Layout.minimumWidth: 40
Layout.maximumHeight: 20
Layout.preferredHeight: 20
Layout.minimumHeight: 20
}
HoverableRadiusButton{
HoverableRadiusButton {
id: btnDeleteAccept
Layout.fillWidth: true
Layout.maximumWidth: 130
Layout.preferredWidth: 130
Layout.minimumWidth: 130
Layout.maximumHeight: 30
Layout.preferredHeight: 30
Layout.minimumHeight: 30
radius: height /2
radius: height / 2
text: qsTr("Delete")
font.pointSize: 10
font.pointSize: JamiTheme.buttonFontSize
font.kerning: true
onClicked: {
@@ -190,25 +165,12 @@ Dialog {
}
}
Item{
Layout.fillWidth: true
Layout.minimumWidth: 40
Layout.maximumHeight: 20
Layout.preferredHeight: 20
Layout.minimumHeight: 20
}
HoverableButtonTextItem{
HoverableButtonTextItem {
id: btnDeleteCancel
Layout.leftMargin: 20
Layout.fillWidth: true
Layout.maximumWidth: 130
Layout.preferredWidth: 130
Layout.minimumWidth: 130
Layout.maximumHeight: 30
Layout.preferredHeight: 30
Layout.minimumHeight: 30
backgroundColor: "red"
onEnterColor: Qt.rgba(150 / 256, 0, 0, 0.7)
@@ -218,37 +180,16 @@ Dialog {
onPressColor: backgroundColor
textColor: "white"
radius: height /2
radius: height / 2
text: qsTr("Cancel")
font.pointSize: 10
font.pointSize: JamiTheme.buttonFontSize
font.kerning: true
onClicked: {
reject()
}
}
Item{
Layout.fillWidth: true
Layout.minimumWidth: 40
Layout.maximumHeight: 20
Layout.preferredHeight: 20
Layout.minimumHeight: 20
}
}
Item{
Layout.fillWidth: true
Layout.maximumHeight: 5
Layout.preferredHeight: 5
Layout.minimumHeight: 5
Layout.leftMargin: 11
Layout.rightMargin: 11
Layout.bottomMargin: 11
}
}
}

View File

@@ -22,12 +22,10 @@ import QtQuick.Layouts 1.14
import QtGraphicalEffects 1.0
import net.jami.Models 1.0
/*
* General menu item.
* Can control top, bottom, left, right border width.
* Use onClicked slot to simulate item click event.
* Can have image icon at the left of the text.
*/
// General menu item.
// Can control top, bottom, left, right border width.
// Use onClicked slot to simulate item click event.
// Can have image icon at the left of the text.
MenuItem {
id: menuItem

View File

@@ -22,15 +22,13 @@ import net.jami.Models 1.0
import QtGraphicalEffects 1.15
/*
* HoverableButton contains the following configurable properties:
* 1. Color changes on different button state
* 2. Radius control (rounded)
* 3. Text content or image content
* 4. Can use OnClicked slot to implement some click logic
*
* Note: if use text property directly, buttonTextColor will not work.
*/
// HoverableButton contains the following configurable properties:
// 1. Color changes on different button state
// 2. Radius control (rounded)
// 3. Text content or image content
// 4. Can use OnClicked slot to implement some click logic
//
// Note: if use text property directly, buttonTextColor will not work.
Button {
id: hoverableButton

View File

@@ -1,4 +1,3 @@
/*
* Copyright (C) 2020 by Savoir-faire Linux
* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
@@ -20,20 +19,18 @@ import QtQuick 2.14
import QtQuick.Controls 2.14
import net.jami.Models 1.0
// HoverableButton containes functionalites:
// 1. Color changes on different button state
// 2. Radius control (rounded)
// 3. Text content or image content
// 4. Can use OnClicked slot to implement some click logic
/*
* HoverableButton containes functionalites:
* 1. Color changes on different button state
* 2. Radius control (rounded)
* 3. Text content or image content
* 4. Can use OnClicked slot to implement some click logic
*/
Button {
id: hoverableButton
id: root
property int fontPointSize: 9
property int buttonImageHeight: hoverableButtonBackground.height - 10
property int buttonImageWidth: hoverableButtonBackground.width - 10
property int buttonImageHeight: hoverableButtonBackground.height
property int buttonImageWidth: hoverableButtonBackground.width
property string backgroundColor: JamiTheme.releaseColor
property string onPressColor: JamiTheme.pressColor
@@ -58,8 +55,8 @@ Button {
ToolTip.text: toolTipText
contentItem: Text {
text: hoverableButton.text
font: hoverableButton.font
text: root.text
font: root.font
opacity: enabled ? 1.0 : 0.3
color: textColor
horizontalAlignment: Text.AlignHCenter
@@ -70,7 +67,7 @@ Button {
background: Rectangle {
id: hoverableButtonBackground
color: hoverableButton.enabled ? backgroundColor:onDisabledBackgroundColor
color: root.enabled ? backgroundColor:onDisabledBackgroundColor
Image {
id: hoverableButtonImage
@@ -86,7 +83,7 @@ Button {
}
MouseArea {
enabled: hoverableButton.enabled
enabled: root.enabled
anchors.fill: parent
hoverEnabled: true
@@ -96,7 +93,7 @@ Button {
}
onReleased: {
hoverableButtonBackground.color = onReleaseColor
hoverableButton.clicked()
root.clicked()
}
onEntered: {
hoverableButtonBackground.color = onEnterColor

View File

@@ -1,4 +1,3 @@
/*
* Copyright (C) 2020 by Savoir-faire Linux
* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
@@ -21,15 +20,14 @@ import QtQuick.Controls 2.14
import net.jami.Models 1.0
/*
* HoverableButton contains the following configurable properties:
* 1. Color changes on different button state
* 2. Radius control (rounded)
* 3. Text content or image content
* 4. Can use OnClicked slot to implement some click logic
*/
// HoverableButton contains the following configurable properties:
// 1. Color changes on different button state
// 2. Radius control (rounded)
// 3. Text content or image content
// 4. Can use OnClicked slot to implement some click logic
Button {
id: hoverableButton
id: root
property int fontPointSize: 9
property int buttonImageHeight: hoverableButtonBackground.height - 10
property int buttonImageWidth: hoverableButtonBackground.width - 10
@@ -83,7 +81,7 @@ Button {
}
onReleased: {
hoverableButtonBackground.color = onReleaseColor
hoverableButton.clicked()
root.clicked()
}
onEntered: {
hoverableButtonBackground.color = onEnterColor

View File

@@ -29,21 +29,10 @@ TextField{
}
}
Layout.minimumHeight: fieldLayoutHeight
Layout.preferredHeight: fieldLayoutHeight
Layout.maximumHeight: fieldLayoutHeight
Layout.minimumWidth: fieldLayoutWidth
Layout.maximumWidth: fieldLayoutWidth
Layout.preferredWidth: fieldLayoutWidth
Layout.fillWidth: layoutFillwidth
Layout.alignment: Qt.AlignHCenter
wrapMode: Text.Wrap
readOnly: false
selectByMouse: true
font.pointSize: 10
font.pointSize: JamiTheme.settingsFontSize
font.kerning: true
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter

View File

@@ -1,4 +1,3 @@
/*
* Copyright (C) 2020 by Savoir-faire Linux
* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
@@ -20,12 +19,9 @@ import QtQuick 2.14
import Qt.labs.platform 1.1
FileDialog {
id: fileDialog
id: root
/*
* Use enum to avoid importing Qt.labs.platform when using JamiFileDialog.
*/
// Use enum to avoid importing Qt.labs.platform when using JamiFileDialog.
property int mode: JamiFileDialog.Mode.OpenFile
enum Mode {
@@ -39,13 +35,13 @@ FileDialog {
onModeChanged: {
switch(mode) {
case JamiFileDialog.Mode.OpenFile:
fileDialog.fileMode = FileDialog.OpenFile
root.fileMode = FileDialog.OpenFile
break
case JamiFileDialog.Mode.OpenFiles:
fileDialog.fileMode = FileDialog.OpenFiles
root.fileMode = FileDialog.OpenFiles
break
default:
fileDialog.fileMode = FileDialog.SaveFile
root.fileMode = FileDialog.SaveFile
}
}
}

View File

@@ -19,6 +19,9 @@
import QtQuick 2.14
import QtQuick.Controls 2.14
import QtGraphicalEffects 1.15
import QtQuick.Layouts 1.15
import "../constant"
Button {
id: root
@@ -33,6 +36,8 @@ Button {
property var preferredWidth: 400
property var preferredHeight: 36
property int elide: Text.ElideRight
font.kerning: true
icon.source: ""
@@ -44,43 +49,48 @@ Button {
Rectangle {
anchors.fill: parent
color: "transparent"
Image {
source: root.icon.source
width: root.icon.width
height: root.icon.height
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 16
layer {
enabled: true
effect: ColorOverlay {
id: overlay
color:{
if (!outlined)
return "white"
if (hovered && root.hoveredColor)
return root.hoveredColor
if (checked && root.pressedColor)
return root.pressedColor
return root.color
RowLayout {
anchors.fill: parent
anchors.centerIn: parent
Image {
source: root.icon.source
Layout.preferredWidth: root.icon.width
Layout.preferredHeight: root.icon.height
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
Layout.leftMargin: JamiTheme.preferredMarginSize / 2
layer {
enabled: true
effect: ColorOverlay {
id: overlay
color:{
if (!outlined)
return "white"
if (hovered && root.hoveredColor)
return root.hoveredColor
if (checked && root.pressedColor)
return root.pressedColor
return root.color
}
}
}
}
}
Text {
text: root.text
color: {
if (!outlined)
return "white"
if (hovered && root.hoveredColor)
return root.hoveredColor
if (checked && root.pressedColor)
return root.pressedColor
return root.color
Text {
Layout.rightMargin: root.icon.width + JamiTheme.preferredMarginSize / 2
text: root.text
elide: root.elide
color: {
if (!outlined)
return "white"
if (hovered && root.hoveredColor)
return root.hoveredColor
if (checked && root.pressedColor)
return root.pressedColor
return root.color
}
font: root.font
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
}
font: root.font
anchors.centerIn: parent
horizontalAlignment: Text.AlignHCenter
}
}
}

View File

@@ -30,8 +30,6 @@ MessageDialog {
width: 300
height: 200
onRejected: {}
function openWithParameters(titleToDisplay, infoToDisplay, infoIconMode = StandardIcon.Information, buttons = StandardButton.Ok){
title = titleToDisplay
text = infoToDisplay

View File

@@ -23,11 +23,11 @@ import QtQuick.Controls.Styles 1.4
import net.jami.Models 1.0
import "../constant"
/*
* PasswordDialog for changing password and exporting account
*/
// PasswordDialog for changing password and exporting account
Dialog {
id: passwordDialog
id: root
enum PasswordEnteringPurpose {
ChangePassword,
@@ -41,14 +41,14 @@ Dialog {
property int purpose: PasswordDialog.ChangePassword
header : Rectangle {
id: dialogHeader
width: parent.width
height: 64
color: "transparent"
Text {
anchors.left: parent.left
anchors.leftMargin: 24
anchors.bottom: parent.bottom
anchors.bottomMargin: 24
anchors.fill: parent
anchors.leftMargin: JamiTheme.preferredMarginSize
anchors.topMargin: JamiTheme.preferredMarginSize
text: {
switch(purpose){
@@ -61,6 +61,7 @@ Dialog {
}
}
font.pointSize: JamiTheme.headerFontSize
wrapMode: Text.Wrap
}
}
@@ -72,7 +73,7 @@ Dialog {
confirmPasswordEdit.borderColorMode = InfoLineEdit.NORMAL
passwordEdit.clear()
confirmPasswordEdit.clear()
passwordDialog.open()
root.open()
}
function haveDone(code, currentPurpose) {
@@ -116,19 +117,20 @@ Dialog {
}
if (success) {
haveDone(successCode, passwordDialog.purpose)
haveDone(successCode, root.purpose)
} else {
btnChangePasswordConfirm.enabled = false
currentPasswordEdit.borderColorMode = InfoLineEdit.ERROR
}
}
function savePasswordQML() {
var success = false
success = ClientWrapper.accountAdaptor.savePassword(ClientWrapper.utilsAdaptor.getCurrAccId(),currentPasswordEdit.text, passwordEdit.text)
if (success) {
ClientWrapper.accountAdaptor.setArchiveHasPassword(passwordEdit.text.length !== 0)
haveDone(successCode, passwordDialog.purpose)
haveDone(successCode, root.purpose)
} else {
currentPasswordEdit.borderColorMode = InfoLineEdit.ERROR
btnChangePasswordConfirm.enabled = false
@@ -136,73 +138,54 @@ Dialog {
}
visible: false
anchors.centerIn: parent.Center
x: (parent.width - width) / 2
y: (parent.height - height) / 2
height: contentLayout.implicitHeight + 64 + 16
contentItem: Rectangle {
implicitWidth: 280
implicitHeight: contentLayout.implicitHeight + dialogHeader.height + JamiTheme.preferredMarginSize
implicitWidth: 350
ColumnLayout {
id: contentLayout
anchors.fill: parent
spacing: 8
ColumnLayout {
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
spacing: 7
MaterialLineEdit {
id: currentPasswordEdit
ColumnLayout {
spacing: 0
Layout.alignment: Qt.AlignHCenter
MaterialLineEdit {
id: currentPasswordEdit
Layout.maximumHeight: visible ?
48 :
0
Layout.fillWidth: true
visible: purpose === PasswordDialog.ChangePassword || purpose === PasswordDialog.ExportAccount
echoMode: TextInput.Password
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
placeholderText: qsTr("Enter Current Password")
onTextChanged: {
if (purpose === PasswordDialog.ChangePassword) {
validatePassword()
}
if (currentPasswordEdit.text.length == 0) {
btnChangePasswordConfirm.enabled = false
} else {
btnChangePasswordConfirm.enabled = true
}
}
}
}
Item {
Layout.maximumHeight: visible ?
48 :
0
Layout.fillWidth: true
Layout.minimumHeight: 8
Layout.preferredHeight: 8
Layout.maximumHeight: 8
visible: purpose === PasswordDialog.ChangePassword || purpose === PasswordDialog.ExportAccount
echoMode: TextInput.Password
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
placeholderText: qsTr("Enter Current Password")
onTextChanged: {
if (purpose === PasswordDialog.ChangePassword) {
validatePassword()
}
if (currentPasswordEdit.text.length == 0) {
btnChangePasswordConfirm.enabled = false
} else {
btnChangePasswordConfirm.enabled = true
}
}
}
MaterialLineEdit {
id: passwordEdit
Layout.fillWidth: true
Layout.topMargin: JamiTheme.preferredMarginSize / 2
fieldLayoutHeight: 48
layoutFillwidth: true
visible: purpose === PasswordDialog.ChangePassword || purpose === PasswordDialog.SetPassword
echoMode: TextInput.Password
@@ -216,17 +199,11 @@ Dialog {
}
}
Item {
Layout.fillWidth: true
Layout.minimumHeight: 8
Layout.preferredHeight: 8
Layout.maximumHeight: 8
}
MaterialLineEdit {
id: confirmPasswordEdit
Layout.fillWidth: true
Layout.topMargin: JamiTheme.preferredMarginSize / 2
fieldLayoutHeight: 48
layoutFillwidth: true
@@ -244,10 +221,7 @@ Dialog {
}
RowLayout {
spacing: 8
Layout.fillWidth: true
Layout.topMargin: JamiTheme.preferredMarginSize / 2
Layout.alignment: Qt.AlignRight
Button {
@@ -270,6 +244,7 @@ Dialog {
Button {
id: btnChangePasswordCancel
Layout.leftMargin: JamiTheme.preferredMarginSize / 2
contentItem: Text {
text: qsTr("CANCEL")
@@ -281,7 +256,7 @@ Dialog {
}
onClicked: {
passwordDialog.reject()
root.reject()
}
}
}

View File

@@ -6,7 +6,7 @@ import Qt.labs.platform 1.1
import QtGraphicalEffects 1.0
import net.jami.Models 1.0
ColumnLayout{
ColumnLayout {
property bool takePhotoState: false
property bool hasAvatar: false
property bool isDefaultIcon: false
@@ -72,9 +72,7 @@ ColumnLayout{
}
}
spacing: 0
Label{
Label {
id: avatarLabel
visible: !takePhotoState
@@ -90,11 +88,11 @@ ColumnLayout{
color: "grey"
radius: height / 2
Image{
Image {
id: avatarImg
anchors.fill: parent
source: {
source: {
if(imgBase64.length === 0){
return "qrc:/images/default_avatar_overlay.svg"
} else {
@@ -104,7 +102,7 @@ ColumnLayout{
fillMode: Image.PreserveAspectCrop
layer.enabled: true
layer.effect: OpacityMask {
maskSource: Rectangle{
maskSource: Rectangle {
width: avatarImg.width
height: avatarImg.height
radius: {
@@ -117,12 +115,13 @@ ColumnLayout{
}
}
PhotoboothPreviewRender{
PhotoboothPreviewRender {
id:previewWidget
onHideBooth:{
stopBooth()
}
visible: takePhotoState
focus: visible
@@ -132,7 +131,7 @@ ColumnLayout{
layer.enabled: true
layer.effect: OpacityMask {
maskSource: Rectangle{
maskSource: Rectangle {
width: previewWidget.width
height: previewWidget.height
radius: {
@@ -142,7 +141,7 @@ ColumnLayout{
}
}
Label{
Label {
id: flashOverlay
anchors.fill: previewWidget
@@ -159,15 +158,13 @@ ColumnLayout{
}
}
RowLayout{
RowLayout {
id: buttonsRowLayout
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.preferredHeight: 30
Layout.topMargin: 5
spacing: 15
Layout.topMargin: JamiTheme.preferredMarginSize / 2
HoverableButton {
id: takePhotoButton

View File

@@ -1,4 +1,4 @@
/**
/*
* Copyright (C) 2020 by Savoir-faire Linux
* Author: Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com>
*
@@ -100,7 +100,7 @@ ItemDelegate {
ToolTip.text: preferenceSummary
}
HoverableRadiusButton{
HoverableRadiusButton {
id: btnPreference
visible: preferenceType === PreferenceItemDelegate.DEFAULT
backgroundColor: "white"
@@ -113,7 +113,7 @@ ItemDelegate {
buttonImageHeight: 20
buttonImageWidth: 20
source:{
source: {
return "qrc:/images/icons/round-settings-24px.svg"
}

View File

@@ -26,7 +26,7 @@ import QtQuick.Controls.Styles 1.4
import "../constant"
ComboBox {
id: control
id: root
property string tooltipText:""
@@ -35,30 +35,32 @@ ComboBox {
ToolTip.text: tooltipText
delegate: ItemDelegate {
width: control.width
width: root.width
contentItem: Text {
text: {
var currentItem = control.delegateModel.items.get(index)
return currentItem.model[control.textRole].toString()
if (index < 0)
return qsTr("")
var currentItem = root.delegateModel.items.get(index)
return currentItem.model[root.textRole].toString()
}
color: "black"
font: control.font
font: root.font
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
}
highlighted: control.highlightedIndex === index
highlighted: root.highlightedIndex === index
}
indicator: Canvas {
id: canvas
x: control.width - width - control.rightPadding
y: control.topPadding + (control.availableHeight - height) / 2
x: root.width - width - root.rightPadding
y: root.topPadding + (root.availableHeight - height) / 2
width: 12
height: 8
contextType: "2d"
Connections {
target: control
target: root
function onPressedChanged(){
canvas.requestPaint()
}
@@ -70,17 +72,17 @@ ComboBox {
context.lineTo(width, 0);
context.lineTo(width / 2, height);
context.closePath();
context.fillStyle = control.pressed ? JamiTheme.pressColor : "black";
context.fillStyle = root.pressed ? JamiTheme.pressColor : "black";
context.fill();
}
}
contentItem: Text {
leftPadding: 0
rightPadding: control.indicator.width + control.spacing
rightPadding: root.indicator.width + root.spacing
text: control.displayText
font: control.font
text: root.displayText
font: root.font
color: "black"
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
@@ -90,21 +92,21 @@ ComboBox {
implicitWidth: 120
implicitHeight: 40
border.color: "white"
border.width: control.visualFocus ? 2 : 1
border.width: root.visualFocus ? 2 : 1
radius: 2
}
popup: Popup {
y: control.height - 1
width: control.width
y: root.height - 1
width: root.width
implicitHeight: contentItem.implicitHeight
padding: 1
contentItem: ListView {
clip: true
implicitHeight: contentHeight
model: control.delegateModel
currentIndex: control.highlightedIndex
model: root.delegateModel
currentIndex: root.highlightedIndex
ScrollIndicator.vertical: ScrollIndicator { }
}

View File

@@ -24,29 +24,21 @@ Button {
id: tintedButton
/*
* TintColor, color for the pixmap when button is hovered.
*/
// TintColor, color for the pixmap when button is hovered.
property string tintColor: "white"
/*
* NormalPixmapSource - icons in normal state (non-toggled).
* SelectedPixmapSource - icons once button is toggled.
*/
// NormalPixmapSource - icons in normal state (non-toggled).
// SelectedPixmapSource - icons once button is toggled.
property string normalPixmapSource: ""
property string selectedPixmapSource: ""
/*
* IsSelected property is to help set button current state manually.
*/
// IsSelected property is to help set button current state manually.
property bool isSelected: false
/*
* ButtonEntered signal is to help call overlay change its opacity
*/
// ButtonEntered signal is to help call overlay change its opacity
signal buttonEntered
function setChecked(checked) {
@@ -100,9 +92,7 @@ Button {
onEntered: {
/*
* Tinted.
*/
// Tinted.
if (isSelected) {
tintedButtonImage.source = "image://tintedPixmap/"
+ selectedPixmapSource.replace(

View File

@@ -90,7 +90,7 @@ Item {
property int menuFontSize: 12
property int maximumWidthSettingsView: 800
property int preferredFieldWidth: 216
property int preferredFieldWidth: 236
property int preferredFieldHeight: 32
property int preferredMarginSize: 16

View File

@@ -1,4 +1,3 @@
/*
* Copyright (C) 2020 by Savoir-faire Linux
* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
@@ -24,10 +23,8 @@ import QtQuick.Controls.Universal 2.12
import QtGraphicalEffects 1.14
import net.jami.Models 1.0
// Import qml component files.
/*
* Import qml component files.
*/
import "components"
import "../wizardview"
import "../settingsview"
@@ -51,9 +48,7 @@ Window {
property int savedWelcomeViewMaxWidth: 0
property bool sidePanelHidden: false
/*
* To calculate tab bar bottom border hidden rect left margin.
*/
// To calculate tab bar bottom border hidden rect left margin.
property int tabBarLeftMargin: 8
property int tabButtonShrinkSize: 8
property bool inSettingsView: false
@@ -92,9 +87,7 @@ Window {
function recursionStackViewItemMove(stackOne, stackTwo, depth=1) {
/*
* Move all items (expect the bottom item) to stacktwo by the same order in stackone.
*/
// Move all items (expect the bottom item) to stacktwo by the same order in stackone.
if (stackOne.depth === depth) {
return
}
@@ -163,10 +156,8 @@ Window {
}
/*
* Check if it is coming from the current responsible call,
* and push views onto the correct stackview
*/
// Check if it is coming from the current responsible call,
// and push views onto the correct stackview
if (callStackView.responsibleAccountId === accountId
&& callStackView.responsibleConvUid === convUid) {
pushCallStackView()
@@ -175,9 +166,7 @@ Window {
function onCloseCallStack(accountId, convUid) {
/*
* Check if call stack view is on any of the stackview.
*/
// Check if call stack view is on any of the stackview.
if (callStackView.responsibleAccountId === accountId
&& callStackView.responsibleConvUid === convUid) {
if (mainViewStack.find(function (item, index) {
@@ -199,9 +188,7 @@ Window {
function onIncomingCallNeedToSetupMainView(accountId, convUid) {
/*
* Set up the call stack view that is needed by call overlay.
*/
// Set up the call stack view that is needed by call overlay.
if (!inSettingsView) {
mainViewStack.pop(null, StackView.Immediate)
sidePanelViewStack.pop(null, StackView.Immediate)
@@ -287,9 +274,7 @@ Window {
splitView.width - sidePanelViewStackPreferredWidth)
SplitView.fillHeight: true
/*
* AccountComboBox is always visible
*/
// AccountComboBox is always visible
AccountComboBox {
id: accountComboBox
@@ -455,10 +440,7 @@ Window {
}
}
/*
* Set up chatview.
*/
// Set up chatview.
MessagesAdapter.setupChatView(currentUID)
callStackView.setLinkedWebview(
communicationPageMessageWebView)
@@ -473,9 +455,7 @@ Window {
}
/*
* Push messageWebView or callStackView onto the correct stackview
*/
// Push messageWebView or callStackView onto the correct stackview
mainViewStack.pop(null, StackView.Immediate)
sidePanelViewStack.pop(null, StackView.Immediate)
@@ -503,10 +483,7 @@ Window {
}
onAccountComboBoxNeedToShowWelcomePage: {
/*
* If the item argument is specified, all items down to (but not including) item will be popped.
*/
// If the item argument is specified, all items down to (but not including) item will be popped.
if (!inSettingsView) {
mainViewStack.pop(welcomePage)
welcomePage.updateWelcomePage()
@@ -535,9 +512,7 @@ Window {
id: callStackView
visible: false
objectName: "callStackViewObject"
}
WelcomePage {
@@ -547,6 +522,7 @@ Window {
SettingsView {
id: settingsView
anchors.fill: parent
visible: false
@@ -622,28 +598,20 @@ Window {
})
/*
* Set qml MessageWebView object pointer to c++.
*/
// Set qml MessageWebView object pointer to c++.
MessagesAdapter.setQmlObject(this)
}
}
onWidthChanged: {
/*
* Hide unnecessary stackview when width is changed.
*/
// Hide unnecessary stackview when width is changed.
if (mainViewWindow.width < sidePanelViewStackPreferredWidth
+ mainViewStackPreferredWidth - 5
&& mainViewStack.visible) {
mainViewStack.visible = false
sidePanelHidden = true
/*
* The find callback function is called for each item in the stack.
*/
// The find callback function is called for each item in the stack.
var inWelcomeViewStack = mainViewStack.find(
function (item, index) {
return index > 0

View File

@@ -27,15 +27,11 @@ Dialog {
id: aboutPopUp
/*
* When dialog is opened, trigger mainViewWindow overlay which is defined in overlay.model (model : true is necessary).
*/
// When dialog is opened, trigger mainViewWindow overlay which is defined in overlay.model (model : true is necessary).
modal: true
/*
* Content height + margin.
*/
// Content height + margin.
contentHeight: aboutPopUpContentRectColumnLayout.height + 5 * 7
ProjectCreditsScrollView {
@@ -129,9 +125,7 @@ Dialog {
verticalAlignment: Text.AlignVCenter
/*
* TextMetrics does not work for multi-line.
*/
// TextMetrics does not work for multi-line.
text: qsTr("The Qt client for Jami.\nJami is a secured and distributed communication software.")
}
@@ -141,9 +135,7 @@ Dialog {
Layout.alignment: Qt.AlignCenter
/*
* Strangely, hoveredLink works badly when width grows too large
*/
// Strangely, hoveredLink works badly when width grows too large
Layout.preferredWidth: 50
Layout.preferredHeight: textMetricsjamiDeclarationHyperText.boundingRect.height
Layout.topMargin: 5
@@ -167,9 +159,7 @@ Dialog {
anchors.fill: parent
/*
* We don't want to eat clicks on the Text.
*/
// We don't want to eat clicks on the Text.
acceptedButtons: Qt.NoButton
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
}

View File

@@ -35,9 +35,7 @@ Popup {
implicitWidth: accountComboBox.width - 1
/*
* Hack - limite the accounts that can be shown.
*/
// Hack - limite the accounts that can be shown.
implicitHeight: {
comboBoxPopup.visible
return Math.min(accountComboBox.height *
@@ -50,9 +48,7 @@ Popup {
id: comboBoxPopupListView
/*
* In list view, index is an interger.
*/
// In list view, index is an interger.
clip: true
model: accountListModel
implicitHeight: contentHeight
@@ -70,9 +66,7 @@ Popup {
fillMode: Image.PreserveAspectFit
mipmap: true
/*
* Role::Picture
*/
// Role::Picture
source: {
var data = accountListModel.data(accountListModel.index(index, 0), 259)
if (data === undefined) {

View File

@@ -31,9 +31,7 @@ Popup {
property int type: ContactPicker.ContactPickerType.JAMICONFERENCE
/*
* Important to keep it one, since enum in c++ starts at one for conferences.
*/
// Important to keep it one, since enum in c++ starts at one for conferences.
enum ContactPickerType {
JAMICONFERENCE = 1,
SIPTRANSFER

View File

@@ -122,9 +122,7 @@ Rectangle {
y: callOverlayRect.height / 2 - sipInputPanel.height / 2
}
/*
* Timer to decide when overlay fade out.
*/
// Timer to decide when overlay fade out.
Timer {
id: callOverlayTimer
interval: 5000
@@ -220,11 +218,9 @@ Rectangle {
color: "transparent"
/*
* Rect states: "entered" state should make overlay fade in,
* "freezed" state should make overlay fade out.
* Combine with PropertyAnimation of opacity.
*/
// Rect states: "entered" state should make overlay fade in,
// "freezed" state should make overlay fade out.
// Combine with PropertyAnimation of opacity.
states: [
State {
name: "entered"
@@ -283,9 +279,7 @@ Rectangle {
}
onAddToConferenceButtonClicked: {
/*
* Create contact picker - conference.
*/
// Create contact picker - conference.
ContactPickerCreation.createContactPickerObjects(
ContactPicker.ContactPickerType.JAMICONFERENCE,
callOverlayRect)
@@ -321,9 +315,7 @@ Rectangle {
}
/*
* MouseAreas to make sure that overlay states are correctly set.
*/
// MouseAreas to make sure that overlay states are correctly set.
MouseArea {
id: callOverlayButtonGroupLeftSideMouseArea
@@ -421,9 +413,7 @@ Rectangle {
id: callViewContextMenu
onTransferCallButtonClicked: {
/*
* Create contact picker - sip transfer.
*/
// Create contact picker - sip transfer.
ContactPickerCreation.createContactPickerObjects(
ContactPicker.ContactPickerType.SIPTRANSFER,
callOverlayRect)

View File

@@ -29,10 +29,8 @@ import "../../commoncomponents"
Rectangle {
id: root
/*
* ButtonCounts here is to make sure that flow layout margin is calculated correctly,
* since no other methods can make buttons at the layout center.
*/
// ButtonCounts here is to make sure that flow layout margin is calculated correctly,
// since no other methods can make buttons at the layout center.
property int buttonPreferredSize: 24
property var isMaster: true
property var isSip: false

View File

@@ -31,10 +31,8 @@ Rectangle {
anchors.fill: parent
/*
* When selected conversation is changed,
* these values will also be changed.
*/
// When selected conversation is changed,
// these values will also be changed.
property string responsibleConvUid: ""
property string responsibleAccountId: ""
@@ -43,9 +41,7 @@ Rectangle {
videoCallPage.closeInCallConversation()
/*
* Close potential window, context menu releated windows.
*/
// Close potential window, context menu releated windows.
audioCallPage.closeContextMenuAndRelatedWindows()
VideoCallFullScreenWindowContainerCreation.closeVideoCallFullScreenWindowContainer()
@@ -110,9 +106,7 @@ Rectangle {
function onShowOutgoingCallPage(accountId, convUid) {
/*
* Need to check whether it is the current selected conversation.
*/
// Need to check whether it is the current selected conversation.
if (responsibleConvUid === convUid
&& responsibleAccountId === accountId) {
showOutgoingCallPage()
@@ -122,9 +116,7 @@ Rectangle {
function onShowIncomingCallPage(accountId, convUid) {
/*
* Check is done within the js.
*/
// Check is done within the js.
IncomingCallPageCreation.createincomingCallPageWindowObjects(
accountId, convUid)
IncomingCallPageCreation.showIncomingCallPageWindow(accountId,

View File

@@ -1,4 +1,4 @@
/**
/*
* Copyright (C) 2020 by Savoir-faire Linux
* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
* Author: Sébastien Blin <sebastien.blin@savoirfairelinux.com>
@@ -129,9 +129,7 @@ Item {
function generateDeviceMenuItem() {
var deviceContextMenuInfoMap = AvAdapter.populateVideoDeviceContextMenuItem()
/*
* Somehow, the map size is undefined, so use this instead.
*/
// Somehow, the map size is undefined, so use this instead.
var mapSize = deviceContextMenuInfoMap["size"]
if (mapSize === 0)
@@ -166,19 +164,19 @@ Item {
})
}
/* TODO: In the future we want to implement this
// TODO: In the future we want to implement this
GeneralMenuItem {
id: advancedInfosItem
// GeneralMenuItem {
// id: advancedInfosItem
itemName: qsTr("Advanced informations")
iconSource: "qrc:/images/icons/info-24px.svg"
leftBorderWidth: commonBorderWidth
rightBorderWidth: commonBorderWidth
// itemName: qsTr("Advanced informations")
// iconSource: "qrc:/images/icons/info-24px.svg"
// leftBorderWidth: commonBorderWidth
// rightBorderWidth: commonBorderWidth
onClicked: {
root.close()
}
}*/
// onClicked: {
// root.close()
// }
// }
}

View File

@@ -30,9 +30,7 @@ Popup {
property int type: ContactPicker.ContactPickerType.JAMICONFERENCE
/*
* Important to keep it one, since enum in c++ starts at one for conferences.
*/
// Important to keep it one, since enum in c++ starts at one for conferences.
enum ContactPickerType {
JAMICONFERENCE = 1,
SIPTRANSFER
@@ -136,9 +134,7 @@ Popup {
onAboutToShow: {
/*
* Reset the model on each show.
*/
// Reset the model on each show.
contactPickerListView.model = ContactAdapter.getContactSelectableModel(
type)
}

View File

@@ -32,10 +32,8 @@ Rectangle {
}
/*
* Hack - there is no real way now to make TextField lose its focus,
* unless transfer it to other component.
*/
// Hack - there is no real way now to make TextField lose its focus,
// unless transfer it to other component.
function clearFocus() {
fakeFocus.forceActiveFocus()
}

View File

@@ -32,19 +32,15 @@ ItemDelegate {
target: conversationSmartListView
/*
* Hack, make sure that smartListItemDelegate does not show extra item
* when searching new contacts.
*/
// Hack, make sure that smartListItemDelegate does not show extra item
// when searching new contacts.
function onForceUpdatePotentialInvalidItem() {
smartListItemDelegate.visible = conversationSmartListView.model.rowCount(
) <= index ? false : true
}
/*
* When currentIndex is -1, deselect items, if not, change select item
*/
// When currentIndex is -1, deselect items, if not, change select item
function onCurrentIndexIsChanged() {
if (conversationSmartListView.currentIndex === -1
|| conversationSmartListView.currentIndex !== index) {
@@ -184,9 +180,7 @@ ItemDelegate {
if (mouse.button === Qt.RightButton) {
smartListContextMenu.parent = mouseAreaSmartListItemDelegate
/*
* Make menu pos at mouse.
*/
// Make menu pos at mouse.
var relativeMousePos = mapToItem(itemSmartListBackground,
mouse.x, mouse.y)
smartListContextMenu.x = relativeMousePos.x

View File

@@ -26,11 +26,9 @@ import net.jami.Models 1.0
import "../../commoncomponents"
/*
* IncomingCallPage as a seperate window,
* exist at the right bottom, as a notification to user that
* a call is incoming.
*/
// IncomingCallPage as a seperate window,
// exist at the right bottom, as a notification to user that
// a call is incoming.
Window {
id: incomingCallPage
@@ -38,9 +36,7 @@ Window {
property int minHeight: 400
/*
* The unique identifier for incomingCallPage
*/
// The unique identifier for incomingCallPage
property string responsibleAccountId: ""
property string responsibleConvUid: ""
@@ -65,14 +61,12 @@ Window {
function updatePositionToRightBottom() {
/*
* Screen right bottom,
* since the qt screen.virtualY, virtualX does not work properly,
* we need to calculate the screen x, y ourselves, by
* using to fact that window will always be in the middle if no x or y
* specificed.
* ex: https://doc.qt.io/qt-5/qscreen.html#geometry-prop
*/
// Screen right bottom,
// since the qt screen.virtualY, virtualX does not work properly,
// we need to calculate the screen x, y ourselves, by
// using to fact that window will always be in the middle if no x or y
// specificed.
// ex: https://doc.qt.io/qt-5/qscreen.html#geometry-prop
var virtualX = (incomingCallPage.x + width / 2) - screen.width / 2
incomingCallPage.x = virtualX + screen.width - width
incomingCallPage.y = screen.height - height - 50
@@ -96,9 +90,7 @@ Window {
color: "black"
/*
* Simulate window drag. (top with height 30).
*/
// Simulate window drag. (top with height 30).
MouseArea {
id: dragMouseArea

View File

@@ -1,4 +1,4 @@
/**
/*
* Copyright (C) 2020 by Savoir-faire Linux
* Author: Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com>
*

View File

@@ -1,4 +1,4 @@
/**
/*
* Copyright (C) 2020 by Savoir-faire Linux
* Author: Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com>
*

View File

@@ -111,16 +111,12 @@ Rectangle {
id: jsBridgeObject
/*
* ID, under which this object will be known at chatview.js side.
*/
// ID, under which this object will be known at chatview.js side.
WebChannel.id: "jsbridge"
/*
* Functions that are exposed, return code can be derived from js side
* by setting callback function.
*/
// Functions that are exposed, return code can be derived from js side
// by setting callback function.
function deleteInteraction(arg) {
MessagesAdapter.deleteInteraction(arg)
}
@@ -274,9 +270,7 @@ Rectangle {
}
/*
* Provide WebEngineProfile.
*/
// Provide WebEngineProfile.
WebEngineProfile {
id: messageWebViewProfile
@@ -288,9 +282,7 @@ Rectangle {
}
/*
* Provide WebChannel by registering jsBridgeObject.
*/
// Provide WebChannel by registering jsBridgeObject.
WebChannel {
id: messageWebViewChannel
registeredObjects: [jsBridgeObject]

View File

@@ -77,9 +77,7 @@ Rectangle {
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
/*
* Width + margin.
*/
// Width + margin.
Layout.preferredWidth: messagingHeaderRect.width
- backToWelcomeViewButton.width - buttonGroup.width - 45
Layout.preferredHeight: messagingHeaderRect.height

View File

@@ -48,9 +48,7 @@ Rectangle {
color: "black"
/*
* Prevent right click propagate to VideoCallPage.
*/
// Prevent right click propagate to VideoCallPage.
MouseArea {
anchors.fill: parent
propagateComposedEvents: false

View File

@@ -24,13 +24,11 @@ import QtQuick.Controls.Universal 2.12
import net.jami.Models 1.0
/*
* ScreenRubberBand as a seperate frameless window,
* is to simulate the whole screen area and provide the user
* the ability to select certain area of it.
*
* Typically, it is used for video screen sharing.
*/
// ScreenRubberBand as a seperate frameless window,
// is to simulate the whole screen area and provide the user
// the ability to select certain area of it.
// Typically, it is used for video screen sharing.
Window {
id: screenRubberBandWindow
@@ -39,17 +37,13 @@ Window {
flags: Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint | Qt.WA_TranslucentBackground
/*
* Opacity with 0.7 window that will fill the entire screen,
* provide the users to select the area that they
* want to share.
*/
// Opacity with 0.7 window that will fill the entire screen,
// provide the users to select the area that they
// want to share.
color: Qt.rgba(0, 0, 0, 0.7)
/*
* Rect for selection.
*/
// Rect for selection.
Rectangle {
id: recSelect
@@ -74,9 +68,7 @@ Window {
cursorShape: Qt.CrossCursor
/*
* Geo changing for user selection.
*/
// Geo changing for user selection.
onPressed: {
originalX = mouseX
originalY = mouseY

View File

@@ -27,12 +27,9 @@ import "../js/screenrubberbandcreation.js" as ScreenRubberBandCreation
import "../../commoncomponents"
/*
* SelectScreenWindow as a seperate window,
* is to make user aware of which screen they want to share,
* during the video call, if the context menu item is selected.
*/
// SelectScreenWindow as a seperate window,
// is to make user aware of which screen they want to share,
// during the video call, if the context menu item is selected.
Window {
id: selectScreenWindow
@@ -42,15 +39,11 @@ Window {
property int selectedScreenNumber: -1
/*
* Decide whether to show screen area or entire screen.
*/
// Decide whether to show screen area or entire screen.
property bool selectArea: false
/*
* How many rows the ScrollView should have.
*/
// How many rows the ScrollView should have.
function calculateRepeaterModel() {
var numberOfScreens = Qt.application.screens.length
@@ -75,9 +68,7 @@ Window {
title: "Screen sharing"
/*
* Note: Qt.application.screens[0] is the app's current existing screen.
*/
// Note: Qt.application.screens[0] is the app's current existing screen.
screen: Qt.application.screens[0]
Rectangle {
@@ -110,9 +101,7 @@ Window {
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
/*
* Column of rows repeater (two screen captures in a row).
*/
// Column of rows repeater (two screen captures in a row).
Column {
id: screenSelectionScrollViewColumn
@@ -134,20 +123,16 @@ Window {
function onSelectedScreenNumberChanged() {
/*
* Recover from green state.
*/
// Recover from green state.
screenSelectionRectOdd.borderColor = JamiTheme.tabbarBorderColor
screenSelectionRectEven.borderColor = JamiTheme.tabbarBorderColor
}
}
/*
* To make sure that two screen captures in one row,
* a repeater of two rect is needed, which one in charge
* of odd number screen, one in charge of even number screen.
*/
// To make sure that two screen captures in one row,
// a repeater of two rect is needed, which one in charge
// of odd number screen, one in charge of even number screen.
Rectangle {
id: screenSelectionRectOdd
@@ -305,9 +290,7 @@ Window {
ScreenRubberBandCreation.showScreenRubberBandWindow()
/*
* Destory selectScreenWindow once screenRubberBand is closed.
*/
// Destory selectScreenWindow once screenRubberBand is closed.
ScreenRubberBandCreation.connectOnClosingEvent(function () {
selectScreenWindow.close()
})

View File

@@ -38,9 +38,7 @@ Rectangle {
signal needToAddNewAccount
/*
* Hack -> force redraw.
*/
// Hack -> force redraw.
function forceReselectConversationSmartListCurrentIndex() {
var index = conversationSmartListView.currentIndex
conversationSmartListView.currentIndex = -1
@@ -48,9 +46,7 @@ Rectangle {
}
/*
* For contact request conv to be focused correctly.
*/
// For contact request conv to be focused correctly.
function setCurrentUidSmartListModelIndex() {
conversationSmartListView.currentIndex
= conversationSmartListView.model.currentUidSmartListModelIndex(
@@ -94,15 +90,11 @@ Rectangle {
conversationSmartListView.updateListView()
}
/*
* Intended -> since strange behavior will happen without this for stackview.
*/
// Intended -> since strange behavior will happen without this for stackview.
anchors.top: parent.top
anchors.fill: parent
/*
* Search bar container to embed search label
*/
// Search bar container to embed search label
ContactSearchBar {
id: contactSearchBar
width: sidePanelRect.width - 26

View File

@@ -24,16 +24,12 @@ import net.jami.Models 1.0
import "../../commoncomponents"
/*
* SipInputPanel is a key pad that is designed to be
* used in sip calls.
*/
// SipInputPanel is a key pad that is designed to be
// used in sip calls.
Popup {
id: sipInputPanelPopUp
/*
* Space between sipInputPanelRect and grid layout
*/
// Space between sipInputPanelRect and grid layout
property int sipPanelPadding: 20
contentWidth: sipInputPanelRectGridLayout.implicitWidth + 20

View File

@@ -35,15 +35,11 @@ Dialog {
property int preferredImgSize: 80
modal: true
/*
* Content height + margin.
*/
// Content height + margin.
contentHeight: userProfileDialogLayout.implicitHeight + 60
contentWidth: userProfileDialogLayout.implicitWidth + 60
/*
* Fake focus to make sure that text edit lose focus on close.
*/
// Fake focus to make sure that text edit lose focus on close.
FocusScope {
id: fakeFocusTextEdit
}
@@ -68,9 +64,7 @@ Dialog {
mipmap: true
}
/*
* Visible when user alias is not empty or equals to id.
*/
// Visible when user alias is not empty or equals to id.
Text {
id: contactAlias
@@ -110,9 +104,7 @@ Dialog {
color: JamiTheme.faddedFontColor
}
/*
* Visible when user name is not empty or equals to alias.
*/
// Visible when user name is not empty or equals to alias.
Text {
id: contactDisplayName

View File

@@ -88,9 +88,7 @@ Rectangle {
function previewMagneticSnap() {
/*
* Calculate the position where the previewRenderer should attach to.
*/
// Calculate the position where the previewRenderer should attach to.
var previewRendererCenter = Qt.point(
previewRenderer.x + previewRenderer.width / 2,
previewRenderer.y + previewRenderer.height / 2)
@@ -102,9 +100,7 @@ Rectangle {
if (previewRendererCenter.y >= distantRendererCenter.y) {
/*
* Bottom right.
*/
// Bottom right.
previewToX = Qt.binding(function () {
return videoCallPageMainRect.width - previewRenderer.width - previewMargin
})
@@ -114,9 +110,7 @@ Rectangle {
} else {
/*
* Top right.
*/
// Top right.
previewToX = Qt.binding(function () {
return videoCallPageMainRect.width - previewRenderer.width - previewMargin
})
@@ -126,9 +120,7 @@ Rectangle {
if (previewRendererCenter.y >= distantRendererCenter.y) {
/*
* Bottom left.
*/
// Bottom left.
previewToX = previewMargin
previewToY = Qt.binding(function () {
return videoCallPageMainRect.height - previewRenderer.height - previewMarginY
@@ -136,9 +128,7 @@ Rectangle {
} else {
/*
* Top left.
*/
// Top left.
previewToX = previewMargin
previewToY = previewMarginY
}
@@ -246,12 +236,10 @@ Rectangle {
id: previewRenderer
/*
* Property is used in the {} expression for height (extra dependency),
* it will not affect the true height expression, since expression
* at last will be taken only, but it will force the height to update
* and reevaluate getPreviewImageScalingFactor().
*/
// Property is used in the {} expression for height (extra dependency),
// it will not affect the true height expression, since expression
// at last will be taken only, but it will force the height to update
// and reevaluate getPreviewImageScalingFactor().
property int previewImageScalingFactorUpdated: 0
Connections {
@@ -266,7 +254,7 @@ Rectangle {
return previewRenderer.width * previewRenderer.getPreviewImageScalingFactor()
}
x: videoCallPageMainRect.width - previewRenderer.width - previewMargin
y: videoCallPageMainRect.height - previewRenderer.height - previewMargin - 56 /* Avoid overlay */
y: videoCallPageMainRect.height - previewRenderer.height - previewMargin - 56 // Avoid overlay
z: -1
states: [
@@ -309,18 +297,14 @@ Rectangle {
onPositionChanged: {
/*
* Calculate mouse position relative change.
*/
// Calculate mouse position relative change.
var delta = Qt.point(mouse.x - clickPos.x,
mouse.y - clickPos.y)
var deltaW = previewRenderer.x + delta.x + previewRenderer.width
var deltaH = previewRenderer.y + delta.y + previewRenderer.height
/*
* Check if the previewRenderer exceeds the border of videoCallPageMainRect.
*/
// Check if the previewRenderer exceeds the border of videoCallPageMainRect.
if (deltaW < videoCallPageMainRect.width
&& previewRenderer.x + delta.x > 1)
previewRenderer.x += delta.x

View File

@@ -22,9 +22,7 @@ import net.jami.Models 1.0
import "../../commoncomponents"
/*
* Menu item wrapper for video device checkable item.
*/
// Menu item wrapper for video device checkable item.
GeneralMenuItem {
id: videoCallPageContextMenuDeviceItem

View File

@@ -1,4 +1,3 @@
/*
* Copyright (C) 2020 by Savoir-faire Linux
* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>

View File

@@ -28,7 +28,7 @@ import net.jami.Adapters 1.0
import "components"
Rectangle {
id: settingsViewWindow
id: root
enum SettingsMenu{
@@ -49,53 +49,53 @@ Rectangle {
if(selectedMenu === sel && (!recovery)){return}
switch(sel){
case SettingsView.Account:
currentAccountSettingsScrollWidget.connectCurrentAccount()
case SettingsView.Account:
currentAccountSettingsScrollWidget.connectCurrentAccount()
avSettings.stopAudioMeter()
avSettings.stopPreviewing()
selectedMenu = sel
if(!settingsViewRect.isSIP){
if(currentAccountSettingsScrollWidget.isPhotoBoothOpened())
{
currentAccountSettingsScrollWidget.setAvatar()
}
currentAccountSettingsScrollWidget.updateAccountInfoDisplayed()
} else {
if(currentSIPAccountSettingsScrollWidget.isPhotoBoothOpened()) {
currentSIPAccountSettingsScrollWidget.setAvatar()
}
currentSIPAccountSettingsScrollWidget.updateAccountInfoDisplayed()
}
break
case SettingsView.General:
try{
avSettings.stopAudioMeter()
avSettings.stopPreviewing()
} catch(erro){}
selectedMenu = sel
generalSettings.populateGeneralSettings()
break
case SettingsView.Media:
selectedMenu = sel
selectedMenu = sel
if(!settingsViewRect.isSIP){
if(currentAccountSettingsScrollWidget.isPhotoBoothOpened())
{
currentAccountSettingsScrollWidget.setAvatar()
}
currentAccountSettingsScrollWidget.updateAccountInfoDisplayed()
} else {
if(currentSIPAccountSettingsScrollWidget.isPhotoBoothOpened()) {
currentSIPAccountSettingsScrollWidget.setAvatar()
}
currentSIPAccountSettingsScrollWidget.updateAccountInfoDisplayed()
}
break
case SettingsView.General:
try{
avSettings.stopAudioMeter()
avSettings.stopPreviewing()
} catch(erro){}
selectedMenu = sel
generalSettings.populateGeneralSettings()
break
case SettingsView.Media:
selectedMenu = sel
avSettings.stopPreviewing()
avSettings.populateAVSettings()
avSettings.startAudioMeter()
break
case SettingsView.Plugin:
try{
avSettings.stopAudioMeter()
avSettings.stopPreviewing()
} catch(erro){}
avSettings.populateAVSettings()
avSettings.startAudioMeter()
break
case SettingsView.Plugin:
try{
avSettings.stopAudioMeter()
avSettings.stopPreviewing()
} catch(erro){}
selectedMenu = sel
pluginSettings.populatePluginSettings()
break
selectedMenu = sel
pluginSettings.populatePluginSettings()
break
}
}
@@ -140,20 +140,17 @@ Rectangle {
property int selectedMenu: SettingsView.Account
/*
* signal to redirect the page to main view
*/
// signal to redirect the page to main view
signal settingsViewWindowNeedToShowMainViewWindow()
signal settingsViewWindowNeedToShowNewWizardWindow
signal settingsBackArrowClicked
visible: true
anchors.fill: parent
Rectangle {
id: settingsViewRect
anchors.fill: parent
anchors.fill: root
property bool isSIP: {
switch (profileType) {
@@ -165,10 +162,10 @@ Rectangle {
}
StackLayout {
anchors.fill: parent
id: rightSettingsWidget
anchors.fill: parent
property int pageIdCurrentAccountSettingsScrollPage: 0
property int pageIdCurrentSIPAccountSettingScrollPage: 1
property int pageIdGeneralSettingsPage: 2
@@ -189,8 +186,6 @@ Rectangle {
return pageIdAvSettingPage
case SettingsView.Plugin:
return pageIdPluginSettingsPage
case SettingsView.Plugin:
return pageIdPluginSettingsPage
}
}
@@ -198,6 +193,10 @@ Rectangle {
CurrentAccountSettingsScrollPage {
id: currentAccountSettingsScrollWidget
Layout.fillHeight: true
Layout.maximumWidth: JamiTheme.maximumWidthSettingsView
anchors.centerIn: parent
onNavigateToMainView: {
leaveSettingsSlot(true)
}
@@ -211,6 +210,10 @@ Rectangle {
CurrentSIPAccountSettingScrollPage {
id: currentSIPAccountSettingsScrollWidget
Layout.fillHeight: true
Layout.maximumWidth: JamiTheme.maximumWidthSettingsView
anchors.centerIn: parent
onNavigateToMainView: {
leaveSettingsSlot(true)
}
@@ -223,24 +226,33 @@ Rectangle {
// general setting page, index 2
GeneralSettingsPage {
id: generalSettings
Layout.fillHeight: true
Layout.maximumWidth: JamiTheme.maximumWidthSettingsView
anchors.centerIn: parent
}
// av setting page, index 3
AvSettingPage {
id: avSettings
Layout.fillHeight: true
Layout.maximumWidth: JamiTheme.maximumWidthSettingsView
anchors.centerIn: parent
}
// plugin setting page, index 4
PluginSettingsPage {
id: pluginSettings
Layout.fillHeight: true
Layout.maximumWidth: JamiTheme.maximumWidthSettingsView
anchors.centerIn: parent
}
}
}
/*
* Back button signal redirection
*/
// Back button signal redirection
Component.onCompleted: {
currentAccountSettingsScrollWidget.backArrowClicked.connect(settingsBackArrowClicked)
currentSIPAccountSettingsScrollWidget.backArrowClicked.connect(settingsBackArrowClicked)

File diff suppressed because it is too large Load Diff

View File

@@ -31,6 +31,10 @@ import net.jami.Adapters 1.0
import "../../commoncomponents"
ColumnLayout {
id: root
property int itemWidth
function updateAccountInfoDisplayedAdvance() {
//Call Settings
checkAutoConnectOnLocalNetwork.checked = SettingsAdapter.getAccountConfig_PeerDiscovery()
@@ -72,22 +76,22 @@ ColumnLayout {
}
function updateAudioCodecs(){
audioCodecListModel.layoutAboutToBeChanged()
audioCodecListModel.dataChanged(audioCodecListModel.index(0, 0),
audioCodecListModel.index(audioCodecListModel.rowCount() - 1, 0))
audioCodecListModel.layoutChanged()
audioListWidget.model.layoutAboutToBeChanged()
audioListWidget.model.dataChanged(audioListWidget.model.index(0, 0),
audioListWidget.model.index(audioListWidget.model.rowCount() - 1, 0))
audioListWidget.model.layoutChanged()
}
function updateVideoCodecs(){
videoCodecListModel.layoutAboutToBeChanged()
videoCodecListModel.dataChanged(videoCodecListModel.index(0, 0),
videoCodecListModel.index(videoCodecListModel.rowCount() - 1, 0))
videoCodecListModel.layoutChanged()
videoListWidget.model.layoutAboutToBeChanged()
videoListWidget.model.dataChanged(videoListWidget.model.index(0, 0),
videoListWidget.model.index(videoListWidget.model.rowCount() - 1, 0))
videoListWidget.model.layoutChanged()
}
function decreaseAudioCodecPriority(){
var index = audioListWidget.currentIndex
var codecId = audioCodecListModel.data(audioCodecListModel.index(index,0), AudioCodecListModel.AudioCodecID)
var codecId = audioListWidget.model.data(audioListWidget.model.index(index,0), AudioCodecListModel.AudioCodecID)
SettingsAdapter.decreaseAudioCodecPriority(codecId)
audioListWidget.currentIndex = index + 1
@@ -96,7 +100,7 @@ ColumnLayout {
function increaseAudioCodecPriority(){
var index = audioListWidget.currentIndex
var codecId = audioCodecListModel.data(audioCodecListModel.index(index,0), AudioCodecListModel.AudioCodecID)
var codecId = audioListWidget.model.data(audioListWidget.model.index(index,0), AudioCodecListModel.AudioCodecID)
SettingsAdapter.increaseAudioCodecPriority(codecId)
audioListWidget.currentIndex = index - 1
@@ -105,7 +109,7 @@ ColumnLayout {
function decreaseVideoCodecPriority(){
var index = videoListWidget.currentIndex
var codecId = videoCodecListModel.data(videoCodecListModel.index(index,0), VideoCodecListModel.VideoCodecID)
var codecId = videoListWidget.model.data(videoListWidget.model.index(index,0), VideoCodecListModel.VideoCodecID)
SettingsAdapter.decreaseVideoCodecPriority(codecId)
videoListWidget.currentIndex = index + 1
@@ -114,21 +118,13 @@ ColumnLayout {
function increaseVideoCodecPriority(){
var index = videoListWidget.currentIndex
var codecId = videoCodecListModel.data(videoCodecListModel.index(index,0), VideoCodecListModel.VideoCodecID)
var codecId = videoListWidget.model.data(videoListWidget.model.index(index,0), VideoCodecListModel.VideoCodecID)
SettingsAdapter.increaseVideoCodecPriority(codecId)
videoListWidget.currentIndex = index - 1
updateVideoCodecs()
}
VideoCodecListModel{
id: videoCodecListModel
}
AudioCodecListModel{
id: audioCodecListModel
}
function changeRingtonePath(url){
if(url.length !== 0) {
SettingsAdapter.set_RingtonePath(url)
@@ -172,14 +168,6 @@ ColumnLayout {
nameFilters: [qsTr("Audio Files") + " (*.wav *.ogg *.opus *.mp3 *.aiff *.wma)", qsTr(
"All files") + " (*)"]
onRejected: {}
onVisibleChanged: {
if (!visible) {
rejected()
}
}
onAccepted: {
var url = ClientWrapper.utilsAdaptor.getAbsPath(file.toString())
changeRingtonePath(url)
@@ -198,14 +186,6 @@ ColumnLayout {
nameFilters: [qsTr("Certificate File") + " (*.crt)", qsTr(
"All files") + " (*)"]
onRejected: {}
onVisibleChanged: {
if (!visible) {
rejected()
}
}
onAccepted: {
var url = ClientWrapper.utilsAdaptor.getAbsPath(file.toString())
changeFileCACert(url)
@@ -224,14 +204,6 @@ ColumnLayout {
nameFilters: [qsTr("Certificate File") + " (*.crt)", qsTr(
"All files") + " (*)"]
onRejected: {}
onVisibleChanged: {
if (!visible) {
rejected()
}
}
onAccepted: {
var url = ClientWrapper.utilsAdaptor.getAbsPath(file.toString())
changeFileUserCert(url)
@@ -252,40 +224,22 @@ ColumnLayout {
nameFilters: [qsTr("Key File") + " (*.key)", qsTr(
"All files") + " (*)"]
onRejected: {}
onVisibleChanged: {
if (!visible) {
rejected()
}
}
onAccepted: {
var url = ClientWrapper.utilsAdaptor.getAbsPath(file.toString())
changeFilePrivateKey(url)
}
}
id: advancedSettingsViewLayout
Layout.fillWidth: true
property int preferredColumnWidth : accountViewRect.width / 2 - 50
ColumnLayout {
spacing: 8
Layout.fillWidth: true
Layout.fillHeight: true
ElidedTextLabel {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Call Settings")
fontSize: JamiTheme.headerFontSize
maxWidth: preferredColumnWidth
maxWidth: width
}
ColumnLayout {
@@ -295,7 +249,7 @@ ColumnLayout {
ToggleSwitch {
id: checkBoxUntrusted
labelText: allowIncomingCallsText.elidedText
labelText: qsTr("Allow incoming calls from unknown contacts")
fontPointSize: JamiTheme.settingsFontSize
onSwitchToggled: {
@@ -303,19 +257,10 @@ ColumnLayout {
}
}
TextMetrics {
id: allowIncomingCallsText
elide: Text.ElideRight
elideWidth: preferredColumnWidth
text: qsTr("Allow incoming calls from unknown contacts")
}
ToggleSwitch {
id: checkBoxAutoAnswer
Layout.fillWidth: true
labelText: autoAnswerCallsElidedText.elidedText
labelText: qsTr("Auto Answer Calls")
fontPointSize: JamiTheme.settingsFontSize
onSwitchToggled: {
@@ -323,17 +268,10 @@ ColumnLayout {
}
}
TextMetrics {
id: autoAnswerCallsElidedText
elide: Text.ElideRight
elideWidth: preferredColumnWidth
text: qsTr("Auto Answer Calls")
}
ToggleSwitch {
id: checkBoxCustomRingtone
labelText: enableCustomRingtoneElidedText.elidedText
labelText: qsTr("Enable Custom Ringtone")
fontPointSize: JamiTheme.settingsFontSize
onSwitchToggled: {
@@ -342,24 +280,15 @@ ColumnLayout {
}
}
TextMetrics {
id: enableCustomRingtoneElidedText
elide: Text.ElideRight
elideWidth: preferredColumnWidth
text: qsTr("Enable Custom Ringtone")
}
RowLayout {
Layout.fillWidth: true
ElidedTextLabel {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Select Custom Ringtone")
maxWidth: preferredColumnWidth
maxWidth: width
fontSize: JamiTheme.settingsFontSize
}
@@ -367,7 +296,7 @@ ColumnLayout {
id: btnRingtone
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: preferredColumnWidth
Layout.preferredWidth: itemWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
source: "qrc:/images/icons/round-folder-24px.svg"
@@ -385,7 +314,7 @@ ColumnLayout {
id: checkBoxRdv
labelText: qsTr("(Experimental) Rendez-vous: turn your account into a conference room")
fontPointSize: 10
fontPointSize: JamiTheme.settingsFontSize
onSwitchToggled: {
SettingsAdapter.setIsRendezVous(checked)
@@ -395,17 +324,14 @@ ColumnLayout {
}
ColumnLayout {
spacing: 8
Layout.fillWidth: true
ElidedTextLabel {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Name Server")
maxWidth: preferredColumnWidth
maxWidth: width
fontSize: JamiTheme.headerFontSize
}
@@ -414,20 +340,15 @@ ColumnLayout {
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: JamiTheme.preferredMarginSize
ElidedTextLabel {
Text {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Address")
fontSize: JamiTheme.settingsFontSize
maxWidth: preferredColumnWidth
}
Item {
Layout.fillHeight: true
Layout.fillWidth: true
text: qsTr("Address")
elide: Text.ElideRight
font.pointSize: JamiTheme.settingsFontSize
font.kerning: true
verticalAlignment: Text.AlignVCenter
}
MaterialLineEdit {
@@ -435,7 +356,7 @@ ColumnLayout {
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
Layout.preferredWidth: itemWidth
padding: 8
@@ -451,20 +372,18 @@ ColumnLayout {
}
}
ColumnLayout {
spacing: 8
Layout.fillWidth: true
ElidedTextLabel {
Text {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("OpenDHT Configuration")
fontSize: JamiTheme.headerFontSize
maxWidth: preferredColumnWidth
text: qsTr("OpenDHT Configuration")
elide: Text.ElideRight
font.pointSize: JamiTheme.headerFontSize
font.kerning: true
verticalAlignment: Text.AlignVCenter
}
ColumnLayout {
@@ -488,13 +407,11 @@ ColumnLayout {
ElidedTextLabel {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
text: qsTr("Proxy Address")
font.pointSize: JamiTheme.settingsFontSize
maxWidth: preferredColumnWidth
maxWidth: width
}
MaterialLineEdit {
@@ -502,7 +419,7 @@ ColumnLayout {
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
Layout.preferredWidth: itemWidth
padding: 8
@@ -511,7 +428,7 @@ ColumnLayout {
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
wrapMode: Text.NoWrap
onEditingFinished: {
SettingsAdapter.setProxyAddress(text)
}
@@ -523,18 +440,11 @@ ColumnLayout {
ElidedTextLabel {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
text: qsTr("Bootstrap")
font.pointSize: JamiTheme.settingsFontSize
maxWidth: preferredColumnWidth
}
Item {
Layout.fillHeight: true
Layout.fillWidth: true
maxWidth: width
}
MaterialLineEdit {
@@ -542,7 +452,7 @@ ColumnLayout {
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
Layout.preferredWidth: itemWidth
padding: 8
@@ -551,7 +461,7 @@ ColumnLayout {
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
wrapMode: Text.NoWrap
onEditingFinished: {
SettingsAdapter.setBootstrapAddress(text)
}
@@ -561,18 +471,17 @@ ColumnLayout {
}
ColumnLayout {
spacing: 8
Layout.fillWidth: true
ElidedTextLabel {
Text {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Security")
fontSize: JamiTheme.headerFontSize
maxWidth: preferredColumnWidth
text: qsTr("Security")
elide: Text.ElideRight
font.pointSize: JamiTheme.headerFontSize
font.kerning: true
verticalAlignment: Text.AlignVCenter
}
ColumnLayout {
@@ -582,21 +491,17 @@ ColumnLayout {
GridLayout {
rows: 4
columns: 2
rowSpacing: 8
columnSpacing: 8
Layout.fillWidth: true
// CA Certificate
ElidedTextLabel {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("CA Certificate")
fontSize: JamiTheme.settingsFontSize
maxWidth: preferredColumnWidth
maxWidth: width
}
MaterialButton {
@@ -604,7 +509,7 @@ ColumnLayout {
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
Layout.preferredWidth: itemWidth
source: "qrc:/images/icons/round-folder-24px.svg"
color: JamiTheme.buttonTintedGrey
@@ -619,13 +524,11 @@ ColumnLayout {
// User Certificate
ElidedTextLabel {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("User Certificate")
fontSize: JamiTheme.settingsFontSize
maxWidth: preferredColumnWidth
maxWidth: width
}
MaterialButton {
@@ -633,7 +536,7 @@ ColumnLayout {
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
Layout.preferredWidth: itemWidth
source: "qrc:/images/icons/round-folder-24px.svg"
color: JamiTheme.buttonTintedGrey
@@ -648,13 +551,11 @@ ColumnLayout {
// Private Key
ElidedTextLabel {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Private Key")
fontSize: JamiTheme.settingsFontSize
maxWidth: preferredColumnWidth
maxWidth: width
}
MaterialButton {
@@ -662,7 +563,7 @@ ColumnLayout {
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
Layout.preferredWidth: itemWidth
source: "qrc:/images/icons/round-folder-24px.svg"
color: JamiTheme.buttonTintedGrey
@@ -675,24 +576,23 @@ ColumnLayout {
}
// Private key password
ElidedTextLabel {
Text {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Private Key Password")
fontSize: JamiTheme.settingsFontSize
maxWidth: preferredColumnWidth
text: qsTr("Private Key Password")
elide: Text.ElideRight
font.pointSize: JamiTheme.settingsFontSize
font.kerning: true
verticalAlignment: Text.AlignVCenter
}
MaterialLineEdit {
id: lineEditCertPassword
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
Layout.preferredWidth: itemWidth
padding: 8
@@ -702,26 +602,22 @@ ColumnLayout {
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
echoMode: TextInput.Password
wrapMode: Text.NoWrap
}
}
}
}
ColumnLayout {
spacing: 8
Layout.fillWidth: true
ElidedTextLabel {
Layout.fillWidth: true
Layout.topMargin: JamiTheme.preferredMarginSize
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Connectivity")
fontSize: JamiTheme.headerFontSize
maxWidth: preferredColumnWidth
maxWidth: width
}
ColumnLayout {
@@ -733,7 +629,7 @@ ColumnLayout {
Layout.fillWidth: true
labelText: autoConnectOnLocalNetworkElidedText.elidedText
labelText: qsTr("Auto Connect On Local Network")
fontPointSize: JamiTheme.settingsFontSize
onSwitchToggled: {
@@ -741,13 +637,6 @@ ColumnLayout {
}
}
TextMetrics {
id: autoConnectOnLocalNetworkElidedText
elide: Text.ElideRight
elideWidth: preferredColumnWidth
text: qsTr("Auto Connect On Local Network")
}
ToggleSwitch {
id: checkBoxUPnP
@@ -778,15 +667,15 @@ ColumnLayout {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
ElidedTextLabel {
Text {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("TURN Address")
fontSize: JamiTheme.settingsFontSize
maxWidth: preferredColumnWidth
text: qsTr("TURN Address")
elide: Text.ElideRight
font.pointSize: JamiTheme.settingsFontSize
font.kerning: true
verticalAlignment: Text.AlignVCenter
}
MaterialLineEdit {
@@ -794,7 +683,7 @@ ColumnLayout {
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
Layout.preferredWidth: itemWidth
padding: 8
@@ -803,7 +692,7 @@ ColumnLayout {
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
wrapMode: Text.NoWrap
onEditingFinished: {
SettingsAdapter.setTURNAddress(text)
}
@@ -814,15 +703,15 @@ ColumnLayout {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
ElidedTextLabel {
Text {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("TURN Username")
fontSize: JamiTheme.settingsFontSize
maxWidth: preferredColumnWidth
text: qsTr("TURN Username")
elide: Text.ElideRight
font.pointSize: JamiTheme.settingsFontSize
font.kerning: true
verticalAlignment: Text.AlignVCenter
}
MaterialLineEdit {
@@ -830,7 +719,7 @@ ColumnLayout {
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
Layout.preferredWidth: itemWidth
padding: 8
@@ -839,7 +728,7 @@ ColumnLayout {
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
wrapMode: Text.NoWrap
onEditingFinished: {
SettingsAdapter.setTURNUsername(text)
}
@@ -850,14 +739,15 @@ ColumnLayout {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
ElidedTextLabel {
Text {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("TURN Password")
fontSize: JamiTheme.settingsFontSize
maxWidth: preferredColumnWidth
text: qsTr("TURN Password")
elide: Text.ElideRight
font.pointSize: JamiTheme.settingsFontSize
font.kerning: true
verticalAlignment: Text.AlignVCenter
}
MaterialLineEdit {
@@ -865,7 +755,7 @@ ColumnLayout {
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
Layout.preferredWidth: itemWidth
padding: 8
layer.mipmap: false
@@ -876,14 +766,11 @@ ColumnLayout {
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
echoMode: TextInput.Password
onEditingFinished: {
SettingsAdapter.setTURNPassword(text)
}
wrapMode: Text.NoWrap
onEditingFinished: SettingsAdapter.setTURNPassword(text)
}
}
ToggleSwitch {
id: checkBoxSTUNEnable
@@ -902,17 +789,16 @@ ColumnLayout {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
ElidedTextLabel {
Text {
id: lblEditSTUNAddress
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("STUN Address")
fontSize: JamiTheme.settingsFontSize
maxWidth: preferredColumnWidth
text: qsTr("STUN Address")
elide: Text.ElideRight
font.pointSize: JamiTheme.settingsFontSize
font.kerning: true
verticalAlignment: Text.AlignVCenter
}
MaterialLineEdit {
@@ -920,7 +806,7 @@ ColumnLayout {
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
Layout.preferredWidth: itemWidth
padding: 8
@@ -931,24 +817,19 @@ ColumnLayout {
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
onEditingFinished: {
SettingsAdapter.setSTUNAddress(text)
}
wrapMode: Text.NoWrap
onEditingFinished: SettingsAdapter.setSTUNAddress(text)
}
}
}
}
ColumnLayout {
spacing: 8
Layout.fillWidth: true
Label {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
text: qsTr("Media")
font.pointSize: JamiTheme.headerFontSize
@@ -968,9 +849,7 @@ ColumnLayout {
labelText: qsTr("Enable Video")
fontPointSize: JamiTheme.settingsFontSize
onSwitchToggled: {
SettingsAdapter.setVideoState(checked)
}
onSwitchToggled: SettingsAdapter.setVideoState(checked)
}
RowLayout {
@@ -988,55 +867,37 @@ ColumnLayout {
ElidedTextLabel {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
maxWidth: preferredColumnWidth - 50
maxWidth: width
eText: qsTr("Video Codecs")
fontSize: JamiTheme.settingsFontSize
}
HoverableRadiusButton {
HoverableButtonTextItem {
id: videoDownPushButton
Layout.minimumWidth: 24
Layout.preferredWidth: 24
Layout.maximumWidth: 24
Layout.minimumHeight: 24
Layout.preferredHeight: 24
Layout.maximumHeight: 24
buttonImageHeight: height
buttonImageWidth: height
radius: height / 2
icon.source: "qrc:/images/icons/round-arrow_drop_down-24px.svg"
icon.width: 24
icon.height: 24
source: "qrc:/images/icons/round-arrow_drop_down-24px.svg"
onClicked: {
decreaseVideoCodecPriority()
}
}
HoverableRadiusButton {
HoverableButtonTextItem {
id: videoUpPushButton
Layout.minimumWidth: 24
Layout.preferredWidth: 24
Layout.maximumWidth: 24
Layout.minimumHeight: 24
Layout.preferredHeight: 24
Layout.maximumHeight: 24
buttonImageHeight: height
buttonImageWidth: height
radius: height / 2
icon.source: "qrc:/images/icons/round-arrow_drop_up-24px.svg"
icon.width: 24
icon.height: 24
source: "qrc:/images/icons/round-arrow_drop_up-24px.svg"
onClicked: {
increaseVideoCodecPriority()
@@ -1047,14 +908,10 @@ ColumnLayout {
ListViewJami {
id: videoListWidget
Layout.minimumWidth: preferredColumnWidth
Layout.preferredWidth: preferredColumnWidth
Layout.maximumWidth: preferredColumnWidth
Layout.minimumHeight: 192
Layout.preferredHeight: 192
Layout.maximumHeight: 192
Layout.fillWidth: true
Layout.preferredHeight: 190
model: videoCodecListModel
model: VideoCodecListModel{}
delegate: VideoCodecDelegate {
id: videoCodecDelegate
@@ -1080,62 +937,47 @@ ColumnLayout {
ColumnLayout {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.leftMargin: JamiTheme.preferredMarginSize / 2
RowLayout {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
ElidedTextLabel {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
maxWidth: preferredColumnWidth - 50
maxWidth: width
eText: qsTr("Audio Codecs")
fontSize: JamiTheme.settingsFontSize
}
HoverableRadiusButton {
HoverableButtonTextItem {
id: audioDownPushButton
Layout.minimumWidth: 24
Layout.preferredWidth: 24
Layout.maximumWidth: 24
Layout.minimumHeight: 24
Layout.preferredHeight: 24
Layout.maximumHeight: 24
radius: height / 2
buttonImageHeight: height
buttonImageWidth: height
icon.source: "qrc:/images/icons/round-arrow_drop_down-24px.svg"
icon.width: 24
icon.height: 24
source: "qrc:/images/icons/round-arrow_drop_down-24px.svg"
onClicked: {
decreaseAudioCodecPriority()
}
}
HoverableRadiusButton {
HoverableButtonTextItem {
id: audioUpPushButton
Layout.minimumWidth: 24
Layout.preferredWidth: 24
Layout.maximumWidth: 24
Layout.minimumHeight: 24
Layout.preferredHeight: 24
Layout.maximumHeight: 24
radius: height / 2
buttonImageHeight: height
buttonImageWidth: height
icon.source: "qrc:/images/icons/round-arrow_drop_up-24px.svg"
icon.width: 24
icon.height: 24
source: "qrc:/images/icons/round-arrow_drop_up-24px.svg"
onClicked: {
increaseAudioCodecPriority()
@@ -1146,14 +988,10 @@ ColumnLayout {
ListViewJami {
id: audioListWidget
Layout.minimumWidth: preferredColumnWidth
Layout.preferredWidth: preferredColumnWidth
Layout.maximumWidth: preferredColumnWidth
Layout.minimumHeight: 192
Layout.preferredHeight: 192
Layout.maximumHeight: 192
Layout.fillWidth: true
Layout.preferredHeight: 190
model: audioCodecListModel
model: AudioCodecListModel{}
delegate: AudioCodecDelegate {
id: audioCodecDelegate

View File

@@ -26,36 +26,28 @@ import QtQuick.Controls.Styles 1.4
import net.jami.Models 1.0
ItemDelegate {
id: videoCodecDelegate
id: root
property string audioCodecName : ""
property bool isEnabled : false
property int audioCodecId
property string samplerRate: ""
property int checkBoxWidth: 24
signal audioCodecStateChange(string idToSet , bool isToBeEnabled)
property int checkBoxWidth: 24
highlighted: ListView.isCurrentItem
RowLayout{
RowLayout {
anchors.fill: parent
z: 1
spacing: 10
CheckBox{
CheckBox {
id: checkBoxIsEnabled
Layout.leftMargin: 20
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.fillHeight: true
Layout.minimumWidth: checkBoxWidth
Layout.preferredWidth: checkBoxWidth
Layout.maximumWidth: checkBoxWidth
tristate: false
checkState: isEnabled ? Qt.Checked : Qt.Unchecked
@@ -74,7 +66,7 @@ ItemDelegate {
var result
var result_bool
if (checkState === Qt.Checked){
if (checkState === Qt.Checked) {
result = Qt.Unchecked
result_bool = false
} else {
@@ -86,17 +78,18 @@ ItemDelegate {
}
}
Label{
Label {
id: formatNameLabel
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
Layout.fillWidth: true
Layout.fillHeight: true
Layout.rightMargin: JamiTheme.preferredMarginSize / 2
text: audioCodecName + " " + samplerRate + " Hz"
elide: Text.ElideRight
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
font.pointSize: 8
font.kerning: true
}

View File

@@ -29,41 +29,49 @@ import "../../commoncomponents"
Rectangle {
id: root
AudioInputDeviceModel{
id: audioInputDeviceModel
property int preferredColumnWidth: root.width / 2 - 50
property int preferredSettingsWidth: root.width - 100
property real aspectRatio: 0.75
property bool previewAvailable: false
signal backArrowClicked
Connections{
target: ClientWrapper.avmodel
enabled: root.visible
function onAudioMeter(id, level){
slotAudioMeter(id,level)
}
}
AudioOutputDeviceModel{
id: audioOutputDeviceModel
Connections{
target: ClientWrapper.renderManager
enabled: root.visible
function onVideoDeviceListChanged(){
slotVideoDeviceListChanged()
}
}
AudioManagerListModel{
id: audioManagerListModel
}
VideoInputDeviceModel{
id: videoInputDeviceModel
}
VideoFormatResolutionModel{
id: videoFormatResolutionModel
}
VideoFormatFpsModel{
id: videoFormatFpsModel
onVisibleChanged: {
if (!visible) {
stopPreviewing()
stopAudioMeter()
}
}
function populateAVSettings(){
audioInputDeviceModel.reset()
audioInputComboBox.model.reset()
audioOutputDeviceModel.reset()
inputComboBox.currentIndex = audioInputDeviceModel.getCurrentSettingIndex()
audioInputComboBox.currentIndex = audioInputComboBox.model.getCurrentSettingIndex()
outputComboBox.currentIndex = audioOutputDeviceModel.getCurrentSettingIndex()
ringtoneDeviceComboBox.currentIndex = audioOutputDeviceModel.getCurrentRingtoneDeviceIndex()
audioManagerRowLayout.visible = (audioManagerListModel.rowCount() > 0)
if(audioManagerListModel.rowCount() > 0){
audioManagerComboBox.currentIndex = audioManagerListModel.getCurrentSettingIndex()
audioManagerRowLayout.visible = (audioManagerComboBox.model.rowCount() > 0)
if(audioManagerComboBox.model.rowCount() > 0){
audioManagerComboBox.currentIndex = audioManagerComboBox.model.getCurrentSettingIndex()
}
populateVideoSettings()
@@ -72,16 +80,16 @@ Rectangle {
}
function populateVideoSettings() {
videoInputDeviceModel.reset()
deviceBox.model.reset()
deviceBox.enabled = (videoInputDeviceModel.deviceCount() > 0)
resolutionBox.enabled = (videoInputDeviceModel.deviceCount() > 0)
fpsBox.enabled = (videoInputDeviceModel.deviceCount() > 0)
labelVideoDevice.enabled = (videoInputDeviceModel.deviceCount() > 0)
labelVideoResolution.enabled = (videoInputDeviceModel.deviceCount() > 0)
labelVideoFps.enabled = (videoInputDeviceModel.deviceCount() > 0)
deviceBox.enabled = (deviceBox.model.deviceCount() > 0)
resolutionBox.enabled = (deviceBox.model.deviceCount() > 0)
fpsBox.enabled = (deviceBox.model.deviceCount() > 0)
labelVideoDevice.enabled = (deviceBox.model.deviceCount() > 0)
labelVideoResolution.enabled = (deviceBox.model.deviceCount() > 0)
labelVideoFps.enabled = (deviceBox.model.deviceCount() > 0)
deviceBox.currentIndex = videoInputDeviceModel.getCurrentSettingIndex()
deviceBox.currentIndex = deviceBox.model.getCurrentSettingIndex()
slotDeviceBoxCurrentIndexChanged(deviceBox.currentIndex)
try{
@@ -97,8 +105,8 @@ Rectangle {
}
try{
videoFormatResolutionModel.reset()
resolutionBox.currentIndex = videoFormatResolutionModel.getCurrentSettingIndex()
resolutionBox.model.reset()
resolutionBox.currentIndex = resolutionBox.model.getCurrentSettingIndex()
slotFormatCurrentIndexChanged(resolutionBox.currentIndex,true)
} catch(err){console.warn("Exception: " + err.message)}
}
@@ -136,7 +144,7 @@ Rectangle {
function slotAudioManagerIndexChanged(index){
stopAudioMeter(false)
var selectedAudioManager = audioManagerListModel.data(audioManagerListModel.index(
var selectedAudioManager = audioManagerComboBox.model.data(audioManagerComboBox.model.index(
index, 0), AudioManagerListModel.AudioManagerID)
ClientWrapper.avmodel.setAudioManager(selectedAudioManager)
startAudioMeter(false)
@@ -160,7 +168,7 @@ Rectangle {
function slotAudioInputIndexChanged(index){
stopAudioMeter(false)
var selectedInputDeviceName = audioInputDeviceModel.data(audioInputDeviceModel.index(
var selectedInputDeviceName = audioInputComboBox.model.data(audioInputComboBox.model.index(
index, 0), AudioInputDeviceModel.Device_ID)
ClientWrapper.avmodel.setInputDevice(selectedInputDeviceName)
@@ -168,14 +176,14 @@ Rectangle {
}
function slotDeviceBoxCurrentIndexChanged(index){
if(videoInputDeviceModel.deviceCount() <= 0){
if(deviceBox.model.deviceCount() <= 0){
return
}
try{
var deviceId = videoInputDeviceModel.data(videoInputDeviceModel.index(
var deviceId = deviceBox.model.data(deviceBox.model.index(
index, 0), VideoInputDeviceModel.DeviceId)
var deviceName = videoInputDeviceModel.data(videoInputDeviceModel.index(
var deviceName = deviceBox.model.data(deviceBox.model.index(
index, 0), VideoInputDeviceModel.DeviceName)
if(deviceId.length === 0){
console.warn("Couldn't find device: " + deviceName)
@@ -193,17 +201,17 @@ Rectangle {
var resolution
var rate
if(isResolutionIndex){
resolution = videoFormatResolutionModel.data(videoFormatResolutionModel.index(
resolution = resolutionBox.model.data(resolutionBox.model.index(
index, 0), VideoFormatResolutionModel.Resolution)
videoFormatFpsModel.currentResolution = resolution
fpsBox.currentIndex = videoFormatFpsModel.getCurrentSettingIndex()
rate = videoFormatFpsModel.data(videoFormatFpsModel.index(
fpsBox.model.currentResolution = resolution
fpsBox.currentIndex = fpsBox.model.getCurrentSettingIndex()
rate = fpsBox.model.data(fpsBox.model.index(
fpsBox.currentIndex, 0), VideoFormatFpsModel.FPS)
} else {
resolution = videoFormatResolutionModel.data(videoFormatResolutionModel.index(
resolution = resolutionBox.model.data(resolutionBox.model.index(
resolutionBox.currentIndex, 0), VideoFormatResolutionModel.Resolution)
videoFormatFpsModel.currentResolution = resolution
rate = videoFormatFpsModel.data(videoFormatFpsModel.index(
fpsBox.model.currentResolution = resolution
rate = fpsBox.model.data(fpsBox.model.index(
index, 0), VideoFormatFpsModel.FPS)
}
@@ -227,43 +235,10 @@ Rectangle {
}
}
property int preferredColumnWidth: avSettingsScrollView.width / 2 - 50
property int preferredSettingsWidth: avSettingsScrollView.width - 100
property real aspectRatio: 0.75
property bool previewAvailable: false
signal backArrowClicked
Connections{
target: ClientWrapper.avmodel
enabled: root.visible
function onAudioMeter(id, level){
slotAudioMeter(id,level)
}
AudioOutputDeviceModel{
id: audioOutputDeviceModel
}
Connections{
target: ClientWrapper.renderManager
enabled: root.visible
function onVideoDeviceListChanged(){
slotVideoDeviceListChanged()
}
}
onVisibleChanged: {
if (!visible) {
stopPreviewing()
stopAudioMeter()
}
}
Layout.fillHeight: true
Layout.maximumWidth: JamiTheme.maximumWidthSettingsView
anchors.centerIn: parent
ColumnLayout {
anchors.fill: root
@@ -272,19 +247,15 @@ Rectangle {
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.fillWidth: true
Layout.maximumHeight: 64
Layout.minimumHeight: 64
Layout.preferredHeight: 64
HoverableButton {
id: backToSettingsMenuButton
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
Layout.preferredWidth: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.rightMargin: JamiTheme.preferredMarginSize
radius: 30
radius: JamiTheme.preferredFieldHeight
source: "qrc:/images/icons/ic_arrow_back_24px.svg"
backgroundColor: "white"
onExitColor: "white"
@@ -300,9 +271,6 @@ Rectangle {
Label {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
text: qsTr("Audio / Video")
font.pointSize: JamiTheme.titleFontSize
@@ -317,362 +285,296 @@ Rectangle {
ScrollView {
id: avSettingsScrollView
property ScrollBar vScrollBar: ScrollBar.vertical
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
ScrollBar.vertical.policy: ScrollBar.AsNeeded
Layout.fillHeight: true
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
width: root.width
height: root.height - avSettingsTitle.height
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
ScrollBar.vertical.policy: ScrollBar.AsNeeded
focus: true
clip: true
ColumnLayout {
Layout.fillHeight: true
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
spacing: 24
width: root.width
// Audio
ColumnLayout {
spacing: 8
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
ElidedTextLabel {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Audio")
fontSize: JamiTheme.headerFontSize
maxWidth: preferredColumnWidth
maxWidth: width
}
ColumnLayout {
RowLayout {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: JamiTheme.preferredMarginSize
RowLayout {
ElidedTextLabel {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.fillHeight: true
ElidedTextLabel {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Microphone")
fontSize: JamiTheme.settingsFontSize
maxWidth: preferredColumnWidth
}
SettingParaCombobox {
id: inputComboBox
Layout.maximumWidth: preferredColumnWidth
Layout.preferredWidth: preferredColumnWidth
Layout.minimumWidth: preferredColumnWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
font.pointSize: JamiTheme.buttonFontSize
font.kerning: true
model: audioInputDeviceModel
textRole: "ID_UTF8"
tooltipText: qsTr("Audio input device selector")
onActivated: {
slotAudioInputIndexChanged(index)
}
}
eText: qsTr("Microphone")
fontSize: JamiTheme.settingsFontSize
maxWidth: width
}
// the audio level meter
LevelMeter {
id: audioInputMeter
Layout.minimumWidth: preferredSettingsWidth
Layout.preferredWidth: preferredSettingsWidth
Layout.maximumWidth: preferredSettingsWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
SettingParaCombobox {
id: audioInputComboBox
Layout.preferredWidth: preferredColumnWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
indeterminate: false
from: 0
to: 100
}
font.pointSize: JamiTheme.buttonFontSize
font.kerning: true
RowLayout {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
ElidedTextLabel {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Output Device")
fontSize: JamiTheme.settingsFontSize
maxWidth: preferredColumnWidth
}
SettingParaCombobox {
id: outputComboBox
Layout.maximumWidth: preferredColumnWidth
Layout.preferredWidth: preferredColumnWidth
Layout.minimumWidth: preferredColumnWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
font.pointSize: JamiTheme.settingsFontSize
font.kerning: true
model: audioOutputDeviceModel
textRole: "ID_UTF8"
tooltipText: qsTr("Choose the audio output device")
onActivated: {
slotAudioOutputIndexChanged(index)
}
model: AudioInputDeviceModel {}
textRole: "ID_UTF8"
tooltipText: qsTr("Audio input device selector")
onActivated: {
slotAudioInputIndexChanged(index)
}
}
}
RowLayout {
// the audio level meter
LevelMeter {
id: audioInputMeter
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: preferredSettingsWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
indeterminate: false
from: 0
to: 100
}
RowLayout {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: JamiTheme.preferredMarginSize
ElidedTextLabel {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
ElidedTextLabel {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Ringtone Device")
font.pointSize: JamiTheme.settingsFontSize
maxWidth: preferredColumnWidth
}
SettingParaCombobox {
id: ringtoneDeviceComboBox
Layout.maximumWidth: preferredColumnWidth
Layout.preferredWidth: preferredColumnWidth
Layout.minimumWidth: preferredColumnWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
font.pointSize: JamiTheme.buttonFontSize
font.kerning: true
model: audioOutputDeviceModel
textRole: "ID_UTF8"
tooltipText: qsTr("Choose the ringtone output device")
onActivated: {
slotRingtoneDeviceIndexChanged(index)
}
}
eText: qsTr("Output Device")
fontSize: JamiTheme.settingsFontSize
maxWidth: width
}
RowLayout {
id: audioManagerRowLayout
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
SettingParaCombobox {
id: outputComboBox
ElidedTextLabel {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
text: qsTr("Audio Manager")
fontSize: JamiTheme.settingsFontSize
maxWidth: preferredColumnWidth
font.pointSize: JamiTheme.settingsFontSize
font.kerning: true
model: audioOutputDeviceModel
textRole: "ID_UTF8"
tooltipText: qsTr("Choose the audio output device")
onActivated: {
slotAudioOutputIndexChanged(index)
}
}
}
SettingParaCombobox {
id: audioManagerComboBox
RowLayout {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.maximumWidth: preferredColumnWidth
Layout.preferredWidth: preferredColumnWidth
Layout.minimumWidth: preferredColumnWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
ElidedTextLabel {
Layout.fillWidth: true
font.pointSize: JamiTheme.buttonFontSize
font.kerning: true
eText: qsTr("Ringtone Device")
font.pointSize: JamiTheme.settingsFontSize
maxWidth: width
}
model: audioManagerListModel
textRole: "ID_UTF8"
SettingParaCombobox {
id: ringtoneDeviceComboBox
onActivated: {
slotAudioManagerIndexChanged(index)
}
Layout.preferredWidth: preferredColumnWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
font.pointSize: JamiTheme.settingsFontSize
font.kerning: true
model: audioOutputDeviceModel
textRole: "ID_UTF8"
tooltipText: qsTr("Choose the ringtone output device")
onActivated: {
slotRingtoneDeviceIndexChanged(index)
}
}
}
RowLayout {
id: audioManagerRowLayout
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: JamiTheme.preferredMarginSize
ElidedTextLabel {
Layout.fillWidth: true
text: qsTr("Audio Manager")
fontSize: JamiTheme.settingsFontSize
maxWidth: width
}
SettingParaCombobox {
id: audioManagerComboBox
Layout.preferredWidth: preferredColumnWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
font.pointSize: JamiTheme.buttonFontSize
font.kerning: true
model: AudioManagerListModel {}
textRole: "ID_UTF8"
onActivated: {
slotAudioManagerIndexChanged(index)
}
}
}
}
ColumnLayout {
spacing: 8
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
ElidedTextLabel {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Video")
fontSize: JamiTheme.headerFontSize
maxWidth: preferredSettingsWidth
}
ColumnLayout {
Layout.leftMargin: 16
RowLayout {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: JamiTheme.preferredMarginSize
ElidedTextLabel {
id: labelVideoDevice
RowLayout {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
ElidedTextLabel {
id: labelVideoDevice
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Device")
fontSize: JamiTheme.settingsFontSize
maxWidth: preferredColumnWidth
}
SettingParaCombobox {
id: deviceBox
Layout.maximumWidth: preferredColumnWidth
Layout.preferredWidth: preferredColumnWidth
Layout.minimumWidth: preferredColumnWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
font.pointSize: JamiTheme.buttonFontSize
font.kerning: true
model: videoInputDeviceModel
textRole: "DeviceName_UTF8"
tooltipText: qsTr("Video device selector")
onActivated: {
slotDeviceBoxCurrentIndexChanged(index)
}
}
eText: qsTr("Device")
fontSize: JamiTheme.settingsFontSize
maxWidth: width
}
RowLayout {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
ElidedTextLabel {
id: labelVideoResolution
SettingParaCombobox {
id: deviceBox
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Resolution")
fontSize: JamiTheme.settingsFontSize
maxWidth: preferredColumnWidth
}
font.pointSize: JamiTheme.buttonFontSize
font.kerning: true
SettingParaCombobox {
id: resolutionBox
model: VideoInputDeviceModel {}
Layout.maximumWidth: preferredColumnWidth
Layout.preferredWidth: preferredColumnWidth
Layout.minimumWidth: preferredColumnWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
font.pointSize: JamiTheme.buttonFontSize
font.kerning: true
model: videoFormatResolutionModel
textRole: "Resolution_UTF8"
tooltipText: qsTr("Video device resolution selector")
onActivated: {
slotFormatCurrentIndexChanged(index,true)
}
textRole: "DeviceName_UTF8"
tooltipText: qsTr("Video device selector")
onActivated: {
slotDeviceBoxCurrentIndexChanged(index)
}
}
}
RowLayout {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: JamiTheme.preferredMarginSize
ElidedTextLabel {
id: labelVideoResolution
RowLayout {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
ElidedTextLabel {
id: labelVideoFps
eText: qsTr("Resolution")
fontSize: JamiTheme.settingsFontSize
maxWidth: width
}
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
SettingParaCombobox {
id: resolutionBox
eText: qsTr("Fps")
fontSize: JamiTheme.settingsFontSize
maxWidth: preferredColumnWidth
Layout.preferredWidth: preferredColumnWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
font.pointSize: JamiTheme.buttonFontSize
font.kerning: true
model: VideoFormatResolutionModel {}
textRole: "Resolution_UTF8"
tooltipText: qsTr("Video device resolution selector")
onActivated: {
slotFormatCurrentIndexChanged(index,true)
}
}
}
SettingParaCombobox {
id: fpsBox
RowLayout {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.maximumWidth: preferredColumnWidth
Layout.preferredWidth: preferredColumnWidth
Layout.minimumWidth: preferredColumnWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
ElidedTextLabel {
id: labelVideoFps
font.pointSize: JamiTheme.buttonFontSize
font.kerning: true
Layout.fillWidth: true
model: videoFormatFpsModel
textRole: "FPS_ToDisplay_UTF8"
eText: qsTr("Fps")
fontSize: JamiTheme.settingsFontSize
maxWidth: width
}
tooltipText: qsTr("Video device fps selector")
SettingParaCombobox {
id: fpsBox
onActivated: {
slotFormatCurrentIndexChanged(index,false)
}
Layout.preferredWidth: preferredColumnWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
font.pointSize: JamiTheme.buttonFontSize
font.kerning: true
model: VideoFormatFpsModel {}
textRole: "FPS_ToDisplay_UTF8"
tooltipText: qsTr("Video device fps selector")
onActivated: {
slotFormatCurrentIndexChanged(index,false)
}
}
}
@@ -703,15 +605,12 @@ Rectangle {
}
}
Label {
visible: !previewAvailable
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
text: qsTr("Preview unavailable")
font.pointSize: JamiTheme.settingsFontSize
@@ -727,28 +626,16 @@ Rectangle {
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.bottomMargin: JamiTheme.preferredMarginSize
labelText: hwAccelText.elidedText
labelText: qsTr("Enable hardware acceleration")
fontPointSize: JamiTheme.settingsFontSize
onSwitchToggled: {
slotSetHardwareAccel(checked)
}
}
TextMetrics {
id: hwAccelText
elide: Text.ElideRight
elideWidth: preferredSettingsWidth - 50
text: qsTr("Enable hardware acceleration")
}
Item {
Layout.preferredWidth: root.width - 32
Layout.minimumWidth: root.width - 32
Layout.maximumWidth: JamiTheme.maximumWidthSettingsView - 32
Layout.fillHeight: true
}
}
}
}

View File

@@ -28,7 +28,7 @@ import net.jami.Models 1.0
import "../../commoncomponents"
ItemDelegate {
id: deviceItemDelegate
id: root
property string contactName : ""
property string contactID: ""
@@ -54,39 +54,30 @@ ItemDelegate {
highlighted: ListView.isCurrentItem
RowLayout{
RowLayout {
anchors.fill: parent
spacing: 8
Label{
Label {
id: labelContactAvatar
Layout.alignment: Qt.AlignVCenter
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.preferredWidth: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: 16
Layout.rightMargin: 16
Layout.minimumWidth: 32
Layout.preferredWidth: 32
Layout.maximumWidth: 32
Layout.minimumHeight: 32
Layout.preferredHeight: 32
Layout.maximumHeight: 32
background: Rectangle{
background: Rectangle {
anchors.fill: parent
color: "transparent"
Image {
id: avatarImg
anchors.fill: parent
source: "data:image/png;base64," + contactPicture_base64
source: contactPicture_base64 === "" ? "" : "data:image/png;base64," + contactPicture_base64
fillMode: Image.PreserveAspectCrop
layer.enabled: true
layer.effect: OpacityMask {
maskSource: Rectangle{
maskSource: Rectangle {
width: avatarImg.width
height: avatarImg.height
radius: {
@@ -102,7 +93,6 @@ ItemDelegate {
ColumnLayout{
Layout.fillWidth: true
Layout.fillHeight: true
Layout.alignment: Qt.AlignVCenter
Label{
@@ -110,23 +100,14 @@ ItemDelegate {
Layout.fillWidth: true
Layout.minimumHeight: 24
Layout.preferredHeight: 24
Layout.maximumHeight: 24
font.pointSize: JamiTheme.textFontSize
font.kerning: true
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
text: labelContactNameElidedText.elidedText
}
TextMetrics {
id: labelContactNameElidedText
elide: Text.ElideRight
elideWidth: deviceItemDelegate.width - 80
text: contactName === "" ? qsTr("name") : contactName
}
@@ -144,14 +125,7 @@ ItemDelegate {
horizontalAlignment: Qt.AlignLeft
verticalAlignment: Qt.AlignVCenter
text: labelContactIdElidedText.elidedText
}
TextMetrics {
id: labelContactIdElidedText
elide: Text.ElideRight
elideWidth: deviceItemDelegate.width - 80
text: contactID === "" ? qsTr("id") : contactID
}
}
@@ -162,13 +136,8 @@ ItemDelegate {
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
Layout.rightMargin: 8
Layout.minimumWidth: 32
Layout.preferredWidth: 32
Layout.maximumWidth: 32
Layout.minimumHeight: 32
Layout.preferredHeight: 32
Layout.maximumHeight: 32
Layout.preferredWidth: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
buttonImageHeight: height - 8
buttonImageWidth: width - 8

View File

@@ -31,7 +31,7 @@ import net.jami.Adapters 1.0
import "../../commoncomponents"
Rectangle {
id: accountViewRect
id: root
enum RegName {
BLANK,
@@ -46,7 +46,7 @@ Rectangle {
property bool registeredIdNeedsSet: false
property int refreshVariable : 0
property int preferredColumnWidth : accountViewRect.width / 2 - 50
property int preferredColumnWidth : root.width / 2 - 50
signal navigateToMainView
signal navigateToNewWizardView
@@ -81,7 +81,7 @@ Rectangle {
// update device list view
updateAndShowDevicesSlot()
bannedContactsLayoutWidget.visible = (bannedListModel.rowCount() > 0)
bannedContactsLayoutWidget.visible = (bannedListWidget.model.rowCount() > 0)
if (advanceSettingsView.visible) {
advanceSettingsView.updateAccountInfoDisplayedAdvance()
@@ -128,7 +128,7 @@ Rectangle {
Connections {
id: accountConnections_ContactModel
target: ClientWrapper.contactModel
enabled: accountViewRect.visible
enabled: root.visible
function onModelUpdated(uri, needsSorted) {
updateAndShowBannedContactsSlot()
@@ -146,7 +146,7 @@ Rectangle {
Connections {
id: accountConnections_DeviceModel
target: ClientWrapper.deviceModel
enabled: accountViewRect.visible
enabled: root.visible
function onDeviceAdded(id) {
updateAndShowDevicesSlot()
@@ -222,9 +222,7 @@ Rectangle {
ClientWrapper.accountModel.setAccountEnabled(ClientWrapper.utilsAdaptor.getCurrAccId(), state)
}
/*
* JamiFileDialog for exporting account
*/
// JamiFileDialog for exporting account
JamiFileDialog {
id: exportBtn_Dialog
@@ -248,18 +246,10 @@ Rectangle {
var title = isSuccessful ? qsTr("Success") : qsTr("Error")
var iconMode = isSuccessful ? StandardIcon.Information : StandardIcon.Critical
var info = isSuccessful ? qsTr("Export Successful") : qsTr("Export Failed")
msgDialog.openWithParameters(title,info, iconMode, StandardButton.Ok)
MessageBox.openWithParameters(title,info, iconMode, StandardButton.Ok)
}
}
}
onRejected: {}
onVisibleChanged: {
if (!visible) {
rejected()
}
}
}
function exportAccountSlot() {
@@ -269,6 +259,8 @@ Rectangle {
PasswordDialog {
id: passwordDialog
anchors.centerIn: parent.Center
onDoneSignal: {
var success = (code === successCode)
var title = success ? qsTr("Success") : qsTr("Error")
@@ -288,14 +280,10 @@ Rectangle {
break
}
msgDialog.openWithParameters(title,info, iconMode, StandardButton.Ok)
MessageBox.openWithParameters(title,info, iconMode, StandardButton.Ok)
}
}
MessageBox {
id: msgDialog
}
function passwordClicked() {
if (ClientWrapper.accountAdaptor.hasPassword()){
passwordDialog.openDialog(PasswordDialog.ChangePassword)
@@ -308,12 +296,10 @@ Rectangle {
deleteAccountDialog.open()
}
DeleteAccountDialog{
DeleteAccountDialog {
id: deleteAccountDialog
anchors.centerIn: parent.Center
x: (parent.width - width) / 2
y: (parent.height - height) / 2
onAccepted: {
ClientWrapper.accountAdaptor.setSelectedConvId()
@@ -342,6 +328,8 @@ Rectangle {
LinkDeviceDialog{
id: linkDeviceDialog
anchors.centerIn: parent.Center
onAccepted: {
updateAndShowDevicesSlot()
}
@@ -354,6 +342,8 @@ Rectangle {
RevokeDevicePasswordDialog{
id: revokeDevicePasswordDialog
anchors.centerIn: parent.Center
onRevokeDeviceWithPassword:{
revokeDeviceWithIDAndPassword(idOfDevice, password)
}
@@ -369,27 +359,13 @@ Rectangle {
icon :StandardIcon.Information
standardButtons: StandardButton.Ok | StandardButton.Cancel
onYes: {
accepted()
}
onNo:{
rejected()
}
onDiscard: {
rejected()
}
onAccepted: {
revokeDeviceWithIDAndPassword(idOfDev,"")
}
onRejected: {}
}
function removeDeviceSlot(index){
var idOfDevice = deviceItemListModel.data(deviceItemListModel.index(index,0), DeviceItemListModel.DeviceID)
var idOfDevice = settingsListView.model.data(settingsListView.model.index(index,0), DeviceItemListModel.DeviceID)
if(ClientWrapper.accountAdaptor.hasPassword()){
revokeDevicePasswordDialog.openRevokeDeviceDialog(idOfDevice)
} else {
@@ -404,12 +380,12 @@ Rectangle {
}
function updateAndShowBannedContactsSlot() {
if(bannedListModel.rowCount() <= 0){
if(bannedListWidget.model.rowCount() <= 0){
bannedContactsLayoutWidget.visible = false
return
}
bannedListModel.reset()
bannedListWidget.model.reset()
}
function updateAndShowDevicesSlot() {
@@ -417,48 +393,31 @@ Rectangle {
linkDevPushButton.visible = true
}
deviceItemListModel.reset()
settingsListView.model.reset()
}
DeviceItemListModel {
id: deviceItemListModel
}
BannedListModel{
id: bannedListModel
}
Layout.fillHeight: true
Layout.maximumWidth: JamiTheme.maximumWidthSettingsView
anchors.centerIn: parent
ColumnLayout {
anchors.fill: accountViewRect
anchors.fill: root
RowLayout {
id: accountPageTitle
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.fillWidth: true
Layout.maximumHeight: 64
Layout.minimumHeight: 64
Layout.preferredHeight: 64
HoverableButton {
id: backToSettingsMenuButton
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
Layout.preferredWidth: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.rightMargin: JamiTheme.preferredMarginSize
radius: 32
radius: JamiTheme.preferredFieldHeight
source: "qrc:/images/icons/ic_arrow_back_24px.svg"
backgroundColor: "white"
onExitColor: "white"
toolTipText: qsTr("Toggle to display side panel")
hoverEnabled: true
visible: mainViewWindow.sidePanelHidden
onClicked: {
@@ -466,17 +425,16 @@ Rectangle {
}
}
ElidedTextLabel {
Label {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Account Settings")
fontSize: JamiTheme.titleFontSize
maxWidth: !backToSettingsMenuButton.visible ? accountViewRect.width - 100 :
accountViewRect.width - backToSettingsMenuButton.width - 100
text: qsTr("Account Settings")
font.pointSize: JamiTheme.titleFontSize
font.kerning: true
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
}
@@ -484,30 +442,20 @@ Rectangle {
id: accountScrollView
property ScrollBar vScrollBar: ScrollBar.vertical
Layout.fillHeight: true
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
width: accountViewRect.width
height: accountViewRect.height - accountPageTitle.height
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
ScrollBar.vertical.policy: ScrollBar.AsNeeded
Layout.fillHeight: true
Layout.fillWidth: true
focus: true
clip: true
/*
* ScrollView Layout
*/
// ScrollView Layout
ColumnLayout {
id: accountViewLayout
Layout.fillHeight: true
Layout.preferredWidth: accountViewRect.width
Layout.alignment: Qt.AlignHCenter
spacing: 24
width: root.width
ToggleSwitch {
id: accountEnableCheckBox
@@ -515,6 +463,7 @@ Rectangle {
Layout.fillWidth: true
Layout.topMargin: JamiTheme.preferredMarginSize
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
labelText: qsTr("Enable")
fontPointSize: JamiTheme.headerFontSize
@@ -524,21 +473,16 @@ Rectangle {
}
}
/*
* Profile
*/
// Profile
ColumnLayout {
Layout.fillWidth: true
Layout.fillHeight: true
spacing: 8
Layout.topMargin: JamiTheme.preferredMarginSize
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
Label {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: JamiTheme.preferredMarginSize
text: qsTr("Profile")
font.pointSize: JamiTheme.headerFontSize
@@ -551,16 +495,11 @@ Rectangle {
PhotoboothView {
id: currentAccountAvatar
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Layout.alignment: Qt.AlignCenter
boothWidth: Math.min(224, accountViewRect.width - 100)
boothWidth: Math.min(224, root.width - 100) + 50
Layout.maximumWidth: boothWidth+50
Layout.preferredWidth: boothWidth+50
Layout.minimumWidth: boothWidth+50
Layout.maximumHeight: boothWidth+50
Layout.preferredHeight: boothWidth+50
Layout.minimumHeight: boothWidth+50
Layout.preferredWidth: boothWidth
onImageAcquired: {
SettingsAdapter.setCurrAccAvatar(imgBase64)
@@ -593,41 +532,31 @@ Rectangle {
}
}
/*
* Identity
*/
// Identity
ColumnLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.leftMargin: JamiTheme.preferredMarginSize
spacing: 8
Layout.rightMargin: JamiTheme.preferredMarginSize
ElidedTextLabel {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Identity")
maxWidth: accountViewRect.width - 72
maxWidth: root.width - 72
fontSize: JamiTheme.headerFontSize
}
RowLayout {
spacing: 8
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: JamiTheme.preferredMarginSize
Label {
id: idLabel
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.fillHeight: true
text: qsTr("Id")
font.pointSize: JamiTheme.settingsFontSize
@@ -670,7 +599,7 @@ Rectangle {
id: currentRingIDText
elide: Text.ElideRight
elideWidth: accountViewRect.width - idLabel.width -JamiTheme.preferredMarginSize*4
elideWidth: root.width - idLabel.width -JamiTheme.preferredMarginSize*4
text: { refreshVariable
return ClientWrapper.SettingsAdapter.getCurrentAccount_Profile_Info_Uri()
@@ -680,34 +609,29 @@ Rectangle {
}
RowLayout {
spacing: 8
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.preferredHeight: JamiTheme.preferredFieldHeight
ElidedTextLabel {
id: lblRegisteredName
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
eText: qsTr("Registered name")
fontSize: JamiTheme.settingsFontSize
maxWidth: preferredColumnWidth
maxWidth: width
}
MaterialLineEdit {
id: currentRegisteredID
Layout.alignment: Qt.AlignCenter
Layout.alignment: Qt.AlignRight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
Layout.fillWidth: true
placeholderText: { refreshVariable
var result = registeredIdNeedsSet ?
var result = true ?
qsTr("Type here to register a username") : ""
return result}
@@ -763,13 +687,12 @@ Rectangle {
}
}
/*
* Buttons Pwd, Export, Delete
*/
// Buttons Pwd, Export, Delete
ColumnLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
spacing: 8
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
MaterialButton {
id: passwdPushButton
@@ -844,17 +767,14 @@ Rectangle {
}
}
/*
Linked devices
*/
// Linked devices
ColumnLayout {
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
Label {
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
text: qsTr("Linked Devices")
@@ -870,20 +790,18 @@ Rectangle {
id: settingsListView
Layout.fillWidth: true
Layout.minimumHeight: 160
Layout.preferredHeight: 160
Layout.maximumHeight: 160
model: deviceItemListModel
model: DeviceItemListModel{}
delegate: DeviceItemDelegate{
delegate: DeviceItemDelegate {
id: settingsListDelegate
implicitWidth: settingsListView.width
width: settingsListView.width
height: 72
height: 70
deviceName : DeviceName
deviceName: DeviceName
deviceId: DeviceID
isCurrent: IsCurrent
@@ -916,8 +834,6 @@ Rectangle {
source: "qrc:/images/icons/round-add-24px.svg"
text: qsTr("Link Another Device")
font.pointSize: JamiTheme.textFontSize
font.kerning: true
onClicked: {
showLinkDevSlot()
@@ -926,18 +842,15 @@ Rectangle {
}
}
/*
* Banned contacts
*/
// Banned contacts
ColumnLayout {
id: bannedContactsLayoutWidget
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.alignment: Qt.AlignHCenter
spacing: 8
RowLayout {
Layout.fillWidth: true
@@ -946,14 +859,11 @@ Rectangle {
id: lblBannedContacts
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Banned Contacts")
fontSize: JamiTheme.headerFontSize
maxWidth: accountViewRect.width - bannedContactsBtn.width
- JamiTheme.preferredMarginSize*4
maxWidth: root.width - bannedContactsBtn.width
- JamiTheme.preferredMarginSize * 4
}
HoverableButtonTextItem {
@@ -961,13 +871,8 @@ Rectangle {
Layout.alignment: Qt.AlignRight
Layout.maximumWidth: JamiTheme.preferredFieldHeight
Layout.preferredWidth: JamiTheme.preferredFieldHeight
Layout.minimumWidth: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
radius: height / 2
@@ -986,19 +891,15 @@ Rectangle {
ColumnLayout {
id: bannedContactsListWidget
spacing: 8
visible: false
ListViewJami {
id: bannedListWidget
Layout.fillWidth: true
Layout.minimumHeight: 160
Layout.preferredHeight: 160
Layout.maximumHeight: 160
model: bannedListModel
model: BannedListModel{}
delegate: BannedItemDelegate{
id: bannedListDelegate
@@ -1022,43 +923,32 @@ Rectangle {
}
}
/*
* Advanced Settigs Button
*/
// Advanced Settigs Button
RowLayout {
id: rowAdvancedSettingsBtn
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.bottomMargin: 8
ElidedTextLabel {
id: lblAdvancedAccountSettings
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Advanced Account Settings")
fontSize: JamiTheme.headerFontSize
maxWidth: accountViewRect.width - advancedAccountSettingsPButton.width
- JamiTheme.preferredMarginSize*6
maxWidth: root.width - advancedAccountSettingsPButton.width
- JamiTheme.preferredMarginSize * 6
}
HoverableButtonTextItem {
id: advancedAccountSettingsPButton
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.minimumWidth: JamiTheme.preferredFieldHeight
Layout.preferredWidth: JamiTheme.preferredFieldHeight
Layout.maximumWidth: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignHCenter
radius: height / 2
@@ -1086,23 +976,15 @@ Rectangle {
}
}
/*
* Advanced Settings
*/
// Advanced Settings
AdvancedSettingsView {
id: advanceSettingsView
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.bottomMargin: JamiTheme.preferredMarginSize
visible: false
}
/*
* To keep max width
*/
Item {
Layout.preferredWidth: accountViewRect.width - 32
Layout.minimumWidth: accountViewRect.width - 32
Layout.maximumWidth: JamiTheme.maximumWidthSettingsView - 32
Layout.fillHeight: true
itemWidth: preferredColumnWidth
}
}
}

View File

@@ -27,12 +27,12 @@ import net.jami.Models 1.0
import "../../commoncomponents"
Rectangle {
id: sipAccountViewRect
id: root
signal navigateToMainView
signal navigateToNewWizardView
signal backArrowClicked
property int preferredColumnWidth : sipAccountViewRect.width / 2 - 50
property int preferredColumnWidth : root.width / 2 - 50
function updateAccountInfoDisplayed() {
displaySIPNameLineEdit.text = SettingsAdapter.getCurrentAccount_Profile_Info_Alias()
@@ -74,12 +74,10 @@ Rectangle {
deleteAccountDialog_SIP.open()
}
DeleteAccountDialog{
DeleteAccountDialog {
id: deleteAccountDialog_SIP
anchors.centerIn: parent.Center
x: (parent.width - width) / 2
y: (parent.height - height) / 2
onAccepted: {
ClientWrapper.accountAdaptor.setSelectedConvId()
@@ -92,35 +90,24 @@ Rectangle {
}
}
Layout.fillHeight: true
Layout.maximumWidth: JamiTheme.maximumWidthSettingsView
anchors.centerIn: parent
ColumnLayout {
anchors.fill: sipAccountViewRect
anchors.fill: root
RowLayout {
id: sipAccountPageTitle
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.fillWidth: true
Layout.maximumHeight: 64
Layout.minimumHeight: 64
Layout.preferredHeight: 64
HoverableButton {
id: backToSettingsMenuButton
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
Layout.preferredWidth: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.rightMargin: JamiTheme.preferredMarginSize
radius: 32
radius: JamiTheme.preferredFieldHeight
source: "qrc:/images/icons/ic_arrow_back_24px.svg"
backgroundColor: "white"
onExitColor: "white"
toolTipText: qsTr("Toggle to display side panel")
hoverEnabled: true
visible: mainViewWindow.sidePanelHidden
@@ -130,17 +117,16 @@ Rectangle {
}
}
ElidedTextLabel {
Label {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Account Settings")
fontSize: JamiTheme.titleFontSize
maxWidth: !backToSettingsMenuButton.visible ? sipAccountViewRect.width - 100 :
sipAccountViewRect.width - backToSettingsMenuButton.width - 100
text: qsTr("Account Settings")
font.pointSize: JamiTheme.titleFontSize
font.kerning: true
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
}
@@ -151,30 +137,20 @@ Rectangle {
Layout.fillHeight: true
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
width: sipAccountViewRect.width
height: sipAccountViewRect.height - sipAccountPageTitle.height
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
ScrollBar.vertical.policy: ScrollBar.AsNeeded
clip: true
ColumnLayout {
id: accountSIPLayout
Layout.fillHeight: true
Layout.preferredWidth: sipAccountViewRect.width
Layout.alignment: Qt.AlignHCenter
spacing: 24
width: root.width
ToggleSwitch {
id: accountSIPEnableCheckBox
Layout.topMargin: JamiTheme.preferredMarginSize
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
labelText: qsTr("Enable")
fontPointSize: JamiTheme.headerFontSize
@@ -188,14 +164,11 @@ Rectangle {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.leftMargin: JamiTheme.preferredMarginSize
spacing: 8
Layout.rightMargin: JamiTheme.preferredMarginSize
Label {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
text: qsTr("Profile")
font.pointSize: JamiTheme.headerFontSize
@@ -208,16 +181,11 @@ Rectangle {
PhotoboothView {
id: currentSIPAccountAvatar
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Layout.alignment: Qt.AlignCenter
boothWidth: Math.min(224, sipAccountViewRect.width - 100)
boothWidth: Math.min(224, root.width - 100) + 50
Layout.maximumWidth: boothWidth+50
Layout.preferredWidth: boothWidth+50
Layout.minimumWidth: boothWidth+50
Layout.maximumHeight: boothWidth+50
Layout.preferredHeight: boothWidth+50
Layout.minimumHeight: boothWidth+50
Layout.preferredWidth: boothWidth
onImageAcquired: {
SettingsAdapter.setCurrAccAvatar(imgBase64)
@@ -250,22 +218,18 @@ Rectangle {
}
}
ColumnLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.leftMargin: JamiTheme.preferredMarginSize
spacing: 8
Layout.rightMargin: JamiTheme.preferredMarginSize
ElidedTextLabel {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Identity")
maxWidth: sipAccountViewRect.width - 72
maxWidth: root.width - 72
fontSize: JamiTheme.headerFontSize
}
@@ -274,8 +238,6 @@ Rectangle {
rows: 4
columns: 2
flow: GridLayout.LeftToRight
rowSpacing: 8
columnSpacing: 6
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
@@ -283,9 +245,7 @@ Rectangle {
// user name
ElidedTextLabel {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Username")
fontSize: JamiTheme.settingsFontSize
@@ -299,7 +259,7 @@ Rectangle {
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
font.pointSize: JamiTheme.settingsFontSize // Albert: buttonSize?
font.pointSize: JamiTheme.settingsFontSize
font.kerning: true
horizontalAlignment: Text.AlignLeft
@@ -316,9 +276,7 @@ Rectangle {
// host name
ElidedTextLabel {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Hostname")
fontSize: JamiTheme.settingsFontSize
@@ -349,9 +307,7 @@ Rectangle {
// proxy
ElidedTextLabel {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
text: qsTr("Proxy")
font.pointSize: JamiTheme.settingsFontSize
@@ -365,7 +321,7 @@ Rectangle {
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
font.pointSize: JamiTheme.settingsFontSize // Albert
font.pointSize: JamiTheme.settingsFontSize
font.kerning: true
horizontalAlignment: Text.AlignLeft
@@ -382,9 +338,7 @@ Rectangle {
// password
ElidedTextLabel {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Password")
fontSize: JamiTheme.settingsFontSize
@@ -439,38 +393,33 @@ Rectangle {
id: rowAdvancedSettingsBtn
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.bottomMargin: 8
ElidedTextLabel {
id: lblAdvancedAccountSettings
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Advanced Account Settings")
fontSize: JamiTheme.headerFontSize
maxWidth: sipAccountViewRect.width - advancedAccountSettingsSIPButton.width - 80
maxWidth: root.width - advancedAccountSettingsSIPButton.width
- JamiTheme.preferredMarginSize * 6
}
HoverableRadiusButton {
HoverableButtonTextItem {
id: advancedAccountSettingsSIPButton
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.minimumWidth: JamiTheme.preferredFieldHeight
Layout.preferredWidth: JamiTheme.preferredFieldHeight
Layout.maximumWidth: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignHCenter
radius: height / 2
icon.source: {
toolTipText: qsTr("Press to display or hide advance settings")
source: {
if (advanceSIPSettingsView.visible) {
return "qrc:/images/icons/round-arrow_drop_up-24px.svg"
} else {
@@ -493,15 +442,12 @@ Rectangle {
// instantiate advance setting page
AdvancedSIPSettingsView {
id: advanceSIPSettingsView
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.bottomMargin: JamiTheme.preferredMarginSize
visible: false
}
Item {
Layout.preferredWidth: sipAccountViewRect.width - 32
Layout.minimumWidth: sipAccountViewRect.width - 32
Layout.maximumWidth: JamiTheme.maximumWidthSettingsView - 32
Layout.fillHeight: true
itemWidth: preferredColumnWidth
}
}
}

View File

@@ -28,7 +28,7 @@ import net.jami.Models 1.0
import "../../commoncomponents"
ItemDelegate {
id: deviceItemDelegate
id: root
property string deviceName : ""
property string deviceId : ""
@@ -64,108 +64,71 @@ ItemDelegate {
highlighted: ListView.isCurrentItem
RowLayout {
id: layoutDeviceItemDelegate
anchors.fill: parent
spacing: 8
anchors.fill: root
Image {
Layout.leftMargin: 16
id: deviceImage
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.alignment: Qt.AlignVCenter
Layout.minimumWidth: 24
Layout.preferredWidth: 24
Layout.maximumWidth: 24
Layout.minimumHeight: 24
Layout.preferredHeight: 24
Layout.maximumHeight: 24
source: "qrc:/images/icons/baseline-desktop_windows-24px.svg"
}
ColumnLayout {
id: col
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.leftMargin: 16
Layout.leftMargin: JamiTheme.preferredMarginSize
RowLayout {
InfoLineEdit {
id: editDeviceName
implicitWidth: parent.width
Layout.fillWidth: true
spacing: 0
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.preferredHeight: 30
Layout.alignment: Qt.AlignLeft
font.pointSize: JamiTheme.textFontSize
font.kerning: true
InfoLineEdit {
id: editDeviceName
wrapMode: Text.NoWrap
readOnly: !editable
backgroundColor: "white"
text: elidedTextDeviceName.elidedText
}
Layout.preferredWidth: deviceItemDelegate.width - 112
Layout.maximumWidth: deviceItemDelegate.width - 112
Layout.minimumWidth: deviceItemDelegate.width - 112
fieldLayoutWidth: deviceItemDelegate.width - 112
TextMetrics {
id: elidedTextDeviceName
Layout.minimumHeight: 24
Layout.preferredHeight: 24
Layout.maximumHeight: 24
fieldLayoutHeight: 24
Layout.alignment: Qt.AlignLeft
font.pointSize: JamiTheme.textFontSize
font.kerning: true
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
readOnly: !editable
backgroundColor: "white"
text: elidedTextDeviceName.elidedText
}
TextMetrics {
id: elidedTextDeviceName
elide: Text.ElideRight
elideWidth: deviceItemDelegate.width - 112
text: deviceName
}
elide: Text.ElideRight
elideWidth: root.width - btnEditDevice.width - deviceImage.width - 8
text: deviceName
}
ElidedTextLabel {
id: labelDeviceId
Layout.fillWidth: true
Layout.leftMargin: 12
Layout.minimumHeight: 24
Layout.preferredHeight: 24
Layout.maximumHeight: 24
Layout.leftMargin: 8
maxWidth: deviceItemDelegate.width - 112
maxWidth: root.width - btnEditDevice.width - deviceImage.width
eText: deviceId === "" ? qsTr("Device Id") : deviceId
}
}
HoverableRadiusButton {
id: btnEditDevice
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
Layout.rightMargin: 8
Layout.minimumWidth: 32
Layout.preferredWidth: 32
Layout.maximumWidth: 32
Layout.minimumHeight: 32
Layout.preferredHeight: 32
Layout.maximumHeight: 32
Layout.preferredWidth: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
buttonImageHeight: height - 8
buttonImageWidth: width - 8
radius: height / 2
width: 25
height: 25
width: 24
height: 24
backgroundColor: "transparent"

View File

@@ -29,7 +29,7 @@ import net.jami.Enums 1.0
import "../../commoncomponents"
Rectangle {
id: generalSettingsRect
id: root
function populateGeneralSettings(){
// settings
@@ -105,14 +105,6 @@ Rectangle {
var dir = ClientWrapper.utilsAdaptor.getAbsPath(folder.toString())
downloadPath = dir
}
onRejected: {}
onVisibleChanged: {
if (!visible) {
rejected()
}
}
}
function openRecordFolderSlot(){
@@ -129,14 +121,6 @@ Rectangle {
var dir = ClientWrapper.utilsAdaptor.getAbsPath(folder.toString())
recordPath = dir
}
onRejected: {}
onVisibleChanged: {
if (!visible) {
rejected()
}
}
}
//TODO: complete check for update and check for Beta slot functions
@@ -149,8 +133,8 @@ Rectangle {
// recording
property string recordPath: SettingsAdapter.getDir_Document()
property int preferredColumnWidth : generalSettingsScrollView.width / 2 - 50
property int preferredSettingsWidth : generalSettingsScrollView.width - 100
property int preferredColumnWidth : root.width / 2 - 50
property int preferredSettingsWidth : root.width - 100
signal backArrowClicked
@@ -167,31 +151,23 @@ Rectangle {
}
}
Layout.fillHeight: true
Layout.maximumWidth: JamiTheme.maximumWidthSettingsView
anchors.centerIn: parent
ColumnLayout {
anchors.fill: generalSettingsRect
anchors.fill: root
RowLayout {
id: generalSettingsTitle
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.fillWidth: true
Layout.maximumHeight: 64
Layout.minimumHeight: 64
Layout.preferredHeight: 64
HoverableButton {
id: backToSettingsMenuButton
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
Layout.preferredWidth: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.rightMargin: JamiTheme.preferredMarginSize
radius: 32
radius: JamiTheme.preferredFieldHeight
source: "qrc:/images/icons/ic_arrow_back_24px.svg"
backgroundColor: "white"
onExitColor: "white"
@@ -206,9 +182,6 @@ Rectangle {
Label {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
text: qsTr("General")
font.pointSize: JamiTheme.titleFontSize
@@ -220,41 +193,27 @@ Rectangle {
}
ScrollView{
ScrollView {
id: generalSettingsScrollView
property ScrollBar vScrollBar: ScrollBar.vertical
Layout.fillHeight: true
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
width: generalSettingsRect.width
height: generalSettingsRect.height - generalSettingsTitle.height
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
ScrollBar.vertical.policy: ScrollBar.AsNeeded
focus: true
clip: true
ColumnLayout {
Layout.fillHeight: true
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
spacing: 24
width: root.width
// system setting panel
ColumnLayout {
spacing: 8
Layout.fillWidth: true
Layout.topMargin: JamiTheme.preferredMarginSize
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
Label {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
text: qsTr("System")
font.pointSize: JamiTheme.headerFontSize
@@ -264,268 +223,214 @@ Rectangle {
verticalAlignment: Text.AlignVCenter
}
ColumnLayout {
spacing: 8
ToggleSwitch {
id: notificationCheckBox
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
ToggleSwitch {
id: notificationCheckBox
labelText: qsTr("Enable desktop notifications")
fontPointSize: JamiTheme.settingsFontSize
labelText: desktopNotificationsElidedText.elidedText
fontPointSize: JamiTheme.settingsFontSize
tooltipText: qsTr("toggle enable notifications")
tooltipText: qsTr("toggle enable notifications")
onSwitchToggled: {
setEnableNotifications(checked)
}
onSwitchToggled: {
setEnableNotifications(checked)
}
}
TextMetrics {
id: desktopNotificationsElidedText
elide: Text.ElideRight
elideWidth: preferredSettingsWidth
text: qsTr("Enable desktop notifications")
ToggleSwitch {
id: closeOrMinCheckBox
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
labelText: qsTr("Keep minimize on close")
fontPointSize: JamiTheme.settingsFontSize
tooltipText: qsTr("toggle keep minimized on close")
onSwitchToggled: {
setMinimizeOnClose(checked)
}
}
ToggleSwitch {
id: applicationOnStartUpCheckBox
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
ToggleSwitch {
id: closeOrMinCheckBox
labelText: qsTr("Run On Startup")
fontPointSize: JamiTheme.settingsFontSize
labelText: keepMinimizeElidedText.elidedText
fontPointSize: JamiTheme.settingsFontSize
tooltipText: qsTr("toggle run application on system startup")
tooltipText: qsTr("toggle keep minimized on close")
onSwitchToggled: {
setMinimizeOnClose(checked)
}
onSwitchToggled: {
slotSetRunOnStartUp(checked)
}
}
TextMetrics {
id: keepMinimizeElidedText
elide: Text.ElideRight
elideWidth: preferredSettingsWidth
text: qsTr("Keep minimize on close")
}
RowLayout {
Layout.fillWidth: true
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: JamiTheme.preferredMarginSize
ToggleSwitch {
id: applicationOnStartUpCheckBox
labelText: runOnStartupElidedText.elidedText
fontPointSize: JamiTheme.settingsFontSize
tooltipText: qsTr("toggle run application on system startup")
onSwitchToggled: {
slotSetRunOnStartUp(checked)
}
}
TextMetrics {
id: runOnStartupElidedText
elide: Text.ElideRight
elideWidth: preferredSettingsWidth
text: qsTr("Run On Startup")
}
RowLayout {
spacing: 8
Label {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.fillHeight: true
ElidedTextLabel {
text: qsTr("Downloads folder")
font.pointSize: JamiTheme.settingsFontSize
font.kerning: true
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
eText: qsTr("Downloads folder")
font.pointSize: JamiTheme.settingsFontSize
maxWidth: preferredColumnWidth
}
MaterialButton {
id: downloadButton
MaterialButton {
id: downloadButton
Layout.alignment: Qt.AlignRight
Layout.preferredWidth: preferredColumnWidth
Layout.fillHeight: true
Layout.alignment: Qt.AlignRight
Layout.preferredWidth: preferredColumnWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
toolTipText: qsTr("Press to choose download folder path")
text: downloadPath
source: "qrc:/images/icons/round-folder-24px.svg"
color: JamiTheme.buttonTintedGrey
hoveredColor: JamiTheme.buttonTintedGreyHovered
pressedColor: JamiTheme.buttonTintedGreyPressed
toolTipText: qsTr("Press to choose download folder path")
text: downloadPath
source: "qrc:/images/icons/round-folder-24px.svg"
color: JamiTheme.buttonTintedGrey
hoveredColor: JamiTheme.buttonTintedGreyHovered
pressedColor: JamiTheme.buttonTintedGreyPressed
onClicked: {
openDownloadFolderSlot()
}
onClicked: {
openDownloadFolderSlot()
}
}
}
}
// call recording setting panel
// // call recording setting panel
ColumnLayout {
spacing: 8
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
ElidedTextLabel {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
eText: qsTr("Call Recording")
font.pointSize: JamiTheme.headerFontSize
maxWidth: preferredSettingsWidth
maxWidth: width
}
ColumnLayout {
spacing: 8
ToggleSwitch {
id: alwaysRecordingCheckBox
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
ToggleSwitch {
id: alwaysRecordingCheckBox
labelText: qsTr("Always record calls")
fontPointSize: JamiTheme.settingsFontSize
labelText: alwaysRecordElidedText.elidedText
fontPointSize: JamiTheme.settingsFontSize
onSwitchToggled: {
slotAlwaysRecordingClicked(checked)
}
onSwitchToggled: {
slotAlwaysRecordingClicked(checked)
}
}
TextMetrics {
id: alwaysRecordElidedText
elide: Text.ElideRight
elideWidth: preferredSettingsWidth
text: qsTr("Always record calls")
ToggleSwitch {
id: recordPreviewCheckBox
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
labelText: qsTr("Record preview video for a call")
fontPointSize: JamiTheme.settingsFontSize
onSwitchToggled: {
slotRecordPreviewClicked(checked)
}
}
RowLayout {
Layout.fillWidth: true
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: JamiTheme.preferredMarginSize
ToggleSwitch {
id: recordPreviewCheckBox
labelText: recordPreviewElidedText.elidedText
fontPointSize: JamiTheme.settingsFontSize
onSwitchToggled: {
slotRecordPreviewClicked(checked)
}
}
TextMetrics {
id: recordPreviewElidedText
elide: Text.ElideRight
elideWidth: preferredSettingsWidth
text: qsTr("Record preview video for a call")
}
RowLayout {
spacing: 8
Text {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.rightMargin: JamiTheme.preferredMarginSize / 2
Label {
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.minimumHeight: JamiTheme.preferredFieldHeight
text: qsTr("Quality")
font.pointSize: JamiTheme.settingsFontSize
font.kerning: true
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
Label {
id: recordQualityValueLabel
Layout.minimumWidth: 50
Layout.preferredWidth: 50
Layout.maximumWidth: 50
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
text: qsTr("VALUE ")
font.pointSize: JamiTheme.settingsFontSize
font.kerning: true
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
Slider{
id: recordQualitySlider
Layout.maximumWidth: preferredColumnWidth
Layout.preferredWidth: preferredColumnWidth
Layout.minimumWidth: preferredColumnWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
from: 0
to: 500
stepSize: 1
onMoved: {
slotRecordQualitySliderValueChanged(value)
}
}
text: qsTr("Quality")
font.pointSize: JamiTheme.settingsFontSize
font.kerning: true
elide: Text.ElideRight
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
RowLayout {
spacing: 8
Text {
id: recordQualityValueLabel
Layout.alignment: Qt.AlignRight
Layout.fillHeight: true
Layout.fillWidth: true
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.rightMargin: JamiTheme.preferredMarginSize / 2
Label {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
text: qsTr("VALUE ")
text: qsTr("Save in")
font.pointSize: JamiTheme.settingsFontSize
font.kerning: true
font.pointSize: JamiTheme.settingsFontSize
font.kerning: true
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
}
Slider {
id: recordQualitySlider
Layout.maximumWidth: preferredColumnWidth
Layout.alignment: Qt.AlignRight
Layout.fillWidth: true
Layout.fillHeight: true
from: 0
to: 500
stepSize: 1
onMoved: {
slotRecordQualitySliderValueChanged(value)
}
}
}
MaterialButton {
id: recordPathButton
RowLayout {
Layout.fillWidth: true
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.alignment: Qt.AlignRight
Layout.preferredWidth: preferredColumnWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Label {
Layout.fillWidth: true
Layout.fillHeight: true
toolTipText: qsTr("Press to choose record folder path")
text: recordPath
source: "qrc:/images/icons/round-folder-24px.svg"
color: JamiTheme.buttonTintedGrey
hoveredColor: JamiTheme.buttonTintedGreyHovered
pressedColor: JamiTheme.buttonTintedGreyPressed
text: qsTr("Save in")
font.pointSize: JamiTheme.settingsFontSize
font.kerning: true
onClicked: {
openRecordFolderSlot()
}
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
MaterialButton {
id: recordPathButton
Layout.alignment: Qt.AlignRight
Layout.fillHeight: true
Layout.preferredWidth: preferredColumnWidth
toolTipText: qsTr("Press to choose record folder path")
text: recordPath
source: "qrc:/images/icons/round-folder-24px.svg"
color: JamiTheme.buttonTintedGrey
hoveredColor: JamiTheme.buttonTintedGreyHovered
pressedColor: JamiTheme.buttonTintedGreyPressed
onClicked: {
openRecordFolderSlot()
}
}
}
@@ -533,16 +438,14 @@ Rectangle {
// update setting panel
ColumnLayout {
spacing: 8
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.bottomMargin: JamiTheme.preferredMarginSize
visible: Qt.platform.os == "windows"? true : false
Label {
Layout.fillWidth: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
text: qsTr("Updates")
font.pointSize: JamiTheme.headerFontSize
@@ -552,81 +455,54 @@ Rectangle {
verticalAlignment: Text.AlignVCenter
}
ColumnLayout {
spacing: 8
Layout.fillWidth: true
ToggleSwitch {
id: autoUpdateCheckBox
ToggleSwitch {
id: autoUpdateCheckBox
labelText: qsTr("Check for updates automatically")
fontPointSize: JamiTheme.settingsFontSize
labelText: autoUpdateText.elidedText
fontPointSize: JamiTheme.settingsFontSize
tooltipText: qsTr("toggle automatic updates")
tooltipText: qsTr("toggle automatic updates")
onSwitchToggled: {
setAutoUpdate(checked)
}
}
TextMetrics {
id: autoUpdateText
elide: Text.ElideRight
elideWidth: preferredSettingsWidth
text: qsTr("Check for updates automatically")
}
HoverableRadiusButton {
id: checkUpdateButton
Layout.alignment: Qt.AlignHCenter
Layout.maximumWidth: JamiTheme.preferredFieldWidth
Layout.preferredWidth: JamiTheme.preferredFieldWidth
Layout.minimumWidth: JamiTheme.preferredFieldWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
radius: height / 2
toolTipText: qsTr("Check for updates now")
text: qsTr("Updates")
fontPointSize: JamiTheme.buttonFontSize
onClicked: {
checkForUpdateSlot()
}
}
HoverableRadiusButton {
id: installBetaButton
Layout.alignment: Qt.AlignHCenter
Layout.maximumWidth: JamiTheme.preferredFieldWidth
Layout.preferredWidth: JamiTheme.preferredFieldWidth
Layout.minimumWidth: JamiTheme.preferredFieldWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
radius: height / 2
toolTipText: qsTr("Install the latest beta version")
text: qsTr("Beta Install")
fontPointSize: JamiTheme.buttonFontSize
onClicked: {
installBetaSlot()
}
onSwitchToggled: {
setAutoUpdate(checked)
}
}
}
Item {
Layout.preferredWidth: generalSettingsRect.width - 32
Layout.minimumWidth: generalSettingsRect.width - 32
Layout.maximumWidth: JamiTheme.maximumWidthSettingsView - 32
Layout.fillHeight: true
HoverableRadiusButton {
id: checkUpdateButton
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: JamiTheme.preferredFieldWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
radius: height / 2
toolTipText: qsTr("Check for updates now")
text: qsTr("Updates")
fontPointSize: JamiTheme.buttonFontSize
onClicked: {
checkForUpdateSlot()
}
}
HoverableRadiusButton {
id: installBetaButton
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: JamiTheme.preferredFieldWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
radius: height / 2
toolTipText: qsTr("Install the latest beta version")
text: qsTr("Beta Install")
fontPointSize: JamiTheme.buttonFontSize
onClicked: {
installBetaSlot()
}
}
}
}
}

View File

@@ -25,20 +25,20 @@ import net.jami.Models 1.0
import "../../commoncomponents"
Dialog {
id: linkDeviceDialog
id: root
function openLinkDeviceDialog(){
function openLinkDeviceDialog() {
infoLabel.text = qsTr("This pin and the account password should be entered in your device within 10 minutes.")
passwordEdit.clear()
linkDeviceDialog.open()
if(ClientWrapper.accountAdaptor.hasPassword()){
root.open()
if(ClientWrapper.accountAdaptor.hasPassword()) {
stackedWidget.currentIndex = 0
} else {
setGeneratingPage()
}
}
function setGeneratingPage(){
function setGeneratingPage() {
if(passwordEdit.length === 0 && ClientWrapper.accountAdaptor.hasPassword()){
setExportPage(NameDirectory.ExportOnRingStatus.WRONG_PASSWORD, "")
return
@@ -50,7 +50,7 @@ Dialog {
timerForExport.restart()
}
function slotExportOnRing(){
function slotExportOnRing() {
ClientWrapper.accountModel.exportOnRing(ClientWrapper.utilsAdaptor.getCurrAccId(),passwordEdit.text)
}
@@ -80,7 +80,7 @@ Dialog {
function setExportPage(status, pin){
timeOut.stop()
if(status === NameDirectory.ExportOnRingStatus.SUCCESS){
if(status === NameDirectory.ExportOnRingStatus.SUCCESS) {
infoLabel.isSucessState = true
yourPinLabel.visible = true
exportedPIN.visible = true
@@ -91,7 +91,7 @@ Dialog {
yourPinLabel.visible = false
exportedPIN.visible = false
switch(status){
switch(status) {
case NameDirectory.ExportOnRingStatus.WRONG_PASSWORD:
infoLabel.text = qsTr("Incorrect password")
@@ -114,14 +114,13 @@ Dialog {
Connections{
target: ClientWrapper.nameDirectory
function onExportOnRingEnded(status, pin){
function onExportOnRingEnded(status, pin) {
setExportPage(status, pin)
}
}
visible: false
anchors.centerIn: parent.Center
x: (parent.width - width) / 2
y: (parent.height - height) / 2
@@ -130,136 +129,85 @@ Dialog {
height: 64
color: "transparent"
Text {
anchors.left: parent.left
anchors.leftMargin: 24
anchors.bottom: parent.bottom
anchors.bottomMargin: 24
anchors.fill: parent
anchors.leftMargin: JamiTheme.preferredMarginSize
anchors.topMargin: JamiTheme.preferredMarginSize
text: qsTr("Link another device")
font.pointSize: JamiTheme.headerFontSize
wrapMode: Text.Wrap
}
}
height: contentItem.implicitHeight + 64 + 8
width: contentItem.implicitWidth + 24
onClosed: {
if(infoLabel.isSucessState){
if(infoLabel.isSucessState) {
accept()
} else {
reject()
}
}
contentItem: Rectangle{
implicitWidth: 280
implicitHeight: 208
contentItem: Rectangle {
implicitWidth: 350
implicitHeight: 210
StackLayout{
StackLayout {
id: stackedWidget
anchors.fill: parent
currentIndex: 2
Rectangle{
Rectangle {
id: passwordConfirmPage
Layout.fillWidth: true
Layout.fillHeight: true
Layout.leftMargin: 11
Layout.rightMargin: 11
Layout.topMargin: 11
Layout.bottomMargin: 11
Layout.alignment: Qt.AlignCenter
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.bottomMargin: JamiTheme.preferredMarginSize
ColumnLayout{
ColumnLayout {
anchors.fill: parent
spacing: 7
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Item{
Layout.alignment: Qt.AlignHCenter
Layout.fillHeight: true
Layout.maximumHeight: 20
Layout.preferredHeight: 20
Layout.minimumHeight: 20
}
Label{
Layout.preferredWidth: 219
Label {
Layout.topMargin: JamiTheme.preferredMarginSize
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
wrapMode: Text.Wrap
text: qsTr("Enter your account password")
font.pointSize: 8
font.kerning: true
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
Item{
Layout.alignment: Qt.AlignHCenter
Layout.fillHeight: true
Layout.maximumHeight: 20
Layout.preferredHeight: 20
Layout.minimumHeight: 20
}
InfoLineEdit{
MaterialLineEdit {
id: passwordEdit
Layout.preferredHeight: 48
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.minimumWidth: 294
Layout.preferredWidth: 294
Layout.preferredHeight: 30
Layout.minimumHeight: 30
Layout.maximumWidth: 300
echoMode: TextInput.Password
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
placeholderText: qsTr("Password")
}
Item{
Layout.alignment: Qt.AlignHCenter
Layout.fillHeight: true
Layout.maximumHeight: 20
Layout.preferredHeight: 20
Layout.minimumHeight: 20
}
RowLayout{
spacing: 7
Layout.alignment: Qt.AlignHCenter
RowLayout {
Layout.topMargin: JamiTheme.preferredMarginSize
Layout.preferredHeight: 30
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Item{
Layout.fillWidth: true
Layout.maximumHeight: 20
Layout.preferredHeight: 20
Layout.minimumHeight: 20
}
HoverableRadiusButton{
HoverableRadiusButton {
id: btnPasswordOk
Layout.maximumWidth: 130
Layout.preferredWidth: 130
Layout.minimumWidth: 130
Layout.maximumHeight: 30
Layout.preferredHeight: 30
Layout.minimumHeight: 30
radius: height /2
radius: height / 2
text: qsTr("Register")
font.pointSize: 10
@@ -270,25 +218,11 @@ Dialog {
}
}
Item{
Layout.fillWidth: true
Layout.minimumWidth: 40
Layout.maximumHeight: 20
Layout.preferredHeight: 20
Layout.minimumHeight: 20
}
HoverableButtonTextItem {
id: btnCancel
Layout.maximumWidth: 130
Layout.leftMargin: 20
Layout.preferredWidth: 130
Layout.minimumWidth: 130
Layout.maximumHeight: 30
Layout.preferredHeight: 30
Layout.minimumHeight: 30
backgroundColor: "red"
onEnterColor: Qt.rgba(150 / 256, 0, 0, 0.7)
@@ -298,7 +232,7 @@ Dialog {
onPressColor: backgroundColor
textColor: "white"
radius: height /2
radius: height / 2
text: qsTr("Cancel")
font.pointSize: 10
@@ -308,49 +242,23 @@ Dialog {
reject()
}
}
Item{
Layout.fillWidth: true
Layout.minimumWidth: 40
Layout.maximumHeight: 20
Layout.preferredHeight: 20
Layout.minimumHeight: 20
}
}
Item{
Layout.alignment: Qt.AlignHCenter
Layout.fillHeight: true
Layout.maximumHeight: 20
Layout.preferredHeight: 20
Layout.minimumHeight: 20
}
}
}
Rectangle{
Rectangle {
id: exportingPage
Layout.fillWidth: true
Layout.fillHeight: true
ColumnLayout{
ColumnLayout {
anchors.fill: parent
spacing: 8
anchors.centerIn: parent
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Label{
Label {
Layout.alignment: Qt.AlignLeft
Layout.minimumHeight: 0
Layout.preferredHeight: 30
Layout.maximumHeight: 30
Layout.leftMargin: 16
Layout.leftMargin: JamiTheme.preferredMarginSize
wrapMode: Text.Wrap
text: qsTr("Exporting Account")
@@ -358,96 +266,51 @@ Dialog {
verticalAlignment: Text.AlignVCenter
}
RowLayout{
spacing: 7
Label {
id: exportingSpinner
Item{
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: parent.width - JamiTheme.preferredMarginSize * 2
Layout.maximumHeight: 20
Layout.preferredHeight: 20
Layout.minimumHeight: 20
}
background: Rectangle {
anchors.fill: parent
AnimatedImage {
id: spinnerMovie
Label{
id: exportingSpinner
Layout.alignment: Qt.AlignHCenter
Layout.maximumWidth: 96
Layout.preferredWidth: 96
Layout.minimumWidth: 96
Layout.maximumHeight: 96
Layout.preferredHeight: 96
Layout.minimumHeight: 96
background: Rectangle {
anchors.fill: parent
AnimatedImage {
id: spinnerMovie
anchors.fill: parent
source: "qrc:/images/jami_eclipse_spinner.gif"
source: "qrc:/images/jami_eclipse_spinner.gif"
playing: exportingSpinner.visible
paused: false
fillMode: Image.PreserveAspectFit
mipmap: true
}
playing: exportingSpinner.visible
paused: false
fillMode: Image.PreserveAspectFit
mipmap: true
}
}
Item{
Layout.fillWidth: true
Layout.maximumHeight: 20
Layout.preferredHeight: 20
Layout.minimumHeight: 20
}
}
Item{
Layout.alignment: Qt.AlignHCenter
Layout.fillHeight: true
Layout.minimumHeight: 40
Layout.maximumWidth: 20
Layout.preferredWidth: 20
Layout.minimumWidth: 20
}
}
}
Rectangle{
Rectangle {
id: exportedPage
Layout.fillWidth: true
Layout.fillHeight: true
ColumnLayout{
ColumnLayout {
anchors.fill: parent
spacing: 8
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
RowLayout{
spacing: 8
anchors.centerIn: parent
RowLayout {
Layout.alignment: Qt.AlignLeft
Layout.fillWidth: true
Layout.leftMargin: 16
Layout.preferredWidth: parent.width - JamiTheme.preferredMarginSize * 2
Layout.leftMargin: JamiTheme.preferredMarginSize
Label{
Label {
id: yourPinLabel
Layout.alignment: Qt.AlignLeft
Layout.preferredHeight: 25
wrapMode: Text.Wrap
text: "Your PIN is:"
font.kerning: true
@@ -455,21 +318,18 @@ Dialog {
verticalAlignment: Text.AlignVCenter
}
Label{
Label {
id: exportedPIN
Layout.alignment: Qt.AlignHCenter
Layout.preferredHeight: 25
Layout.leftMargin: JamiTheme.preferredMarginSize / 2
wrapMode: Text.Wrap
text: "PIN"
font.pointSize: 12
font.pointSize: JamiTheme.menuFontSize
font.kerning: true
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
Label {
@@ -484,9 +344,8 @@ Dialog {
padding: isSucessState ? 8 : 0
Layout.alignment: Qt.AlignLeft
Layout.leftMargin: 12
Layout.preferredWidth: 280 - 32
Layout.preferredHeight: 50
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.preferredWidth: parent.width - JamiTheme.preferredMarginSize * 2
wrapMode: Text.Wrap
text: qsTr("This pin and the account password should be entered in your device within 10 minutes.")
@@ -508,10 +367,8 @@ Dialog {
}
RowLayout {
spacing: 8
width: 280
Layout.alignment: Qt.AlignRight
Layout.fillWidth: true
Button {
id: btnCloseExportDialog
@@ -526,7 +383,7 @@ Dialog {
}
onClicked: {
if(infoLabel.isSucessState){
if(infoLabel.isSucessState) {
accept()
} else {
reject()

View File

@@ -105,7 +105,7 @@ Dialog {
}
contentItem: Rectangle{
implicitWidth: 365
implicitWidth: 350
implicitHeight: 208
StackLayout{

View File

@@ -1,4 +1,4 @@
/**
/*
* Copyright (C) 2019-2020 by Savoir-faire Linux
* Author: Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com>
*

View File

@@ -1,4 +1,4 @@
/**
/*
* Copyright (C) 2020 by Savoir-faire Linux
* Author: Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com>
*
@@ -109,10 +109,10 @@ Rectangle {
Label{
Layout.alignment: Qt.AlignHCenter
background: Rectangle{
background: Rectangle {
Image {
anchors.centerIn: parent
source: "file:"+pluginIcon
source: pluginIcon === "" ? "" : "file:" + pluginIcon
height: 35
width: 35
}

View File

@@ -1,4 +1,4 @@
/**
/*
* Copyright (C) 2019-2020 by Savoir-faire Linux
* Author: Aline Gondim Sanots <aline.gondimsantos@savoirfairelinux.com>
*
@@ -76,14 +76,6 @@ Rectangle {
nameFilters: [qsTr("Plugin Files") + " (*.jpl)", qsTr(
"All files") + " (*)"]
onRejected: {}
onVisibleChanged: {
if (!visible) {
rejected()
}
}
onAccepted: {
var url = ClientWrapper.utilsAdaptor.getAbsPath(file.toString())
ClientWrapper.pluginModel.installPlugin(url, true)
@@ -113,6 +105,7 @@ Rectangle {
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: JamiTheme.preferredFieldWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.topMargin: JamiTheme.preferredMarginSize / 2
color: JamiTheme.buttonTintedBlack
hoveredColor: JamiTheme.buttonTintedBlackHovered
@@ -123,8 +116,6 @@ Rectangle {
source: "qrc:/images/icons/round-add-24px.svg"
text: qsTr("Install Plugin")
font.pointSize: JamiTheme.textFontSize
font.kerning: true
onClicked: {
openPluginFileSlot()

View File

@@ -1,4 +1,4 @@
/**
/*
* Copyright (C) 2020 by Savoir-faire Linux
* Author: Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com>
*
@@ -39,29 +39,28 @@ Rectangle {
ClientWrapper.pluginModel.setPluginsEnabled(state)
}
Layout.fillHeight: true
Layout.maximumWidth: JamiTheme.maximumWidthSettingsView
anchors.centerIn: parent
signal backArrowClicked
ColumnLayout {
anchors.fill: root
RowLayout {
id:pageTitle
id: pageTitle
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.fillWidth: true
Layout.preferredHeight: 64
Layout.leftMargin: 16
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
HoverableButton {
Layout.preferredWidth: 30
id: backToSettingsMenuButton
radius: 30
Layout.preferredWidth: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
radius: JamiTheme.preferredFieldHeight
source: "qrc:/images/icons/ic_arrow_back_24px.svg"
backgroundColor: "white"
onExitColor: "white"
toolTipText: qsTr("Toggle to display side panel")
hoverEnabled: true
visible: mainViewWindow.sidePanelHidden
@@ -94,15 +93,14 @@ Rectangle {
clip: true
ColumnLayout {
id: pluginViewLayout
width: root.width
ToggleSwitch {
id: enabledplugin
Layout.fillWidth: true
Layout.topMargin: 15
Layout.leftMargin: 16
Layout.rightMargin: 16
Layout.topMargin: JamiTheme.preferredMarginSize
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
labelText: "Enable"
fontPointSize: JamiTheme.headerFontSize
@@ -121,13 +119,13 @@ Rectangle {
PluginListSettingsView {
id: pluginListSettingsView
Layout.fillWidth: true
Layout.leftMargin: 16
Layout.rightMargin: 16
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.alignment: Qt.AlignHCenter
pluginListPreferencesView: pluginListPreferencesView
Layout.topMargin: 15
Layout.topMargin: JamiTheme.preferredMarginSize
Layout.minimumHeight: 0
Layout.preferredHeight: childrenRect.height
}
@@ -135,8 +133,9 @@ Rectangle {
PluginListPreferencesView {
id: pluginListPreferencesView
Layout.fillWidth: true
Layout.leftMargin: 16
Layout.rightMargin: 16
Layout.leftMargin: JamiTheme.preferredMarginSize
Layout.rightMargin: JamiTheme.preferredMarginSize
Layout.bottomMargin: JamiTheme.preferredMarginSize
Layout.minimumHeight: 0
Layout.preferredHeight: childrenRect.height
}

View File

@@ -20,11 +20,11 @@ import QtQuick 2.15
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.14
import QtQuick.Controls.Styles 1.4
import "../../constant"
import "../../commoncomponents"
Dialog {
id: revokeDevicePasswordDialog
id: root
property string deviceId : ""
@@ -33,160 +33,95 @@ Dialog {
function openRevokeDeviceDialog(deviceIdIn){
deviceId = deviceIdIn
passwordEdit.clear()
revokeDevicePasswordDialog.open()
root.open()
}
header : Rectangle {
width: parent.width
height: 64
color: "transparent"
Text {
anchors.fill: parent
anchors.leftMargin: JamiTheme.preferredMarginSize
anchors.topMargin: JamiTheme.preferredMarginSize
text: qsTr("Enter this account's password to confirm the removal of this device")
wrapMode: Text.Wrap
font.pointSize: JamiTheme.headerFontSize
}
}
visible: false
anchors.centerIn: parent.Center
x: (parent.width - width) / 2
y: (parent.height - height) / 2
title: qsTr("Enter this account's password to confirm the removal of this device")
onClosed: {
reject()
}
onAccepted:{
onAccepted: {
revokeDeviceWithPassword(deviceId,passwordEdit.text)
}
contentItem: Rectangle{
implicitWidth: 365
implicitHeight: 120
contentItem: Rectangle {
implicitWidth: 350
implicitHeight: contentLayout.implicitHeight + 64 + JamiTheme.preferredMarginSize
ColumnLayout{
ColumnLayout {
id: contentLayout
anchors.fill: parent
spacing: 7
anchors.centerIn: parent
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Item{
Layout.fillHeight: true
Layout.maximumWidth: 20
Layout.preferredWidth: 20
Layout.minimumWidth: 20
}
InfoLineEdit{
MaterialLineEdit {
id: passwordEdit
Layout.preferredHeight: 48
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.minimumWidth: 294
Layout.preferredWidth: 294
Layout.preferredHeight: 30
Layout.minimumHeight: 30
Layout.maximumWidth: 300
echoMode: TextInput.Password
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
placeholderText: qsTr("Password")
}
Item{
Layout.fillHeight: true
RowLayout {
Layout.topMargin: JamiTheme.preferredMarginSize / 2
Layout.alignment: Qt.AlignRight
Layout.maximumWidth: 20
Layout.preferredWidth: 20
Layout.minimumWidth: 20
}
Button {
id: btnChangePasswordConfirm
RowLayout{
spacing: 7
contentItem: Text {
text: qsTr("CONFIRM")
color: JamiTheme.buttonTintedBlue
}
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
Item{
Layout.fillWidth: true
Layout.maximumHeight: 20
Layout.preferredHeight: 20
Layout.minimumHeight: 20
}
HoverableRadiusButton{
id: btnOkay
Layout.maximumWidth: 130
Layout.preferredWidth: 130
Layout.minimumWidth: 130
Layout.maximumHeight: 30
Layout.preferredHeight: 30
Layout.minimumHeight: 30
radius: height /2
text: qsTr("Okay")
font.pointSize: 10
font.kerning: true
background: Rectangle {
color: "transparent"
}
onClicked: {
accept()
timerToOperate.restart()
}
}
Item{
Layout.fillWidth: true
Layout.minimumWidth: 40
Layout.maximumHeight: 20
Layout.preferredHeight: 20
Layout.minimumHeight: 20
}
Button {
id: btnChangePasswordCancel
Layout.leftMargin: JamiTheme.preferredMarginSize / 2
HoverableButtonTextItem {
id: btnCancel
contentItem: Text {
text: qsTr("CANCEL")
color: JamiTheme.buttonTintedBlue
}
Layout.maximumWidth: 130
Layout.preferredWidth: 130
Layout.minimumWidth: 130
Layout.maximumHeight: 30
Layout.preferredHeight: 30
Layout.minimumHeight: 30
backgroundColor: "red"
onEnterColor: Qt.rgba(150 / 256, 0, 0, 0.7)
onDisabledBackgroundColor: Qt.rgba(
255 / 256,
0, 0, 0.8)
onPressColor: backgroundColor
textColor: "white"
radius: height /2
text: qsTr("Cancel")
font.pointSize: 10
font.kerning: true
background: Rectangle {
color: "transparent"
}
onClicked: {
reject()
root.reject()
}
}
Item{
Layout.fillWidth: true
Layout.minimumWidth: 40
Layout.maximumHeight: 20
Layout.preferredHeight: 20
Layout.minimumHeight: 20
}
}
Item{
Layout.fillHeight: true
Layout.maximumWidth: 20
Layout.preferredWidth: 20
Layout.minimumWidth: 20
}
}
}

View File

@@ -24,8 +24,10 @@ import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.14
import QtQuick.Controls.Styles 1.4
import "../../commoncomponents"
import "../../constant"
RowLayout {
id: root
property string labelText: ""
property int widthOfSwitch: 50
property int heightOfSwitch: 10
@@ -39,34 +41,25 @@ RowLayout {
signal switchToggled
spacing: 8
Layout.fillWidth: true
Layout.maximumHeight: 32
ElidedTextLabel {
Text {
Layout.fillWidth: true
Layout.minimumHeight: heightOfLayout
Layout.preferredHeight: heightOfLayout
Layout.maximumHeight: heightOfLayout
eText: qsTr(labelText)
fontSize: fontPointSize
maxWidth: parent.width - widthOfSwitch
Layout.rightMargin: JamiTheme.preferredMarginSize
text: qsTr(labelText)
font.pointSize: fontPointSize
font.kerning: true
elide: Text.ElideRight
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
Switch {
id: switchOfLayout
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
Layout.maximumWidth: widthOfSwitch
Layout.preferredWidth: widthOfSwitch
Layout.minimumWidth: widthOfSwitch
Layout.minimumHeight: heightOfSwitch
Layout.preferredHeight: heightOfSwitch
Layout.maximumHeight: heightOfSwitch
hoverEnabled: true
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval

View File

@@ -26,34 +26,27 @@ import QtQuick.Controls.Styles 1.4
import net.jami.Models 1.0
ItemDelegate {
id: videoCodecDelegate
id: root
property string videoCodecName : ""
property bool isEnabled : false
property int videoCodecId
property int checkBoxWidth: 24
signal videoCodecStateChange(string idToSet , bool isToBeEnabled)
property int checkBoxWidth: 24
highlighted: ListView.isCurrentItem
RowLayout{
RowLayout {
anchors.fill: parent
spacing: 10
CheckBox{
id: checkBoxIsEnabled
Layout.leftMargin: 20
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.fillHeight: true
Layout.minimumWidth: checkBoxWidth
Layout.preferredWidth: checkBoxWidth
Layout.maximumWidth: checkBoxWidth
tristate: false
checkState: isEnabled ? Qt.Checked : Qt.Unchecked
@@ -72,7 +65,7 @@ ItemDelegate {
var result
var result_bool
if (checkState === Qt.Checked){
if (checkState === Qt.Checked) {
result = Qt.Unchecked
result_bool = false
} else {
@@ -84,17 +77,18 @@ ItemDelegate {
}
}
Label{
Label {
id: formatNameLabel
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
Layout.fillWidth: true
Layout.fillHeight: true
Layout.rightMargin: JamiTheme.preferredMarginSize / 2
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
text: videoCodecName
elide: Text.ElideRight
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
font.pointSize: 8
font.kerning: true
}

View File

@@ -61,9 +61,7 @@ Rectangle {
property var inputParaObject: ({})
/*
* signal to redirect the page to main view
*/
// signal to redirect the page to main view
signal needToShowMainViewWindow(int accountIndex)
signal wizardViewIsClosed
@@ -168,8 +166,6 @@ Rectangle {
id: passwordDialog
anchors.centerIn: parent.Center
x: (parent.width - width) / 2
y: (parent.height - height) / 2
visible: false
purpose: PasswordDialog.ExportAccount

View File

@@ -32,9 +32,7 @@ Rectangle {
signal leavePage
signal export_Btn_FileDialogAccepted(bool accepted, string folderDir)
/*
* JamiFileDialog for exporting account
*/
// JamiFileDialog for exporting account
JamiFileDialog {
id: exportBtn_Dialog

View File

@@ -23,10 +23,7 @@ import QtQuick.Controls 2.14
import "../../constant"
import "../../commoncomponents"
/*
* an independent widget that keeps the password's textfields, including password field and confirm password field
*/
// An independent widget that keeps the password's textfields, including password field and confirm password field
GridLayout {
id: root

View File

@@ -57,9 +57,7 @@ Rectangle {
onActivated: leavePage()
}
/*
* JamiFileDialog for exporting account
*/
// JamiFileDialog for exporting account
JamiFileDialog {
id: exportBtn_Dialog

View File

@@ -22,13 +22,12 @@ import QtGraphicalEffects 1.15
import net.jami.Models 1.0
/*
* HoverableButton contains the following configurable properties:
* 1. Color changes on different button state
* 2. Radius control (rounded)
* 3. Text content or image content
* 4. Can use OnClicked slot to implement some click logic
*/
//
// HoverableButton contains the following configurable properties:
// 1. Color changes on different button state
// 2. Radius control (rounded)
// 3. Text content or image content
// 4. Can use OnClicked slot to implement some click logic
Button {
id: hoverableButton
property int fontPointSize: 9