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