FIXES:
avoid calling connected account ui right panel enter shortcut connection non modal zrtp popup clear magic search bar when action clicked multicall : use call locale address for sticker instead of default account
This commit is contained in:
parent
552f7acb46
commit
bd5015742a
13 changed files with 66 additions and 15 deletions
|
|
@ -99,9 +99,22 @@ void AccountList::setDefaultAccount(QSharedPointer<AccountCore> account) {
|
||||||
emit defaultAccountChanged();
|
emit defaultAccountChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AccountGui *AccountList::findAccountByAddress(const QString &address) {
|
||||||
|
for (auto &item : mList) {
|
||||||
|
if (auto isAccount = item.objectCast<AccountCore>()) {
|
||||||
|
if (isAccount->getIdentityAddress() == address) {
|
||||||
|
return new AccountGui(isAccount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
bool AccountList::getHaveAccount() const {
|
bool AccountList::getHaveAccount() const {
|
||||||
return mHaveAccount;
|
return mHaveAccount;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AccountList::setHaveAccount(bool haveAccount) {
|
void AccountList::setHaveAccount(bool haveAccount) {
|
||||||
if (mHaveAccount != haveAccount) {
|
if (mHaveAccount != haveAccount) {
|
||||||
mHaveAccount = haveAccount;
|
mHaveAccount = haveAccount;
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ public:
|
||||||
AccountGui *getDefaultAccount() const;
|
AccountGui *getDefaultAccount() const;
|
||||||
QSharedPointer<AccountCore> getDefaultAccountCore() const;
|
QSharedPointer<AccountCore> getDefaultAccountCore() const;
|
||||||
void setDefaultAccount(QSharedPointer<AccountCore> account);
|
void setDefaultAccount(QSharedPointer<AccountCore> account);
|
||||||
|
AccountGui *findAccountByAddress(const QString &address);
|
||||||
|
|
||||||
bool getHaveAccount() const;
|
bool getHaveAccount() const;
|
||||||
void setHaveAccount(bool haveAccount);
|
void setHaveAccount(bool haveAccount);
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,10 @@ void AccountProxy::resetDefaultAccount() {
|
||||||
emit this->defaultAccountChanged(); // Warn the UI
|
emit this->defaultAccountChanged(); // Warn the UI
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AccountGui *AccountProxy::findAccountByAddress(const QString &address) {
|
||||||
|
return dynamic_cast<AccountList *>(sourceModel())->findAccountByAddress(address);
|
||||||
|
}
|
||||||
|
|
||||||
bool AccountProxy::getHaveAccount() const {
|
bool AccountProxy::getHaveAccount() const {
|
||||||
return dynamic_cast<AccountList *>(sourceModel())->getHaveAccount();
|
return dynamic_cast<AccountList *>(sourceModel())->getHaveAccount();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ public:
|
||||||
AccountGui *getDefaultAccount(); // Get a new object from List or give the stored one.
|
AccountGui *getDefaultAccount(); // Get a new object from List or give the stored one.
|
||||||
void setDefaultAccount(AccountGui *account); // TODO
|
void setDefaultAccount(AccountGui *account); // TODO
|
||||||
void resetDefaultAccount(); // Reset the default account to let UI build its new object if needed.
|
void resetDefaultAccount(); // Reset the default account to let UI build its new object if needed.
|
||||||
|
Q_INVOKABLE AccountGui *findAccountByAddress(const QString &address);
|
||||||
|
|
||||||
bool getHaveAccount() const;
|
bool getHaveAccount() const;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,13 @@ bool ToolModel::createCall(const QString &sipAddress,
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
for (auto &account : core->getAccountList()) {
|
||||||
|
if (account->getContactAddress()->weakEqual(address)) {
|
||||||
|
*errorMessage = "The calling address is a connected account.";
|
||||||
|
lDebug() << "[" + QString(gClassName) + "]" + *errorMessage;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::shared_ptr<linphone::CallParams> params = core->createCallParams(nullptr);
|
std::shared_ptr<linphone::CallParams> params = core->createCallParams(nullptr);
|
||||||
CallModel::activateLocalVideo(params, nullptr, localVideoEnabled);
|
CallModel::activateLocalVideo(params, nullptr, localVideoEnabled);
|
||||||
|
|
|
||||||
|
|
@ -179,6 +179,7 @@ AppWindow {
|
||||||
ZrtpTokenAuthenticationDialog {
|
ZrtpTokenAuthenticationDialog {
|
||||||
id: zrtpValidation
|
id: zrtpValidation
|
||||||
call: mainWindow.call
|
call: mainWindow.call
|
||||||
|
modal: false
|
||||||
}
|
}
|
||||||
Popup {
|
Popup {
|
||||||
id: waitingPopup
|
id: waitingPopup
|
||||||
|
|
@ -520,6 +521,10 @@ AppWindow {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.maximumHeight: rightPanel.height
|
Layout.maximumHeight: rightPanel.height
|
||||||
visible: callList.contentHeight > 0
|
visible: callList.contentHeight > 0
|
||||||
|
leftPadding: 17 * DefaultStyle.dp
|
||||||
|
rightPadding: 17 * DefaultStyle.dp
|
||||||
|
topPadding: 16 * DefaultStyle.dp
|
||||||
|
bottomPadding: 16 * DefaultStyle.dp
|
||||||
|
|
||||||
contentItem: ListView {
|
contentItem: ListView {
|
||||||
id: callList
|
id: callList
|
||||||
|
|
@ -537,8 +542,6 @@ AppWindow {
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: delegateContent
|
id: delegateContent
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.leftMargin: 10 * DefaultStyle.dp
|
|
||||||
anchors.rightMargin: 10 * DefaultStyle.dp
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
Avatar {
|
Avatar {
|
||||||
id: delegateAvatar
|
id: delegateAvatar
|
||||||
|
|
@ -550,6 +553,7 @@ AppWindow {
|
||||||
id: delegateName
|
id: delegateName
|
||||||
property var remoteAddress: UtilsCpp.getDisplayName(modelData.core.peerAddress)
|
property var remoteAddress: UtilsCpp.getDisplayName(modelData.core.peerAddress)
|
||||||
text: remoteAddress ? remoteAddress.value : ""
|
text: remoteAddress ? remoteAddress.value : ""
|
||||||
|
Layout.leftMargin: 8 * DefaultStyle.dp
|
||||||
Connections {
|
Connections {
|
||||||
target: modelData.core
|
target: modelData.core
|
||||||
}
|
}
|
||||||
|
|
@ -560,6 +564,7 @@ AppWindow {
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
id: callStateText
|
id: callStateText
|
||||||
|
Layout.rightMargin: 2 * DefaultStyle.dp
|
||||||
text: modelData.core.state === LinphoneEnums.CallState.Paused
|
text: modelData.core.state === LinphoneEnums.CallState.Paused
|
||||||
|| modelData.core.state === LinphoneEnums.CallState.PausedByRemote
|
|| modelData.core.state === LinphoneEnums.CallState.PausedByRemote
|
||||||
? qsTr("Appel en pause") : qsTr("Appel en cours")
|
? qsTr("Appel en pause") : qsTr("Appel en cours")
|
||||||
|
|
@ -568,7 +573,6 @@ AppWindow {
|
||||||
id: listCallOptionsButton
|
id: listCallOptionsButton
|
||||||
Layout.preferredWidth: 24 * DefaultStyle.dp
|
Layout.preferredWidth: 24 * DefaultStyle.dp
|
||||||
Layout.preferredHeight: 24 * DefaultStyle.dp
|
Layout.preferredHeight: 24 * DefaultStyle.dp
|
||||||
Layout.alignment: Qt.AlignRight
|
|
||||||
|
|
||||||
popup.contentItem: ColumnLayout {
|
popup.contentItem: ColumnLayout {
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
|
||||||
|
|
@ -219,7 +219,7 @@ Item {
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
id: sipAddr
|
id: sipAddr
|
||||||
text: UtilsCpp.generateLinphoneSipAddress(magicSearchBar.text)
|
text: magicSearchBar.text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Item {
|
Item {
|
||||||
|
|
@ -236,6 +236,7 @@ Item {
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
UtilsCpp.createCall(sipAddr.text)
|
UtilsCpp.createCall(sipAddr.text)
|
||||||
|
magicSearchBar.clearText()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Button {
|
Button {
|
||||||
|
|
@ -246,7 +247,10 @@ Item {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
source: AppIcons.videoCamera
|
source: AppIcons.videoCamera
|
||||||
}
|
}
|
||||||
onClicked: UtilsCpp.createCall(sipAddr.text, {'localVideoEnabled':true})
|
onClicked: {
|
||||||
|
UtilsCpp.createCall(sipAddr.text, {'localVideoEnabled':true})
|
||||||
|
magicSearchBar.clearText()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Button {
|
Button {
|
||||||
|
|
@ -275,6 +279,7 @@ Item {
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
mainItem.createContact(magicSearchBar.text, sipAddr.text)
|
mainItem.createContact(magicSearchBar.text, sipAddr.text)
|
||||||
|
magicSearchBar.clearText()
|
||||||
listPopup.close()
|
listPopup.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ RowLayout {
|
||||||
AccountProxy{
|
AccountProxy{
|
||||||
id: accounts
|
id: accounts
|
||||||
}
|
}
|
||||||
account: accounts.defaultAccount
|
account: accounts.findAccountByAddress(mainItem.localAddress)
|
||||||
}
|
}
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
|
||||||
|
|
@ -72,12 +72,13 @@ ColumnLayout {
|
||||||
Layout.topMargin: 7 * DefaultStyle.dp
|
Layout.topMargin: 7 * DefaultStyle.dp
|
||||||
spacing: 29 * DefaultStyle.dp
|
spacing: 29 * DefaultStyle.dp
|
||||||
Button {
|
Button {
|
||||||
|
id: connectionButton
|
||||||
leftPadding: 20 * DefaultStyle.dp
|
leftPadding: 20 * DefaultStyle.dp
|
||||||
rightPadding: 20 * DefaultStyle.dp
|
rightPadding: 20 * DefaultStyle.dp
|
||||||
topPadding: 11 * DefaultStyle.dp
|
topPadding: 11 * DefaultStyle.dp
|
||||||
bottomPadding: 11 * DefaultStyle.dp
|
bottomPadding: 11 * DefaultStyle.dp
|
||||||
contentItem: StackLayout {
|
contentItem: StackLayout {
|
||||||
id: connectionButton
|
id: connectionButtonContent
|
||||||
currentIndex: 0
|
currentIndex: 0
|
||||||
Text {
|
Text {
|
||||||
text: qsTr("Connexion")
|
text: qsTr("Connexion")
|
||||||
|
|
@ -100,15 +101,16 @@ ColumnLayout {
|
||||||
target: LoginPageCpp
|
target: LoginPageCpp
|
||||||
onRegistrationStateChanged: {
|
onRegistrationStateChanged: {
|
||||||
if (LoginPageCpp.registrationState != LinphoneEnums.RegistrationState.Progress) {
|
if (LoginPageCpp.registrationState != LinphoneEnums.RegistrationState.Progress) {
|
||||||
connectionButton.currentIndex = 0
|
connectionButtonContent.currentIndex = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onErrorMessageChanged: {
|
onErrorMessageChanged: {
|
||||||
connectionButton.currentIndex = 0
|
connectionButtonContent.currentIndex = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onClicked: {
|
|
||||||
|
function trigger() {
|
||||||
username.errorMessage = ""
|
username.errorMessage = ""
|
||||||
password.errorMessage = ""
|
password.errorMessage = ""
|
||||||
errorText.text = ""
|
errorText.text = ""
|
||||||
|
|
@ -121,8 +123,14 @@ ColumnLayout {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
LoginPageCpp.login(usernameEdit.text, passwordEdit.text)
|
LoginPageCpp.login(usernameEdit.text, passwordEdit.text)
|
||||||
connectionButton.currentIndex = 1
|
connectionButtonContent.currentIndex = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Shortcut {
|
||||||
|
sequences: ["Return", "Enter"]
|
||||||
|
onActivated: connectionButton.trigger()
|
||||||
|
}
|
||||||
|
onPressed: connectionButton.trigger()
|
||||||
}
|
}
|
||||||
Button {
|
Button {
|
||||||
background: Item {
|
background: Item {
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,10 @@ Rectangle {
|
||||||
|
|
||||||
onVisibleChanged: if (!visible && numericPad) numericPad.close()
|
onVisibleChanged: if (!visible && numericPad) numericPad.close()
|
||||||
|
|
||||||
|
function clearText() {
|
||||||
|
textField.text = ""
|
||||||
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
enabled: numericPad != undefined
|
enabled: numericPad != undefined
|
||||||
target: numericPad ? numericPad : null
|
target: numericPad ? numericPad : null
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,11 @@ Item{
|
||||||
property alias call: allDevices.currentCall
|
property alias call: allDevices.currentCall
|
||||||
property ConferenceGui conference: call && call.core.conference || null
|
property ConferenceGui conference: call && call.core.conference || null
|
||||||
property var callState: call && call.core.state || undefined
|
property var callState: call && call.core.state || undefined
|
||||||
|
property string localAddress: call && call.conference
|
||||||
|
? call.conference.core.me.core.sipAddress
|
||||||
|
: call.core.localAddress
|
||||||
|
|| ""
|
||||||
|
onLocalAddressChanged: console.log("======== local addr changed", localAddress)
|
||||||
|
|
||||||
property ParticipantDeviceProxy participantDevices : ParticipantDeviceProxy {
|
property ParticipantDeviceProxy participantDevices : ParticipantDeviceProxy {
|
||||||
id: allDevices
|
id: allDevices
|
||||||
|
|
@ -80,11 +85,10 @@ Item{
|
||||||
anchors.bottom: mainItem.bottom
|
anchors.bottom: mainItem.bottom
|
||||||
anchors.rightMargin: 20 * DefaultStyle.dp
|
anchors.rightMargin: 20 * DefaultStyle.dp
|
||||||
anchors.bottomMargin: 10 * DefaultStyle.dp
|
anchors.bottomMargin: 10 * DefaultStyle.dp
|
||||||
//participantDevice: allDevices.me
|
|
||||||
videoEnabled: preview.visible && mainItem.call && mainItem.call.core.localVideoEnabled
|
videoEnabled: preview.visible && mainItem.call && mainItem.call.core.localVideoEnabled
|
||||||
onVideoEnabledChanged: console.log("P : " +videoEnabled + " / " +visible +" / " +mainItem.call)
|
onVideoEnabledChanged: console.log("P : " +videoEnabled + " / " +visible +" / " +mainItem.call)
|
||||||
property AccountProxy accounts: AccountProxy{id: accountProxy}
|
property AccountProxy accounts: AccountProxy{id: accountProxy}
|
||||||
account: accountProxy.defaultAccount
|
account: accountProxy.findAccountByAddress(mainItem.localAddress)
|
||||||
call: mainItem.call
|
call: mainItem.call
|
||||||
displayAll: false
|
displayAll: false
|
||||||
displayPresence: false
|
displayPresence: false
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ Mosaic {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
qmlName: 'G_'+index
|
qmlName: 'G_'+index
|
||||||
call: !grid.call.core.isConference ? grid.call : null
|
call: !grid.call.core.isConference ? grid.call : null
|
||||||
account: index == 0 ? accountProxy.defaultAccount : null
|
account: index == 0 ? accountProxy.findAccountByAddress(mainItem.localAddress) : null
|
||||||
displayAll: false
|
displayAll: false
|
||||||
bigBottomAddress: true
|
bigBottomAddress: true
|
||||||
displayPresence: false
|
displayPresence: false
|
||||||
|
|
|
||||||
|
|
@ -512,7 +512,7 @@ AbstractMainPage {
|
||||||
id: contactDetail
|
id: contactDetail
|
||||||
visible: mainItem.selectedRowHistoryGui != undefined
|
visible: mainItem.selectedRowHistoryGui != undefined
|
||||||
property var contactObj: UtilsCpp.findFriendByAddress(contactAddress)
|
property var contactObj: UtilsCpp.findFriendByAddress(contactAddress)
|
||||||
contact: contactObj ? contactObj.value : null
|
contact: contactObj && contactObj.value || null
|
||||||
contactAddress: mainItem.selectedRowHistoryGui && mainItem.selectedRowHistoryGui.core.remoteAddress || ""
|
contactAddress: mainItem.selectedRowHistoryGui && mainItem.selectedRowHistoryGui.core.remoteAddress || ""
|
||||||
contactName: mainItem.selectedRowHistoryGui ? mainItem.selectedRowHistoryGui.core.displayName : ""
|
contactName: mainItem.selectedRowHistoryGui ? mainItem.selectedRowHistoryGui.core.displayName : ""
|
||||||
anchors.top: rightPanelStackView.top
|
anchors.top: rightPanelStackView.top
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue