hide notification content setting

This commit is contained in:
Gaelle Braud 2026-02-02 13:27:51 +01:00
parent 8df5fb833c
commit ca4380bfd0
9 changed files with 255 additions and 30 deletions

View file

@ -366,7 +366,8 @@ void Notifier::notifyReceivedMessages(const std::shared_ptr<linphone::ChatRoom>
txt = tr("new_conference_invitation"); txt = tr("new_conference_invitation");
}; };
if (messages.size() == 1) { // Display only sender on mono message. if (messages.size() == 1 &&
SettingsModel::getInstance()->getDisplayNotificationContent()) { // Display only sender on mono message.
if (message->isRead()) return; if (message->isRead()) return;
getMessage(message); getMessage(message);
if (txt.isEmpty()) { // Do not notify message without content if (txt.isEmpty()) { // Do not notify message without content
@ -382,6 +383,9 @@ void Notifier::notifyReceivedMessages(const std::shared_ptr<linphone::ChatRoom>
} }
} }
if (unreadCount == 0) return; if (unreadCount == 0) return;
else if (unreadCount == 1)
//: 'New message received!' Notification that warn the user of a new message.
txt = tr("new_chat_room_message");
if (unreadCount > 1) if (unreadCount > 1)
//: 'New messages received!' Notification that warn the user of new messages. //: 'New messages received!' Notification that warn the user of new messages.
txt = tr("new_chat_room_messages"); txt = tr("new_chat_room_messages");

View file

