Commit 7cf7ad83 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/views/App/Main/Assistant/FetchRemoteConfiguration): view done

parent 0106e497
...@@ -610,6 +610,14 @@ Server url not configured.</translation> ...@@ -610,6 +610,14 @@ Server url not configured.</translation>
<source>urlLabel</source> <source>urlLabel</source>
<translation>URL</translation> <translation>URL</translation>
</message> </message>
<message>
<source>remoteProvisioningError</source>
<translation>Unable to set this remote provisioning uri.</translation>
</message>
<message>
<source>remoteProvisioningUpdateDescription</source>
<translation>It&apos;s necessary to restart the application. Do you want to restart now?</translation>
</message>
</context> </context>
<context> <context>
<name>FileMessage</name> <name>FileMessage</name>
......
...@@ -610,6 +610,14 @@ Url du serveur non configurée.</translation> ...@@ -610,6 +610,14 @@ Url du serveur non configurée.</translation>
<source>urlLabel</source> <source>urlLabel</source>
<translation>URL</translation> <translation>URL</translation>
</message> </message>
<message>
<source>remoteProvisioningError</source>
<translation>Impossible d&apos;utiliser cette URL de configuration.</translation>
</message>
<message>
<source>remoteProvisioningUpdateDescription</source>
<translation>Voulez-vous redémarrer maintenant pour prendre en compte ces modifications ?</translation>
</message>
</context> </context>
<context> <context>
<name>FileMessage</name> <name>FileMessage</name>
......
...@@ -645,3 +645,16 @@ void SettingsModel::setSavedVideosFolder (const QString &folder) { ...@@ -645,3 +645,16 @@ void SettingsModel::setSavedVideosFolder (const QString &folder) {
mConfig->setString(UI_SECTION, "saved_videos_folder", ::Utils::qStringToLinphoneString(_folder)); mConfig->setString(UI_SECTION, "saved_videos_folder", ::Utils::qStringToLinphoneString(_folder));
emit savedVideosFolderChanged(_folder); emit savedVideosFolderChanged(_folder);
} }
// -----------------------------------------------------------------------------
QString SettingsModel::getRemoteProvisioning () const {
return ::Utils::linphoneStringToQString(CoreManager::getInstance()->getCore()->getProvisioningUri());
}
void SettingsModel::setRemoteProvisioning (const QString &remoteProvisioning) {
if (!CoreManager::getInstance()->getCore()->setProvisioningUri(::Utils::qStringToLinphoneString(remoteProvisioning)))
emit remoteProvisioningChanged(remoteProvisioning);
else
emit remoteProvisioningNotChanged(remoteProvisioning);
}
...@@ -111,6 +111,8 @@ class SettingsModel : public QObject { ...@@ -111,6 +111,8 @@ class SettingsModel : public QObject {
// Misc. --------------------------------------------------------------------- // Misc. ---------------------------------------------------------------------
Q_PROPERTY(QString remoteProvisioning READ getRemoteProvisioning WRITE setRemoteProvisioning NOTIFY remoteProvisioningChanged);
Q_PROPERTY(QString savedScreenshotsFolder READ getSavedScreenshotsFolder WRITE setSavedScreenshotsFolder NOTIFY savedScreenshotsFolderChanged); Q_PROPERTY(QString savedScreenshotsFolder READ getSavedScreenshotsFolder WRITE setSavedScreenshotsFolder NOTIFY savedScreenshotsFolderChanged);
Q_PROPERTY(QString savedVideosFolder READ getSavedVideosFolder WRITE setSavedVideosFolder NOTIFY savedVideosFolderChanged); Q_PROPERTY(QString savedVideosFolder READ getSavedVideosFolder WRITE setSavedVideosFolder NOTIFY savedVideosFolderChanged);
...@@ -262,6 +264,9 @@ public: ...@@ -262,6 +264,9 @@ public:
QString getSavedVideosFolder () const; QString getSavedVideosFolder () const;
void setSavedVideosFolder (const QString &folder); void setSavedVideosFolder (const QString &folder);
QString getRemoteProvisioning () const;
void setRemoteProvisioning (const QString &remoteProvisioning);
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
static const std::string UI_SECTION; static const std::string UI_SECTION;
...@@ -335,6 +340,9 @@ signals: ...@@ -335,6 +340,9 @@ signals:
void savedScreenshotsFolderChanged (const QString &folder); void savedScreenshotsFolderChanged (const QString &folder);
void savedVideosFolderChanged (const QString &folder); void savedVideosFolderChanged (const QString &folder);
void remoteProvisioningChanged (const QString &remoteProvisioning);
void remoteProvisioningNotChanged (const QString &remoteProvisioning);
private: private:
std::shared_ptr<linphone::Config> mConfig; std::shared_ptr<linphone::Config> mConfig;
}; };
......
import QtQuick 2.7
import Common 1.0 import Common 1.0
import Linphone 1.0 import Linphone 1.0
import Utils 1.0
// ============================================================================= // =============================================================================
AssistantAbstractView { AssistantAbstractView {
mainAction: (function () { mainAction: requestBlock.execute
App.restart()
})
mainActionEnabled: url.text.length > 0 mainActionEnabled: url.text.length > 0
mainActionLabel: qsTr('confirmAction') mainActionLabel: qsTr('confirmAction')
...@@ -15,18 +15,55 @@ AssistantAbstractView { ...@@ -15,18 +15,55 @@ AssistantAbstractView {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
Form { Connections {
target: SettingsModel
onRemoteProvisioningChanged: {
requestBlock.stop('')
window.detachVirtualWindow()
window.attachVirtualWindow(Utils.buildDialogUri('ConfirmDialog'), {
descriptionText: qsTr('remoteProvisioningUpdateDescription'),
}, function (status) {
if (status) {
App.restart()
} else {
window.setView('Home')
}
})
}
onRemoteProvisioningNotChanged: requestBlock.stop(qsTr('remoteProvisioningError'))
}
// ---------------------------------------------------------------------------
Column {
anchors.fill: parent anchors.fill: parent
orientation: Qt.Vertical
FormLine { Form {
FormGroup { orientation: Qt.Vertical
label: qsTr('urlLabel') width: parent.width
FormLine {
FormGroup {
label: qsTr('urlLabel')
TextField { TextField {
id: url id: url
}
} }
} }
} }
RequestBlock {
id: requestBlock
action: (function () {
SettingsModel.remoteProvisioning = url.text
})
width: parent.width
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment