Commit 213a5431 authored by Tijmen de Mes's avatar Tijmen de Mes

Syntax fixes

parent 95ad70fc
...@@ -214,6 +214,7 @@ class ScreenSharingStreamInfo(MSRPStreamInfo): ...@@ -214,6 +214,7 @@ class ScreenSharingStreamInfo(MSRPStreamInfo):
if stream is not None: if stream is not None:
self.mode = stream.handler.type self.mode = stream.handler.type
class MessageStreamInfo(object): class MessageStreamInfo(object):
def __init__(self): def __init__(self):
self.encryption = None self.encryption = None
...@@ -488,6 +489,7 @@ class BlinkSession(BlinkSessionBase): ...@@ -488,6 +489,7 @@ class BlinkSession(BlinkSessionBase):
else: else:
self.timer.stop() self.timer.stop()
self.direction = None self.direction = None
self.__dict__['active'] = False self.__dict__['active'] = False
...@@ -685,6 +687,7 @@ class BlinkSession(BlinkSessionBase): ...@@ -685,6 +687,7 @@ class BlinkSession(BlinkSessionBase):
self._initialize(reinitialize=True) self._initialize(reinitialize=True)
else: else:
self._delete_when_done = len(stream_descriptions) == 1 and stream_descriptions[0].type == 'audio' self._delete_when_done = len(stream_descriptions) == 1 and stream_descriptions[0].type == 'audio'
self.direction = 'outgoing' self.direction = 'outgoing'
self.account = account self.account = account
self.contact = contact self.contact = contact
...@@ -3016,6 +3019,7 @@ class ChatSessionIconLabel(QLabel): ...@@ -3016,6 +3019,7 @@ class ChatSessionIconLabel(QLabel):
ui_class, base_class = uic.loadUiType(Resources.get('chat_session.ui')) ui_class, base_class = uic.loadUiType(Resources.get('chat_session.ui'))
class ChatSessionWidget(base_class, ui_class): class ChatSessionWidget(base_class, ui_class):
class StandardDisplayMode(metaclass=MarkerType): pass class StandardDisplayMode(metaclass=MarkerType): pass
class AlternateDisplayMode(metaclass=MarkerType): pass class AlternateDisplayMode(metaclass=MarkerType): pass
...@@ -3106,6 +3110,7 @@ class ChatSessionWidget(base_class, ui_class): ...@@ -3106,6 +3110,7 @@ class ChatSessionWidget(base_class, ui_class):
self.video_icon.setVisible('video' in session.blink_session.streams) self.video_icon.setVisible('video' in session.blink_session.streams)
self.screen_sharing_icon.setVisible('screen-sharing' in session.blink_session.streams) self.screen_sharing_icon.setVisible('screen-sharing' in session.blink_session.streams)
del ui_class, base_class del ui_class, base_class
...@@ -4762,7 +4767,7 @@ class ConferenceParticipantDelegate(QStyledItemDelegate, ColorHelperMixin): ...@@ -4762,7 +4767,7 @@ class ConferenceParticipantDelegate(QStyledItemDelegate, ColorHelperMixin):
def editorEvent(self, event, model, option, index): def editorEvent(self, event, model, option, index):
if event.type() == QEvent.MouseButtonRelease and event.button() == Qt.LeftButton and event.modifiers() == Qt.NoModifier: if event.type() == QEvent.MouseButtonRelease and event.button() == Qt.LeftButton and event.modifiers() == Qt.NoModifier:
cross_rect = option.rect.adjusted(option.rect.width()-14, 0, 0, -option.rect.height()/2) # top half of the rightmost 14 pixels cross_rect = option.rect.adjusted(option.rect.width() - 14, 0, 0, -option.rect.height() / 2) # top half of the rightmost 14 pixels
if cross_rect.contains(event.pos()): if cross_rect.contains(event.pos()):
item = index.data(Qt.UserRole) item = index.data(Qt.UserRole)
model.session.server_conference.remove_participant(item.participant) model.session.server_conference.remove_participant(item.participant)
...@@ -4801,8 +4806,8 @@ class ConferenceParticipantDelegate(QStyledItemDelegate, ColorHelperMixin): ...@@ -4801,8 +4806,8 @@ class ConferenceParticipantDelegate(QStyledItemDelegate, ColorHelperMixin):
base_contrast_color = self.calc_light_color(background_color) base_contrast_color = self.calc_light_color(background_color)
gradient = QLinearGradient(0, 0, 1, 0) gradient = QLinearGradient(0, 0, 1, 0)
gradient.setCoordinateMode(QLinearGradient.ObjectBoundingMode) gradient.setCoordinateMode(QLinearGradient.ObjectBoundingMode)
gradient.setColorAt(0.0, self.color_with_alpha(base_contrast_color, 0.3*255)) gradient.setColorAt(0.0, self.color_with_alpha(base_contrast_color, 0.3 * 255))
gradient.setColorAt(1.0, self.color_with_alpha(base_contrast_color, 0.8*255)) gradient.setColorAt(1.0, self.color_with_alpha(base_contrast_color, 0.8 * 255))
contrast_color = QBrush(gradient) contrast_color = QBrush(gradient)
else: else:
foreground_color = widget.palette().color(QPalette.Normal, widget.foregroundRole()) foreground_color = widget.palette().color(QPalette.Normal, widget.foregroundRole())
...@@ -5129,13 +5134,13 @@ class IncomingDialogBase(QDialog): ...@@ -5129,13 +5134,13 @@ class IncomingDialogBase(QDialog):
total_width = width + window_frame_size.width() total_width = width + window_frame_size.width()
total_height = height + window_frame_size.height() total_height = height + window_frame_size.height()
x = int(limit(screen_geometry.center().x() - total_width/2, min=available_geometry.left(), max=available_geometry.right()-total_width)) x = int(limit(screen_geometry.center().x() - total_width / 2, min=available_geometry.left(), max=available_geometry.right() - total_width))
if slot is None: if slot is None:
y = -1 y = -1
elif slot % 2 == 0: elif slot % 2 == 0:
y = int(screen_geometry.center().y() + (slot-1)*total_height/2) y = int(screen_geometry.center().y() + (slot-1) * total_height / 2)
else: else:
y = int(screen_geometry.center().y() - slot*total_height/2) y = int(screen_geometry.center().y() - slot * total_height / 2)
if available_geometry.top() <= y <= available_geometry.bottom() - total_height: if available_geometry.top() <= y <= available_geometry.bottom() - total_height:
self.setGeometry(x, y, width, height) self.setGeometry(x, y, width, height)
......
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