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