contact list generic VariantList FriendModel resetAddresses check null default account address list update on save generic item for white background lists ui fix set photo friend protect friendmodel setters remove main splitview to stick to the mock-up (keeping it commented cause it may be useful to be able to resize the panels) default image avatar fix crash when address not set fix ui in call Really fix call variantobject destroying himself before call started fix: display suggestions fix list view current item always reset cause updated every time contact history list changed fix blinking call log list view on content changed fix popup button popup y when exceed window delete contact confirmation popup fix popup call contact list don't show popup if only one address possible set/remove default address if append/remove from address list
106 lines
2.8 KiB
QML
106 lines
2.8 KiB
QML
import QtQuick 2.15
|
|
import QtQuick.Layouts 1.3
|
|
import QtQuick.Controls
|
|
import Linphone
|
|
import UtilsCpp 1.0
|
|
|
|
Window {
|
|
id: mainWindow
|
|
width: 1512 * DefaultStyle.dp
|
|
height: 982 * DefaultStyle.dp
|
|
visible: true
|
|
title: qsTr("Linphone")
|
|
// TODO : handle this bool when security mode is implemented
|
|
property bool firstConnection: true
|
|
|
|
// access window properties from all its children
|
|
// (used in popupbutton to see if the popup exceed window height)
|
|
property Window mainApplicationWindow: mainWindow
|
|
|
|
function goToNewCall() {
|
|
mainWindowStackView.replace(mainPage, StackView.Immediate)
|
|
mainWindowStackView.currentItem.goToNewCall()
|
|
}
|
|
function transferCallSucceed() {
|
|
mainWindowStackView.replace(mainPage, StackView.Immediate)
|
|
mainWindowStackView.currentItem.transferCallSucceed()
|
|
}
|
|
|
|
AccountProxy {
|
|
// TODO : change this so it does not display the main page for one second
|
|
// when we fail trying to connect the first account (account is added and
|
|
// removed shortly after)
|
|
id: accountProxy
|
|
}
|
|
StackView {
|
|
id: mainWindowStackView
|
|
anchors.fill: parent
|
|
initialItem: accountProxy.haveAccount ? mainPage : UtilsCpp.getFirstLaunch() ? welcomePage : loginPage
|
|
}
|
|
Component {
|
|
id: welcomePage
|
|
WelcomePage {
|
|
onStartButtonPressed: {
|
|
mainWindowStackView.replace(loginPage)// Replacing the first item will destroy the old.
|
|
UtilsCpp.setFirstLaunch(false)
|
|
}
|
|
}
|
|
}
|
|
Component {
|
|
id: loginPage
|
|
LoginPage {
|
|
showBackButton: accountProxy.haveAccount
|
|
onGoBack: mainWindowStackView.replace(mainPage)
|
|
onUseSIPButtonClicked: mainWindowStackView.push(sipLoginPage)
|
|
onGoToRegister: mainWindowStackView.replace(registerPage)
|
|
onConnectionSucceed: {
|
|
mainWindowStackView.replace(mainPage)
|
|
}
|
|
}
|
|
}
|
|
Component {
|
|
id: sipLoginPage
|
|
SIPLoginPage {
|
|
onGoBack: mainWindowStackView.pop()
|
|
onGoToRegister: mainWindowStackView.replace(registerPage)
|
|
|
|
onConnectionSucceed: {
|
|
mainWindowStackView.replace(mainPage)
|
|
}
|
|
}
|
|
}
|
|
Component {
|
|
id: registerPage
|
|
RegisterPage {
|
|
onReturnToLogin: mainWindowStackView.replace(loginPage)
|
|
onRegisterCalled: (countryCode, phoneNumber, email) => {
|
|
mainWindowStackView.push(checkingPage, {"phoneNumber": phoneNumber, "email": email})
|
|
}
|
|
}
|
|
}
|
|
Component {
|
|
id: checkingPage
|
|
RegisterCheckingPage {
|
|
onReturnToRegister: mainWindowStackView.pop()
|
|
}
|
|
}
|
|
Component {
|
|
id: securityModePage
|
|
SecurityModePage {
|
|
id: securePage
|
|
onModeSelected: (index) => {
|
|
// TODO : connect to cpp part when ready
|
|
var selectedMode = index == 0 ? "chiffrement" : "interoperable"
|
|
console.debug("[SelectMode]User: User selected mode " + selectedMode)
|
|
mainWindowStackView.replace(mainPage)
|
|
}
|
|
}
|
|
}
|
|
Component {
|
|
id: mainPage
|
|
MainLayout {
|
|
onAddAccountRequest: mainWindowStackView.replace(loginPage)
|
|
// StackView.onActivated: connectionSecured(0) // TODO : connect to cpp part when ready
|
|
}
|
|
}
|
|
}
|