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>
<source>urlLabel</source>
<translation>URL</translation>
</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>
<name>FileMessage</name>
......
......@@ -610,6 +610,14 @@ Url du serveur non configurée.</translation>
<source>urlLabel</source>
<translation>URL</translation>
</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>
<name>FileMessage</name>
......
......@@ -645,3 +645,16 @@ void SettingsModel::setSavedVideosFolder (const QString &folder) {
mConfig->setString(UI_SECTION, "saved_videos_folder", ::Utils::qStringToLinphoneString(_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 {
// Misc. ---------------------------------------------------------------------
Q_PROPERTY(QString remoteProvisioning READ getRemoteProvisioning WRITE setRemoteProvisioning NOTIFY remoteProvisioningChanged);
Q_PROPERTY(QString savedScreenshotsFolder READ getSavedScreenshotsFolder WRITE setSavedScreenshotsFolder NOTIFY savedScreenshotsFolderChanged);
Q_PROPERTY(QString savedVideosFolder READ getSavedVideosFolder WRITE setSavedVideosFolder NOTIFY savedVideosFolderChanged);
......@@ -262,6 +264,9 @@ public:
QString getSavedVideosFolder () const;
void setSavedVideosFolder (const QString &folder);
QString getRemoteProvisioning () const;
void setRemoteProvisioning (const QString &remoteProvisioning);
// ---------------------------------------------------------------------------
static const std::string UI_SECTION;
......@@ -335,6 +340,9 @@ signals:
void savedScreenshotsFolderChanged (const QString &folder);
void savedVideosFolderChanged (const QString &folder);
void remoteProvisioningChanged (const QString &remoteProvisioning);
void remoteProvisioningNotChanged (const QString &remoteProvisioning);
private:
std::shared_ptr<linphone::Config> mConfig;
};
......
import QtQuick 2.7
import Common 1.0
import Linphone 1.0
import Utils 1.0
// =============================================================================
AssistantAbstractView {
mainAction: (function () {
App.restart()
})
mainAction: requestBlock.execute
mainActionEnabled: url.text.length > 0
mainActionLabel: qsTr('confirmAction')
......@@ -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
orientation: Qt.Vertical
FormLine {
FormGroup {
label: qsTr('urlLabel')
Form {
orientation: Qt.Vertical
width: parent.width
FormLine {
FormGroup {
label: qsTr('urlLabel')
TextField {
id: url
TextField {
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