Commit 93435971 authored by Ronan's avatar Ronan

feat(Settings): add developer options to disable assistant buttons

parent 1c104951
......@@ -1401,6 +1401,26 @@ Server URL ist nicht konfiguriert.</translation>
<source>defaultDisplayNameLabel</source>
<translation>Anzeigename</translation>
</message>
<message>
<source>assistantTitle</source>
<translation>Assistent</translation>
</message>
<message>
<source>createAppSipAccountEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>useAppSipAccountEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>useOtherSipAccountEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>fetchRemoteConfigurationEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsSipAccountsEdit</name>
......
......@@ -1406,6 +1406,26 @@ your friend&apos;s SIP address or username.</translation>
<source>defaultDisplayNameLabel</source>
<translation>Display name</translation>
</message>
<message>
<source>assistantTitle</source>
<translation>Assistant</translation>
</message>
<message>
<source>createAppSipAccountEnabledLabel</source>
<translation>Enable account creation</translation>
</message>
<message>
<source>useAppSipAccountEnabledLabel</source>
<translation>Enable account usage</translation>
</message>
<message>
<source>useOtherSipAccountEnabledLabel</source>
<translation>Enable generic account usage</translation>
</message>
<message>
<source>fetchRemoteConfigurationEnabledLabel</source>
<translation>Enable configuration fetch</translation>
</message>
</context>
<context>
<name>SettingsSipAccountsEdit</name>
......
......@@ -1404,6 +1404,26 @@ Cliquez ici : &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<source>defaultDisplayNameLabel</source>
<translation>Nom d&apos;affichage</translation>
</message>
<message>
<source>assistantTitle</source>
<translation>Assistant</translation>
</message>
<message>
<source>createAppSipAccountEnabledLabel</source>
<translation>Activer la création de compte</translation>
</message>
<message>
<source>useAppSipAccountEnabledLabel</source>
<translation>Activer l&apos;utilisation de compte</translation>
</message>
<message>
<source>useOtherSipAccountEnabledLabel</source>
<translation>Activer l&apos;utilisation générique de compte</translation>
</message>
<message>
<source>fetchRemoteConfigurationEnabledLabel</source>
<translation>Activer le téléchargement de conf.</translation>
</message>
</context>
<context>
<name>SettingsSipAccountsEdit</name>
......
......@@ -1401,6 +1401,26 @@
<source>defaultDisplayNameLabel</source>
<translation>表示名</translation>
</message>
<message>
<source>assistantTitle</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>createAppSipAccountEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>useAppSipAccountEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>useOtherSipAccountEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>fetchRemoteConfigurationEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsSipAccountsEdit</name>
......
......@@ -1403,6 +1403,26 @@ Tiesiog, įveskite savo draugo SIP adresą ar naudotojo vardą.</translation>
<source>defaultDisplayNameLabel</source>
<translation>Rodomas vardas</translation>
</message>
<message>
<source>assistantTitle</source>
<translation>Pagelbiklis</translation>
</message>
<message>
<source>createAppSipAccountEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>useAppSipAccountEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>useOtherSipAccountEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>fetchRemoteConfigurationEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsSipAccountsEdit</name>
......
......@@ -1406,6 +1406,26 @@ o endereço SIP ou nome de usuário do seu amigo.</translation>
<source>defaultDisplayNameLabel</source>
<translation>Exibir nome</translation>
</message>
<message>
<source>assistantTitle</source>
<translation>Assistente</translation>
</message>
<message>
<source>createAppSipAccountEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>useAppSipAccountEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>useOtherSipAccountEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>fetchRemoteConfigurationEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsSipAccountsEdit</name>
......
......@@ -1401,6 +1401,26 @@
<source>defaultDisplayNameLabel</source>
<translation>Отображаемое имя</translation>
</message>
<message>
<source>assistantTitle</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>createAppSipAccountEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>useAppSipAccountEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>useOtherSipAccountEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>fetchRemoteConfigurationEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsSipAccountsEdit</name>
......
......@@ -1403,6 +1403,26 @@ Klicka här: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<source>defaultDisplayNameLabel</source>
<translation>Visningsnamn</translation>
</message>
<message>
<source>assistantTitle</source>
<translation>Assistent</translation>
</message>
<message>
<source>createAppSipAccountEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>useAppSipAccountEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>useOtherSipAccountEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>fetchRemoteConfigurationEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsSipAccountsEdit</name>
......
......@@ -1403,6 +1403,26 @@ arkadaşınızın SIP adresini veya kullanıcı adını girin.</translation>
<source>defaultDisplayNameLabel</source>
<translation>Görünen ad</translation>
</message>
<message>
<source>assistantTitle</source>
<translation>Yardimci</translation>
</message>
<message>
<source>createAppSipAccountEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>useAppSipAccountEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>useOtherSipAccountEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>fetchRemoteConfigurationEnabledLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsSipAccountsEdit</name>
......
......@@ -45,6 +45,46 @@ SettingsModel::SettingsModel (QObject *parent) : QObject(parent) {
configureRlsUri();
}
// =============================================================================
// Assistant.
// =============================================================================
bool SettingsModel::getUseAppSipAccountEnabled () const {
return !!mConfig->getInt(UiSection, "use_app_sip_account_enabled", 1);
}
void SettingsModel::setUseAppSipAccountEnabled (bool status) {
mConfig->setInt(UiSection, "use_app_sip_account_enabled", status);
emit useAppSipAccountEnabledChanged(status);
}
bool SettingsModel::getUseOtherSipAccountEnabled () const {
return !!mConfig->getInt(UiSection, "use_other_sip_account_enabled", 1);
}
void SettingsModel::setUseOtherSipAccountEnabled (bool status) {
mConfig->setInt(UiSection, "use_other_sip_account_enabled", status);
emit useOtherSipAccountEnabledChanged(status);
}
bool SettingsModel::getCreateAppSipAccountEnabled () const {
return !!mConfig->getInt(UiSection, "create_app_sip_account_enabled", 1);
}
void SettingsModel::setCreateAppSipAccountEnabled (bool status) {
mConfig->setInt(UiSection, "create_app_sip_account_enabled", status);
emit createAppSipAccountEnabledChanged(status);
}
bool SettingsModel::getFetchRemoteConfigurationEnabled () const {
return !!mConfig->getInt(UiSection, "fetch_remote_configuration_enabled", 1);
}
void SettingsModel::setFetchRemoteConfigurationEnabled (bool status) {
mConfig->setInt(UiSection, "fetch_remote_configuration_enabled", status);
emit fetchRemoteConfigurationEnabledChanged(status);
}
// =============================================================================
// Audio.
// =============================================================================
......
......@@ -35,6 +35,13 @@ class SettingsModel : public QObject {
// PROPERTIES.
// ===========================================================================
// Assistant. ----------------------------------------------------------------
Q_PROPERTY(bool createAppSipAccountEnabled READ getCreateAppSipAccountEnabled WRITE setCreateAppSipAccountEnabled NOTIFY createAppSipAccountEnabledChanged);
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);
// Audio. --------------------------------------------------------------------
Q_PROPERTY(QStringList captureDevices READ getCaptureDevices CONSTANT);
......@@ -171,6 +178,20 @@ public:
// METHODS.
// ===========================================================================
// Assistant. ----------------------------------------------------------------
bool getCreateAppSipAccountEnabled () const;
void setCreateAppSipAccountEnabled (bool status);
bool getFetchRemoteConfigurationEnabled () const;
void setFetchRemoteConfigurationEnabled (bool status);
bool getUseAppSipAccountEnabled () const;
void setUseAppSipAccountEnabled (bool status);
bool getUseOtherSipAccountEnabled () const;
void setUseOtherSipAccountEnabled (bool status);
// Audio. --------------------------------------------------------------------
QStringList getCaptureDevices () const;
......@@ -371,6 +392,13 @@ public:
// ===========================================================================
signals:
// Assistant. ----------------------------------------------------------------
void createAppSipAccountEnabledChanged (bool status);
void fetchRemoteConfigurationEnabledChanged (bool status);
void useAppSipAccountEnabledChanged (bool status);
void useOtherSipAccountEnabledChanged (bool status);
// Audio. --------------------------------------------------------------------
void captureDeviceChanged (const QString &device);
......
......@@ -2,6 +2,7 @@ import QtQuick 2.7
import QtQuick.Layouts 1.3
import Common 1.0
import Linphone 1.0
import App.Styles 1.0
......@@ -90,6 +91,7 @@ ColumnLayout {
}
text: $text.replace('%1', Qt.application.name.toUpperCase())
enabled: SettingsModel[$view.charAt(0).toLowerCase() + $view.slice(1) + "Enabled"];
onClicked: assistant.pushView($view)
}
......
......@@ -122,5 +122,59 @@ TabContainer {
onClicked: Logic.editAccount()
}
}
// -------------------------------------------------------------------------
// Assistant.
// -------------------------------------------------------------------------
Form {
title: qsTr('assistantTitle')
visible: SettingsModel.developerSettingsEnabled
width: parent.width
FormLine {
FormGroup {
label: qsTr('createAppSipAccountEnabledLabel')
Switch {
checked: SettingsModel.createAppSipAccountEnabled
onClicked: SettingsModel.createAppSipAccountEnabled = !checked
}
}
FormGroup {
label: qsTr('useAppSipAccountEnabledLabel')
Switch {
checked: SettingsModel.useAppSipAccountEnabled
onClicked: SettingsModel.useAppSipAccountEnabled = !checked
}
}
}
FormLine {
FormGroup {
label: qsTr('useOtherSipAccountEnabledLabel')
Switch {
checked: SettingsModel.useOtherSipAccountEnabled
onClicked: SettingsModel.useOtherSipAccountEnabled = !checked
}
}
FormGroup {
label: qsTr('fetchRemoteConfigurationEnabledLabel')
Switch {
checked: SettingsModel.fetchRemoteConfigurationEnabled
onClicked: SettingsModel.fetchRemoteConfigurationEnabled = !checked
}
}
}
}
}
}
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