Commit b41727d9 authored by Dan Pascu's avatar Dan Pascu

Fixed updating toolbar buttons when changing sessions and allow hold early

parent 6f16c32d
...@@ -804,12 +804,6 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin): ...@@ -804,12 +804,6 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin):
self.hold_button.setChecked(session.blink_session.local_hold) self.hold_button.setChecked(session.blink_session.local_hold)
self.record_button.setVisible('audio' in session.blink_session.streams) self.record_button.setVisible('audio' in session.blink_session.streams)
self.record_button.setChecked(session.blink_session.recording) self.record_button.setChecked(session.blink_session.recording)
# fixme: also update their enabled/disabled state (maybe not here though as this is called everytime the session changes) -Dan
# possible fix: have flags on the chat session item to indicate if it can be hold/recorded and have the chat session item listen to session notifications
# and when it changes these flags it will post a ChatSessionItemDidChange notification, which will end up calling this function
# and updating the window widgets. the ChatWindow will then not listen to session notifications anymore to change the state.
# this will also help fix issues with changes for other sessions (non-selected) being leaked into the selected session and
# changing its hold/record state -Dan
def _update_control_menu(self): def _update_control_menu(self):
menu = self.control_menu menu = self.control_menu
...@@ -1087,23 +1081,10 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin): ...@@ -1087,23 +1081,10 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin):
# they do not check if the session is in the model. maybe the right approach is to always have BlinkSessions in the model and if we need any other kind of sessions we create a # they do not check if the session is in the model. maybe the right approach is to always have BlinkSessions in the model and if we need any other kind of sessions we create a
# different class for them that posts different notifications. in that case we can do in in NewIncoming/Outgoing -Dan # different class for them that posts different notifications. in that case we can do in in NewIncoming/Outgoing -Dan
def _NH_BlinkSessionWillConnect(self, notification):
self.hold_button.setEnabled(False)
def _NH_BlinkSessionDidConnect(self, notification):
self.hold_button.setEnabled(True)
def _NH_BlinkSessionWillAddStream(self, notification): def _NH_BlinkSessionWillAddStream(self, notification):
self.hold_button.setEnabled(False)
if notification.data.stream.type == 'chat': if notification.data.stream.type == 'chat':
self.show() self.show()
def _NH_BlinkSessionDidAddStream(self, notification):
self.hold_button.setEnabled(True)
def _NH_BlinkSessionDidNotAddStream(self, notification):
self.hold_button.setEnabled(True)
def _NH_BlinkSessionDidRemoveStream(self, notification): def _NH_BlinkSessionDidRemoveStream(self, notification):
self._update_control_menu() self._update_control_menu()
self._update_session_info_panel(update_visibility=True) self._update_session_info_panel(update_visibility=True)
......
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