From 95fb6b96948c77157163f05615bd6935e613573d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 14 Feb 2017 12:33:20 +0100 Subject: [PATCH] feat(ui/views/App/Settings/SettingsNetwork): view in progress --- linphone-desktop/assets/languages/en.ts | 32 ++++++++ linphone-desktop/assets/languages/fr.ts | 34 ++++++++- .../ui/modules/Common/ForceScrollBar.qml | 2 + .../modules/Common/Form/Tab/TabContainer.qml | 51 +++++++++++-- .../Styles/Form/Fields/TextFieldStyle.qml | 2 +- .../Styles/Form/Tab/TabContainerStyle.qml | 7 +- .../ui/views/App/Settings/SettingsNetwork.qml | 74 ++++++++++++++++++- .../ui/views/App/Settings/SettingsWindow.qml | 8 +- .../Styles/Settings/SettingsWindowStyle.qml | 1 + 9 files changed, 194 insertions(+), 17 deletions(-) diff --git a/linphone-desktop/assets/languages/en.ts b/linphone-desktop/assets/languages/en.ts index 3b74cad53..48c5f28c5 100644 --- a/linphone-desktop/assets/languages/en.ts +++ b/linphone-desktop/assets/languages/en.ts @@ -607,6 +607,38 @@ Server url not configured. networkProtocolAndPortsTitle Network protocol and Ports + + sipUdpPortLabel + SIP UDP port + + + randomSipUdpPortLabel + Random + + + sipTcpPortLabel + SIP TCP port + + + randomSipTcpPortLabel + Random + + + audioRtpUdpPortLabel + Audio RTP UDP port + + + randomAudioRtpUdpPortLabel + Random + + + randomVideoRtpUdpPortLabel + Random + + + videoRtpUdpPortLabel + Video RTP UDP port + SettingsWindow diff --git a/linphone-desktop/assets/languages/fr.ts b/linphone-desktop/assets/languages/fr.ts index 1596e109e..b76b9c28d 100644 --- a/linphone-desktop/assets/languages/fr.ts +++ b/linphone-desktop/assets/languages/fr.ts @@ -556,7 +556,7 @@ Url du serveur non configurée. noEncryption - Aucune + Aucun autoAnswerLabel @@ -617,6 +617,38 @@ Url du serveur non configurée. networkProtocolAndPortsTitle Protocol réseau et ports + + sipUdpPortLabel + Port SIP UDP + + + randomSipUdpPortLabel + Aléatoire + + + sipTcpPortLabel + Port SIP TCP + + + randomSipTcpPortLabel + Aléatoire + + + audioRtpUdpPortLabel + Port Audio RTP UDP + + + randomAudioRtpUdpPortLabel + Aléatoire + + + randomVideoRtpUdpPortLabel + Aléatoire + + + videoRtpUdpPortLabel + Port Vidéo RTP UDP + SettingsWindow diff --git a/linphone-desktop/ui/modules/Common/ForceScrollBar.qml b/linphone-desktop/ui/modules/Common/ForceScrollBar.qml index f9cf1d7ea..46aaeb777 100644 --- a/linphone-desktop/ui/modules/Common/ForceScrollBar.qml +++ b/linphone-desktop/ui/modules/Common/ForceScrollBar.qml @@ -26,4 +26,6 @@ ScrollBar { radius: ForceScrollBarStyle.contentItem.radius } hoverEnabled: true + + visible: size < 1.0 } diff --git a/linphone-desktop/ui/modules/Common/Form/Tab/TabContainer.qml b/linphone-desktop/ui/modules/Common/Form/Tab/TabContainer.qml index 9bdce5f07..10128db21 100644 --- a/linphone-desktop/ui/modules/Common/Form/Tab/TabContainer.qml +++ b/linphone-desktop/ui/modules/Common/Form/Tab/TabContainer.qml @@ -1,6 +1,10 @@ import QtQuick 2.7 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.1 +import Common 1.0 import Common.Styles 1.0 +import Utils 1.0 // ============================================================================= @@ -10,16 +14,47 @@ Rectangle { anchors.fill: parent color: TabContainerStyle.color - Item { - id: content + ColumnLayout { + anchors.fill: parent + spacing: 0 - anchors { - fill: parent + Flickable { + ScrollBar.vertical: ForceScrollBar { + id: scrollBar + } - bottomMargin: TabContainerStyle.bottomMargin - leftMargin: TabContainerStyle.leftMargin - rightMargin: TabContainerStyle.rightMargin - topMargin: TabContainerStyle.topMargin + Layout.fillHeight: true + Layout.fillWidth: true + + boundsBehavior: Flickable.StopAtBounds + clip: true + + contentHeight: Utils.ensureArray(_content).reduce(function (acc, item) { return item.height }, 0, []) + + TabContainerStyle.topMargin + TabContainerStyle.bottomMargin + contentWidth: width + + Item { + id: content + + anchors { + left: parent.left + leftMargin: TabContainerStyle.leftMargin + right: parent.right + rightMargin: TabContainerStyle.rightMargin + top: parent.top + topMargin: TabContainerStyle.topMargin + } + + width: parent.width + } + } + + Rectangle { + Layout.fillWidth: true + Layout.preferredHeight: TabContainerStyle.separator.height + + color: TabContainerStyle.separator.color + visible: scrollBar.visible } } } diff --git a/linphone-desktop/ui/modules/Common/Styles/Form/Fields/TextFieldStyle.qml b/linphone-desktop/ui/modules/Common/Styles/Form/Fields/TextFieldStyle.qml index 8820ef56e..7ee2b57a4 100644 --- a/linphone-desktop/ui/modules/Common/Styles/Form/Fields/TextFieldStyle.qml +++ b/linphone-desktop/ui/modules/Common/Styles/Form/Fields/TextFieldStyle.qml @@ -8,7 +8,7 @@ import Common 1.0 QtObject { property QtObject background: QtObject { property int height: 36 - property int width: 300 + property int width: 200 property int radius: 4 diff --git a/linphone-desktop/ui/modules/Common/Styles/Form/Tab/TabContainerStyle.qml b/linphone-desktop/ui/modules/Common/Styles/Form/Tab/TabContainerStyle.qml index 4f198fae5..70840e9aa 100644 --- a/linphone-desktop/ui/modules/Common/Styles/Form/Tab/TabContainerStyle.qml +++ b/linphone-desktop/ui/modules/Common/Styles/Form/Tab/TabContainerStyle.qml @@ -7,8 +7,13 @@ import Common 1.0 QtObject { property color color: Colors.k - property int bottomMargin: 15 + property int bottomMargin: 30 property int leftMargin: 30 property int rightMargin: 30 property int topMargin: 30 + + property QtObject separator: QtObject { + property int height: 2 + property color color: Colors.u + } } diff --git a/linphone-desktop/ui/views/App/Settings/SettingsNetwork.qml b/linphone-desktop/ui/views/App/Settings/SettingsNetwork.qml index 014719edb..24234b336 100644 --- a/linphone-desktop/ui/views/App/Settings/SettingsNetwork.qml +++ b/linphone-desktop/ui/views/App/Settings/SettingsNetwork.qml @@ -8,8 +8,8 @@ import App.Styles 1.0 TabContainer { Column { - anchors.fill: parent spacing: SettingsWindowStyle.forms.spacing + width: parent.width // ------------------------------------------------------------------------- // Transport. @@ -59,7 +59,79 @@ TabContainer { width: parent.width FormLine { + FormGroup { + label: qsTr('sipUdpPortLabel') + NumericField { + readOnly: randomSipUdpPort.checked + } + } + + FormGroup { + label: qsTr('randomSipUdpPortLabel') + + Switch { + id: randomSipUdpPort + } + } + } + + FormLine { + FormGroup { + label: qsTr('sipTcpPortLabel') + + NumericField { + readOnly: randomSipTcpPort.checked + } + } + + FormGroup { + label: qsTr('randomSipTcpPortLabel') + + Switch { + id: randomSipTcpPort + } + } + } + + FormLine { + FormGroup { + label: qsTr('audioRtpUdpPortLabel') + + NumericField { + readOnly: randomAudioRtpUdpPort.checked + } + } + + FormGroup { + label: qsTr('randomAudioRtpUdpPortLabel') + + Switch { + id: randomAudioRtpUdpPort + } + } + } + + FormLine { + FormGroup { + label: qsTr('videoRtpUdpPortLabel') + + NumericField { + readOnly: randomVideoRtpUdpPort.checked || !enableVideoRtpUdpPort.checked + } + } + + FormGroup { + label: qsTr('randomVideoRtpUdpPortLabel') + + Switch { + id: randomVideoRtpUdpPort + } + } + + Switch { + id: enableVideoRtpUdpPort + } } } diff --git a/linphone-desktop/ui/views/App/Settings/SettingsWindow.qml b/linphone-desktop/ui/views/App/Settings/SettingsWindow.qml index 58825af50..3e32eafac 100644 --- a/linphone-desktop/ui/views/App/Settings/SettingsWindow.qml +++ b/linphone-desktop/ui/views/App/Settings/SettingsWindow.qml @@ -15,11 +15,8 @@ ApplicationWindow { height: SettingsWindowStyle.height width: SettingsWindowStyle.width - maximumHeight: height - maximumWidth: width - - minimumHeight: height - minimumWidth: width + minimumHeight: SettingsWindowStyle.height + minimumWidth: SettingsWindowStyle.width title: qsTr('settingsTitle') visible: true @@ -108,6 +105,7 @@ ApplicationWindow { TextButtonB { Layout.alignment: Qt.AlignRight + Layout.topMargin: SettingsWindowStyle.validButton.topMargin Layout.bottomMargin: SettingsWindowStyle.validButton.bottomMargin Layout.rightMargin: SettingsWindowStyle.validButton.rightMargin diff --git a/linphone-desktop/ui/views/App/Styles/Settings/SettingsWindowStyle.qml b/linphone-desktop/ui/views/App/Styles/Settings/SettingsWindowStyle.qml index 4d627ce98..f58330120 100644 --- a/linphone-desktop/ui/views/App/Styles/Settings/SettingsWindowStyle.qml +++ b/linphone-desktop/ui/views/App/Styles/Settings/SettingsWindowStyle.qml @@ -14,5 +14,6 @@ QtObject { property QtObject validButton: QtObject { property int bottomMargin: 30 property int rightMargin: 30 + property int topMargin: 30 } }