mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-21 12:54:26 -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->setAutoRaise(true) ;
|
||||||
videoCaptureToggleButton->setCheckable(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(audioListenToggleButton, SIGNAL(clicked()), this , SLOT(toggleAudioListen()));
|
||||||
connect(audioCaptureToggleButton, SIGNAL(clicked()), this , SLOT(toggleAudioCapture()));
|
connect(audioCaptureToggleButton, SIGNAL(clicked()), this , SLOT(toggleAudioCapture()));
|
||||||
connect(hangupButton, SIGNAL(clicked()), this , SLOT(hangupCall()));
|
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->addTitleBarWidget(audioListenToggleButton) ;
|
||||||
mChatWidget->addVOIPBarWidget(audioCaptureToggleButton) ;
|
mChatWidget->addTitleBarWidget(audioCaptureToggleButton) ;
|
||||||
mChatWidget->addVOIPBarWidget(hangupButton) ;
|
mChatWidget->addTitleBarWidget(hangupButton) ;
|
||||||
mChatWidget->addVOIPBarWidget(videoCaptureToggleButton) ;
|
mChatWidget->addTitleBarWidget(videoCaptureToggleButton) ;
|
||||||
|
mChatWidget->addTitleBarWidget(hideChatTextToggleButton) ;
|
||||||
|
|
||||||
outputAudioProcessor = NULL ;
|
outputAudioProcessor = NULL ;
|
||||||
outputAudioDevice = NULL ;
|
outputAudioDevice = NULL ;
|
||||||
|
@ -252,6 +272,7 @@ void VOIPChatWidgetHolder::toggleVideoCapture()
|
||||||
{
|
{
|
||||||
if (videoCaptureToggleButton->isChecked())
|
if (videoCaptureToggleButton->isChecked())
|
||||||
{
|
{
|
||||||
|
hideChatTextToggleButton->setEnabled(true);
|
||||||
//activate video input
|
//activate video input
|
||||||
//
|
//
|
||||||
videoWidget->show();
|
videoWidget->show();
|
||||||
|
@ -272,6 +293,9 @@ void VOIPChatWidgetHolder::toggleVideoCapture()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
hideChatTextToggleButton->setEnabled(false);
|
||||||
|
hideChatTextToggleButton->setChecked(false);
|
||||||
|
toggleHideChatText();
|
||||||
inputVideoDevice->stop() ;
|
inputVideoDevice->stop() ;
|
||||||
videoCaptureToggleButton->setToolTip(tr("Activate camera"));
|
videoCaptureToggleButton->setToolTip(tr("Activate camera"));
|
||||||
outputVideoDevice->showFrameOff();
|
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()
|
void VOIPChatWidgetHolder::botMouseEnter()
|
||||||
{
|
{
|
||||||
RSButtonOnText *source = qobject_cast<RSButtonOnText *>(QObject::sender());
|
RSButtonOnText *source = qobject_cast<RSButtonOnText *>(QObject::sender());
|
||||||
|
|
|
@ -62,6 +62,7 @@ private slots:
|
||||||
void toggleAudioListen();
|
void toggleAudioListen();
|
||||||
void toggleAudioCapture();
|
void toggleAudioCapture();
|
||||||
void toggleVideoCapture();
|
void toggleVideoCapture();
|
||||||
|
void toggleHideChatText();
|
||||||
void hangupCall() ;
|
void hangupCall() ;
|
||||||
void botMouseEnter();
|
void botMouseEnter();
|
||||||
void botMouseLeave();
|
void botMouseLeave();
|
||||||
|
@ -87,6 +88,7 @@ protected:
|
||||||
QToolButton *audioListenToggleButton ;
|
QToolButton *audioListenToggleButton ;
|
||||||
QToolButton *audioCaptureToggleButton ;
|
QToolButton *audioCaptureToggleButton ;
|
||||||
QToolButton *videoCaptureToggleButton ;
|
QToolButton *videoCaptureToggleButton ;
|
||||||
|
QToolButton *hideChatTextToggleButton ;
|
||||||
QToolButton *hangupButton ;
|
QToolButton *hangupButton ;
|
||||||
|
|
||||||
typedef QMap<QString, RSButtonOnText*> button_map;
|
typedef QMap<QString, RSButtonOnText*> button_map;
|
||||||
|
|
|
@ -214,7 +214,7 @@ void ChatWidget::setDefaultExtraFileFlags(TransferRequestFlags fl)
|
||||||
|
|
||||||
void ChatWidget::addChatHorizontalWidget(QWidget *w)
|
void ChatWidget::addChatHorizontalWidget(QWidget *w)
|
||||||
{
|
{
|
||||||
ui->verticalLayout_2->addWidget(w) ;
|
ui->vl_Plugins->addWidget(w) ;
|
||||||
update() ;
|
update() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,9 +223,14 @@ void ChatWidget::addChatBarWidget(QWidget *w)
|
||||||
ui->pluginButtonFrame->layout()->addWidget(w) ;
|
ui->pluginButtonFrame->layout()->addWidget(w) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatWidget::addVOIPBarWidget(QWidget *w)
|
void ChatWidget::addTitleBarWidget(QWidget *w)
|
||||||
{
|
{
|
||||||
ui->titleBarFrame->layout()->addWidget(w) ;
|
ui->pluginTitleFrame->layout()->addWidget(w) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ChatWidget::hideChatText(bool hidden)
|
||||||
|
{
|
||||||
|
ui->frame_ChatText->setHidden(hidden); ;
|
||||||
}
|
}
|
||||||
|
|
||||||
RSButtonOnText* ChatWidget::getNewButtonOnTextBrowser()
|
RSButtonOnText* ChatWidget::getNewButtonOnTextBrowser()
|
||||||
|
|
|
@ -108,9 +108,8 @@ public:
|
||||||
// Adds one widget in the chat bar. Used to add e.g. new buttons. The widget should be
|
// Adds one widget in the chat bar. Used to add e.g. new buttons. The widget should be
|
||||||
// small enough in size.
|
// small enough in size.
|
||||||
void addChatBarWidget(QWidget *w) ;
|
void addChatBarWidget(QWidget *w) ;
|
||||||
|
void addTitleBarWidget(QWidget *w);
|
||||||
|
void hideChatText(bool hidden);
|
||||||
void addVOIPBarWidget(QWidget *w);
|
|
||||||
RSButtonOnText* getNewButtonOnTextBrowser();
|
RSButtonOnText* getNewButtonOnTextBrowser();
|
||||||
RSButtonOnText* getNewButtonOnTextBrowser(QString text);
|
RSButtonOnText* getNewButtonOnTextBrowser(QString text);
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue