Commit 5a3ca07a authored by Tijmen de Mes's avatar Tijmen de Mes

Added setting to enable IMDN per account

parent ce2a7839
......@@ -64,6 +64,7 @@ class ServerSettings(SettingsGroup):
class SMSSettings(SettingsGroup):
use_cpim = Setting(type=bool, default=True)
enable_iscomposing = Setting(type=bool, default=True)
enable_imdn = Setting(type=bool, default=True)
class SoundSettings(SettingsGroup):
......
......@@ -256,8 +256,10 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
self.prefix_button.activated[str].connect(self._SH_PrefixButtonActivated)
self.account_tls_name_editor.editingFinished.connect(self._SH_TLSPeerNameEditorEditingFinished)
# Account sms settings
self.message_cpim_enabled_button.clicked.connect(self._SH_EnableMessageCPIMButtonClicked)
self.message_iscomposing_enabled_button.clicked.connect(self._SH_EnableMessageIsComposingButtonClicked)
self.message_imdn_enabled_button.clicked.connect(self._SH_EnableMessageIMDNButtonClicked)
# Audio devices
self.audio_alert_device_button.activated[int].connect(self._SH_AudioAlertDeviceButtonActivated)
......@@ -829,6 +831,8 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
# SMS settings tab, also relevant for bonjour
self.message_cpim_enabled_button.setChecked(account.sms.use_cpim)
self.message_iscomposing_enabled_button.setChecked(account.sms.enable_iscomposing)
self.message_imdn_enabled_button.setEnabled(account.sms.use_cpim)
self.message_imdn_enabled_button.setChecked(account.sms.enable_imdn)
if account is not bonjour_account:
self.account_auto_answer.setText('Auto answer from allowed contacts')
......@@ -1420,6 +1424,7 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
def _SH_EnableMessageCPIMButtonClicked(self, checked):
account = self.selected_account
account.sms.use_cpim = checked
self.message_imdn_enabled_button.setEnabled(account.sms.use_cpim)
account.save()
def _SH_EnableMessageIsComposingButtonClicked(self, checked):
......@@ -1427,6 +1432,11 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
account.sms.enable_iscomposing = checked
account.save()
def _SH_EnableMessageIMDNButtonClicked(self, checked):
account = self.selected_account
account.sms.enable_imdn = checked
account.save()
# Audio devices signal handlers
def _SH_AudioAlertDeviceButtonActivated(self, index):
device = self.audio_alert_device_button.itemData(index)
......
......@@ -1278,34 +1278,21 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item row="4" column="0">
<widget class="QCheckBox" name="message_cpim_enabled_button">
<item row="5" column="1">
<widget class="QCheckBox" name="message_iscomposing_enabled_button">
<property name="text">
<string>Use CPIM envelope</string>
<string>Enable Is-Composing</string>
</property>
</widget>
</item>
<item row="2" column="0">
<item row="2" column="1">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="6" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<item row="1" column="1">
<widget class="QLabel" name="message_label">
<property name="font">
<font>
......@@ -1321,16 +1308,66 @@
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="message_iscomposing_enabled_button">
<item row="4" column="1">
<widget class="QCheckBox" name="message_cpim_enabled_button">
<property name="text">
<string>Enable Is-Composing</string>
<string>Use CPIM envelope</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>When sending and receiving messages</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="message_imdn_enabled_button">
<property name="text">
<string>Enable IMDN (Read receipts)</string>
</property>
</widget>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>If you turn off IMDN you won't be able to see receipts from other people</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="advanced_tab">
......
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