Commit 861667d0 authored by Dan Pascu's avatar Dan Pascu

Show active sessions indicator while in contacts panel

parent 62066c58
...@@ -44,6 +44,7 @@ class MainWindow(base_class, ui_class): ...@@ -44,6 +44,7 @@ class MainWindow(base_class, ui_class):
self.set_user_icon(Resources.get("icons/default-avatar.png")) # ":/resources/icons/default-avatar.png" self.set_user_icon(Resources.get("icons/default-avatar.png")) # ":/resources/icons/default-avatar.png"
self.enable_call_buttons(False) self.enable_call_buttons(False)
self.active_sessions_label.hide()
self.account_model = AccountModel(self) self.account_model = AccountModel(self)
self.enabled_account_model = ActiveAccountModel(self.account_model, self) self.enabled_account_model = ActiveAccountModel(self.account_model, self)
...@@ -393,6 +394,8 @@ class MainWindow(base_class, ui_class): ...@@ -393,6 +394,8 @@ class MainWindow(base_class, ui_class):
def _SH_SessionModelChangedStructure(self): def _SH_SessionModelChangedStructure(self):
active_sessions = self.session_model.active_sessions active_sessions = self.session_model.active_sessions
self.active_sessions_label.setText(u'There is 1 active call' if len(active_sessions)==1 else u'There are %d active calls' % len(active_sessions))
self.active_sessions_label.setVisible(any(active_sessions))
self.hangup_all_button.setEnabled(any(active_sessions)) self.hangup_all_button.setEnabled(any(active_sessions))
selected_indexes = self.session_list.selectionModel().selectedIndexes() selected_indexes = self.session_list.selectionModel().selectedIndexes()
active_session = self.session_model.data(selected_indexes[0]) if selected_indexes else Null active_session = self.session_model.data(selected_indexes[0]) if selected_indexes else Null
......
...@@ -281,7 +281,7 @@ ...@@ -281,7 +281,7 @@
<item> <item>
<widget class="QStackedWidget" name="main_view"> <widget class="QStackedWidget" name="main_view">
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="contacts_panel"> <widget class="QWidget" name="contacts_panel">
<layout class="QVBoxLayout" name="verticalLayout_8"> <layout class="QVBoxLayout" name="verticalLayout_8">
...@@ -294,7 +294,7 @@ ...@@ -294,7 +294,7 @@
<item> <item>
<widget class="QStackedWidget" name="contacts_view"> <widget class="QStackedWidget" name="contacts_view">
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="contact_list_panel"> <widget class="QWidget" name="contact_list_panel">
<layout class="QVBoxLayout" name="verticalLayout_7"> <layout class="QVBoxLayout" name="verticalLayout_7">
...@@ -489,6 +489,32 @@ buttons below.</string> ...@@ -489,6 +489,32 @@ buttons below.</string>
</widget> </widget>
</widget> </widget>
</item> </item>
<item>
<widget class="QLabel" name="active_sessions_label">
<property name="font">
<font>
<family>Sans Serif</family>
</font>
</property>
<property name="styleSheet">
<string>background-color: #a0003a;
border-style: outset;
border-width: 1px;
border-radius: 3px;
border-color: #800040;
color: white;
margin-left: 1px;
margin-right: 1px;
padding: 2px;</string>
</property>
<property name="text">
<string>There are active calls</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item> <item>
<layout class="QHBoxLayout" name="contact_buttonbox_layout"> <layout class="QHBoxLayout" name="contact_buttonbox_layout">
<property name="spacing"> <property name="spacing">
......
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