Commit b23b651f authored by Ronan's avatar Ronan
Browse files

feat(ui/views/App/Main/Home): `Invite friends` and `Assistant` windows are now...

feat(ui/views/App/Main/Home): `Invite friends` and `Assistant` windows are now directly in this view
parent f0654e12
......@@ -28,6 +28,13 @@
<translation>Start in the system tray, do not show the main interface.</translation>
</message>
</context>
<context>
<name>Assistant</name>
<message>
<source>assistantTitle</source>
<translation type="obsolete">Linphone - Assistant</translation>
</message>
</context>
<context>
<name>AssistantAbstractView</name>
<message>
......@@ -86,7 +93,7 @@
<name>AssistantFetchRemoteConfiguration</name>
<message>
<source>fetchRemoteConfigurationTitle</source>
<translation>Fetch remote configuration</translation>
<translation>FETCH REMOTE CONFIGURATION</translation>
</message>
<message>
<source>urlLabel</source>
......@@ -190,7 +197,7 @@
<name>AssistantWindow</name>
<message>
<source>assistantTitle</source>
<translation>Linphone - Assistant</translation>
<translation type="vanished">Linphone - Assistant</translation>
</message>
</context>
<context>
......@@ -607,54 +614,54 @@ Server url not configured.</translation>
<name>InviteFriends</name>
<message>
<source>enterEmailLabel</source>
<translation type="vanished">Enter your friend&apos;s email address</translation>
<translation>Enter your friend&apos;s email address</translation>
</message>
<message>
<source>messageLabel</source>
<translation type="vanished">You can modify the invitation that will be sent</translation>
<translation>You can modify the invitation that will be sent</translation>
</message>
<message>
<source>cancel</source>
<translation type="vanished">CANCEL</translation>
<translation>CANCEL</translation>
</message>
<message>
<source>confirm</source>
<translation type="vanished">CONFIRM</translation>
<translation>CONFIRM</translation>
</message>
<message>
<source>inviteFriendsTitle</source>
<translation type="vanished">Linphone - Invite Friends</translation>
<translation>Invite Friends</translation>
</message>
<message>
<source>defaultMessage</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>defaultSubject</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>InviteFriendsWindow</name>
<message>
<source>cancel</source>
<translation type="unfinished">CANCEL</translation>
<translation type="obsolete">CANCEL</translation>
</message>
<message>
<source>confirm</source>
<translation type="unfinished">CONFIRM</translation>
</message>
<message>
<source>defaultSubject</source>
<translation type="unfinished"></translation>
<translation type="obsolete">CONFIRM</translation>
</message>
<message>
<source>inviteFriendsTitle</source>
<translation type="unfinished">Linphone - Invite Friends</translation>
<translation type="obsolete">Linphone - Invite Friends</translation>
</message>
<message>
<source>enterEmailLabel</source>
<translation type="unfinished">Enter your friend&apos;s email address</translation>
<translation type="obsolete">Enter your friend&apos;s email address</translation>
</message>
<message>
<source>messageLabel</source>
<translation type="unfinished">You can modify the invitation that will be sent</translation>
</message>
<message>
<source>defaultMessage</source>
<translation type="unfinished"></translation>
<translation type="obsolete">You can modify the invitation that will be sent</translation>
</message>
</context>
<context>
......
......@@ -28,6 +28,13 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Assistant</name>
<message>
<source>assistantTitle</source>
<translation type="obsolete">Linphone - Assistant</translation>
</message>
</context>
<context>
<name>AssistantAbstractView</name>
<message>
......@@ -86,7 +93,7 @@
<name>AssistantFetchRemoteConfiguration</name>
<message>
<source>fetchRemoteConfigurationTitle</source>
<translation>Télécharger une configuration</translation>
<translation>TÉLÉCHARGER UNE CONFIGURATION</translation>
</message>
<message>
<source>urlLabel</source>
......@@ -190,7 +197,7 @@
<name>AssistantWindow</name>
<message>
<source>assistantTitle</source>
<translation>Linphone - Assistant</translation>
<translation type="vanished">Linphone - Assistant</translation>
</message>
</context>
<context>
......@@ -606,54 +613,54 @@ Url du serveur non configurée.</translation>
<name>InviteFriends</name>
<message>
<source>enterEmailLabel</source>
<translation type="vanished">Entrer l&apos;adresse email de votre ami</translation>
<translation>Entrer l&apos;adresse email de votre ami</translation>
</message>
<message>
<source>messageLabel</source>
<translation type="vanished">Modifier l&apos;invitation qui sera envoyée</translation>
<translation>Modifier l&apos;invitation qui sera envoyée</translation>
</message>
<message>
<source>cancel</source>
<translation type="vanished">ANNULER</translation>
<translation>ANNULER</translation>
</message>
<message>
<source>confirm</source>
<translation type="vanished">CONFIRMER</translation>
<translation>CONFIRMER</translation>
</message>
<message>
<source>inviteFriendsTitle</source>
<translation type="vanished">Linphone - Inviter des amis</translation>
<translation>Inviter des amis</translation>
</message>
<message>
<source>defaultMessage</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>defaultSubject</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>InviteFriendsWindow</name>
<message>
<source>cancel</source>
<translation type="unfinished">ANNULER</translation>
<translation type="obsolete">ANNULER</translation>
</message>
<message>
<source>confirm</source>
<translation type="unfinished">CONFIRMER</translation>
</message>
<message>
<source>defaultSubject</source>
<translation type="unfinished"></translation>
<translation type="obsolete">CONFIRMER</translation>
</message>
<message>
<source>inviteFriendsTitle</source>
<translation type="unfinished">Linphone - Inviter des amis</translation>
<translation type="obsolete">Linphone - Inviter des amis</translation>
</message>
<message>
<source>enterEmailLabel</source>
<translation type="unfinished">Entrer l&apos;adresse email de votre ami</translation>
<translation type="obsolete">Entrer l&apos;adresse email de votre ami</translation>
</message>
<message>
<source>messageLabel</source>
<translation type="unfinished">Modifier l&apos;invitation qui sera envoyée</translation>
</message>
<message>
<source>defaultMessage</source>
<translation type="unfinished"></translation>
<translation type="obsolete">Modifier l&apos;invitation qui sera envoyée</translation>
</message>
</context>
<context>
......
......@@ -311,24 +311,24 @@
<file>ui/scripts/Utils/qmldir</file>
<file>ui/scripts/Utils/uri-tools.js</file>
<file>ui/scripts/Utils/utils.js</file>
<file>ui/views/App/Assistant/AssistantAbstractView.qml</file>
<file>ui/views/App/Assistant/AssistantCreateLinphoneSipAccount.qml</file>
<file>ui/views/App/Assistant/AssistantFetchRemoteConfiguration.qml</file>
<file>ui/views/App/Assistant/AssistantHome.qml</file>
<file>ui/views/App/Assistant/AssistantUseLinphoneSipAccount.qml</file>
<file>ui/views/App/Assistant/AssistantUseOtherSipAccount.qml</file>
<file>ui/views/App/AssistantWindow.qml</file>
<file>ui/views/App/Calls/AbstractStartingCall.qml</file>
<file>ui/views/App/Calls/CallsWindow.qml</file>
<file>ui/views/App/Calls/Incall.qml</file>
<file>ui/views/App/Calls/IncomingCall.qml</file>
<file>ui/views/App/Calls/OutgoingCall.qml</file>
<file>ui/views/App/IncallFullscreenWindow.qml</file>
<file>ui/views/App/InviteFriendsWindow.qml</file>
<file>ui/views/App/Main/Assistant/AssistantAbstractView.qml</file>
<file>ui/views/App/Main/Assistant/AssistantCreateLinphoneSipAccount.qml</file>
<file>ui/views/App/Main/Assistant/AssistantFetchRemoteConfiguration.qml</file>
<file>ui/views/App/Main/Assistant/AssistantHome.qml</file>
<file>ui/views/App/Main/Assistant/AssistantUseLinphoneSipAccount.qml</file>
<file>ui/views/App/Main/Assistant/AssistantUseOtherSipAccount.qml</file>
<file>ui/views/App/Main/Assistant.qml</file>
<file>ui/views/App/Main/ContactEdit.qml</file>
<file>ui/views/App/Main/Contacts.qml</file>
<file>ui/views/App/Main/Conversation.qml</file>
<file>ui/views/App/Main/Home.qml</file>
<file>ui/views/App/Main/InviteFriends.qml</file>
<file>ui/views/App/Main/MainWindowMenuBar.qml</file>
<file>ui/views/App/Main/MainWindow.qml</file>
<file>ui/views/App/ManageAccountsWindow.qml</file>
......@@ -340,18 +340,18 @@
<file>ui/views/App/Settings/SettingsUi.qml</file>
<file>ui/views/App/Settings/SettingsVideo.qml</file>
<file>ui/views/App/Settings/SettingsWindow.qml</file>
<file>ui/views/App/Styles/Assistant/AssistantAbstractViewStyle.qml</file>
<file>ui/views/App/Styles/Assistant/AssistantCreateLinphoneSipAccountStyle.qml</file>
<file>ui/views/App/Styles/Assistant/AssistantHomeStyle.qml</file>
<file>ui/views/App/Styles/Assistant/AssistantUseLinphoneSipAccountStyle.qml</file>
<file>ui/views/App/Styles/AssistantWindowStyle.qml</file>
<file>ui/views/App/Styles/Calls/CallStyle.qml</file>
<file>ui/views/App/Styles/Calls/CallsWindowStyle.qml</file>
<file>ui/views/App/Styles/InviteFriendsWindowStyle.qml</file>
<file>ui/views/App/Styles/Main/Assistant/AssistantAbstractViewStyle.qml</file>
<file>ui/views/App/Styles/Main/Assistant/AssistantCreateLinphoneSipAccountStyle.qml</file>
<file>ui/views/App/Styles/Main/Assistant/AssistantHomeStyle.qml</file>
<file>ui/views/App/Styles/Main/Assistant/AssistantUseLinphoneSipAccountStyle.qml</file>
<file>ui/views/App/Styles/Main/AssistantStyle.qml</file>
<file>ui/views/App/Styles/Main/ContactEditStyle.qml</file>
<file>ui/views/App/Styles/Main/ContactsStyle.qml</file>
<file>ui/views/App/Styles/Main/ConversationStyle.qml</file>
<file>ui/views/App/Styles/Main/HomeStyle.qml</file>
<file>ui/views/App/Styles/Main/InviteFriendsStyle.qml</file>
<file>ui/views/App/Styles/Main/MainWindowMenuBarStyle.qml</file>
<file>ui/views/App/Styles/Main/MainWindowStyle.qml</file>
<file>ui/views/App/Styles/ManageAccountsWindowStyle.qml</file>
......
import QtQuick 2.7
import Common 1.0
import App.Styles 1.0
// =============================================================================
DialogPlus {
buttons: [
TextButtonA {
text: qsTr('cancel')
onClicked: exit(-1)
},
TextButtonB {
enabled: email.length && message.length
text: qsTr('confirm')
onClicked: {
Qt.openUrlExternally(
'mailto:' + encodeURIComponent(email.text) +
'?subject=' + encodeURIComponent(qsTr('defaultSubject')) +
'&body=' + encodeURIComponent(message.text)
)
exit(0)
}
}
]
centeredButtons: true
title: qsTr('inviteFriendsTitle')
height: InviteFriendsWindowStyle.height
width: InviteFriendsWindowStyle.width
maximumHeight: InviteFriendsWindowStyle.height
maximumWidth: InviteFriendsWindowStyle.width
minimumHeight: InviteFriendsWindowStyle.height
minimumWidth: InviteFriendsWindowStyle.width
// ---------------------------------------------------------------------------
Form {
anchors {
fill: parent
leftMargin: InviteFriendsWindowStyle.leftMargin
rightMargin: InviteFriendsWindowStyle.rightMargin
}
orientation: Qt.Vertical
FormLine {
FormGroup {
label: qsTr('enterEmailLabel')
TextField {
id: email
inputMethodHints: Qt.ImhEmailCharactersOnly
width: parent.width
}
}
}
FormLine {
FormGroup {
label: qsTr('messageLabel')
TextAreaField {
id: message
height: InviteFriendsWindowStyle.message.height
text: qsTr('defaultMessage')
}
}
}
}
}
......@@ -8,20 +8,16 @@ import App.Styles 1.0
// =============================================================================
Window {
id: window
Item {
id: assistant
// ---------------------------------------------------------------------------
readonly property string viewsPath: 'qrc:/ui/views/App/Assistant/'
readonly property string viewsPath: 'qrc:/ui/views/App/Main/Assistant/'
// ---------------------------------------------------------------------------
function pushView (view) {
stack.push(
Utils.isString(view)
? viewsPath + view + '.qml'
: view
Utils.isString(view) ? viewsPath + view + '.qml' : view
)
}
......@@ -31,31 +27,9 @@ Window {
// ---------------------------------------------------------------------------
modality: Qt.WindowModal
title: qsTr('assistantTitle')
visible: true
height: AssistantWindowStyle.height
width: AssistantWindowStyle.width
maximumHeight: AssistantWindowStyle.height
maximumWidth: AssistantWindowStyle.width
minimumHeight: AssistantWindowStyle.height
minimumWidth: AssistantWindowStyle.width
// ---------------------------------------------------------------------------
Shortcut {
sequence: StandardKey.Close
onActivated: close()
}
// ---------------------------------------------------------------------------
Rectangle {
anchors.fill: parent
color: AssistantWindowStyle.color
color: AssistantStyle.color
}
// ---------------------------------------------------------------------------
......@@ -66,50 +40,50 @@ Window {
anchors {
fill: parent
bottomMargin: AssistantWindowStyle.bottomMargin
leftMargin: AssistantWindowStyle.leftMargin
rightMargin: AssistantWindowStyle.rightMargin
topMargin: AssistantWindowStyle.topMargin
bottomMargin: AssistantStyle.bottomMargin
leftMargin: AssistantStyle.leftMargin
rightMargin: AssistantStyle.rightMargin
topMargin: AssistantStyle.topMargin
}
initialItem: window.viewsPath + 'AssistantHome.qml'
initialItem: assistant.viewsPath + 'AssistantHome.qml'
// -------------------------------------------------------------------------
popEnter: Transition {
XAnimator {
duration: AssistantWindowStyle.stackAnimation.duration
YAnimator {
duration: AssistantStyle.stackAnimation.duration
easing.type: Easing.OutBack
from: -stack.width - AssistantWindowStyle.leftMargin
to: 0
from: stack.height + AssistantStyle.bottomMargin
to: 0
}
}
popExit: Transition {
XAnimator {
duration: AssistantWindowStyle.stackAnimation.duration
duration: AssistantStyle.stackAnimation.duration
easing.type: Easing.OutBack
from: 0
to: stack.width + AssistantWindowStyle.rightMargin
to: stack.width + AssistantStyle.rightMargin
}
}
}
pushEnter: Transition {
XAnimator {
duration: AssistantWindowStyle.stackAnimation.duration
duration: AssistantStyle.stackAnimation.duration
easing.type: Easing.OutBack
from: stack.width + AssistantWindowStyle.rightMargin
from: stack.width + AssistantStyle.rightMargin
to: 0
}
}
pushExit: Transition {
XAnimator {
duration: AssistantWindowStyle.stackAnimation.duration
YAnimator {
duration: AssistantStyle.stackAnimation.duration
easing.type: Easing.OutBack
from: 0
to: -stack.width - AssistantWindowStyle.leftMargin
from: 0
to: stack.height + AssistantStyle.bottomMargin
}
}
}
}
}
......@@ -7,7 +7,7 @@ import App.Styles 1.0
// =============================================================================
ColumnLayout {
Item {
id: view
// ---------------------------------------------------------------------------
......@@ -26,15 +26,15 @@ ColumnLayout {
height: stack.height
width: stack.width
spacing: AssistantAbstractViewStyle.spacing
// --------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Info.
// --------------------------------------------------------------------------
// ---------------------------------------------------------------------------
Column {
Layout.fillWidth: true
anchors.centerIn: parent
spacing: AssistantAbstractViewStyle.info.spacing
width: parent.width
Text {
id: title
......@@ -60,34 +60,39 @@ ColumnLayout {
font.pointSize: AssistantAbstractViewStyle.info.description.fontSize
horizontalAlignment: Text.AlignHCenter
visible: text.length > 0
width: parent.width
}
}
// --------------------------------------------------------------------------
// Content.
// --------------------------------------------------------------------------
// -------------------------------------------------------------------------
// Content.
// -------------------------------------------------------------------------
Item {
id: content
Item {
id: content
Layout.alignment: Qt.AlignHCenter
Layout.fillHeight: true
Layout.preferredWidth: AssistantAbstractViewStyle.content.width
anchors.horizontalCenter: parent.horizontalCenter
height: AssistantAbstractViewStyle.content.height
width: AssistantAbstractViewStyle.content.width
}
}
// --------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Nav buttons.
// --------------------------------------------------------------------------
// ---------------------------------------------------------------------------
Row {
Layout.alignment: Qt.AlignHCenter
id: buttons
anchors {
bottom: parent.bottom
horizontalCenter: parent.horizontalCenter
}
spacing: AssistantAbstractViewStyle.buttons.spacing
TextButtonA {
text: qsTr('back')
onClicked: window.popView()
onClicked: assistant.popView()
}
TextButtonB {
......
......@@ -147,7 +147,7 @@ AssistantAbstractView {
height: AssistantCreateLinphoneSipAccountStyle.buttons.button.height
width: parent.width
onClicked: window.pushView(phoneNumberView)
onClicked: assistant.pushView(phoneNumberView)
}
TextButtonA {
......@@ -156,7 +156,7 @@ AssistantAbstractView {
height: AssistantCreateLinphoneSipAccountStyle.buttons.button.height
width: parent.width
onClicked: window.pushView(emailAddressView)
onClicked: assistant.pushView(emailAddressView)
}
}
}
......@@ -14,41 +14,54 @@ ColumnLayout {
// Info.
// ---------------------------------------------------------------------------
Icon {
Layout.alignment: Qt.AlignHCenter
Item {
Layout.fillHeight: true