Moved the VoIP Buttons to the top right corner on the Chat Window.

Moved Search Filter feature into a frame, to hide by default for a clean Chat Window, optional enable from the menu.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7772 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2014-12-19 12:17:58 +00:00
parent 6452947e8a
commit f0d3d66e3f
10 changed files with 239 additions and 178 deletions

View File

@ -16,48 +16,59 @@
#include <retroshare/rsstatus.h>
#define CALL_START ":/images/call-start-22.png"
#define CALL_STOP ":/images/call-stop-22.png"
#define CALL_HOLD ":/images/call-hold-22.png"
#define CALL_START ":/images/call-start.png"
#define CALL_STOP ":/images/call-stop.png"
#define CALL_HOLD ":/images/call-hold.png"
VOIPChatWidgetHolder::VOIPChatWidgetHolder(ChatWidget *chatWidget)
: QObject(), ChatWidgetHolder(chatWidget)
{
QIcon icon ;
icon.addPixmap(QPixmap(":/images/audio-volume-muted-22.png")) ;
icon.addPixmap(QPixmap(":/images/audio-volume-medium-22.png"),QIcon::Normal,QIcon::On) ;
icon.addPixmap(QPixmap(":/images/audio-volume-medium-22.png"),QIcon::Disabled,QIcon::On) ;
icon.addPixmap(QPixmap(":/images/audio-volume-medium-22.png"),QIcon::Active,QIcon::On) ;
icon.addPixmap(QPixmap(":/images/audio-volume-medium-22.png"),QIcon::Selected,QIcon::On) ;
icon.addPixmap(QPixmap(":/images/audio-volume-muted.png")) ;
icon.addPixmap(QPixmap(":/images/audio-volume-high.png"),QIcon::Normal,QIcon::On) ;
icon.addPixmap(QPixmap(":/images/audio-volume-high.png"),QIcon::Disabled,QIcon::On) ;
icon.addPixmap(QPixmap(":/images/audio-volume-high.png"),QIcon::Active,QIcon::On) ;
icon.addPixmap(QPixmap(":/images/audio-volume-high.png"),QIcon::Selected,QIcon::On) ;
audioListenToggleButton = new QToolButton ;
audioListenToggleButton->setIcon(icon) ;
audioListenToggleButton->setIconSize(QSize(22,22)) ;
audioListenToggleButton->setIconSize(QSize(48,48)) ;
audioListenToggleButton->setAutoRaise(true) ;
audioListenToggleButton->setCheckable(true);
audioListenToggleButton->setMinimumSize(QSize(28,28)) ;
audioListenToggleButton->setMaximumSize(QSize(28,28)) ;
audioListenToggleButton->setMinimumSize(QSize(50,50)) ;
audioListenToggleButton->setMaximumSize(QSize(50,50)) ;
audioListenToggleButton->setText(QString()) ;
audioListenToggleButton->setToolTip(tr("Mute"));
QIcon icon2 ;
icon2.addPixmap(QPixmap(":/images/call-start-22.png")) ;
icon2.addPixmap(QPixmap(":/images/call-hold-22.png"),QIcon::Normal,QIcon::On) ;
icon2.addPixmap(QPixmap(":/images/call-hold-22.png"),QIcon::Disabled,QIcon::On) ;
icon2.addPixmap(QPixmap(":/images/call-hold-22.png"),QIcon::Active,QIcon::On) ;
icon2.addPixmap(QPixmap(":/images/call-hold-22.png"),QIcon::Selected,QIcon::On) ;
icon2.addPixmap(QPixmap(":/images/call-start.png")) ;
icon2.addPixmap(QPixmap(":/images/call-hold.png"),QIcon::Normal,QIcon::On) ;
icon2.addPixmap(QPixmap(":/images/call-hold.png"),QIcon::Disabled,QIcon::On) ;
icon2.addPixmap(QPixmap(":/images/call-hold.png"),QIcon::Active,QIcon::On) ;
icon2.addPixmap(QPixmap(":/images/call-hold.png"),QIcon::Selected,QIcon::On) ;
audioCaptureToggleButton = new QToolButton ;
audioCaptureToggleButton->setMinimumSize(QSize(28,28)) ;
audioCaptureToggleButton->setMaximumSize(QSize(28,28)) ;
audioCaptureToggleButton->setMinimumSize(QSize(50,50)) ;
audioCaptureToggleButton->setMaximumSize(QSize(50,50)) ;
audioCaptureToggleButton->setText(QString()) ;
audioCaptureToggleButton->setToolTip(tr("Start Call"));
audioCaptureToggleButton->setIcon(icon2) ;
audioCaptureToggleButton->setIconSize(QSize(22,22)) ;
audioCaptureToggleButton->setIconSize(QSize(48,48)) ;
audioCaptureToggleButton->setAutoRaise(true) ;
audioCaptureToggleButton->setCheckable(true) ;
hangupButton = new QToolButton ;
hangupButton->setIcon(QIcon(":/images/call-stop.png")) ;
hangupButton->setIconSize(QSize(48,48)) ;
hangupButton->setMinimumSize(QSize(50,50)) ;
hangupButton->setMaximumSize(QSize(50,50)) ;
hangupButton->setCheckable(false) ;
hangupButton->setAutoRaise(true) ;
hangupButton->setText(QString()) ;
hangupButton->setToolTip(tr("Hangup Call"));
hangupButton->hide();
QIcon icon3 ;
icon3.addPixmap(QPixmap(":/images/video-icon-on.png")) ;
icon3.addPixmap(QPixmap(":/images/video-icon-off.png"),QIcon::Normal,QIcon::On) ;
@ -66,35 +77,24 @@ VOIPChatWidgetHolder::VOIPChatWidgetHolder(ChatWidget *chatWidget)
icon3.addPixmap(QPixmap(":/images/video-icon-off.png"),QIcon::Selected,QIcon::On) ;
videoCaptureToggleButton = new QToolButton ;
videoCaptureToggleButton->setMinimumSize(QSize(28,28)) ;
videoCaptureToggleButton->setMaximumSize(QSize(28,28)) ;
videoCaptureToggleButton->setMinimumSize(QSize(50,50)) ;
videoCaptureToggleButton->setMaximumSize(QSize(50,50)) ;
videoCaptureToggleButton->setText(QString()) ;
videoCaptureToggleButton->setToolTip(tr("Start Video Call"));
videoCaptureToggleButton->setIcon(icon3) ;
videoCaptureToggleButton->setIconSize(QSize(22,22)) ;
videoCaptureToggleButton->setIconSize(QSize(48,48)) ;
videoCaptureToggleButton->setAutoRaise(true) ;
videoCaptureToggleButton->setCheckable(true) ;
hangupButton = new QToolButton ;
hangupButton->setIcon(QIcon(":/images/call-stop-22.png")) ;
hangupButton->setIconSize(QSize(22,22)) ;
hangupButton->setMinimumSize(QSize(28,28)) ;
hangupButton->setMaximumSize(QSize(28,28)) ;
hangupButton->setCheckable(false) ;
hangupButton->setAutoRaise(true) ;
hangupButton->setText(QString()) ;
hangupButton->setToolTip(tr("Hangup Call"));
hangupButton->hide();
connect(videoCaptureToggleButton, SIGNAL(clicked()), this , SLOT(toggleVideoCapture()));
connect(audioListenToggleButton, SIGNAL(clicked()), this , SLOT(toggleAudioListen()));
connect(audioCaptureToggleButton, SIGNAL(clicked()), this , SLOT(toggleAudioCapture()));
connect(hangupButton, SIGNAL(clicked()), this , SLOT(hangupCall()));
mChatWidget->addChatBarWidget(audioListenToggleButton) ;
mChatWidget->addChatBarWidget(audioCaptureToggleButton) ;
mChatWidget->addChatBarWidget(videoCaptureToggleButton) ;
mChatWidget->addChatBarWidget(hangupButton) ;
mChatWidget->addVOIPBarWidget(audioListenToggleButton) ;
mChatWidget->addVOIPBarWidget(audioCaptureToggleButton) ;
mChatWidget->addVOIPBarWidget(hangupButton) ;
mChatWidget->addVOIPBarWidget(videoCaptureToggleButton) ;
outputAudioProcessor = NULL ;
outputAudioDevice = NULL ;

View File

@ -1,13 +1,13 @@
<RCC>
<qresource prefix="/">
<file>images/audio-volume-medium-22.png</file>
<file>images/audio-volume-high.png</file>
<file>images/muted_self.svg</file>
<file>images/audio-volume-muted-22.png</file>
<file>images/audio-volume-muted.png</file>
<file>images/talking_on.svg</file>
<file>images/talking_off.svg</file>
<file>images/call-start-22.png</file>
<file>images/call-stop-22.png</file>
<file>images/call-hold-22.png</file>
<file>images/call-start.png</file>
<file>images/call-stop.png</file>
<file>images/call-hold.png</file>
<file>images/camera-on.png</file>
<file>images/camera-off.png</file>
<file>images/video-icon-big.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -102,6 +102,7 @@ ChatWidget::ChatWidget(QWidget *parent) :
connect(ui->actionMoveToCursor, SIGNAL(triggered()), this, SLOT(toogle_MoveToCursor()));
connect(ui->actionSearchWithoutLimit, SIGNAL(triggered()), this, SLOT(toogle_SeachWithoutLimit()));
connect(ui->searchButton, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuSearchButton(QPoint)));
connect(ui->actionSearch_History, SIGNAL(triggered()), this, SLOT(searchHistory()));
ui->markButton->setToolTip(tr("<b>Mark this selected text</b><br><i>Ctrl+M</i>"));
@ -133,6 +134,8 @@ ChatWidget::ChatWidget(QWidget *parent) :
ui->infoFrame->setVisible(false);
ui->statusMessageLabel->hide();
ui->searchframe->hide();
setAcceptDrops(true);
ui->chatTextEdit->setAcceptDrops(false);
ui->hashBox->setDropWidget(this);
@ -149,6 +152,7 @@ ChatWidget::ChatWidget(QWidget *parent) :
menu->addAction(ui->actionDeleteChatHistory);
menu->addAction(ui->actionSaveChatHistory);
menu->addAction(ui->actionMessageHistory);
menu->addAction(ui->actionSearch_History);
ui->pushtoolsButton->setMenu(menu);
ui->chatTextEdit->installEventFilter(this);
@ -207,6 +211,12 @@ void ChatWidget::addChatBarWidget(QWidget *w)
ui->pluginButtonFrame->layout()->addWidget(w) ;
}
void ChatWidget::addVOIPBarWidget(QWidget *w)
{
ui->titleBarFrame->layout()->addWidget(w) ;
}
void ChatWidget::init(const RsPeerId &peerId, const QString &title)
{
this->peerId = peerId;
@ -1195,6 +1205,16 @@ void ChatWidget::messageHistory()
imBrowser.exec();
}
void ChatWidget::searchHistory()
{
if(ui->actionSearch_History->isChecked()){
ui->searchframe->show();
}else {
ui->searchframe->hide();
}
}
void ChatWidget::addExtraFile()
{
QStringList files;

View File

@ -99,6 +99,9 @@ public:
// small enough in size.
void addChatBarWidget(QWidget *w) ;
void addVOIPBarWidget(QWidget *w);
;
// Adds a new horizonal widget in the layout of the chat window.
void addChatHorizontalWidget(QWidget *w) ;
@ -117,6 +120,8 @@ private slots:
void deleteChatHistory();
void messageHistory();
void resetStatusBar() ;
void searchHistory();
signals:
void infoChanged(ChatWidget*);

View File

@ -64,6 +64,9 @@
<property name="text">
<string notr="true">Title</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
@ -71,6 +74,9 @@
<property name="text">
<string>(Status)</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
@ -98,143 +104,158 @@
</spacer>
</item>
<item>
<widget class="QToolButton" name="markButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<widget class="QFrame" name="searchframe">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="minimumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/highlight.png</normaloff>:/images/highlight.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="LineEditClear" name="leSearch"/>
</item>
<item>
<widget class="QToolButton" name="searchBefore">
<property name="minimumSize">
<size>
<width>14</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>14</width>
<height>28</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/arrow-left.png</normaloff>:/images/arrow-left.png</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="searchAfter">
<property name="minimumSize">
<size>
<width>14</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>14</width>
<height>28</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/arrow-right.png</normaloff>:/images/arrow-right.png</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="searchButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/find.png</normaloff>:/images/find.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="margin">
<number>0</number>
</property>
<item row="0" column="4">
<widget class="QToolButton" name="searchButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/find.png</normaloff>:/images/find.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QToolButton" name="searchBefore">
<property name="minimumSize">
<size>
<width>14</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>14</width>
<height>28</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/arrow-left.png</normaloff>:/images/arrow-left.png</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QToolButton" name="markButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/highlight.png</normaloff>:/images/highlight.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="LineEditClear" name="leSearch"/>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="searchAfter">
<property name="minimumSize">
<size>
<width>14</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>14</width>
<height>28</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/arrow-right.png</normaloff>:/images/arrow-right.png</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
@ -741,6 +762,10 @@ border-image: url(:/images/closepressed.png)
</property>
</action>
<action name="actionSaveChatHistory">
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/document_save.png</normaloff>:/images/document_save.png</iconset>
</property>
<property name="text">
<string>Save Chat History</string>
</property>
@ -824,6 +849,17 @@ border-image: url(:/images/closepressed.png)
<string>Choose color</string>
</property>
</action>
<action name="actionSearch_History">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Display Search Box</string>
</property>
<property name="toolTip">
<string>Search Box</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>