Commit fedca140 authored by Adrian Georgescu's avatar Adrian Georgescu

Added presence and message_summary account settings

parent 6b6b5b72
......@@ -212,6 +212,8 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
# Account information
self.account_enabled_button.clicked.connect(self._SH_AccountEnabledButtonClicked)
self.account_enabled_presence_button.clicked.connect(self._SH_AccountEnabledPresenceButtonClicked)
self.account_enabled_mwi_button.clicked.connect(self._SH_AccountEnabledMWIButtonClicked)
self.display_name_editor.editingFinished.connect(self._SH_DisplayNameEditorEditingFinished)
self.password_editor.editingFinished.connect(self._SH_PasswordEditorEditingFinished)
......@@ -769,7 +771,15 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
# Account information tab
self.account_enabled_button.setChecked(account.enabled)
self.account_enabled_button.setEnabled(True if account is not bonjour_account else BonjourAccount.mdns_available)
self.account_enabled_presence_button.setEnabled(account is not bonjour_account)
self.account_enabled_presence_button.setChecked(account.presence.enabled if account is not bonjour_account else False)
self.account_enabled_mwi_button.setEnabled(account is not bonjour_account)
self.account_enabled_mwi_button.setChecked(account.message_summary.enabled if account is not bonjour_account else False)
self.display_name_editor.setText(account.display_name or '')
if account is not bonjour_account:
self.password_editor.setText(account.auth.password)
selected_index = self.account_list.selectionModel().selectedIndexes()[0]
......@@ -1086,6 +1096,16 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
account.enabled = checked
account.save()
def _SH_AccountEnabledPresenceButtonClicked(self, checked):
account = self.selected_account
account.presence.enabled = checked
account.save()
def _SH_AccountEnabledMWIButtonClicked(self, checked):
account = self.selected_account
account.message_summary.enabled = checked
account.save()
def _SH_DisplayNameEditorEditingFinished(self):
account = self.selected_account
display_name = self.display_name_editor.text() or None
......@@ -1802,6 +1822,10 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
if not account.enabled:
self.refresh_account_registration_widgets(account)
self.reregister_button.setEnabled(account.enabled)
if 'message_summary.enabled' in notification.data.modified:
self.account_enabled_mwi_button.setChecked(account.message_summary.enabled)
if 'presence.enabled' in notification.data.modified:
self.account_enabled_presence_button.setChecked(account.presence.enabled)
if 'display_name' in notification.data.modified:
self.display_name_editor.setText(account.display_name or '')
if 'rtp.audio_codec_list' in notification.data.modified:
......
......@@ -164,7 +164,7 @@
<item row="0" column="3">
<widget class="QTabWidget" name="account_tab_widget">
<property name="currentIndex">
<number>3</number>
<number>0</number>
</property>
<widget class="QWidget" name="account_information_tab">
<attribute name="title">
......@@ -186,19 +186,19 @@
<property name="spacing">
<number>5</number>
</property>
<item row="3" column="0">
<widget class="QLabel" name="password_label">
<property name="text">
<string>Password:</string>
<item row="1" column="0" colspan="2">
<widget class="Line" name="line">
<property name="minimumSize">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="display_name_editor"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="display_name_label">
<property name="text">
......@@ -209,20 +209,20 @@
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="Line" name="line">
<property name="minimumSize">
<item row="6" column="0" colspan="2">
<spacer name="account_information_spacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>10</height>
<width>20</width>
<height>40</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</spacer>
</item>
<item row="6" column="0" colspan="2">
<item row="7" column="0" colspan="2">
<widget class="QLabel" name="account_registration_label">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
......@@ -235,6 +235,19 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="display_name_editor"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="password_label">
<property name="text">
<string>Password:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="password_editor">
<property name="echoMode">
......@@ -249,18 +262,19 @@
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<spacer name="account_information_spacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<item row="4" column="1">
<widget class="QCheckBox" name="account_enabled_presence_button">
<property name="text">
<string>Enable presence</string>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</widget>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="account_enabled_mwi_button">
<property name="text">
<string>Enable Message Waiting Indicator</string>
</property>
</spacer>
</widget>
</item>
</layout>
</widget>
......
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