fix #LINQT-1553 auth dialog on start even if account is registered
This commit is contained in:
parent
1c1bd91080
commit
96772fabac
3 changed files with 18 additions and 30 deletions
|
|
@ -909,6 +909,16 @@ void App::onExitOnCloseChanged() {
|
||||||
void App::onAuthenticationRequested(const std::shared_ptr<linphone::Core> &core,
|
void App::onAuthenticationRequested(const std::shared_ptr<linphone::Core> &core,
|
||||||
const std::shared_ptr<linphone::AuthInfo> &authInfo,
|
const std::shared_ptr<linphone::AuthInfo> &authInfo,
|
||||||
linphone::AuthMethod method) {
|
linphone::AuthMethod method) {
|
||||||
|
bool authInfoIsInAccounts = false;
|
||||||
|
for (auto &account : core->getAccountList()) {
|
||||||
|
auto accountAuthInfo = account->findAuthInfo();
|
||||||
|
if (authInfo && accountAuthInfo && authInfo->isEqualButAlgorithms(accountAuthInfo)) {
|
||||||
|
authInfoIsInAccounts = true;
|
||||||
|
if (account->getState() == linphone::RegistrationState::Ok) return;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!authInfoIsInAccounts) return;
|
||||||
mCoreModelConnection->invokeToCore([this, core, authInfo, method]() {
|
mCoreModelConnection->invokeToCore([this, core, authInfo, method]() {
|
||||||
auto window = App::getInstance()->getMainWindow();
|
auto window = App::getInstance()->getMainWindow();
|
||||||
if (!window) {
|
if (!window) {
|
||||||
|
|
|
||||||
|
|
@ -223,7 +223,7 @@ bool ToolModel::createCall(const QString &sipAddress,
|
||||||
std::shared_ptr<linphone::Account> ToolModel::findAccount(const std::shared_ptr<const linphone::Address> &address) {
|
std::shared_ptr<linphone::Account> ToolModel::findAccount(const std::shared_ptr<const linphone::Address> &address) {
|
||||||
std::shared_ptr<linphone::Account> account;
|
std::shared_ptr<linphone::Account> account;
|
||||||
for (auto item : CoreModel::getInstance()->getCore()->getAccountList()) {
|
for (auto item : CoreModel::getInstance()->getCore()->getAccountList()) {
|
||||||
if (item->getContactAddress() && item->getContactAddress()->weakEqual(address)) {
|
if (item->getParams() && item->getParams()->getIdentityAddress()->weakEqual(address)) {
|
||||||
account = item;
|
account = item;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ Item {
|
||||||
id: mainItem
|
id: mainItem
|
||||||
width: 517 * DefaultStyle.dp
|
width: 517 * DefaultStyle.dp
|
||||||
readonly property int topPadding: 23 * DefaultStyle.dp
|
readonly property int topPadding: 23 * DefaultStyle.dp
|
||||||
readonly property int bottomPadding: 18 * DefaultStyle.dp
|
readonly property int bottomPadding: 13 * DefaultStyle.dp
|
||||||
readonly property int leftPadding: 24 * DefaultStyle.dp
|
readonly property int leftPadding: 24 * DefaultStyle.dp
|
||||||
readonly property int rightPadding: 24 * DefaultStyle.dp
|
readonly property int rightPadding: 24 * DefaultStyle.dp
|
||||||
readonly property int spacing: 16 * DefaultStyle.dp
|
readonly property int spacing: 16 * DefaultStyle.dp
|
||||||
|
|
@ -21,7 +21,7 @@ Item {
|
||||||
signal addAccountRequest()
|
signal addAccountRequest()
|
||||||
signal editAccount(AccountGui account)
|
signal editAccount(AccountGui account)
|
||||||
|
|
||||||
implicitHeight: list.contentHeight + topPadding + bottomPadding + 32 * DefaultStyle.dp + 1 + newAccountArea.height
|
implicitHeight: list.contentHeight + topPadding + bottomPadding + 32 * DefaultStyle.dp + 1 + addAccountButton.height
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
id: childLayout
|
id: childLayout
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
|
|
@ -78,38 +78,16 @@ Item {
|
||||||
height: 1 * DefaultStyle.dp
|
height: 1 * DefaultStyle.dp
|
||||||
color: DefaultStyle.main2_300
|
color: DefaultStyle.main2_300
|
||||||
}
|
}
|
||||||
MouseArea{
|
IconLabelButton{
|
||||||
id: addAccountButton
|
id: addAccountButton
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: 32 * DefaultStyle.dp
|
|
||||||
visible: SettingsCpp.maxAccount == 0 || SettingsCpp.maxAccount > accountProxy.count
|
visible: SettingsCpp.maxAccount == 0 || SettingsCpp.maxAccount > accountProxy.count
|
||||||
onClicked: mainItem.addAccountRequest()
|
onClicked: mainItem.addAccountRequest()
|
||||||
RowLayout{
|
icon.source: AppIcons.plusCircle
|
||||||
id: newAccountArea
|
icon.width: 32 * DefaultStyle.dp
|
||||||
anchors.fill: parent
|
icon.height: 32 * DefaultStyle.dp
|
||||||
spacing: 5 * DefaultStyle.dp
|
|
||||||
EffectImage {
|
|
||||||
id: newAccount
|
|
||||||
imageSource: AppIcons.plusCircle
|
|
||||||
width: 32 * DefaultStyle.dp
|
|
||||||
height: 32 * DefaultStyle.dp
|
|
||||||
Layout.preferredWidth: 32 * DefaultStyle.dp
|
|
||||||
Layout.preferredHeight: 32 * DefaultStyle.dp
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
fillMode: Image.PreserveAspectFit
|
|
||||||
colorizationColor: DefaultStyle.main2_500main
|
|
||||||
}
|
|
||||||
Text{
|
|
||||||
Layout.fillHeight: true
|
|
||||||
Layout.fillWidth: true
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
font.weight: 400 * DefaultStyle.dp
|
|
||||||
font.pixelSize: 14 * DefaultStyle.dp
|
|
||||||
color: DefaultStyle.main2_500main
|
|
||||||
text: 'Ajouter un compte'
|
text: 'Ajouter un compte'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue