only switch automatically to main page when account added and app is being restarted (fix #LINQT-2224)

This commit is contained in:
Gaelle Braud 2025-11-27 11:32:42 +01:00
parent 8ee8058065
commit cca8db9055
5 changed files with 95 additions and 87 deletions

View file

@ -405,8 +405,12 @@ void App::setSelf(QSharedPointer<App>(me)) {
mustBeInMainThread(log().arg(Q_FUNC_INFO));
// There is an account added by a remote provisioning, force switching to main page
// because the account may not be connected already
QMetaObject::invokeMethod(mMainWindow, "openMainPage", Qt::DirectConnection,
Q_ARG(QVariant, accountConnected));
// if (accountConnected)
if (mPossiblyLookForAddedAccount) {
QMetaObject::invokeMethod(mMainWindow, "openMainPage", Qt::DirectConnection,
Q_ARG(QVariant, accountConnected));
}
mPossiblyLookForAddedAccount = false;
});
}
});
@ -682,19 +686,22 @@ void App::initCore() {
} else lInfo() << log().arg("Stay minimized");
firstOpen = false;
lInfo() << log().arg("Checking remote provisioning");
if (CoreModel::getInstance()->mConfigStatus == linphone::ConfiguringState::Failed &&
mIsRestarting) {
QMetaObject::invokeMethod(thread(), [this]() {
auto message = CoreModel::getInstance()->mConfigMessage;
//: not reachable
if (message.isEmpty()) message = tr("configuration_error_detail");
mustBeInMainThread(log().arg(Q_FUNC_INFO));
//: Error
Utils::showInformationPopup(
tr("info_popup_error_title"),
//: Remote provisioning failed : %1
tr("info_popup_configuration_failed_message").arg(message), false);
});
if (mIsRestarting) {
if (CoreModel::getInstance()->mConfigStatus == linphone::ConfiguringState::Failed) {
QMetaObject::invokeMethod(thread(), [this]() {
auto message = CoreModel::getInstance()->mConfigMessage;
//: not reachable
if (message.isEmpty()) message = tr("configuration_error_detail");
mustBeInMainThread(log().arg(Q_FUNC_INFO));
//: Error
Utils::showInformationPopup(
tr("info_popup_error_title"),
//: Remote provisioning failed : %1
tr("info_popup_configuration_failed_message").arg(message), false);
});
} else {
mPossiblyLookForAddedAccount = true;
}
}
checkForUpdate();
mIsRestarting = false;

View file

@ -224,6 +224,7 @@ private:
bool mAutoStart = false;
bool mCoreStarted = false;
bool mIsRestarting = false;
bool mPossiblyLookForAddedAccount = false;
QLocale mLocale = QLocale::system();
DefaultTranslatorCore *mTranslatorCore = nullptr;
DefaultTranslatorCore *mDefaultTranslatorCore = nullptr;

View file

@ -648,134 +648,134 @@
</message>
<message>
<location filename="../../core/App.cpp" line="392"/>
<location filename="../../core/App.cpp" line="441"/>
<location filename="../../core/App.cpp" line="694"/>
<location filename="../../core/App.cpp" line="445"/>
<location filename="../../core/App.cpp" line="698"/>
<source>info_popup_error_title</source>
<extracomment>Error</extracomment>
<translation>Fehler</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="393"/>
<location filename="../../core/App.cpp" line="696"/>
<location filename="../../core/App.cpp" line="700"/>
<source>info_popup_configuration_failed_message</source>
<extracomment>Remote provisioning failed : %1</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/App.cpp" line="444"/>
<location filename="../../core/App.cpp" line="448"/>
<source>info_popup_error_checking_update</source>
<extracomment>An error occured while trying to check update. Please try again later or contact support team.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/App.cpp" line="451"/>
<location filename="../../core/App.cpp" line="455"/>
<source>info_popup_new_version_download_label</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/App.cpp" line="454"/>
<location filename="../../core/App.cpp" line="458"/>
<source>info_popup_new_version_available_title</source>
<extracomment>New version available !</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/App.cpp" line="456"/>
<location filename="../../core/App.cpp" line="460"/>
<source>info_popup_new_version_available_message</source>
<extracomment>A new version of Linphone (%1) is available. %2</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/App.cpp" line="462"/>
<location filename="../../core/App.cpp" line="466"/>
<source>info_popup_version_up_to_date_title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/App.cpp" line="464"/>
<location filename="../../core/App.cpp" line="468"/>
<source>info_popup_version_up_to_date_message</source>
<extracomment>Your version is up to date</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/App.cpp" line="690"/>
<location filename="../../core/App.cpp" line="694"/>
<source>configuration_error_detail</source>
<extracomment>not reachable</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/App.cpp" line="963"/>
<location filename="../../core/App.cpp" line="970"/>
<source>application_description</source>
<extracomment>&quot;A free and open source SIP video-phone.&quot;</extracomment>
<translation>Ein kostenloses Open-Source SIP Video-Telefon.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="965"/>
<location filename="../../core/App.cpp" line="972"/>
<source>command_line_arg_order</source>
<extracomment>&quot;Send an order to the application towards a command line&quot;</extracomment>
<translation>Kommandozeilen-Befehl an die Anwendung schicken</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="969"/>
<location filename="../../core/App.cpp" line="976"/>
<source>command_line_option_show_help</source>
<translation>Zeige Hilfe</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="974"/>
<location filename="../../core/App.cpp" line="981"/>
<source>command_line_option_show_app_version</source>
<translation>App-Version anzeigen</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="982"/>
<location filename="../../core/App.cpp" line="989"/>
<source>command_line_option_config_to_fetch</source>
<extracomment>&quot;Specify the linphone configuration file to be fetched. It will be merged with the current configuration.&quot;</extracomment>
<translation>Abzurufende Linphone-Konfigurationsdatei angeben. Sie wird mit der aktuellen Konfiguration zusammengeführt.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="984"/>
<location filename="../../core/App.cpp" line="991"/>
<source>command_line_option_config_to_fetch_arg</source>
<extracomment>&quot;URL, path or file&quot;</extracomment>
<translation>URL, Pfad oder Datei</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="989"/>
<location filename="../../core/App.cpp" line="996"/>
<source>command_line_option_minimized</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/App.cpp" line="992"/>
<location filename="../../core/App.cpp" line="999"/>
<source>command_line_option_log_to_stdout</source>
<translation>Debug-Informationen auf der Standardausgabe ausgeben</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="995"/>
<location filename="../../core/App.cpp" line="1002"/>
<source>command_line_option_print_app_logs_only</source>
<extracomment>&quot;Print only logs from the application&quot;</extracomment>
<translation>Nur Anwendungs-Logs ausgeben</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1366"/>
<location filename="../../core/App.cpp" line="1373"/>
<source>hide_action</source>
<extracomment>&quot;Cacher&quot; &quot;Afficher&quot;</extracomment>
<translation>Ausblenden</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1366"/>
<location filename="../../core/App.cpp" line="1373"/>
<source>show_action</source>
<translation>Zeigen</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1381"/>
<location filename="../../core/App.cpp" line="1388"/>
<source>quit_action</source>
<extracomment>&quot;Quitter&quot;</extracomment>
<translation>Beenden</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1399"/>
<location filename="../../core/App.cpp" line="1406"/>
<source>check_for_update</source>
<extracomment>Check for update</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1517"/>
<location filename="../../core/App.cpp" line="1524"/>
<source>mark_all_read_action</source>
<translation type="unfinished"></translation>
</message>

View file

@ -653,134 +653,134 @@
</message>
<message>
<location filename="../../core/App.cpp" line="392"/>
<location filename="../../core/App.cpp" line="441"/>
<location filename="../../core/App.cpp" line="694"/>
<location filename="../../core/App.cpp" line="445"/>
<location filename="../../core/App.cpp" line="698"/>
<source>info_popup_error_title</source>
<extracomment>Error</extracomment>
<translation>Error</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="393"/>
<location filename="../../core/App.cpp" line="696"/>
<location filename="../../core/App.cpp" line="700"/>
<source>info_popup_configuration_failed_message</source>
<extracomment>Remote provisioning failed : %1</extracomment>
<translation>Remote provisioning failed : %1</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="444"/>
<location filename="../../core/App.cpp" line="448"/>
<source>info_popup_error_checking_update</source>
<extracomment>An error occured while trying to check update. Please try again later or contact support team.</extracomment>
<translation>An error occured while trying to check update. Please try again later or contact support team.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="451"/>
<location filename="../../core/App.cpp" line="455"/>
<source>info_popup_new_version_download_label</source>
<translation>Download it !</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="454"/>
<location filename="../../core/App.cpp" line="458"/>
<source>info_popup_new_version_available_title</source>
<extracomment>New version available !</extracomment>
<translation>New version available !</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="456"/>
<location filename="../../core/App.cpp" line="460"/>
<source>info_popup_new_version_available_message</source>
<extracomment>A new version of Linphone (%1) is available. %2</extracomment>
<translation>A new version of Linphone (%1) is available at %1</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="462"/>
<location filename="../../core/App.cpp" line="466"/>
<source>info_popup_version_up_to_date_title</source>
<translation>Up to date</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="464"/>
<location filename="../../core/App.cpp" line="468"/>
<source>info_popup_version_up_to_date_message</source>
<extracomment>Your version is up to date</extracomment>
<translation>Up to date Your version is up to date</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="690"/>
<location filename="../../core/App.cpp" line="694"/>
<source>configuration_error_detail</source>
<extracomment>not reachable</extracomment>
<translation>not reachable</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="963"/>
<location filename="../../core/App.cpp" line="970"/>
<source>application_description</source>
<extracomment>&quot;A free and open source SIP video-phone.&quot;</extracomment>
<translation>A free and open source SIP video-phone.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="965"/>
<location filename="../../core/App.cpp" line="972"/>
<source>command_line_arg_order</source>
<extracomment>&quot;Send an order to the application towards a command line&quot;</extracomment>
<translation>Send an order to the application towards a command line</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="969"/>
<location filename="../../core/App.cpp" line="976"/>
<source>command_line_option_show_help</source>
<translation>Show this help</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="974"/>
<location filename="../../core/App.cpp" line="981"/>
<source>command_line_option_show_app_version</source>
<translation>Show app version</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="982"/>
<location filename="../../core/App.cpp" line="989"/>
<source>command_line_option_config_to_fetch</source>
<extracomment>&quot;Specify the linphone configuration file to be fetched. It will be merged with the current configuration.&quot;</extracomment>
<translation>Specify the linphone configuration file to be fetched. It will be merged with the current configuration.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="984"/>
<location filename="../../core/App.cpp" line="991"/>
<source>command_line_option_config_to_fetch_arg</source>
<extracomment>&quot;URL, path or file&quot;</extracomment>
<translation>URL, path or file</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="989"/>
<location filename="../../core/App.cpp" line="996"/>
<source>command_line_option_minimized</source>
<translation>Minimize</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="992"/>
<location filename="../../core/App.cpp" line="999"/>
<source>command_line_option_log_to_stdout</source>
<translation>Log to stdout some debug information while running</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="995"/>
<location filename="../../core/App.cpp" line="1002"/>
<source>command_line_option_print_app_logs_only</source>
<extracomment>&quot;Print only logs from the application&quot;</extracomment>
<translation>Print only logs from the application</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1366"/>
<location filename="../../core/App.cpp" line="1373"/>
<source>hide_action</source>
<extracomment>&quot;Cacher&quot; &quot;Afficher&quot;</extracomment>
<translation>Hide</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1366"/>
<location filename="../../core/App.cpp" line="1373"/>
<source>show_action</source>
<translation>Show</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1381"/>
<location filename="../../core/App.cpp" line="1388"/>
<source>quit_action</source>
<extracomment>&quot;Quitter&quot;</extracomment>
<translation>Quit</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1399"/>
<location filename="../../core/App.cpp" line="1406"/>
<source>check_for_update</source>
<extracomment>Check for update</extracomment>
<translation>Check for update</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1517"/>
<location filename="../../core/App.cpp" line="1524"/>
<source>mark_all_read_action</source>
<translation>Marquer tout comme lu</translation>
</message>

View file

@ -653,134 +653,134 @@
</message>
<message>
<location filename="../../core/App.cpp" line="392"/>
<location filename="../../core/App.cpp" line="441"/>
<location filename="../../core/App.cpp" line="694"/>
<location filename="../../core/App.cpp" line="445"/>
<location filename="../../core/App.cpp" line="698"/>
<source>info_popup_error_title</source>
<extracomment>Error</extracomment>
<translation>Erreur</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="393"/>
<location filename="../../core/App.cpp" line="696"/>
<location filename="../../core/App.cpp" line="700"/>
<source>info_popup_configuration_failed_message</source>
<extracomment>Remote provisioning failed : %1</extracomment>
<translation>La configuration distante a échoué : %1</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="444"/>
<location filename="../../core/App.cpp" line="448"/>
<source>info_popup_error_checking_update</source>
<extracomment>An error occured while trying to check update. Please try again later or contact support team.</extracomment>
<translation>Une erreur est survenue lors de la recherche de mise à jour. Merci de réessayer plus tard ou de contacter l&apos;équipe de support.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="451"/>
<location filename="../../core/App.cpp" line="455"/>
<source>info_popup_new_version_download_label</source>
<translation>Téléchargez- !</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="454"/>
<location filename="../../core/App.cpp" line="458"/>
<source>info_popup_new_version_available_title</source>
<extracomment>New version available !</extracomment>
<translation>Nouvelle version disponible !</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="456"/>
<location filename="../../core/App.cpp" line="460"/>
<source>info_popup_new_version_available_message</source>
<extracomment>A new version of Linphone (%1) is available. %2</extracomment>
<translation>Une nouvelle version de Linphone (%1) est disponible. %2</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="462"/>
<location filename="../../core/App.cpp" line="466"/>
<source>info_popup_version_up_to_date_title</source>
<translation>À jour</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="464"/>
<location filename="../../core/App.cpp" line="468"/>
<source>info_popup_version_up_to_date_message</source>
<extracomment>Your version is up to date</extracomment>
<translation>Votre version est à jour</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="690"/>
<location filename="../../core/App.cpp" line="694"/>
<source>configuration_error_detail</source>
<extracomment>not reachable</extracomment>
<translation>indisponible</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="963"/>
<location filename="../../core/App.cpp" line="970"/>
<source>application_description</source>
<extracomment>&quot;A free and open source SIP video-phone.&quot;</extracomment>
<translation>A free and open source SIP video-phone.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="965"/>
<location filename="../../core/App.cpp" line="972"/>
<source>command_line_arg_order</source>
<extracomment>&quot;Send an order to the application towards a command line&quot;</extracomment>
<translation>Send an order to the application towards a command line</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="969"/>
<location filename="../../core/App.cpp" line="976"/>
<source>command_line_option_show_help</source>
<translation>Show this help</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="974"/>
<location filename="../../core/App.cpp" line="981"/>
<source>command_line_option_show_app_version</source>
<translation>Afficher la version de l&apos;application</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="982"/>
<location filename="../../core/App.cpp" line="989"/>
<source>command_line_option_config_to_fetch</source>
<extracomment>&quot;Specify the linphone configuration file to be fetched. It will be merged with the current configuration.&quot;</extracomment>
<translation>Specify the linphone configuration file to be fetched. It will be merged with the current configuration.</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="984"/>
<location filename="../../core/App.cpp" line="991"/>
<source>command_line_option_config_to_fetch_arg</source>
<extracomment>&quot;URL, path or file&quot;</extracomment>
<translation>URL, path or file</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="989"/>
<location filename="../../core/App.cpp" line="996"/>
<source>command_line_option_minimized</source>
<translation>Minimiser</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="992"/>
<location filename="../../core/App.cpp" line="999"/>
<source>command_line_option_log_to_stdout</source>
<translation>Log to stdout some debug information while running</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="995"/>
<location filename="../../core/App.cpp" line="1002"/>
<source>command_line_option_print_app_logs_only</source>
<extracomment>&quot;Print only logs from the application&quot;</extracomment>
<translation>Print only logs from the application</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1366"/>
<location filename="../../core/App.cpp" line="1373"/>
<source>hide_action</source>
<extracomment>&quot;Cacher&quot; &quot;Afficher&quot;</extracomment>
<translation>Cacher</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1366"/>
<location filename="../../core/App.cpp" line="1373"/>
<source>show_action</source>
<translation>Afficher</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1381"/>
<location filename="../../core/App.cpp" line="1388"/>
<source>quit_action</source>
<extracomment>&quot;Quitter&quot;</extracomment>
<translation>Quitter</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1399"/>
<location filename="../../core/App.cpp" line="1406"/>
<source>check_for_update</source>
<extracomment>Check for update</extracomment>
<translation>Rechercher une mise à jour</translation>
</message>
<message>
<location filename="../../core/App.cpp" line="1517"/>
<location filename="../../core/App.cpp" line="1524"/>
<source>mark_all_read_action</source>
<translation>Marquer tout comme lu</translation>
</message>