Commit 7797a7e2 authored by Tijmen de Mes's avatar Tijmen de Mes

Added configuration/Preferences for OpenPGP

parent a6339c83
......@@ -66,6 +66,9 @@ class SMSSettings(SettingsGroup):
enable_iscomposing = Setting(type=bool, default=True)
enable_imdn = Setting(type=bool, default=True)
add_unknown_contacts = Setting(type=bool, default=True)
enable_pgp = Setting(type=bool, default=True)
public_key = Setting(type=ApplicationDataPath, default=None, nillable=True)
private_key = Setting(type=ApplicationDataPath, default=None, nillable=True)
class SoundSettings(SettingsGroup):
......
......@@ -42,6 +42,7 @@ class ChatSettingsExtension(ChatSettings):
auto_accept = Setting(type=bool, default=False)
sms_replication = Setting(type=bool, default=True)
history_directory = Setting(type=ApplicationDataPath, default=ApplicationDataPath('history'))
keys_directory = Setting(type=ApplicationDataPath, default=ApplicationDataPath('keys'))
class GoogleContactsSettings(SettingsGroup):
......
......@@ -261,6 +261,7 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
self.message_iscomposing_enabled_button.clicked.connect(self._SH_EnableMessageIsComposingButtonClicked)
self.message_imdn_enabled_button.clicked.connect(self._SH_EnableMessageIMDNButtonClicked)
self.message_add_unknown_contacts_button.clicked.connect(self._SH_AddUnknownContactsButtonClicked)
self.message_pgp_enabled_button.clicked.connect(self._SH_EnablePGPButtonClicked)
# Audio devices
self.audio_alert_device_button.activated[int].connect(self._SH_AudioAlertDeviceButtonActivated)
......@@ -840,6 +841,7 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
self.message_imdn_enabled_button.setEnabled(account.sms.use_cpim)
self.message_imdn_enabled_button.setChecked(account.sms.enable_imdn)
self.message_add_unknown_contacts_button.setChecked(account.sms.add_unknown_contacts)
self.message_pgp_enabled_button.setChecked(account.sms.enable_pgp)
if account is not bonjour_account:
self.account_auto_answer.setText('Auto answer from allowed contacts')
......@@ -1446,6 +1448,11 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
account.sms.add_unknown_contacts = checked
account.save()
def _SH_EnablePGPButtonClicked(self, checked):
account = self.selected_account
account.sms.enable_pgp = checked
account.save()
# Audio devices signal handlers
def _SH_AudioAlertDeviceButtonActivated(self, index):
device = self.audio_alert_device_button.itemData(index)
......
......@@ -1291,6 +1291,13 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item row="11" column="1">
<widget class="QCheckBox" name="message_add_unknown_contacts_button">
<property name="text">
<string>Add unknown contacts to 'Messages' group in your contacts</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QLabel" name="label_4">
<property name="enabled">
......@@ -1301,17 +1308,26 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Line" name="line_2">
<item row="8" column="1">
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="message_cpim_enabled_button">
<item row="1" column="1">
<widget class="QLabel" name="message_label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Use CPIM envelope</string>
<string>When sending messages</string>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
</widget>
</item>
......@@ -1322,6 +1338,13 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="message_iscomposing_enabled_button">
<property name="text">
......@@ -1342,33 +1365,17 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="message_label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<item row="4" column="1">
<widget class="QCheckBox" name="message_cpim_enabled_button">
<property name="text">
<string>When sending messages</string>
</property>
<property name="scaledContents">
<bool>false</bool>
<string>Use CPIM envelope</string>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QCheckBox" name="message_add_unknown_contacts_button">
<item row="12" column="1">
<widget class="QCheckBox" name="message_pgp_enabled_button">
<property name="text">
<string>Add unknown contacts to 'Messages' group in your contacts</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<string>Enable message encryption with OpenPGP (if supported by receiver)</string>
</property>
</widget>
</item>
......
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