From 6d454b659c2d33bf0fffdf066342e009db11d853 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Thu, 30 Mar 2023 18:19:23 +0200 Subject: [PATCH] Change 'EXECUTABLE-config' URI handler to request a confirmation to the user before using it. Delay its execution on startup. Add auto_apply_provisioning_config_uri_handler rc to remove confirmations. Default URL uses https. Fix dialog description with wrapping text and elides. Fix busy color. Fix duplicate connections on restarting App that done multiple CLI commands. --- CHANGELOG.md | 1 + linphone-app/assets/languages/cs.ts | 5 + linphone-app/assets/languages/da.ts | 5 + linphone-app/assets/languages/de.ts | 5 + linphone-app/assets/languages/en.ts | 5 + linphone-app/assets/languages/es.ts | 5 + linphone-app/assets/languages/fr_FR.ts | 5 + linphone-app/assets/languages/hu.ts | 5 + linphone-app/assets/languages/it.ts | 5 + linphone-app/assets/languages/ja.ts | 5 + linphone-app/assets/languages/lt.ts | 5 + linphone-app/assets/languages/pt_BR.ts | 5 + linphone-app/assets/languages/ru.ts | 5 + linphone-app/assets/languages/sv.ts | 5 + linphone-app/assets/languages/tr.ts | 5 + linphone-app/assets/languages/uk.ts | 5 + linphone-app/assets/languages/zh_CN.ts | 5 + linphone-app/src/app/App.cpp | 139 +++++++++++------- linphone-app/src/app/App.hpp | 6 +- linphone-app/src/app/cli/Cli.cpp | 20 ++- .../src/components/settings/SettingsModel.cpp | 10 ++ .../src/components/settings/SettingsModel.hpp | 5 + .../Common/Dialog/DialogDescription.qml | 3 +- .../ui/views/App/Main/Conversation.qml | 2 +- linphone-app/ui/views/App/Main/MainWindow.qml | 15 ++ 25 files changed, 214 insertions(+), 67 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d901a3b2d..8e1aa36b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Display last seen for contacts. - New language support: Czech - An option to set dial prefix and its use on numbers. +- Fetch remote provisioning from URI handler and with confirmation. ## 5.0.15 - undefined diff --git a/linphone-app/assets/languages/cs.ts b/linphone-app/assets/languages/cs.ts index 90483c397..b08b6c24b 100644 --- a/linphone-app/assets/languages/cs.ts +++ b/linphone-app/assets/languages/cs.ts @@ -1823,6 +1823,11 @@ Klikněte zde: <a href="%1">%1</a> 'Video conference URI is not set. You have to change it in your account settings in order to create new meetings.' : Tooltip to warn the user to change a setting to activate an action. URI videokonference není nastaven. Abyste mohli vytvářet nové konference, musíte jej změnit v nastavení účtu. + + confirmFetchUri + 'Do you want to download and apply configuration from this URL?' : text to confirm to fetch a specified URL + + MainWindowMenuBar diff --git a/linphone-app/assets/languages/da.ts b/linphone-app/assets/languages/da.ts index 1e76bec4c..08f9c8ae4 100644 --- a/linphone-app/assets/languages/da.ts +++ b/linphone-app/assets/languages/da.ts @@ -1813,6 +1813,11 @@ Klik her: <a href="%1">%1</a> 'Video conference URI is not set. You have to change it in your account settings in order to create new meetings.' : Tooltip to warn the user to change a setting to activate an action. + + confirmFetchUri + 'Do you want to download and apply configuration from this URL?' : text to confirm to fetch a specified URL + + MainWindowMenuBar diff --git a/linphone-app/assets/languages/de.ts b/linphone-app/assets/languages/de.ts index dd74d13f2..d4838a083 100644 --- a/linphone-app/assets/languages/de.ts +++ b/linphone-app/assets/languages/de.ts @@ -1813,6 +1813,11 @@ Klicken Sie hier: <a href="%1">%1</a> 'Video conference URI is not set. You have to change it in your account settings in order to create new meetings.' : Tooltip to warn the user to change a setting to activate an action. + + confirmFetchUri + 'Do you want to download and apply configuration from this URL?' : text to confirm to fetch a specified URL + + MainWindowMenuBar diff --git a/linphone-app/assets/languages/en.ts b/linphone-app/assets/languages/en.ts index 44bc9956d..28ebce10a 100644 --- a/linphone-app/assets/languages/en.ts +++ b/linphone-app/assets/languages/en.ts @@ -1813,6 +1813,11 @@ Click here: <a href="%1">%1</a> 'Video conference URI is not set. You have to change it in your account settings in order to create new meetings.' : Tooltip to warn the user to change a setting to activate an action. Video conference URI is not set. You have to change it in your account settings in order to create new conferences. + + confirmFetchUri + 'Do you want to download and apply configuration from this URL?' : text to confirm to fetch a specified URL + Do you want to download and apply configuration from this URL? + MainWindowMenuBar diff --git a/linphone-app/assets/languages/es.ts b/linphone-app/assets/languages/es.ts index f34dd5941..9dea88389 100644 --- a/linphone-app/assets/languages/es.ts +++ b/linphone-app/assets/languages/es.ts @@ -1813,6 +1813,11 @@ Haga clic aquí: <a href="%1">%1 </a> 'Video conference URI is not set. You have to change it in your account settings in order to create new meetings.' : Tooltip to warn the user to change a setting to activate an action. + + confirmFetchUri + 'Do you want to download and apply configuration from this URL?' : text to confirm to fetch a specified URL + + MainWindowMenuBar diff --git a/linphone-app/assets/languages/fr_FR.ts b/linphone-app/assets/languages/fr_FR.ts index 243608499..d8385a059 100644 --- a/linphone-app/assets/languages/fr_FR.ts +++ b/linphone-app/assets/languages/fr_FR.ts @@ -1813,6 +1813,11 @@ Cliquez ici : <a href="%1">%1</a> 'Video conference URI is not set. You have to change it in your account settings in order to create new meetings.' : Tooltip to warn the user to change a setting to activate an action. L'URI de conférence vidéo n'a pas été renseigné. Vous devez la mettre à jour dans les options de comptes pour pouvoir créer de nouvelles réunions. + + confirmFetchUri + 'Do you want to download and apply configuration from this URL?' : text to confirm to fetch a specified URL + + MainWindowMenuBar diff --git a/linphone-app/assets/languages/hu.ts b/linphone-app/assets/languages/hu.ts index 934f16451..5b12814e6 100644 --- a/linphone-app/assets/languages/hu.ts +++ b/linphone-app/assets/languages/hu.ts @@ -1803,6 +1803,11 @@ Kattintson ide: <a href="%1">%1</a> 'Video conference URI is not set. You have to change it in your account settings in order to create new meetings.' : Tooltip to warn the user to change a setting to activate an action. + + confirmFetchUri + 'Do you want to download and apply configuration from this URL?' : text to confirm to fetch a specified URL + + MainWindowMenuBar diff --git a/linphone-app/assets/languages/it.ts b/linphone-app/assets/languages/it.ts index 0607b09b8..0f1251582 100644 --- a/linphone-app/assets/languages/it.ts +++ b/linphone-app/assets/languages/it.ts @@ -1813,6 +1813,11 @@ Clicca: <a href="%1">%1</a> 'Video conference URI is not set. You have to change it in your account settings in order to create new meetings.' : Tooltip to warn the user to change a setting to activate an action. L'URI della video conferenza non è stato impostato. Devi cambiarlo nelle impostazioni del tuo account per poter creare nuove conferenze. + + confirmFetchUri + 'Do you want to download and apply configuration from this URL?' : text to confirm to fetch a specified URL + + MainWindowMenuBar diff --git a/linphone-app/assets/languages/ja.ts b/linphone-app/assets/languages/ja.ts index 44b75ec40..6cf02ba2c 100644 --- a/linphone-app/assets/languages/ja.ts +++ b/linphone-app/assets/languages/ja.ts @@ -1803,6 +1803,11 @@ 'Video conference URI is not set. You have to change it in your account settings in order to create new meetings.' : Tooltip to warn the user to change a setting to activate an action. ビデオ会議のURIが設定されていません。新しく会議を作成するためには、アカウント設定で変更する必要があります。 + + confirmFetchUri + 'Do you want to download and apply configuration from this URL?' : text to confirm to fetch a specified URL + + MainWindowMenuBar diff --git a/linphone-app/assets/languages/lt.ts b/linphone-app/assets/languages/lt.ts index 34c68dba6..d12396e7c 100644 --- a/linphone-app/assets/languages/lt.ts +++ b/linphone-app/assets/languages/lt.ts @@ -1823,6 +1823,11 @@ Spustelėkite čia: <a href="%1">%1</a> 'Video conference URI is not set. You have to change it in your account settings in order to create new meetings.' : Tooltip to warn the user to change a setting to activate an action. + + confirmFetchUri + 'Do you want to download and apply configuration from this URL?' : text to confirm to fetch a specified URL + + MainWindowMenuBar diff --git a/linphone-app/assets/languages/pt_BR.ts b/linphone-app/assets/languages/pt_BR.ts index f4aaa8faa..d826a64fb 100644 --- a/linphone-app/assets/languages/pt_BR.ts +++ b/linphone-app/assets/languages/pt_BR.ts @@ -1813,6 +1813,11 @@ Clique aqui: <a href="%1">%1 </a> 'Video conference URI is not set. You have to change it in your account settings in order to create new meetings.' : Tooltip to warn the user to change a setting to activate an action. A URI não está configurada para videoconferência. Você tem que mudá-lo nas configurações de sua conta a fim de criar novas conferências. + + confirmFetchUri + 'Do you want to download and apply configuration from this URL?' : text to confirm to fetch a specified URL + + MainWindowMenuBar diff --git a/linphone-app/assets/languages/ru.ts b/linphone-app/assets/languages/ru.ts index 1b46e9498..0d9b445f1 100644 --- a/linphone-app/assets/languages/ru.ts +++ b/linphone-app/assets/languages/ru.ts @@ -1823,6 +1823,11 @@ 'Video conference URI is not set. You have to change it in your account settings in order to create new meetings.' : Tooltip to warn the user to change a setting to activate an action. URI видеоконференции не задан. Измените его в параметрах своей учётной записи, чтобы создавать новые конференции. + + confirmFetchUri + 'Do you want to download and apply configuration from this URL?' : text to confirm to fetch a specified URL + + MainWindowMenuBar diff --git a/linphone-app/assets/languages/sv.ts b/linphone-app/assets/languages/sv.ts index 3cda32e05..c9a7d189a 100644 --- a/linphone-app/assets/languages/sv.ts +++ b/linphone-app/assets/languages/sv.ts @@ -1813,6 +1813,11 @@ Klicka här: <a href="%1">%1</a> 'Video conference URI is not set. You have to change it in your account settings in order to create new meetings.' : Tooltip to warn the user to change a setting to activate an action. + + confirmFetchUri + 'Do you want to download and apply configuration from this URL?' : text to confirm to fetch a specified URL + + MainWindowMenuBar diff --git a/linphone-app/assets/languages/tr.ts b/linphone-app/assets/languages/tr.ts index 93dcaff17..59b39d476 100644 --- a/linphone-app/assets/languages/tr.ts +++ b/linphone-app/assets/languages/tr.ts @@ -1803,6 +1803,11 @@ Buraya tıklayın: <a href="%1">%1</a> 'Video conference URI is not set. You have to change it in your account settings in order to create new meetings.' : Tooltip to warn the user to change a setting to activate an action. + + confirmFetchUri + 'Do you want to download and apply configuration from this URL?' : text to confirm to fetch a specified URL + + MainWindowMenuBar diff --git a/linphone-app/assets/languages/uk.ts b/linphone-app/assets/languages/uk.ts index 3523d7e5f..fc05e9510 100644 --- a/linphone-app/assets/languages/uk.ts +++ b/linphone-app/assets/languages/uk.ts @@ -1823,6 +1823,11 @@ 'Video conference URI is not set. You have to change it in your account settings in order to create new meetings.' : Tooltip to warn the user to change a setting to activate an action. + + confirmFetchUri + 'Do you want to download and apply configuration from this URL?' : text to confirm to fetch a specified URL + + MainWindowMenuBar diff --git a/linphone-app/assets/languages/zh_CN.ts b/linphone-app/assets/languages/zh_CN.ts index 6130aebd7..f13eb4be1 100644 --- a/linphone-app/assets/languages/zh_CN.ts +++ b/linphone-app/assets/languages/zh_CN.ts @@ -1803,6 +1803,11 @@ 'Video conference URI is not set. You have to change it in your account settings in order to create new meetings.' : Tooltip to warn the user to change a setting to activate an action. + + confirmFetchUri + 'Do you want to download and apply configuration from this URL?' : text to confirm to fetch a specified URL + + MainWindowMenuBar diff --git a/linphone-app/src/app/App.cpp b/linphone-app/src/app/App.cpp index b89685a5a..1e872707b 100644 --- a/linphone-app/src/app/App.cpp +++ b/linphone-app/src/app/App.cpp @@ -165,34 +165,60 @@ static inline string getConfigPathIfExists (const QCommandLineParser &parser) { return configPath; } -bool App::setFetchConfig (QCommandLineParser *parser) { - bool fetched = false; - QString filePath = parser->value("fetch-config"); +QString App::getFetchConfig (QString filePath, bool * error) { + *error = false; if( !filePath.isEmpty()){ if(QUrl(filePath).isRelative()){// this is a file path filePath = Utils::coreStringToAppString(Paths::getConfigFilePath(filePath, false)); if(!filePath.isEmpty()) filePath = "file://"+filePath; } - if(!filePath.isEmpty()){ - auto instance = CoreManager::getInstance(); - if(instance){ - auto core = instance->getCore(); - if(core){ - filePath.replace('\\','/'); - if(core->setProvisioningUri(Utils::appStringToCoreString(filePath)) == 0){ - parser->process(cleanParserKeys(parser, QStringList("fetch-config")));// Remove this parameter from the parser - fetched = true; - }else - fetched = false; - } - } - } - if(!fetched){ + if(filePath.isEmpty()){ qWarning() <<"Remote provisionning cannot be retrieved. Command have beend cleaned"; - createParser(); + *error = true; } } + return filePath; +} + +QString App::getFetchConfig (QCommandLineParser *parser) { + QString filePath = parser->value("fetch-config"); + bool error = false; + filePath = getFetchConfig(filePath, &error); + if(error) { + qWarning() <<"Remote provisionning cannot be retrieved. Command have beend cleaned"; + createParser(); + }else if( !filePath.isEmpty()) + mParser->process(cleanParserKeys(mParser, QStringList("fetch-config")));// Remove this parameter from the parser + return filePath; +} + +void App::useFetchConfig(const QString& filePath){ + if( !filePath.isEmpty()){ + if(CoreManager::getInstance()->getSettingsModel()->getAutoApplyProvisioningConfigUriHandlerEnabled()) + setFetchConfig(filePath); + else + emit requestFetchConfig(filePath); + } +} + +bool App::setFetchConfig (QString filePath) { + bool fetched = false; + qDebug() << "setFetchConfig with " << filePath; + if(!filePath.isEmpty()){ + auto instance = CoreManager::getInstance(); + if(instance){ + auto core = instance->getCore(); + if(core){ + filePath.replace('\\','/'); + fetched = core->setProvisioningUri(Utils::appStringToCoreString(filePath)) == 0; + } + } + } + if(!fetched){ + qWarning() <<"Remote provisionning cannot be retrieved. Command have beend cleaned"; + }else + restart(); return fetched; } // ----------------------------------------------------------------------------- @@ -255,6 +281,13 @@ App::App (int &argc, char *argv[]) : SingleApplication(argc, argv, true, Mode::U qInfo() << QStringLiteral("Starting " APPLICATION_NAME " (bin: " EXECUTABLE_NAME ")"); qInfo() << QStringLiteral("Use locale: %1 with language: %2").arg(mLocale.name()).arg(QLocale::languageToString(mLocale.language())); + + // Deal with received messages and CLI. + QObject::connect(this, &App::receivedMessage, this, [](int, const QByteArray &byteArray) { + QString command(byteArray); + qInfo() << QStringLiteral("Received command from other application: `%1`.").arg(command); + Cli::executeCommand(command); + }); } App::~App () { @@ -321,6 +354,7 @@ static QQuickWindow *createSubWindow (QQmlApplicationEngine *engine, const char // ----------------------------------------------------------------------------- void App::initContentApp () { + std::string configPath; shared_ptr config; bool mustBeIconified = false; @@ -329,7 +363,6 @@ void App::initContentApp () { // Destroy qml components and linphone core if necessary. if (mEngine) { needRestart = false; - setFetchConfig(mParser); setOpened(false); qInfo() << QStringLiteral("Restarting app..."); @@ -357,12 +390,7 @@ void App::initContentApp () { // Don't quit if last window is closed!!! setQuitOnLastWindowClosed(false); - // Deal with received messages and CLI. - QObject::connect(this, &App::receivedMessage, this, [](int, const QByteArray &byteArray) { - QString command(byteArray); - qInfo() << QStringLiteral("Received command from other application: `%1`.").arg(command); - Cli::executeCommand(command); - }); + #ifndef Q_OS_MACOS mustBeIconified = mParser->isSet("iconified"); @@ -453,8 +481,9 @@ void App::initContentApp () { CoreManager::getInstance(), &CoreManager::coreManagerInitialized, CoreManager::getInstance(), [this, mustBeIconified]() mutable { - if(CoreManager::getInstance()->started()) + if(CoreManager::getInstance()->started()) { openAppAfterInit(mustBeIconified); + } } ); @@ -1062,37 +1091,35 @@ void App::openAppAfterInit (bool mustBeIconified) { checkForUpdates(); #endif // ifdef ENABLE_UPDATE_CHECK - - if(setFetchConfig(mParser)) - restart(); - else{ - // Launch call if wanted and clean parser - if( mParser->isSet("call") && coreManager->isLastRemoteProvisioningGood()){ - QString sipAddress = mParser->value("call"); - mParser->parse(cleanParserKeys(mParser, QStringList("call")));// Clean call from parser - if(coreManager->started()){ - coreManager->getCallsListModel()->launchAudioCall(sipAddress); - }else{ - QObject * context = new QObject(); - QObject::connect(CoreManager::getInstance(), &CoreManager::coreManagerInitialized,context, - [sipAddress,coreManager, context]() mutable { - if(context){ - delete context; - context = nullptr; - coreManager->getCallsListModel()->launchAudioCall(sipAddress); - } - }); - } + // Launch call if wanted and clean parser + if( mParser->isSet("call") && coreManager->isLastRemoteProvisioningGood()){ + QString sipAddress = mParser->value("call"); + mParser->parse(cleanParserKeys(mParser, QStringList("call")));// Clean call from parser + if(coreManager->started()){ + coreManager->getCallsListModel()->launchAudioCall(sipAddress); + }else{ + QObject * context = new QObject(); + QObject::connect(CoreManager::getInstance(), &CoreManager::coreManagerInitialized,context, + [sipAddress,coreManager, context]() mutable { + if(context){ + delete context; + context = nullptr; + coreManager->getCallsListModel()->launchAudioCall(sipAddress); + } + }); } -#ifndef __APPLE__ - if (!mustBeIconified) - smartShowWindow(mainWindow); -#else - Q_UNUSED(mustBeIconified); - smartShowWindow(mainWindow); -#endif - setOpened(true); } + QString fetchFilePath = getFetchConfig(mParser); + mustBeIconified = mustBeIconified && fetchFilePath.isEmpty(); +#ifndef __APPLE__ + if (!mustBeIconified) + smartShowWindow(mainWindow); +#else + Q_UNUSED(mustBeIconified); + smartShowWindow(mainWindow); +#endif + setOpened(true); + useFetchConfig(fetchFilePath); } // ----------------------------------------------------------------------------- diff --git a/linphone-app/src/app/App.hpp b/linphone-app/src/app/App.hpp index 7e48b935f..8ac8958d8 100644 --- a/linphone-app/src/app/App.hpp +++ b/linphone-app/src/app/App.hpp @@ -63,7 +63,10 @@ public: QString getCommandArgument (); - bool setFetchConfig (QCommandLineParser *parser); + QString getFetchConfig (QString filePath, bool * error); + QString getFetchConfig (QCommandLineParser *parser);// Return file path of fetch-config + void useFetchConfig(const QString& filePath); // Check if the fetch is auto or not and make gui request if needed. + Q_INVOKABLE bool setFetchConfig (QString filePath); // return true if filepath has been set. #ifdef Q_OS_MACOS bool event (QEvent *event) override; @@ -131,6 +134,7 @@ signals: void autoStartChanged (bool enabled); void opened (bool status); + void requestFetchConfig(QString filePath); private: void createParser (); diff --git a/linphone-app/src/app/cli/Cli.cpp b/linphone-app/src/app/cli/Cli.cpp index 941db718e..937c756ee 100644 --- a/linphone-app/src/app/cli/Cli.cpp +++ b/linphone-app/src/app/cli/Cli.cpp @@ -488,7 +488,7 @@ void Cli::executeCommand (const QString &command, CommandFormat *format) { // Detect if command is a CLI by testing commands const QString &functionName = parseFunctionName(command); - + const std::string configURI = string(EXECUTABLE_NAME)+"-config"; if(!functionName.isEmpty()){// It is a CLI qInfo() << QStringLiteral("Detecting cli command: `%1`...").arg(command); QHash args = parseArgs(command); @@ -505,7 +505,7 @@ void Cli::executeCommand (const QString &command, CommandFormat *format) { }else{ scheme = tempSipAddress[0].toStdString(); bool ok = false; - for (const string &validScheme : { string("sip"), "sip-"+string(EXECUTABLE_NAME), string("sips"), "sips-"+string(EXECUTABLE_NAME), string("tel"), string("callto"), string(EXECUTABLE_NAME)+ "-config" }) + for (const string &validScheme : { string("sip"), "sip-"+string(EXECUTABLE_NAME), string("sips"), "sips-"+string(EXECUTABLE_NAME), string("tel"), string("callto"), configURI }) if (scheme == validScheme) ok = true; if( !ok){ @@ -515,18 +515,22 @@ void Cli::executeCommand (const QString &command, CommandFormat *format) { tempSipAddress[0] = "sip"; transformedCommand = tempSipAddress.join(':'); } - if( scheme == string(EXECUTABLE_NAME)+"-config" ){ + if( scheme == configURI ){ QHash args = parseArgs(command); + QString fetchUrl; if(args.contains("fetch-config")) - args["fetch-config"] = QByteArray::fromBase64(args["fetch-config"].toUtf8() ); + fetchUrl = QByteArray::fromBase64(args["fetch-config"].toUtf8() ); else { - QUrl url(command); - url.setScheme("https"); - args["fetch-config"] = url.toString(); + QUrl url(command.mid(configURI.size()+1));// Remove 'exec-config:' + if(url.scheme().isEmpty()) + url.setScheme("https"); + fetchUrl = url.toString(); } if (format) *format = CliFormat; - mCommands["show"].execute(args); + QHash dummy; + mCommands["show"].execute(dummy);// Just open the app. + App::getInstance()->useFetchConfig(fetchUrl); }else{ shared_ptr address; if(Utils::isUsername(transformedCommand)){ diff --git a/linphone-app/src/components/settings/SettingsModel.cpp b/linphone-app/src/components/settings/SettingsModel.cpp index 9b4bcb321..91eb54e0c 100644 --- a/linphone-app/src/components/settings/SettingsModel.cpp +++ b/linphone-app/src/components/settings/SettingsModel.cpp @@ -213,6 +213,16 @@ void SettingsModel::setFetchRemoteConfigurationEnabled (bool status) { emit fetchRemoteConfigurationEnabledChanged(status); } +bool SettingsModel::getAutoApplyProvisioningConfigUriHandlerEnabled () const { + return !!mConfig->getInt(UiSection, "auto_apply_provisioning_config_uri_handler", 0); +} + +void SettingsModel::setAutoApplyProvisioningConfigUriHandlerEnabled (bool status) { + mConfig->setInt(UiSection, "auto_apply_provisioning_config_uri_handler", status); + emit autoApplyProvisioningConfigUriHandlerEnabledChanged(); +} + + // --------------------------------------------------------------------------- bool SettingsModel::getAssistantSupportsPhoneNumbers () const { diff --git a/linphone-app/src/components/settings/SettingsModel.hpp b/linphone-app/src/components/settings/SettingsModel.hpp index 93fe6c62e..773198710 100644 --- a/linphone-app/src/components/settings/SettingsModel.hpp +++ b/linphone-app/src/components/settings/SettingsModel.hpp @@ -51,6 +51,7 @@ class SettingsModel : public QObject { Q_PROPERTY(bool fetchRemoteConfigurationEnabled READ getFetchRemoteConfigurationEnabled WRITE setFetchRemoteConfigurationEnabled NOTIFY fetchRemoteConfigurationEnabledChanged) Q_PROPERTY(bool useAppSipAccountEnabled READ getUseAppSipAccountEnabled WRITE setUseAppSipAccountEnabled NOTIFY useAppSipAccountEnabledChanged) Q_PROPERTY(bool useOtherSipAccountEnabled READ getUseOtherSipAccountEnabled WRITE setUseOtherSipAccountEnabled NOTIFY useOtherSipAccountEnabledChanged) + Q_PROPERTY(bool autoApplyProvisioningConfigUriHandlerEnabled READ getAutoApplyProvisioningConfigUriHandlerEnabled WRITE setAutoApplyProvisioningConfigUriHandlerEnabled NOTIFY autoApplyProvisioningConfigUriHandlerEnabledChanged) Q_PROPERTY(bool assistantSupportsPhoneNumbers READ getAssistantSupportsPhoneNumbers WRITE setAssistantSupportsPhoneNumbers NOTIFY assistantSupportsPhoneNumbersChanged) // Webviews config @@ -278,6 +279,9 @@ public: bool getFetchRemoteConfigurationEnabled () const; void setFetchRemoteConfigurationEnabled (bool status); + bool getAutoApplyProvisioningConfigUriHandlerEnabled () const; + void setAutoApplyProvisioningConfigUriHandlerEnabled (bool status); + bool getUseAppSipAccountEnabled () const; void setUseAppSipAccountEnabled (bool status); @@ -675,6 +679,7 @@ signals: void fetchRemoteConfigurationEnabledChanged (bool status); void useAppSipAccountEnabledChanged (bool status); void useOtherSipAccountEnabledChanged (bool status); + void autoApplyProvisioningConfigUriHandlerEnabledChanged(); void assistantSupportsPhoneNumbersChanged (bool status); diff --git a/linphone-app/ui/modules/Common/Dialog/DialogDescription.qml b/linphone-app/ui/modules/Common/Dialog/DialogDescription.qml index efe941c41..042538086 100644 --- a/linphone-app/ui/modules/Common/Dialog/DialogDescription.qml +++ b/linphone-app/ui/modules/Common/Dialog/DialogDescription.qml @@ -29,6 +29,7 @@ Item { font.pointSize: DialogStyle.description.pointSize horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter - wrapMode: Text.WordWrap + wrapMode: Text.Wrap + elide: Text.ElideRight } } diff --git a/linphone-app/ui/views/App/Main/Conversation.qml b/linphone-app/ui/views/App/Main/Conversation.qml index f6818425c..1a442c905 100644 --- a/linphone-app/ui/views/App/Main/Conversation.qml +++ b/linphone-app/ui/views/App/Main/Conversation.qml @@ -594,7 +594,7 @@ ColumnLayout { anchors.left: filterButtons.right anchors.leftMargin: 50 anchors.verticalCenter: parent.verticalCenter - color: BusyIndicatorStyle.alternateColor + color: BusyIndicatorStyle.alternateColor.color running: chatArea.tryingToLoadMoreEntries } diff --git a/linphone-app/ui/views/App/Main/MainWindow.qml b/linphone-app/ui/views/App/Main/MainWindow.qml index 66b162ff1..259ac1aec 100644 --- a/linphone-app/ui/views/App/Main/MainWindow.qml +++ b/linphone-app/ui/views/App/Main/MainWindow.qml @@ -438,4 +438,19 @@ ApplicationWindow { mainSearchBar.text = sipAddress } } + Connections{ + target: App + onRequestFetchConfig: { + window.attachVirtualWindow(Utils.buildCommonDialogUri('ConfirmDialog'), { + flat: true, + //: 'Do you want to download and apply configuration from this URL?' : text to confirm to fetch a specified URL + descriptionText: ''+qsTr('confirmFetchUri') + +'

'+filePath, + }, function (status) { + if (status) { + App.setFetchConfig(filePath) + } + }) + } + } }