@ -50,17 +50,16 @@ SettingsCore::SettingsCore(QObject *parent) : QObject(parent) {
mVideoEnabled = settingsModel->getVideoEnabled(); mVideoEnabled = settingsModel->getVideoEnabled();
mEchoCancellationEnabled = settingsModel->getEchoCancellationEnabled(); mEchoCancellationEnabled = settingsModel->getEchoCancellationEnabled();
mAutoDownloadReceivedFiles = settingsModel->getAutoDownloadReceivedFiles(); mAutoDownloadReceivedFiles = settingsModel->getAutoDownloadReceivedFiles();
mDisplayNotificationContent = settingsModel->getDisplayNotificationContent();
mAutomaticallyRecordCallsEnabled = settingsModel->getAutomaticallyRecordCallsEnabled(); mAutomaticallyRecordCallsEnabled = settingsModel->getAutomaticallyRecordCallsEnabled();
mRingtonePath = settingsModel->getRingtone(); mRingtonePath = settingsModel->getRingtone();
QFileInfo ringtone(mRingtonePath); QFileInfo ringtone(mRingtonePath);
if (ringtone.exists()) { if (ringtone.exists()) {
mRingtoneFileName = ringtone.fileName(); mRingtoneFileName = ringtone.fileName();
mRingtoneFolder = ringtone.absolutePath(); mRingtoneFolder = ringtone.absolutePath();
CoreModel::getInstance()->getCore()->enableNativeRinging(false);
} else { } else {
mRingtoneFileName = mRingtonePath.right(mRingtonePath.lastIndexOf(QDir::separator())); mRingtoneFileName = mRingtonePath.right(mRingtonePath.lastIndexOf(QDir::separator()));
mRingtoneFolder = mRingtonePath.left(mRingtonePath.lastIndexOf(QDir::separator())); mRingtoneFolder = mRingtonePath.left(mRingtonePath.lastIndexOf(QDir::separator()));
CoreModel::getInstance()->getCore()->enableNativeRinging(true);
} }
// Network // Network
@ -166,6 +165,7 @@ SettingsCore::SettingsCore(const SettingsCore &settingsCore) {
mVideoEnabled = settingsCore.mVideoEnabled; mVideoEnabled = settingsCore.mVideoEnabled;
mEchoCancellationEnabled = settingsCore.mEchoCancellationEnabled; mEchoCancellationEnabled = settingsCore.mEchoCancellationEnabled;
mAutoDownloadReceivedFiles = settingsCore.mAutoDownloadReceivedFiles; mAutoDownloadReceivedFiles = settingsCore.mAutoDownloadReceivedFiles;
mDisplayNotificationContent = settingsCore.mDisplayNotificationContent;
mAutomaticallyRecordCallsEnabled = settingsCore.mAutomaticallyRecordCallsEnabled; mAutomaticallyRecordCallsEnabled = settingsCore.mAutomaticallyRecordCallsEnabled;
// Audio // Audio
@ -252,6 +252,7 @@ void SettingsCore::reloadSettings() {
setVideoEnabled(settingsModel->getVideoEnabled()); setVideoEnabled(settingsModel->getVideoEnabled());
setEchoCancellationEnabled(settingsModel->getEchoCancellationEnabled()); setEchoCancellationEnabled(settingsModel->getEchoCancellationEnabled());
setAutoDownloadReceivedFiles(settingsModel->getAutoDownloadReceivedFiles()); setAutoDownloadReceivedFiles(settingsModel->getAutoDownloadReceivedFiles());
setDisplayNotificationContent(settingsModel->getDisplayNotificationContent());
setAutomaticallyRecordCallsEnabled(settingsModel->getAutomaticallyRecordCallsEnabled()); setAutomaticallyRecordCallsEnabled(settingsModel->getAutomaticallyRecordCallsEnabled());
setRingtone(settingsModel->getRingtone()); setRingtone(settingsModel->getRingtone());
@ -402,6 +403,12 @@ void SettingsCore::setSelf(QSharedPointer<SettingsCore> me) {
mSettingsModelConnection->invokeToCore([this, enabled]() { setAutoDownloadReceivedFiles(enabled); }); mSettingsModelConnection->invokeToCore([this, enabled]() { setAutoDownloadReceivedFiles(enabled); });
}); });
// Auto download incoming files
mSettingsModelConnection->makeConnectToModel(
&SettingsModel::displayNotificationContentChanged, [this](const bool enabled) {
mSettingsModelConnection->invokeToCore([this, enabled]() { setDisplayNotificationContent(enabled); });
});
// Auto recording // Auto recording
mSettingsModelConnection->makeConnectToModel( mSettingsModelConnection->makeConnectToModel(
&SettingsModel::automaticallyRecordCallsEnabledChanged, [this](const bool enabled) { &SettingsModel::automaticallyRecordCallsEnabledChanged, [this](const bool enabled) {
@ -642,6 +649,7 @@ void SettingsCore::reset(const SettingsCore &settingsCore) {
setAutomaticallyRecordCallsEnabled(settingsCore.mAutomaticallyRecordCallsEnabled); setAutomaticallyRecordCallsEnabled(settingsCore.mAutomaticallyRecordCallsEnabled);
setAutoDownloadReceivedFiles(settingsCore.mAutoDownloadReceivedFiles); setAutoDownloadReceivedFiles(settingsCore.mAutoDownloadReceivedFiles);
setDisplayNotificationContent(settingsCore.mDisplayNotificationContent);
// Audio // Audio
setCaptureDevices(settingsCore.mCaptureDevices); setCaptureDevices(settingsCore.mCaptureDevices);
setPlaybackDevices(settingsCore.mPlaybackDevices); setPlaybackDevices(settingsCore.mPlaybackDevices);
@ -797,6 +805,14 @@ void SettingsCore::setAutoDownloadReceivedFiles(bool enabled) {
} }
} }
void SettingsCore::setDisplayNotificationContent(bool enabled) {
if (mDisplayNotificationContent != enabled) {
mDisplayNotificationContent = enabled;
emit displayNotificationContentChanged();
setIsSaved(false);
}
}
void SettingsCore::setAutomaticallyRecordCallsEnabled(bool enabled) { void SettingsCore::setAutomaticallyRecordCallsEnabled(bool enabled) {
if (mAutomaticallyRecordCallsEnabled != enabled) { if (mAutomaticallyRecordCallsEnabled != enabled) {
mAutomaticallyRecordCallsEnabled = enabled; mAutomaticallyRecordCallsEnabled = enabled;
@ -1243,6 +1259,8 @@ void SettingsCore::writeIntoModel(std::shared_ptr<SettingsModel> model) const {
// Chat // Chat
model->setAutoDownloadReceivedFiles(mAutoDownloadReceivedFiles); model->setAutoDownloadReceivedFiles(mAutoDownloadReceivedFiles);
model->setDisplayNotificationContent(mDisplayNotificationContent);
// Audio // Audio
model->setRingerDevice(mRingerDevice); model->setRingerDevice(mRingerDevice);
model->setCaptureDevice(mCaptureDevice); model->setCaptureDevice(mCaptureDevice);
@ -1318,6 +1336,7 @@ void SettingsCore::writeFromModel(const std::shared_ptr<SettingsModel> &model) {
// Chat // Chat
mAutoDownloadReceivedFiles = model->getAutoDownloadReceivedFiles(); mAutoDownloadReceivedFiles = model->getAutoDownloadReceivedFiles();
mDisplayNotificationContent = model->getDisplayNotificationContent();
// Audio // Audio
mCaptureDevices = model->getCaptureDevices(); mCaptureDevices = model->getCaptureDevices();

View file

@ -42,6 +42,8 @@ public:
echoCancellationEnabledChanged) echoCancellationEnabledChanged)
Q_PROPERTY(bool autoDownloadReceivedFiles READ getAutoDownloadReceivedFiles WRITE setAutoDownloadReceivedFiles Q_PROPERTY(bool autoDownloadReceivedFiles READ getAutoDownloadReceivedFiles WRITE setAutoDownloadReceivedFiles
NOTIFY autoDownloadReceivedFilesChanged) NOTIFY autoDownloadReceivedFilesChanged)
Q_PROPERTY(bool displayNotificationContent READ getDisplayNotificationContent WRITE setDisplayNotificationContent
NOTIFY displayNotificationContentChanged)
Q_PROPERTY( Q_PROPERTY(
int echoCancellationCalibration READ getEchoCancellationCalibration NOTIFY echoCancellationCalibrationChanged) int echoCancellationCalibration READ getEchoCancellationCalibration NOTIFY echoCancellationCalibrationChanged)
Q_PROPERTY(bool automaticallyRecordCallsEnabled READ getAutomaticallyRecordCallsEnabled WRITE Q_PROPERTY(bool automaticallyRecordCallsEnabled READ getAutomaticallyRecordCallsEnabled WRITE
@ -93,18 +95,17 @@ public:
Q_PROPERTY(bool fullLogsEnabled READ getFullLogsEnabled WRITE setFullLogsEnabled NOTIFY fullLogsEnabledChanged) Q_PROPERTY(bool fullLogsEnabled READ getFullLogsEnabled WRITE setFullLogsEnabled NOTIFY fullLogsEnabledChanged)
Q_PROPERTY(bool crashReporterEnabled READ getCrashReporterEnabled WRITE setCrashReporterEnabled NOTIFY Q_PROPERTY(bool crashReporterEnabled READ getCrashReporterEnabled WRITE setCrashReporterEnabled NOTIFY
crashReporterEnabledChanged) crashReporterEnabledChanged)
Q_PROPERTY(QString logsEmail READ getLogsEmail) Q_PROPERTY(QString logsEmail READ getLogsEmail) Q_PROPERTY(QString logsFolder READ getLogsFolder)
Q_PROPERTY(QString logsFolder READ getLogsFolder) Q_PROPERTY(QString ringtoneName READ getRingtoneFileName NOTIFY ringtoneChanged)
Q_PROPERTY(QString ringtoneName READ getRingtoneFileName NOTIFY ringtoneChanged) Q_PROPERTY(QString ringtonePath READ getRingtonePath WRITE setRingtone NOTIFY ringtoneChanged)
Q_PROPERTY(QString ringtonePath READ getRingtonePath WRITE setRingtone NOTIFY ringtoneChanged) Q_PROPERTY(QString ringtoneFolder MEMBER mRingtoneFolder NOTIFY ringtoneChanged)
Q_PROPERTY(QString ringtoneFolder MEMBER mRingtoneFolder NOTIFY ringtoneChanged) Q_PROPERTY(bool dnd READ dndEnabled WRITE lEnableDnd NOTIFY dndChanged)
Q_PROPERTY(bool dnd READ dndEnabled WRITE lEnableDnd NOTIFY dndChanged) Q_PROPERTY(bool isSaved READ isSaved WRITE setIsSaved NOTIFY isSavedChanged)
Q_PROPERTY(bool isSaved READ isSaved WRITE setIsSaved NOTIFY isSavedChanged)
Q_PROPERTY( Q_PROPERTY(bool showAccountDevices READ showAccountDevices WRITE setShowAccountDevices
bool showAccountDevices READ showAccountDevices WRITE setShowAccountDevices NOTIFY showAccountDevicesChanged) NOTIFY showAccountDevicesChanged)
static QSharedPointer<SettingsCore> create(); static QSharedPointer<SettingsCore> create();
SettingsCore(QObject *parent = Q_NULLPTR); SettingsCore(QObject *parent = Q_NULLPTR);
SettingsCore(const SettingsCore &settingsCore); SettingsCore(const SettingsCore &settingsCore);
virtual ~SettingsCore(); virtual ~SettingsCore();
@ -152,6 +153,11 @@ public:
} }
void setAutoDownloadReceivedFiles(bool enabled); void setAutoDownloadReceivedFiles(bool enabled);
bool getDisplayNotificationContent() {
return mDisplayNotificationContent;
}
void setDisplayNotificationContent(bool enabled);
bool getAutomaticallyRecordCallsEnabled() { bool getAutomaticallyRecordCallsEnabled() {
return mAutomaticallyRecordCallsEnabled; return mAutomaticallyRecordCallsEnabled;
} }
@ -309,6 +315,7 @@ signals:
void echoCancellationEnabledChanged(); void echoCancellationEnabledChanged();
void autoDownloadReceivedFilesChanged(); void autoDownloadReceivedFilesChanged();
void displayNotificationContentChanged();
void automaticallyRecordCallsEnabledChanged(); void automaticallyRecordCallsEnabledChanged();
@ -406,6 +413,7 @@ private:
bool mVideoEnabled; bool mVideoEnabled;
bool mEchoCancellationEnabled; bool mEchoCancellationEnabled;
bool mAutoDownloadReceivedFiles; bool mAutoDownloadReceivedFiles;
bool mDisplayNotificationContent;
bool mAutomaticallyRecordCallsEnabled; bool mAutomaticallyRecordCallsEnabled;
// Audio // Audio

View file

@ -2691,17 +2691,35 @@ Error</extracomment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Layout/Settings/ChatSettingsLayout.qml" line="25"/> <location filename="../../view/Page/Layout/Settings/ChatSettingsLayout.qml" line="21"/>
<source>settings_chat_notifications_title</source>
<extracomment>Notifications</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Layout/Settings/ChatSettingsLayout.qml" line="32"/>
<source>settings_chat_attached_files_auto_download_title</source> <source>settings_chat_attached_files_auto_download_title</source>
<extracomment>&quot;Automatic download&quot;</extracomment> <extracomment>&quot;Automatic download&quot;</extracomment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Layout/Settings/ChatSettingsLayout.qml" line="27"/> <location filename="../../view/Page/Layout/Settings/ChatSettingsLayout.qml" line="34"/>
<source>settings_chat_attached_files_auto_download_subtitle</source> <source>settings_chat_attached_files_auto_download_subtitle</source>
<extracomment>&quot;Automatically download transferred or received files in conversations&quot;</extracomment> <extracomment>&quot;Automatically download transferred or received files in conversations&quot;</extracomment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="../../view/Page/Layout/Settings/ChatSettingsLayout.qml" line="50"/>
<source>settings_chat_display_notification_content_title</source>
<extracomment>&quot;Display notification content&quot;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Layout/Settings/ChatSettingsLayout.qml" line="52"/>
<source>settings_chat_display_notification_content_subtitle</source>
<extracomment>&quot;Display the content of the received message&quot;</extracomment>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>CliModel</name> <name>CliModel</name>
@ -4621,10 +4639,38 @@ Error</extracomment>
<context> <context>
<name>ManageParticipants</name> <name>ManageParticipants</name>
<message> <message>
<location filename="../../view/Page/Layout/Chat/ManageParticipants.qml" line="44"/> <location filename="../../view/Page/Layout/Chat/ManageParticipants.qml" line="29"/>
<source>info_popup_error_title</source>
<translation type="unfinished">Fehler</translation>
</message>
<message>
<location filename="../../view/Page/Layout/Chat/ManageParticipants.qml" line="31"/>
<source>info_popup_manage_participant_error_message</source>
<extracomment>Error while setting participants !</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Layout/Chat/ManageParticipants.qml" line="34"/>
<source>info_popup_success_title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Layout/Chat/ManageParticipants.qml" line="36"/>
<source>info_popup_manage_participant_updated_message</source>
<extracomment>Participants updated</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Layout/Chat/ManageParticipants.qml" line="59"/>
<source>group_infos_manage_participants</source> <source>group_infos_manage_participants</source>
<translation>Participants</translation> <translation>Participants</translation>
</message> </message>
<message>
<location filename="../../view/Page/Layout/Chat/ManageParticipants.qml" line="68"/>
<source>apply_button_text</source>
<extracomment>Apply</extracomment>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MeetingForm</name> <name>MeetingForm</name>
@ -5100,13 +5146,19 @@ Error</extracomment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../core/notifier/Notifier.cpp" line="387"/> <location filename="../../core/notifier/Notifier.cpp" line="388"/>
<source>new_chat_room_message</source>
<extracomment>&apos;New message received!&apos; Notification that warn the user of a new message.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/notifier/Notifier.cpp" line="391"/>
<source>new_chat_room_messages</source> <source>new_chat_room_messages</source>
<extracomment>&apos;New messages received!&apos; Notification that warn the user of new messages.</extracomment> <extracomment>&apos;New messages received!&apos; Notification that warn the user of new messages.</extracomment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../core/notifier/Notifier.cpp" line="415"/> <location filename="../../core/notifier/Notifier.cpp" line="419"/>
<source>new_message_alert_accessible_name</source> <source>new_message_alert_accessible_name</source>
<extracomment>New message on chatroom %1</extracomment> <extracomment>New message on chatroom %1</extracomment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>

View file

@ -2676,17 +2676,35 @@ Only your correspondent can decrypt them.</translation>
<translation>Attached files</translation> <translation>Attached files</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Layout/Settings/ChatSettingsLayout.qml" line="25"/> <location filename="../../view/Page/Layout/Settings/ChatSettingsLayout.qml" line="21"/>
<source>settings_chat_notifications_title</source>
<extracomment>Notifications</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Layout/Settings/ChatSettingsLayout.qml" line="32"/>
<source>settings_chat_attached_files_auto_download_title</source> <source>settings_chat_attached_files_auto_download_title</source>
<extracomment>&quot;Automatic download&quot;</extracomment> <extracomment>&quot;Automatic download&quot;</extracomment>
<translation>Automatic download</translation> <translation>Automatic download</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Layout/Settings/ChatSettingsLayout.qml" line="27"/> <location filename="../../view/Page/Layout/Settings/ChatSettingsLayout.qml" line="34"/>
<source>settings_chat_attached_files_auto_download_subtitle</source> <source>settings_chat_attached_files_auto_download_subtitle</source>
<extracomment>&quot;Automatically download transferred or received files in conversations&quot;</extracomment> <extracomment>&quot;Automatically download transferred or received files in conversations&quot;</extracomment>
<translation>Automatically download transferred or received files in conversations</translation> <translation>Automatically download transferred or received files in conversations</translation>
</message> </message>
<message>
<location filename="../../view/Page/Layout/Settings/ChatSettingsLayout.qml" line="50"/>
<source>settings_chat_display_notification_content_title</source>
<extracomment>&quot;Display notification content&quot;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Layout/Settings/ChatSettingsLayout.qml" line="52"/>
<source>settings_chat_display_notification_content_subtitle</source>
<extracomment>&quot;Display the content of the received message&quot;</extracomment>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>CliModel</name> <name>CliModel</name>
@ -4553,10 +4571,38 @@ Expiration : %1</translation>
<context> <context>
<name>ManageParticipants</name> <name>ManageParticipants</name>
<message> <message>
<location filename="../../view/Page/Layout/Chat/ManageParticipants.qml" line="44"/> <location filename="../../view/Page/Layout/Chat/ManageParticipants.qml" line="29"/>
<source>info_popup_error_title</source>
<translation type="unfinished">Error</translation>
</message>
<message>
<location filename="../../view/Page/Layout/Chat/ManageParticipants.qml" line="31"/>
<source>info_popup_manage_participant_error_message</source>
<extracomment>Error while setting participants !</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Layout/Chat/ManageParticipants.qml" line="34"/>
<source>info_popup_success_title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Layout/Chat/ManageParticipants.qml" line="36"/>
<source>info_popup_manage_participant_updated_message</source>
<extracomment>Participants updated</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Layout/Chat/ManageParticipants.qml" line="59"/>
<source>group_infos_manage_participants</source> <source>group_infos_manage_participants</source>
<translation>Participants</translation> <translation>Participants</translation>
</message> </message>
<message>
<location filename="../../view/Page/Layout/Chat/ManageParticipants.qml" line="68"/>
<source>apply_button_text</source>
<extracomment>Apply</extracomment>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MeetingForm</name> <name>MeetingForm</name>
@ -5023,13 +5069,19 @@ Expiration : %1</translation>
<translation>Conference invitation received !</translation> <translation>Conference invitation received !</translation>
</message> </message>
<message> <message>
<location filename="../../core/notifier/Notifier.cpp" line="387"/> <location filename="../../core/notifier/Notifier.cpp" line="388"/>
<source>new_chat_room_message</source>
<extracomment>&apos;New message received!&apos; Notification that warn the user of a new message.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/notifier/Notifier.cpp" line="391"/>
<source>new_chat_room_messages</source> <source>new_chat_room_messages</source>
<extracomment>&apos;New messages received!&apos; Notification that warn the user of new messages.</extracomment> <extracomment>&apos;New messages received!&apos; Notification that warn the user of new messages.</extracomment>
<translation>New messages received !</translation> <translation>New messages received !</translation>
</message> </message>
<message> <message>
<location filename="../../core/notifier/Notifier.cpp" line="415"/> <location filename="../../core/notifier/Notifier.cpp" line="419"/>
<source>new_message_alert_accessible_name</source> <source>new_message_alert_accessible_name</source>
<extracomment>New message on chatroom %1</extracomment> <extracomment>New message on chatroom %1</extracomment>
<translation>New message on chatroom %1</translation> <translation>New message on chatroom %1</translation>

View file

@ -2651,17 +2651,35 @@ en bout. Seul votre correspondant peut les déchiffrer.</translation>
<translation>Fichiers joints</translation> <translation>Fichiers joints</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Layout/Settings/ChatSettingsLayout.qml" line="25"/> <location filename="../../view/Page/Layout/Settings/ChatSettingsLayout.qml" line="21"/>
<source>settings_chat_notifications_title</source>
<extracomment>Notifications</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Layout/Settings/ChatSettingsLayout.qml" line="32"/>
<source>settings_chat_attached_files_auto_download_title</source> <source>settings_chat_attached_files_auto_download_title</source>
<extracomment>&quot;Automatic download&quot;</extracomment> <extracomment>&quot;Automatic download&quot;</extracomment>
<translation>Téléchargement automatique</translation> <translation>Téléchargement automatique</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Layout/Settings/ChatSettingsLayout.qml" line="27"/> <location filename="../../view/Page/Layout/Settings/ChatSettingsLayout.qml" line="34"/>
<source>settings_chat_attached_files_auto_download_subtitle</source> <source>settings_chat_attached_files_auto_download_subtitle</source>
<extracomment>&quot;Automatically download transferred or received files in conversations&quot;</extracomment> <extracomment>&quot;Automatically download transferred or received files in conversations&quot;</extracomment>
<translation>Télécharger automatiquement les fichiers échangés dans les conversations</translation> <translation>Télécharger automatiquement les fichiers échangés dans les conversations</translation>
</message> </message>
<message>
<location filename="../../view/Page/Layout/Settings/ChatSettingsLayout.qml" line="50"/>
<source>settings_chat_display_notification_content_title</source>
<extracomment>&quot;Display notification content&quot;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Layout/Settings/ChatSettingsLayout.qml" line="52"/>
<source>settings_chat_display_notification_content_subtitle</source>
<extracomment>&quot;Display the content of the received message&quot;</extracomment>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>CliModel</name> <name>CliModel</name>
@ -4524,10 +4542,38 @@ Expiration : %1</translation>
<context> <context>
<name>ManageParticipants</name> <name>ManageParticipants</name>
<message> <message>
<location filename="../../view/Page/Layout/Chat/ManageParticipants.qml" line="44"/> <location filename="../../view/Page/Layout/Chat/ManageParticipants.qml" line="29"/>
<source>info_popup_error_title</source>
<translation type="unfinished">Erreur</translation>
</message>
<message>
<location filename="../../view/Page/Layout/Chat/ManageParticipants.qml" line="31"/>
<source>info_popup_manage_participant_error_message</source>
<extracomment>Error while setting participants !</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Layout/Chat/ManageParticipants.qml" line="34"/>
<source>info_popup_success_title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Layout/Chat/ManageParticipants.qml" line="36"/>
<source>info_popup_manage_participant_updated_message</source>
<extracomment>Participants updated</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Layout/Chat/ManageParticipants.qml" line="59"/>
<source>group_infos_manage_participants</source> <source>group_infos_manage_participants</source>
<translation>Participants</translation> <translation>Participants</translation>
</message> </message>
<message>
<location filename="../../view/Page/Layout/Chat/ManageParticipants.qml" line="68"/>
<source>apply_button_text</source>
<extracomment>Apply</extracomment>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MeetingForm</name> <name>MeetingForm</name>
@ -4994,13 +5040,19 @@ Expiration : %1</translation>
<translation>Nouvelle invitation à une conférence !</translation> <translation>Nouvelle invitation à une conférence !</translation>
</message> </message>
<message> <message>
<location filename="../../core/notifier/Notifier.cpp" line="387"/> <location filename="../../core/notifier/Notifier.cpp" line="388"/>
<source>new_chat_room_message</source>
<extracomment>&apos;New message received!&apos; Notification that warn the user of a new message.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../core/notifier/Notifier.cpp" line="391"/>
<source>new_chat_room_messages</source> <source>new_chat_room_messages</source>
<extracomment>&apos;New messages received!&apos; Notification that warn the user of new messages.</extracomment> <extracomment>&apos;New messages received!&apos; Notification that warn the user of new messages.</extracomment>
<translation>Nouveaux messages reçus !</translation> <translation>Nouveaux messages reçus !</translation>
</message> </message>
<message> <message>
<location filename="../../core/notifier/Notifier.cpp" line="415"/> <location filename="../../core/notifier/Notifier.cpp" line="419"/>
<source>new_message_alert_accessible_name</source> <source>new_message_alert_accessible_name</source>
<extracomment>New message on chatroom %1</extracomment> <extracomment>New message on chatroom %1</extracomment>
<translation>Nouveau message sur la conversation %1</translation> <translation>Nouveau message sur la conversation %1</translation>

View file

@ -472,9 +472,7 @@ void SettingsModel::setRingtone(QString ringtonePath) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO)); mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
QFileInfo ringtone(ringtonePath); QFileInfo ringtone(ringtonePath);
if (ringtonePath.isEmpty() || !ringtone.exists()) { if (ringtonePath.isEmpty() || !ringtone.exists()) {
CoreModel::getInstance()->getCore()->enableNativeRinging(true);
} else { } else {
CoreModel::getInstance()->getCore()->enableNativeRinging(false);
CoreModel::getInstance()->getCore()->setRing(Utils::appStringToCoreString(ringtonePath)); CoreModel::getInstance()->getCore()->setRing(Utils::appStringToCoreString(ringtonePath));
emit ringtoneChanged(ringtonePath); emit ringtoneChanged(ringtonePath);
} }
@ -523,6 +521,17 @@ void SettingsModel::setAutoDownloadReceivedFiles(bool status) {
emit autoDownloadReceivedFilesChanged(status); emit autoDownloadReceivedFilesChanged(status);
} }
bool SettingsModel::getDisplayNotificationContent() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return !!mConfig->getInt(UiSection, "display_notification_content", 1);
}
void SettingsModel::setDisplayNotificationContent(bool display) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mConfig->setInt(UiSection, "display_notification_content", display);
emit displayNotificationContentChanged(display);
}
bool SettingsModel::getEchoCancellationEnabled() const { bool SettingsModel::getEchoCancellationEnabled() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO)); mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return CoreModel::getInstance()->getCore()->echoCancellationEnabled(); return CoreModel::getInstance()->getCore()->echoCancellationEnabled();

