mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
revert fix config login page (accounts registration states are not enough specific to use them as indicator of existing accounts)
This commit is contained in:
parent
c1013baac5
commit
c1f0cd381a
4 changed files with 11 additions and 29 deletions
|
|
@ -486,7 +486,10 @@ void App::initCore() {
|
|||
mEngine->setObjectOwnership(settings.get(), QQmlEngine::CppOwnership);
|
||||
mEngine->setObjectOwnership(this, QQmlEngine::CppOwnership);
|
||||
if (!mAccountList) setAccountList(AccountList::create());
|
||||
else mAccountList->lUpdate();
|
||||
else {
|
||||
mAccountList->setInitialized(false);
|
||||
mAccountList->lUpdate(true);
|
||||
}
|
||||
if (!mCallList) setCallList(CallList::create());
|
||||
else mCallList->lUpdate();
|
||||
if (!mSettings) {
|
||||
|
|
|
|||
|
|
@ -64,27 +64,8 @@ void AccountList::setSelf(QSharedPointer<AccountList> me) {
|
|||
}
|
||||
mModelConnection->invokeToCore([this, accounts, defaultAccountCore, isInitialization]() {
|
||||
mustBeInMainThread(getClassName());
|
||||
auto reallyHaveAccount = [this]() -> bool {
|
||||
// When an account is trying to connect, we don't want to display the features
|
||||
// provided for the accounts that really stays in the account list
|
||||
// (for example the back button to return on the main page in the login page)
|
||||
for (auto &account : getSharedList<AccountCore>()) {
|
||||
if (account->getRegistrationState() != LinphoneEnums::RegistrationState::Progress &&
|
||||
account->getRegistrationState() != LinphoneEnums::RegistrationState::None) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
for (auto &account : getSharedList<AccountCore>()) {
|
||||
disconnect(account.get(), &AccountCore::registrationStateChanged, this, nullptr);
|
||||
}
|
||||
resetData<AccountCore>(*accounts);
|
||||
for (auto &account : getSharedList<AccountCore>()) {
|
||||
connect(account.get(), &AccountCore::registrationStateChanged, this,
|
||||
[this, reallyHaveAccount] { setHaveAccount(reallyHaveAccount()); });
|
||||
}
|
||||
setHaveAccount(reallyHaveAccount());
|
||||
setHaveAccount(accounts->size() > 0);
|
||||
setDefaultAccount(defaultAccountCore);
|
||||
if (isInitialization) setInitialized(true);
|
||||
delete accounts;
|
||||
|
|
|
|||
|
|
@ -143,6 +143,7 @@ bool AccountManager::login(QString username,
|
|||
auto status = core->addAccount(account);
|
||||
if (status == -1) {
|
||||
*errorMessage = tr("Impossible d'ajouter le compte.");
|
||||
core->removeAuthInfo(authInfo);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ AbstractWindow {
|
|||
Connections {
|
||||
target: SettingsCpp
|
||||
function onAssistantGoDirectlyToThirdPartySipAccountLoginChanged() {
|
||||
initStackViewItem()
|
||||
initStackViewItem()
|
||||
}
|
||||
function onIsSavedChanged() {
|
||||
if (SettingsCpp.isSaved) UtilsCpp.showInformationPopup(qsTr("Succès"), qsTr("Les changements ont été sauvegardés"), true, mainWindow)
|
||||
|
|
@ -112,13 +112,10 @@ AbstractWindow {
|
|||
active: AppCpp.coreStarted
|
||||
sourceComponent: AccountProxy {
|
||||
sourceModel: AppCpp.accounts
|
||||
onInitializedChanged: if (isInitialized) {
|
||||
onInitializedChanged: if (isInitialized) {
|
||||
mainWindow.accountProxy = this
|
||||
mainWindow.initStackViewItem()
|
||||
}
|
||||
onHaveAccountChanged: {
|
||||
if (isInitialized) mainWindow.initStackViewItem()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -161,7 +158,7 @@ AbstractWindow {
|
|||
onGoBack: openMainPage()
|
||||
onUseSIPButtonClicked: mainWindowStackView.push(sipLoginPage)
|
||||
onGoToRegister: mainWindowStackView.replace(registerPage)
|
||||
showBackButton: accountProxy?.haveAccount
|
||||
showBackButton: mainWindow.accountProxy?.haveAccount || false
|
||||
}
|
||||
}
|
||||
Component {
|
||||
|
|
@ -175,7 +172,7 @@ AbstractWindow {
|
|||
mainWindowStackView.pop()
|
||||
}
|
||||
onGoToRegister: mainWindowStackView.replace(registerPage)
|
||||
showBackButton: !SettingsCpp.assistantGoDirectlyToThirdPartySipAccountLogin || accountProxy?.haveAccount
|
||||
showBackButton: !SettingsCpp.assistantGoDirectlyToThirdPartySipAccountLogin || mainWindow.accountProxy?.haveAccount
|
||||
}
|
||||
}
|
||||
Component {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue