settings: add rendez-vous option

Change-Id: Ifa2a4502d9eae2cd700de47ae0561d6728ba7a50
This commit is contained in:
Sébastien Blin
2020-07-23 14:51:47 -04:00
parent 655d8e25ee
commit cdcf43cc6a
4 changed files with 34 additions and 6 deletions

View File

@@ -150,7 +150,10 @@ CallAdapter::slotShowIncomingCallView(const QString &accountId, const conversati
/*
* Show incoming call page only.
*/
emit showIncomingCallPage(accountId, convInfo.uid);
auto accountProperties = LRCInstance::accountModel().getAccountConfig(accountId);
if (!accountProperties.autoAnswer && !accountProperties.isRendezVous) {
emit showIncomingCallPage(accountId, convInfo.uid);
}
return;
}
@@ -165,11 +168,7 @@ CallAdapter::slotShowIncomingCallView(const QString &accountId, const conversati
} else {
auto selectedAccountId = LRCInstance::getCurrentAccountInfo().id;
auto accountProperties = LRCInstance::accountModel().getAccountConfig(selectedAccountId);
if (accountProperties.autoAnswer) {
/*
* TODO: Auto answer
*/
} else {
if (!accountProperties.autoAnswer && !accountProperties.isRendezVous) {
emit showIncomingCallPage(accountId, convInfo.uid);
}
}

View File

@@ -380,6 +380,12 @@ SettingsAdaptor::getAccountConfig_DHT_PublicInCalls()
return getAccountConfig().DHT.PublicInCalls;
}
bool
SettingsAdaptor::getAccountConfig_RendezVous()
{
return getAccountConfig().isRendezVous;
}
bool
SettingsAdaptor::getAccountConfig_AutoAnswer()
{
@@ -656,6 +662,15 @@ SettingsAdaptor::setCallsUntrusted(bool state)
LRCInstance::accountModel().setAccountConfig(LRCInstance::getCurrAccId(), confProps);
}
void
SettingsAdaptor::setIsRendezVous(bool state)
{
auto confProps = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId());
confProps.isRendezVous = state;
LRCInstance::accountModel().setAccountConfig(LRCInstance::getCurrAccId(), confProps);
}
void
SettingsAdaptor::setAutoAnswerCalls(bool state)
{

View File

@@ -121,6 +121,7 @@ public:
Q_INVOKABLE bool getAccountConfig_PeerDiscovery();
Q_INVOKABLE bool getAccountConfig_DHT_PublicInCalls();
Q_INVOKABLE bool getAccountConfig_RendezVous();
Q_INVOKABLE bool getAccountConfig_AutoAnswer();
Q_INVOKABLE QString getAccountConfig_RingNS_Uri();
@@ -177,6 +178,7 @@ public:
Q_INVOKABLE void setAutoConnectOnLocalNetwork(bool state);
Q_INVOKABLE void setCallsUntrusted(bool state);
Q_INVOKABLE void setIsRendezVous(bool state);
Q_INVOKABLE void setAutoAnswerCalls(bool state);
Q_INVOKABLE void setEnableRingtone(bool state);
Q_INVOKABLE void setEnableProxy(bool state);

View File

@@ -34,6 +34,7 @@ ColumnLayout {
//Call Settings
checkAutoConnectOnLocalNetwork.checked = ClientWrapper.settingsAdaptor.getAccountConfig_PeerDiscovery()
checkBoxUntrusted.checked = ClientWrapper.settingsAdaptor.getAccountConfig_DHT_PublicInCalls()
checkBoxRdv.checked = ClientWrapper.settingsAdaptor.getAccountConfig_RendezVous()
checkBoxAutoAnswer.checked = ClientWrapper.settingsAdaptor.getAccountConfig_AutoAnswer()
checkBoxCustomRingtone.checked = ClientWrapper.settingsAdaptor.getAccountConfig_Ringtone_RingtoneEnabled()
@@ -380,6 +381,17 @@ ColumnLayout {
}
}
}
ToggleSwitch {
id: checkBoxRdv
labelText: qsTr("(Experimental) Rendez-vous: turn your account into a conference room")
fontPointSize: 10
onSwitchToggled: {
ClientWrapper.settingsAdaptor.setIsRendezVous(checked)
}
}
}
}