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): ...@@ -64,6 +64,7 @@ class ServerSettings(SettingsGroup):
class SMSSettings(SettingsGroup): class SMSSettings(SettingsGroup):
use_cpim = Setting(type=bool, default=True) use_cpim = Setting(type=bool, default=True)
enable_iscomposing = Setting(type=bool, default=True) enable_iscomposing = Setting(type=bool, default=True)
enable_imdn = Setting(type=bool, default=True)
class SoundSettings(SettingsGroup): class SoundSettings(SettingsGroup):
......
...@@ -256,8 +256,10 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton): ...@@ -256,8 +256,10 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
self.prefix_button.activated[str].connect(self._SH_PrefixButtonActivated) self.prefix_button.activated[str].connect(self._SH_PrefixButtonActivated)
self.account_tls_name_editor.editingFinished.connect(self._SH_TLSPeerNameEditorEditingFinished) 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_cpim_enabled_button.clicked.connect(self._SH_EnableMessageCPIMButtonClicked)
self.message_iscomposing_enabled_button.clicked.connect(self._SH_EnableMessageIsComposingButtonClicked) self.message_iscomposing_enabled_button.clicked.connect(self._SH_EnableMessageIsComposingButtonClicked)
self.message_imdn_enabled_button.clicked.connect(self._SH_EnableMessageIMDNButtonClicked)
# Audio devices # Audio devices
self.audio_alert_device_button.activated[int].connect(self._SH_AudioAlertDeviceButtonActivated) self.audio_alert_device_button.activated[int].connect(self._SH_AudioAlertDeviceButtonActivated)
...@@ -829,6 +831,8 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton): ...@@ -829,6 +831,8 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
# SMS settings tab, also relevant for bonjour # SMS settings tab, also relevant for bonjour
self.message_cpim_enabled_button.setChecked(account.sms.use_cpim) self.message_cpim_enabled_button.setChecked(account.sms.use_cpim)
self.message_iscomposing_enabled_button.setChecked(account.sms.enable_iscomposing) 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: if account is not bonjour_account:
self.account_auto_answer.setText('Auto answer from allowed contacts') self.account_auto_answer.setText('Auto answer from allowed contacts')
...@@ -1420,6 +1424,7 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton): ...@@ -1420,6 +1424,7 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
def _SH_EnableMessageCPIMButtonClicked(self, checked): def _SH_EnableMessageCPIMButtonClicked(self, checked):
account = self.selected_account account = self.selected_account
account.sms.use_cpim = checked account.sms.use_cpim = checked
self.message_imdn_enabled_button.setEnabled(account.sms.use_cpim)
account.save() account.save()
def _SH_EnableMessageIsComposingButtonClicked(self, checked): def _SH_EnableMessageIsComposingButtonClicked(self, checked):
...@@ -1427,6 +1432,11 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton): ...@@ -1427,6 +1432,11 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
account.sms.enable_iscomposing = checked account.sms.enable_iscomposing = checked
account.save() account.save()
def _SH_EnableMessageIMDNButtonClicked(self, checked):
account = self.selected_account
account.sms.enable_imdn = checked
account.save()
# Audio devices signal handlers # Audio devices signal handlers
def _SH_AudioAlertDeviceButtonActivated(self, index): def _SH_AudioAlertDeviceButtonActivated(self, index):
device = self.audio_alert_device_button.itemData(index) device = self.audio_alert_device_button.itemData(index)
......
...@@ -1278,34 +1278,21 @@ ...@@ -1278,34 +1278,21 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item row="4" column="0"> <item row="5" column="1">
<widget class="QCheckBox" name="message_cpim_enabled_button"> <widget class="QCheckBox" name="message_iscomposing_enabled_button">
<property name="text"> <property name="text">
<string>Use CPIM envelope</string> <string>Enable Is-Composing</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="1">
<widget class="Line" name="line_2"> <widget class="Line" name="line_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0"> <item row="1" column="1">
<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">
<widget class="QLabel" name="message_label"> <widget class="QLabel" name="message_label">
<property name="font"> <property name="font">
<font> <font>
...@@ -1321,16 +1308,66 @@ ...@@ -1321,16 +1308,66 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0"> <item row="4" column="1">
<widget class="QCheckBox" name="message_iscomposing_enabled_button"> <widget class="QCheckBox" name="message_cpim_enabled_button">
<property name="text"> <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> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </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> </layout>
</widget> </widget>
<widget class="QWidget" name="advanced_tab"> <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