Commit 1bd71e51 authored by Luci Stanescu's avatar Luci Stanescu

Renamed signal handler for consistency

parent 0bf6e608
......@@ -1251,28 +1251,9 @@ class SessionListView(QListView):
def setModel(self, model):
selection_model = self.selectionModel() or Null
selection_model.selectionChanged.disconnect(self._selection_changed)
selection_model.selectionChanged.disconnect(self._SH_SelectionModelSelectionChanged)
super(SessionListView, self).setModel(model)
self.selectionModel().selectionChanged.connect(self._selection_changed)
def _selection_changed(self, selected, deselected):
model = self.model()
for session in (model.data(index) for index in deselected.indexes()):
if session.conference is not None:
for sibling in session.conference.sessions:
sibling.widget.selected = False
else:
session.widget.selected = False
for session in (model.data(index) for index in selected.indexes()):
if session.conference is not None:
for sibling in session.conference.sessions:
sibling.widget.selected = True
else:
session.widget.selected = True
if not selected.isEmpty():
self.setCurrentIndex(selected.indexes()[0])
else:
self.setCurrentIndex(model.index(-1))
self.selectionModel().selectionChanged.connect(self._SH_SelectionModelSelectionChanged)
def contextMenuEvent(self, event):
pass
......@@ -1436,6 +1417,25 @@ class SessionListView(QListView):
else:
session.widget.drop_indicator = True
def _SH_SelectionModelSelectionChanged(self, selected, deselected):
model = self.model()
for session in (model.data(index) for index in deselected.indexes()):
if session.conference is not None:
for sibling in session.conference.sessions:
sibling.widget.selected = False
else:
session.widget.selected = False
for session in (model.data(index) for index in selected.indexes()):
if session.conference is not None:
for sibling in session.conference.sessions:
sibling.widget.selected = True
else:
session.widget.selected = True
if not selected.isEmpty():
self.setCurrentIndex(selected.indexes()[0])
else:
self.setCurrentIndex(model.index(-1))
ui_class, base_class = uic.loadUiType(Resources.get('incoming_dialog.ui'))
......
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