mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-28 09:19:19 +00:00
feat(SettingsModel): add a video mode supports for auto answer (close #44)
This commit is contained in:
parent
c103e18037
commit
9f6857ce7c
6 changed files with 46 additions and 3 deletions
|
|
@ -1110,6 +1110,10 @@ your friend's SIP address or username.</translation>
|
|||
<source>autoAnswerDelayLabel</source>
|
||||
<translation>Delay (in ms)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>autoAnswerWithVideoLabel</source>
|
||||
<translation>Auto answer (with video)</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsNetwork</name>
|
||||
|
|
|
|||
|
|
@ -1108,6 +1108,10 @@ Cliquez ici : <a href="%1">%1</a>
|
|||
<source>autoAnswerDelayLabel</source>
|
||||
<translation>Délai (en ms)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>autoAnswerWithVideoLabel</source>
|
||||
<translation>Répondre autom. (avec vidéo)</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsNetwork</name>
|
||||
|
|
|
|||
|
|
@ -343,10 +343,16 @@ CallModel::CallStatus CallModel::getStatus () const {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void CallModel::acceptWithAutoAnswerDelay () {
|
||||
// Use auto-answer if activated and it's the only call.
|
||||
CoreManager *coreManager = CoreManager::getInstance();
|
||||
if (coreManager->getSettingsModel()->getAutoAnswerStatus() && coreManager->getCore()->getCallsNb() == 1)
|
||||
accept();
|
||||
SettingsModel *settingsModel = coreManager->getSettingsModel();
|
||||
|
||||
// Use auto-answer if activated and it's the only call.
|
||||
if (settingsModel->getAutoAnswerStatus() && coreManager->getCore()->getCallsNb() == 1) {
|
||||
if (mCall->getRemoteParams()->videoEnabled() && settingsModel->getAutoAnswerVideoStatus())
|
||||
acceptWithVideo();
|
||||
else
|
||||
accept();
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -261,6 +261,17 @@ void SettingsModel::setAutoAnswerStatus (bool status) {
|
|||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
bool SettingsModel::getAutoAnswerVideoStatus () const {
|
||||
return !!mConfig->getInt(UI_SECTION, "auto_answer_with_video", 0);
|
||||
}
|
||||
|
||||
void SettingsModel::setAutoAnswerVideoStatus (bool status) {
|
||||
mConfig->setInt(UI_SECTION, "auto_answer_with_video", status);
|
||||
emit autoAnswerVideoStatusChanged(status);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
QString SettingsModel::getFileTransferUrl () const {
|
||||
return ::Utils::coreStringToAppString(
|
||||
CoreManager::getInstance()->getCore()->getFileTransferServer()
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ class SettingsModel : public QObject {
|
|||
// Chat & calls. -------------------------------------------------------------
|
||||
|
||||
Q_PROPERTY(bool autoAnswerStatus READ getAutoAnswerStatus WRITE setAutoAnswerStatus NOTIFY autoAnswerStatusChanged);
|
||||
Q_PROPERTY(bool autoAnswerVideoStatus READ getAutoAnswerVideoStatus WRITE setAutoAnswerVideoStatus NOTIFY autoAnswerVideoStatusChanged);
|
||||
Q_PROPERTY(int autoAnswerDelay READ getAutoAnswerDelay WRITE setAutoAnswerDelay NOTIFY autoAnswerDelayChanged);
|
||||
|
||||
Q_PROPERTY(QString fileTransferUrl READ getFileTransferUrl WRITE setFileTransferUrl NOTIFY fileTransferUrlChanged);
|
||||
|
|
@ -194,6 +195,9 @@ public:
|
|||
bool getAutoAnswerStatus () const;
|
||||
void setAutoAnswerStatus (bool status);
|
||||
|
||||
bool getAutoAnswerVideoStatus () const;
|
||||
void setAutoAnswerVideoStatus (bool status);
|
||||
|
||||
int getAutoAnswerDelay () const;
|
||||
void setAutoAnswerDelay (int delay);
|
||||
|
||||
|
|
@ -333,6 +337,7 @@ signals:
|
|||
// Chat & calls. -------------------------------------------------------------
|
||||
|
||||
void autoAnswerStatusChanged (bool status);
|
||||
void autoAnswerVideoStatusChanged (bool status);
|
||||
void autoAnswerDelayChanged (int delay);
|
||||
|
||||
void fileTransferUrlChanged (const QString &url);
|
||||
|
|
|
|||
|
|
@ -86,6 +86,19 @@ TabContainer {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
FormLine {
|
||||
FormGroup {
|
||||
label: qsTr('autoAnswerWithVideoLabel')
|
||||
|
||||
Switch {
|
||||
checked: SettingsModel.autoAnswerVideoStatus
|
||||
enabled: autoAnswer.checked
|
||||
|
||||
onClicked: SettingsModel.autoAnswerVideoStatus = !checked
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Form {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue