Commit 73e16e21 authored by Dan Pascu's avatar Dan Pascu

Added a separate UI file for the dragged audio session

parent 0dc02b43
......@@ -1306,6 +1306,7 @@ class Bottom: __metaclass__ = MarkerType
ui_class, base_class = uic.loadUiType(Resources.get('audio_session.ui'))
class AudioSessionWidget(base_class, ui_class):
def __init__(self, session, parent=None):
super(AudioSessionWidget, self).__init__(parent)
......@@ -1541,34 +1542,23 @@ class AudioSessionWidget(base_class, ui_class):
super(AudioSessionWidget, self).paintEvent(event)
ui_class, base_class = uic.loadUiType(Resources.get('audio_session_drag.ui'))
class DraggedAudioSessionWidget(base_class, ui_class):
"""Used to draw a dragged session item"""
def __init__(self, session_widget, parent=None):
super(DraggedAudioSessionWidget, self).__init__(parent)
with Resources.directory:
self.setupUi(self)
# add a left margin for the colored band
self.address_layout.setContentsMargins(8, -1, -1, -1)
self.stream_layout.setContentsMargins(8, -1, -1, -1)
self.bottom_layout.setContentsMargins(8, -1, -1, -1)
self.mute_button.hide()
self.hold_button.hide()
self.record_button.hide()
self.hangup_button.hide()
self.tls_label.hide()
self.srtp_label.hide()
self.latency_label.hide()
self.packet_loss_label.hide()
self.duration_label.hide()
self.stream_info_label.setText(u'')
self.address_label.setText(session_widget.address_label.text())
self.selected = session_widget.selected
self.in_conference = session_widget.position_in_conference is not None
self.address_label.setText(session_widget.address_label.text())
if self.in_conference:
self.status_label.setText(u'Drop outside the conference to detach')
self.note_label.setText(u'Drop outside the conference to detach')
else:
self.status_label.setText(u'Drop over a session to conference them')
self.status_label.show()
self.note_label.setText(u'Drop on a session to conference them')
def paintEvent(self, event):
painter = QPainter(self)
......@@ -1598,6 +1588,7 @@ class DraggedAudioSessionWidget(base_class, ui_class):
painter.end()
super(DraggedAudioSessionWidget, self).paintEvent(event)
del ui_class, base_class
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>session</class>
<widget class="QWidget" name="session">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>296</width>
<height>62</height>
</rect>
</property>
<property name="windowTitle">
<string>Session</string>
</property>
<layout class="QVBoxLayout" name="session_layout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>13</number>
</property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>5</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<item>
<widget class="QLabel" name="address_label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>test@example.com</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="note_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Drop&lt;/span&gt;: Conference &amp;nbsp;&lt;span style=&quot; font-weight:600;&quot;&gt;Alt+Drop&lt;/span&gt;: Transfer&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</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