mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-01 10:46:23 -04:00
Add a button on VOIP to hide text when video is on.
This commit is contained in:
parent
d4c838bc72
commit
8a7e359557
5 changed files with 578 additions and 485 deletions
|
@ -107,15 +107,35 @@ VOIPChatWidgetHolder::VOIPChatWidgetHolder(ChatWidget *chatWidget, VOIPNotify *n
|
|||
videoCaptureToggleButton->setAutoRaise(true) ;
|
||||
videoCaptureToggleButton->setCheckable(true) ;
|
||||
|
||||
connect(videoCaptureToggleButton, SIGNAL(clicked()), this , SLOT(toggleVideoCapture()));
|
||||
QIcon icon4 ;
|
||||
icon4.addPixmap(QPixmap(":/images/channels32.png")) ;
|
||||
icon4.addPixmap(QPixmap(":/images/folder-draft24.png"),QIcon::Normal,QIcon::On) ;
|
||||
icon4.addPixmap(QPixmap(":/images/folder-draft24.png"),QIcon::Disabled,QIcon::On) ;
|
||||
icon4.addPixmap(QPixmap(":/images/folder-draft24.png"),QIcon::Active,QIcon::On) ;
|
||||
icon4.addPixmap(QPixmap(":/images/folder-draft24.png"),QIcon::Selected,QIcon::On) ;
|
||||
|
||||
hideChatTextToggleButton = new QToolButton ;
|
||||
hideChatTextToggleButton->setMinimumSize(QSize(44,44)) ;
|
||||
hideChatTextToggleButton->setMaximumSize(QSize(44,44)) ;
|
||||
hideChatTextToggleButton->setText(QString()) ;
|
||||
hideChatTextToggleButton->setToolTip(tr("Hide Chat Text"));
|
||||
hideChatTextToggleButton->setIcon(icon4) ;
|
||||
hideChatTextToggleButton->setIconSize(QSize(42,42)) ;
|
||||
hideChatTextToggleButton->setAutoRaise(true) ;
|
||||
hideChatTextToggleButton->setCheckable(true) ;
|
||||
hideChatTextToggleButton->setEnabled(false) ;
|
||||
|
||||
connect(audioListenToggleButton, SIGNAL(clicked()), this , SLOT(toggleAudioListen()));
|
||||
connect(audioCaptureToggleButton, SIGNAL(clicked()), this , SLOT(toggleAudioCapture()));
|
||||
connect(hangupButton, SIGNAL(clicked()), this , SLOT(hangupCall()));
|
||||
connect(videoCaptureToggleButton, SIGNAL(clicked()), this , SLOT(toggleVideoCapture()));
|
||||
connect(hideChatTextToggleButton, SIGNAL(clicked()), this , SLOT(toggleHideChatText()));
|
||||
|
||||
mChatWidget->addVOIPBarWidget(audioListenToggleButton) ;
|
||||
mChatWidget->addVOIPBarWidget(audioCaptureToggleButton) ;
|
||||
mChatWidget->addVOIPBarWidget(hangupButton) ;
|
||||
mChatWidget->addVOIPBarWidget(videoCaptureToggleButton) ;
|
||||
mChatWidget->addTitleBarWidget(audioListenToggleButton) ;
|
||||
mChatWidget->addTitleBarWidget(audioCaptureToggleButton) ;
|
||||
mChatWidget->addTitleBarWidget(hangupButton) ;
|
||||
mChatWidget->addTitleBarWidget(videoCaptureToggleButton) ;
|
||||
mChatWidget->addTitleBarWidget(hideChatTextToggleButton) ;
|
||||
|
||||
outputAudioProcessor = NULL ;
|
||||
outputAudioDevice = NULL ;
|
||||
|
@ -252,6 +272,7 @@ void VOIPChatWidgetHolder::toggleVideoCapture()
|
|||
{
|
||||
if (videoCaptureToggleButton->isChecked())
|
||||
{
|
||||
hideChatTextToggleButton->setEnabled(true);
|
||||
//activate video input
|
||||
//
|
||||
videoWidget->show();
|
||||
|
@ -272,6 +293,9 @@ void VOIPChatWidgetHolder::toggleVideoCapture()
|
|||
}
|
||||
else
|
||||
{
|
||||
hideChatTextToggleButton->setEnabled(false);
|
||||
hideChatTextToggleButton->setChecked(false);
|
||||
toggleHideChatText();
|
||||
inputVideoDevice->stop() ;
|
||||
videoCaptureToggleButton->setToolTip(tr("Activate camera"));
|
||||
outputVideoDevice->showFrameOff();
|
||||
|
@ -331,6 +355,17 @@ void VOIPChatWidgetHolder::addVideoData(const RsPeerId &peer_id, QByteArray* arr
|
|||
}
|
||||
}
|
||||
|
||||
void VOIPChatWidgetHolder::toggleHideChatText()
|
||||
{
|
||||
if (hideChatTextToggleButton->isChecked()) {
|
||||
mChatWidget->hideChatText(true);
|
||||
hideChatTextToggleButton->setToolTip(tr("Show Chat Text"));
|
||||
} else {
|
||||
mChatWidget->hideChatText(false);
|
||||
hideChatTextToggleButton->setToolTip(tr("Hide Chat Text"));
|
||||
}
|
||||
}
|
||||
|
||||
void VOIPChatWidgetHolder::botMouseEnter()
|
||||
{
|
||||
RSButtonOnText *source = qobject_cast<RSButtonOnText *>(QObject::sender());
|
||||
|
|
|
@ -62,6 +62,7 @@ private slots:
|
|||
void toggleAudioListen();
|
||||
void toggleAudioCapture();
|
||||
void toggleVideoCapture();
|
||||
void toggleHideChatText();
|
||||
void hangupCall() ;
|
||||
void botMouseEnter();
|
||||
void botMouseLeave();
|
||||
|
@ -87,6 +88,7 @@ protected:
|
|||
QToolButton *audioListenToggleButton ;
|
||||
QToolButton *audioCaptureToggleButton ;
|
||||
QToolButton *videoCaptureToggleButton ;
|
||||
QToolButton *hideChatTextToggleButton ;
|
||||
QToolButton *hangupButton ;
|
||||
|
||||
typedef QMap<QString, RSButtonOnText*> button_map;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue