mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-07 14:44:01 +00:00
feat(ui/views/App/Main/Assistant/FetchRemoteConfiguration): view done
This commit is contained in:
parent
0106e49701
commit
7cf7ad834d
5 changed files with 85 additions and 11 deletions
|
|
@ -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'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'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;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
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
|
||||
|
||||
TextField {
|
||||
id: url
|
||||
FormLine {
|
||||
FormGroup {
|
||||
label: qsTr('urlLabel')
|
||||
|
||||
TextField {
|
||||
id: url
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RequestBlock {
|
||||
id: requestBlock
|
||||
|
||||
action: (function () {
|
||||
SettingsModel.remoteProvisioning = url.text
|
||||
})
|
||||
|
||||
width: parent.width
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue