diff --git a/Linphone/core/login/LoginPage.cpp b/Linphone/core/login/LoginPage.cpp index 8bbebc64b..ab1aae1f8 100644 --- a/Linphone/core/login/LoginPage.cpp +++ b/Linphone/core/login/LoginPage.cpp @@ -70,12 +70,15 @@ void LoginPage::login(const QString &username, // Create on Model thread. AccountManager *accountManager = new AccountManager(); connect(accountManager, &AccountManager::registrationStateChanged, this, - [accountManager, this](linphone::RegistrationState state) mutable { + [accountManager, this](linphone::RegistrationState state, QString message) mutable { // View thread setRegistrationState(state); switch (state) { case linphone::RegistrationState::Failed: { - setErrorMessage(QString(tr("Le couple identifiant mot de passe ne correspond pas"))); + if (message.isEmpty()) + setErrorMessage(QString(tr("Le couple identifiant mot de passe ne correspond pas"))); + else + setErrorMessage(message); if (accountManager) { accountManager->deleteLater(); accountManager = nullptr; diff --git a/Linphone/model/account/AccountManager.cpp b/Linphone/model/account/AccountManager.cpp index ed3365334..fb46af091 100644 --- a/Linphone/model/account/AccountManager.cpp +++ b/Linphone/model/account/AccountManager.cpp @@ -137,8 +137,8 @@ bool AccountManager::login(QString username, emit mAccountModel->removeListener(); mAccountModel = nullptr; } - } - emit registrationStateChanged(state); + } + emit registrationStateChanged(state, QString::fromStdString(message)); }); auto status = core->addAccount(account); if (status == -1) { diff --git a/Linphone/model/account/AccountManager.hpp b/Linphone/model/account/AccountManager.hpp index 41209f33e..1fdaa13fd 100644 --- a/Linphone/model/account/AccountManager.hpp +++ b/Linphone/model/account/AccountManager.hpp @@ -55,7 +55,7 @@ public: void linkNewAccountUsingCode(const QString &code, RegisterType registerType, const QString &sipAddress); signals: - void registrationStateChanged(linphone::RegistrationState state); + void registrationStateChanged(linphone::RegistrationState state, QString message = QString()); void newAccountCreationSucceed(QString sipAddress, RegisterType registerType, const QString ®isterAddress); void registerNewAccountFailed(const QString &error); void tokenConversionSucceed(QString convertedToken); diff --git a/Linphone/view/CMakeLists.txt b/Linphone/view/CMakeLists.txt index d3f271ab9..7454c2e16 100644 --- a/Linphone/view/CMakeLists.txt +++ b/Linphone/view/CMakeLists.txt @@ -6,8 +6,9 @@ list(APPEND _LINPHONEAPP_QML_FILES view/Control/Button/CheckBox.qml view/Control/Button/ComboBox.qml view/Control/Button/HelpIconLabelButton.qml - view/Control/Button/IconLabelButton.qml - view/Control/Button/BigButton.qml + view/Control/Button/IconButton.qml + view/Control/Button/IconLabelButton.qml + view/Control/Button/BigButton.qml view/Control/Button/RoundButton.qml view/Control/Button/MediumButton.qml view/Control/Button/SmallButton.qml diff --git a/Linphone/view/Control/Button/IconButton.qml b/Linphone/view/Control/Button/IconButton.qml new file mode 100644 index 000000000..db77bcf53 --- /dev/null +++ b/Linphone/view/Control/Button/IconButton.qml @@ -0,0 +1,40 @@ +import QtQuick +import QtQuick.Effects +import QtQuick.Layouts +import Linphone +import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle + +Button { + id: mainItem + icon.width: 24 * DefaultStyle.dp + icon.height: 24 * DefaultStyle.dp + textSize: 14 * DefaultStyle.dp + textWeight: 400 * DefaultStyle.dp + radius: 5 * DefaultStyle.dp + shadowEnabled: mainItem.activeFocus || hovered + style: ButtonStyle.hoveredBackground + + background: Rectangle { + anchors.fill: parent + radius: mainItem.radius + color: mainItem.pressed + ? mainItem.pressedColor + : mainItem.hovered || mainItem.hasNavigationFocus + ? mainItem.hoveredColor + : mainItem.color + border.color: mainItem.borderColor + } + + contentItem: EffectImage { + imageSource: mainItem.icon.source + imageWidth: mainItem.icon.width + imageHeight: mainItem.icon.height + colorizationColor: mainItem.pressed + ? mainItem.pressedImageColor + : mainItem.hovered + ? mainItem.hoveredImageColor + : mainItem.contentImageColor + Layout.preferredWidth: mainItem.icon.width + Layout.preferredHeight: mainItem.icon.height + } +} diff --git a/cmake/install/install.cmake b/cmake/install/install.cmake index a1f90e99c..185595396 100644 --- a/cmake/install/install.cmake +++ b/cmake/install/install.cmake @@ -120,12 +120,12 @@ elseif(WIN32) NAMES msys2_shell.cmd HINTS "C:/msys64/" ) - include(InstallRequiredSystemLibraries) set(MSVC_VERSION ${MSVC_TOOLSET_VERSION}) set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE) if (CMAKE_BUILD_TYPE STREQUAL "Debug") set(CMAKE_INSTALL_DEBUG_LIBRARIES TRUE) - endif() + endif() + include(InstallRequiredSystemLibraries) find_file(UCRTBASE_LIB "ucrtbase.dll" PATHS "C:/Windows/System32") install(FILES ${UCRTBASE_LIB} DESTINATION "${CMAKE_INSTALL_BINDIR}")