View file

@ -66,6 +66,9 @@ public:
void setAutoDownloadReceivedFiles(bool enabled); void setAutoDownloadReceivedFiles(bool enabled);
bool getAutoDownloadReceivedFiles() const; bool getAutoDownloadReceivedFiles() const;
void setDisplayNotificationContent(bool display);
bool getDisplayNotificationContent() const;
// Audio. -------------------------------------------------------------------- // Audio. --------------------------------------------------------------------
bool getIsInCall() const; bool getIsInCall() const;
@ -287,6 +290,7 @@ signals:
// Messages. -------------------------------------------------------------------- // Messages. --------------------------------------------------------------------
void autoDownloadReceivedFilesChanged(bool enabled); void autoDownloadReceivedFilesChanged(bool enabled);
void displayNotificationContentChanged(bool display);
private: private:
void notifyConfigReady(); void notifyConfigReady();

View file

@ -15,6 +15,13 @@ AbstractSettingsLayout {
subTitle: "", subTitle: "",
contentComponent: attachedFilesParamComp, contentComponent: attachedFilesParamComp,
// hideTopMargin: true // hideTopMargin: true
},
{
//: Notifications
title: qsTr("settings_chat_notifications_title"),
subTitle: "",
contentComponent: displayNotifParamComp,
// hideTopMargin: true
} }
] ]
@ -28,6 +35,24 @@ AbstractSettingsLayout {
propertyName: "autoDownloadReceivedFiles" propertyName: "autoDownloadReceivedFiles"
propertyOwner: SettingsCpp propertyOwner: SettingsCpp
Connections {
target: mainItem
function onSave() {
SettingsCpp.save()
}
}
}
}
Component {
id: displayNotifParamComp
SwitchSetting {
//: "Display notification content"
titleText: qsTr("settings_chat_display_notification_content_title")
//: "Display the content of the received message"
subTitleText: qsTr("settings_chat_display_notification_content_subtitle")
propertyName: "displayNotificationContent"
propertyOwner: SettingsCpp
Connections { Connections {
target: mainItem target: mainItem
function onSave() { function onSave() {