mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Add a button on VOIP to hide text when video is on.
This commit is contained in:
parent
d4c838bc72
commit
8a7e359557
@ -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;
|
||||
|
@ -214,7 +214,7 @@ void ChatWidget::setDefaultExtraFileFlags(TransferRequestFlags fl)
|
||||
|
||||
void ChatWidget::addChatHorizontalWidget(QWidget *w)
|
||||
{
|
||||
ui->verticalLayout_2->addWidget(w) ;
|
||||
ui->vl_Plugins->addWidget(w) ;
|
||||
update() ;
|
||||
}
|
||||
|
||||
@ -223,9 +223,14 @@ void ChatWidget::addChatBarWidget(QWidget *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()
|
||||
|
@ -108,9 +108,8 @@ public:
|
||||
// Adds one widget in the chat bar. Used to add e.g. new buttons. The widget should be
|
||||
// small enough in size.
|
||||
void addChatBarWidget(QWidget *w) ;
|
||||
|
||||
|
||||
void addVOIPBarWidget(QWidget *w);
|
||||
void addTitleBarWidget(QWidget *w);
|
||||
void hideChatText(bool hidden);
|
||||
RSButtonOnText* getNewButtonOnTextBrowser();
|
||||
RSButtonOnText* getNewButtonOnTextBrowser(QString text);
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user