Commit c92ecc5f authored by Dan Pascu's avatar Dan Pascu

Improved user interaction with the conference button

parent cc4caa58
# Copyright (c) 2010 AG Projects. See LICENSE for details. # Copyright (c) 2010 AG Projects. See LICENSE for details.
# #
__all__ = ['ToolButton', 'SegmentButton', 'SingleSegment', 'LeftSegment', 'MiddleSegment', 'RightSegment', 'SwitchViewButton'] __all__ = ['ToolButton', 'ConferenceButton', 'SegmentButton', 'SingleSegment', 'LeftSegment', 'MiddleSegment', 'RightSegment', 'SwitchViewButton']
from PyQt4.QtCore import QTimer, pyqtSignal from PyQt4.QtCore import QTimer, pyqtSignal
from PyQt4.QtGui import QPushButton, QStyle, QStyleOptionToolButton, QStylePainter, QToolButton from PyQt4.QtGui import QAction, QPushButton, QStyle, QStyleOptionToolButton, QStylePainter, QToolButton
class ToolButton(QToolButton): class ToolButton(QToolButton):
...@@ -17,6 +17,26 @@ class ToolButton(QToolButton): ...@@ -17,6 +17,26 @@ class ToolButton(QToolButton):
painter.drawComplexControl(QStyle.CC_ToolButton, option) painter.drawComplexControl(QStyle.CC_ToolButton, option)
class ConferenceButton(ToolButton):
makeConference = pyqtSignal()
breakConference = pyqtSignal()
def __init__(self, parent=None):
super(ConferenceButton, self).__init__(parent)
self.make_conference_action = QAction(u'Conference all single sessions', self, triggered=self.makeConference.emit)
self.break_conference_action = QAction(u'Break selected conference', self, triggered=self.breakConference.emit)
self.toggled.connect(self._SH_Toggled)
self.addAction(self.make_conference_action)
def _SH_Toggled(self, checked):
if checked:
self.removeAction(self.make_conference_action)
self.addAction(self.break_conference_action)
else:
self.removeAction(self.break_conference_action)
self.addAction(self.make_conference_action)
class SegmentTypeMeta(type): class SegmentTypeMeta(type):
def __repr__(cls): def __repr__(cls):
return cls.__name__ return cls.__name__
......
...@@ -712,7 +712,7 @@ buttons below.</string> ...@@ -712,7 +712,7 @@ buttons below.</string>
<widget class="QPushButton" name="hangup_all_button"> <widget class="QPushButton" name="hangup_all_button">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>85</width>
<height>24</height> <height>24</height>
</size> </size>
</property> </property>
...@@ -731,10 +731,10 @@ buttons below.</string> ...@@ -731,10 +731,10 @@ buttons below.</string>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="conference_button"> <widget class="ConferenceButton" name="conference_button">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>85</width>
<height>24</height> <height>24</height>
</size> </size>
</property> </property>
...@@ -753,6 +753,12 @@ buttons below.</string> ...@@ -753,6 +753,12 @@ buttons below.</string>
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="popupMode">
<enum>QToolButton::InstantPopup</enum>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextOnly</enum>
</property>
</widget> </widget>
</item> </item>
<item> <item>
...@@ -873,6 +879,11 @@ buttons below.</string> ...@@ -873,6 +879,11 @@ buttons below.</string>
<extends>QPushButton</extends> <extends>QPushButton</extends>
<header>blink.widgets.buttons</header> <header>blink.widgets.buttons</header>
</customwidget> </customwidget>
<customwidget>
<class>ConferenceButton</class>
<extends>QToolButton</extends>
<header>blink.widgets.buttons</header>
</customwidget>
</customwidgets> </customwidgets>
<tabstops> <tabstops>
<tabstop>search_box</tabstop> <tabstop>search_box</tabstop>
......
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