Commit 48379e75 authored by Dan Pascu's avatar Dan Pascu

Syncronized the conference button state with the selected session

parent 8738da3c
...@@ -52,6 +52,8 @@ class MainWindow(base_class, ui_class): ...@@ -52,6 +52,8 @@ class MainWindow(base_class, ui_class):
self.session_list.setModel(self.session_model) self.session_list.setModel(self.session_model)
self.session_model.test() self.session_model.test()
self.session_list.selectionModel().selectionChanged.connect(self.session_list_selection_changed)
self.contacts_panel.sibling_panel = self.sessions_panel self.contacts_panel.sibling_panel = self.sessions_panel
self.contacts_panel.sibling_name = u'Switch to Calls' self.contacts_panel.sibling_name = u'Switch to Calls'
self.sessions_panel.sibling_panel = self.contacts_panel self.sessions_panel.sibling_panel = self.contacts_panel
...@@ -148,6 +150,14 @@ class MainWindow(base_class, ui_class): ...@@ -148,6 +150,14 @@ class MainWindow(base_class, ui_class):
selected_items = self.contact_list.selectionModel().selectedIndexes() selected_items = self.contact_list.selectionModel().selectedIndexes()
self.enable_call_buttons(len(selected_items)==1 and isinstance(self.contact_model.data(selected_items[0]), Contact)) self.enable_call_buttons(len(selected_items)==1 and isinstance(self.contact_model.data(selected_items[0]), Contact))
def session_list_selection_changed(self, selected, deselected):
selected_indexes = selected.indexes()
if not selected_indexes:
self.conference_button.setChecked(False)
else:
active_session = self.session_model.data(selected_indexes[0])
self.conference_button.setChecked(active_session.conference is not None)
def switch_main_view(self): def switch_main_view(self):
widget = self.main_view.currentWidget().sibling_panel widget = self.main_view.currentWidget().sibling_panel
self.main_view.setCurrentWidget(widget) self.main_view.setCurrentWidget(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