mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Make call tooltips depend on status, grey out vol and mic settings when not in a call
This commit is contained in:
parent
1939231440
commit
398746a129
|
@ -272,7 +272,9 @@ void ChatForm::onAvInvite(int FriendId, int CallId, bool video)
|
||||||
connect(callConfirm, &CallConfirmWidget::rejected, this, &ChatForm::onRejectCallTriggered);
|
connect(callConfirm, &CallConfirmWidget::rejected, this, &ChatForm::onRejectCallTriggered);
|
||||||
|
|
||||||
callButton->setObjectName("grey");
|
callButton->setObjectName("grey");
|
||||||
|
callButton->setToolTip("");
|
||||||
videoButton->setObjectName("yellow");
|
videoButton->setObjectName("yellow");
|
||||||
|
videoButton->setToolTip(tr("Accept/Decline video call"));
|
||||||
connect(videoButton, &QPushButton::clicked, this, &ChatForm::onAnswerCallTriggered);
|
connect(videoButton, &QPushButton::clicked, this, &ChatForm::onAnswerCallTriggered);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -284,7 +286,9 @@ void ChatForm::onAvInvite(int FriendId, int CallId, bool video)
|
||||||
connect(callConfirm, &CallConfirmWidget::rejected, this, &ChatForm::onRejectCallTriggered);
|
connect(callConfirm, &CallConfirmWidget::rejected, this, &ChatForm::onRejectCallTriggered);
|
||||||
|
|
||||||
callButton->setObjectName("yellow");
|
callButton->setObjectName("yellow");
|
||||||
|
callButton->setToolTip(tr("Accept/Decline audio call"));
|
||||||
videoButton->setObjectName("grey");
|
videoButton->setObjectName("grey");
|
||||||
|
videoButton->setToolTip("");
|
||||||
connect(callButton, &QPushButton::clicked, this, &ChatForm::onAnswerCallTriggered);
|
connect(callButton, &QPushButton::clicked, this, &ChatForm::onAnswerCallTriggered);
|
||||||
}
|
}
|
||||||
callButton->style()->polish(callButton);
|
callButton->style()->polish(callButton);
|
||||||
|
@ -317,7 +321,9 @@ void ChatForm::onAvStart(int FriendId, int CallId, bool video)
|
||||||
if (video)
|
if (video)
|
||||||
{
|
{
|
||||||
callButton->setObjectName("grey");
|
callButton->setObjectName("grey");
|
||||||
|
callButton->setToolTip("");
|
||||||
videoButton->setObjectName("red");
|
videoButton->setObjectName("red");
|
||||||
|
videoButton->setToolTip(tr("End video call"));
|
||||||
connect(videoButton, SIGNAL(clicked()),
|
connect(videoButton, SIGNAL(clicked()),
|
||||||
this, SLOT(onHangupCallTriggered()));
|
this, SLOT(onHangupCallTriggered()));
|
||||||
|
|
||||||
|
@ -326,12 +332,26 @@ void ChatForm::onAvStart(int FriendId, int CallId, bool video)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
callButton->setObjectName("red");
|
callButton->setObjectName("red");
|
||||||
|
callButton->setToolTip(tr("End audio call"));
|
||||||
videoButton->setObjectName("grey");
|
videoButton->setObjectName("grey");
|
||||||
|
videoButton->setToolTip("");
|
||||||
connect(callButton, SIGNAL(clicked()),
|
connect(callButton, SIGNAL(clicked()),
|
||||||
this, SLOT(onHangupCallTriggered()));
|
this, SLOT(onHangupCallTriggered()));
|
||||||
}
|
}
|
||||||
callButton->style()->polish(callButton);
|
callButton->style()->polish(callButton);
|
||||||
videoButton->style()->polish(videoButton);
|
videoButton->style()->polish(videoButton);
|
||||||
|
|
||||||
|
micButton->setObjectName("green");
|
||||||
|
micButton->style()->polish(micButton);
|
||||||
|
micButton->setToolTip(tr("Mute microphone"));
|
||||||
|
volButton->setObjectName("green");
|
||||||
|
volButton->style()->polish(volButton);
|
||||||
|
volButton->setToolTip(tr("Mute call"));
|
||||||
|
|
||||||
|
connect(micButton, SIGNAL(clicked()),
|
||||||
|
this, SLOT(onMicMuteToggle()));
|
||||||
|
connect(volButton, SIGNAL(clicked()),
|
||||||
|
this, SLOT(onVolMuteToggle()));
|
||||||
|
|
||||||
startCounter();
|
startCounter();
|
||||||
}
|
}
|
||||||
|
@ -386,8 +406,10 @@ void ChatForm::onAvRinging(int FriendId, int CallId, bool video)
|
||||||
{
|
{
|
||||||
callButton->setObjectName("grey");
|
callButton->setObjectName("grey");
|
||||||
callButton->style()->polish(callButton);
|
callButton->style()->polish(callButton);
|
||||||
|
callButton->setToolTip("");
|
||||||
videoButton->setObjectName("yellow");
|
videoButton->setObjectName("yellow");
|
||||||
videoButton->style()->polish(videoButton);
|
videoButton->style()->polish(videoButton);
|
||||||
|
videoButton->setToolTip(tr("Cancel video call"));
|
||||||
connect(videoButton, SIGNAL(clicked()),
|
connect(videoButton, SIGNAL(clicked()),
|
||||||
this, SLOT(onCancelCallTriggered()));
|
this, SLOT(onCancelCallTriggered()));
|
||||||
}
|
}
|
||||||
|
@ -395,8 +417,10 @@ void ChatForm::onAvRinging(int FriendId, int CallId, bool video)
|
||||||
{
|
{
|
||||||
callButton->setObjectName("yellow");
|
callButton->setObjectName("yellow");
|
||||||
callButton->style()->polish(callButton);
|
callButton->style()->polish(callButton);
|
||||||
|
callButton->setToolTip(tr("Cancel audio call"));
|
||||||
videoButton->setObjectName("grey");
|
videoButton->setObjectName("grey");
|
||||||
videoButton->style()->polish(videoButton);
|
videoButton->style()->polish(videoButton);
|
||||||
|
videoButton->setToolTip("");
|
||||||
connect(callButton, SIGNAL(clicked()),
|
connect(callButton, SIGNAL(clicked()),
|
||||||
this, SLOT(onCancelCallTriggered()));
|
this, SLOT(onCancelCallTriggered()));
|
||||||
}
|
}
|
||||||
|
@ -417,8 +441,10 @@ void ChatForm::onAvStarting(int FriendId, int CallId, bool video)
|
||||||
{
|
{
|
||||||
callButton->setObjectName("grey");
|
callButton->setObjectName("grey");
|
||||||
callButton->style()->polish(callButton);
|
callButton->style()->polish(callButton);
|
||||||
|
callButton->setToolTip("");
|
||||||
videoButton->setObjectName("red");
|
videoButton->setObjectName("red");
|
||||||
videoButton->style()->polish(videoButton);
|
videoButton->style()->polish(videoButton);
|
||||||
|
videoButton->setToolTip(tr("End video call"));
|
||||||
connect(videoButton, SIGNAL(clicked()), this, SLOT(onHangupCallTriggered()));
|
connect(videoButton, SIGNAL(clicked()), this, SLOT(onHangupCallTriggered()));
|
||||||
|
|
||||||
netcam->show(Core::getInstance()->getVideoSourceFromCall(CallId), f->getDisplayedName());
|
netcam->show(Core::getInstance()->getVideoSourceFromCall(CallId), f->getDisplayedName());
|
||||||
|
@ -427,8 +453,10 @@ void ChatForm::onAvStarting(int FriendId, int CallId, bool video)
|
||||||
{
|
{
|
||||||
callButton->setObjectName("red");
|
callButton->setObjectName("red");
|
||||||
callButton->style()->polish(callButton);
|
callButton->style()->polish(callButton);
|
||||||
|
callButton->setToolTip(tr("End audio call"));
|
||||||
videoButton->setObjectName("grey");
|
videoButton->setObjectName("grey");
|
||||||
videoButton->style()->polish(videoButton);
|
videoButton->style()->polish(videoButton);
|
||||||
|
videoButton->setToolTip("");
|
||||||
connect(callButton, SIGNAL(clicked()), this, SLOT(onHangupCallTriggered()));
|
connect(callButton, SIGNAL(clicked()), this, SLOT(onHangupCallTriggered()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -614,16 +642,20 @@ void ChatForm::enableCallButtons()
|
||||||
|
|
||||||
micButton->setObjectName("grey");
|
micButton->setObjectName("grey");
|
||||||
micButton->style()->polish(micButton);
|
micButton->style()->polish(micButton);
|
||||||
|
micButton->setToolTip("");
|
||||||
micButton->disconnect();
|
micButton->disconnect();
|
||||||
volButton->setObjectName("grey");
|
volButton->setObjectName("grey");
|
||||||
volButton->style()->polish(volButton);
|
volButton->style()->polish(volButton);
|
||||||
|
volButton->setToolTip("");
|
||||||
volButton->disconnect();
|
volButton->disconnect();
|
||||||
|
|
||||||
callButton->setObjectName("grey");
|
callButton->setObjectName("grey");
|
||||||
callButton->style()->polish(callButton);
|
callButton->style()->polish(callButton);
|
||||||
|
callButton->setToolTip("");
|
||||||
callButton->disconnect();
|
callButton->disconnect();
|
||||||
videoButton->setObjectName("grey");
|
videoButton->setObjectName("grey");
|
||||||
videoButton->style()->polish(videoButton);
|
videoButton->style()->polish(videoButton);
|
||||||
|
videoButton->setToolTip("");
|
||||||
videoButton->disconnect();
|
videoButton->disconnect();
|
||||||
|
|
||||||
if(disableCallButtonsTimer == nullptr)
|
if(disableCallButtonsTimer == nullptr)
|
||||||
|
@ -642,24 +674,19 @@ void ChatForm::onEnableCallButtons()
|
||||||
qDebug() << "onEnableCallButtons";
|
qDebug() << "onEnableCallButtons";
|
||||||
audioInputFlag = false;
|
audioInputFlag = false;
|
||||||
audioOutputFlag = false;
|
audioOutputFlag = false;
|
||||||
micButton->setObjectName("green");
|
|
||||||
micButton->style()->polish(micButton);
|
|
||||||
volButton->setObjectName("green");
|
|
||||||
volButton->style()->polish(volButton);
|
|
||||||
callButton->setObjectName("green");
|
callButton->setObjectName("green");
|
||||||
callButton->style()->polish(callButton);
|
callButton->style()->polish(callButton);
|
||||||
|
callButton->setToolTip(tr("Start audio call"));
|
||||||
videoButton->setObjectName("green");
|
videoButton->setObjectName("green");
|
||||||
videoButton->style()->polish(videoButton);
|
videoButton->style()->polish(videoButton);
|
||||||
|
videoButton->setToolTip(tr("Start video call"));
|
||||||
|
|
||||||
connect(callButton, SIGNAL(clicked()),
|
connect(callButton, SIGNAL(clicked()),
|
||||||
this, SLOT(onCallTriggered()));
|
this, SLOT(onCallTriggered()));
|
||||||
connect(videoButton, SIGNAL(clicked()),
|
connect(videoButton, SIGNAL(clicked()),
|
||||||
this, SLOT(onVideoCallTriggered()));
|
this, SLOT(onVideoCallTriggered()));
|
||||||
connect(micButton, SIGNAL(clicked()),
|
|
||||||
this, SLOT(onMicMuteToggle()));
|
|
||||||
connect(volButton, SIGNAL(clicked()),
|
|
||||||
this, SLOT(onVolMuteToggle()));
|
|
||||||
|
|
||||||
disableCallButtonsTimer->stop();
|
disableCallButtonsTimer->stop();
|
||||||
delete disableCallButtonsTimer;
|
delete disableCallButtonsTimer;
|
||||||
disableCallButtonsTimer = nullptr;
|
disableCallButtonsTimer = nullptr;
|
||||||
|
@ -671,9 +698,15 @@ void ChatForm::onMicMuteToggle()
|
||||||
{
|
{
|
||||||
emit micMuteToggle(callId);
|
emit micMuteToggle(callId);
|
||||||
if (micButton->objectName() == "red")
|
if (micButton->objectName() == "red")
|
||||||
|
{
|
||||||
micButton->setObjectName("green");
|
micButton->setObjectName("green");
|
||||||
|
micButton->setToolTip(tr("Mute microphone"));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
micButton->setObjectName("red");
|
micButton->setObjectName("red");
|
||||||
|
micButton->setToolTip(tr("Unmute microphone"));
|
||||||
|
}
|
||||||
|
|
||||||
Style::repolish(micButton);
|
Style::repolish(micButton);
|
||||||
}
|
}
|
||||||
|
@ -685,9 +718,15 @@ void ChatForm::onVolMuteToggle()
|
||||||
{
|
{
|
||||||
emit volMuteToggle(callId);
|
emit volMuteToggle(callId);
|
||||||
if (volButton->objectName() == "red")
|
if (volButton->objectName() == "red")
|
||||||
|
{
|
||||||
volButton->setObjectName("green");
|
volButton->setObjectName("green");
|
||||||
|
volButton->setToolTip(tr("Mute call"));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
volButton->setObjectName("red");
|
volButton->setObjectName("red");
|
||||||
|
volButton->setToolTip(tr("Unmute call"));
|
||||||
|
}
|
||||||
|
|
||||||
Style::repolish(volButton);
|
Style::repolish(volButton);
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,7 +121,7 @@ private:
|
||||||
void stopCounter();
|
void stopCounter();
|
||||||
QString secondsToDHMS(quint32 duration);
|
QString secondsToDHMS(quint32 duration);
|
||||||
CallConfirmWidget *callConfirm;
|
CallConfirmWidget *callConfirm;
|
||||||
void enableCallButtons();
|
void enableCallButtons();
|
||||||
bool isTyping;
|
bool isTyping;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -79,16 +79,16 @@ GenericChatForm::GenericChatForm(QWidget *parent)
|
||||||
fileButton->setToolTip(tr("Send file(s)"));
|
fileButton->setToolTip(tr("Send file(s)"));
|
||||||
callButton = new QPushButton();
|
callButton = new QPushButton();
|
||||||
callButton->setFixedSize(50,40);
|
callButton->setFixedSize(50,40);
|
||||||
callButton->setToolTip(tr("Audio call: RED means you're on a call"));
|
callButton->setToolTip(tr("Start an audio call"));
|
||||||
videoButton = new QPushButton();
|
videoButton = new QPushButton();
|
||||||
videoButton->setFixedSize(50,40);
|
videoButton->setFixedSize(50,40);
|
||||||
videoButton->setToolTip(tr("Video call: RED means you're on a call"));
|
videoButton->setToolTip(tr("Start a video call"));
|
||||||
volButton = new QPushButton();
|
volButton = new QPushButton();
|
||||||
//volButton->setFixedSize(25,20);
|
//volButton->setFixedSize(25,20);
|
||||||
volButton->setToolTip(tr("Toggle speakers volume: RED is OFF"));
|
volButton->setToolTip("");
|
||||||
micButton = new QPushButton();
|
micButton = new QPushButton();
|
||||||
// micButton->setFixedSize(25,20);
|
// micButton->setFixedSize(25,20);
|
||||||
micButton->setToolTip(tr("Toggle microphone: RED is OFF"));
|
micButton->setToolTip("");
|
||||||
|
|
||||||
footButtonsSmall->setSpacing(2);
|
footButtonsSmall->setSpacing(2);
|
||||||
|
|
||||||
|
@ -107,11 +107,11 @@ GenericChatForm::GenericChatForm(QWidget *parent)
|
||||||
videoButton->setStyleSheet(Style::getStylesheet(":/ui/videoButton/videoButton.css"));
|
videoButton->setStyleSheet(Style::getStylesheet(":/ui/videoButton/videoButton.css"));
|
||||||
|
|
||||||
QString volButtonStylesheet = Style::getStylesheet(":/ui/volButton/volButton.css");
|
QString volButtonStylesheet = Style::getStylesheet(":/ui/volButton/volButton.css");
|
||||||
volButton->setObjectName("green");
|
volButton->setObjectName("grey");
|
||||||
volButton->setStyleSheet(volButtonStylesheet);
|
volButton->setStyleSheet(volButtonStylesheet);
|
||||||
|
|
||||||
QString micButtonStylesheet = Style::getStylesheet(":/ui/micButton/micButton.css");
|
QString micButtonStylesheet = Style::getStylesheet(":/ui/micButton/micButton.css");
|
||||||
micButton->setObjectName("green");
|
micButton->setObjectName("grey");
|
||||||
micButton->setStyleSheet(micButtonStylesheet);
|
micButton->setStyleSheet(micButtonStylesheet);
|
||||||
|
|
||||||
setLayout(mainLayout);
|
setLayout(mainLayout);
|
||||||
|
|
|
@ -151,11 +151,13 @@ void GroupChatForm::onMicMuteToggle()
|
||||||
{
|
{
|
||||||
Core::getInstance()->enableGroupCallMic(group->getGroupId());
|
Core::getInstance()->enableGroupCallMic(group->getGroupId());
|
||||||
micButton->setObjectName("green");
|
micButton->setObjectName("green");
|
||||||
|
micButton->setToolTip(tr("Mute microphone"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Core::getInstance()->disableGroupCallMic(group->getGroupId());
|
Core::getInstance()->disableGroupCallMic(group->getGroupId());
|
||||||
micButton->setObjectName("red");
|
micButton->setObjectName("red");
|
||||||
|
micButton->setToolTip(tr("Unmute microphone"));
|
||||||
}
|
}
|
||||||
|
|
||||||
Style::repolish(micButton);
|
Style::repolish(micButton);
|
||||||
|
@ -170,11 +172,13 @@ void GroupChatForm::onVolMuteToggle()
|
||||||
{
|
{
|
||||||
Core::getInstance()->enableGroupCallVol(group->getGroupId());
|
Core::getInstance()->enableGroupCallVol(group->getGroupId());
|
||||||
volButton->setObjectName("green");
|
volButton->setObjectName("green");
|
||||||
|
volButton->setToolTip(tr("Mute call"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Core::getInstance()->disableGroupCallVol(group->getGroupId());
|
Core::getInstance()->disableGroupCallVol(group->getGroupId());
|
||||||
volButton->setObjectName("red");
|
volButton->setObjectName("red");
|
||||||
|
volButton->setToolTip(tr("Unmute call"));
|
||||||
}
|
}
|
||||||
|
|
||||||
Style::repolish(volButton);
|
Style::repolish(volButton);
|
||||||
|
@ -190,6 +194,13 @@ void GroupChatForm::onCallClicked()
|
||||||
audioOutputFlag = true;
|
audioOutputFlag = true;
|
||||||
callButton->setObjectName("red");
|
callButton->setObjectName("red");
|
||||||
callButton->style()->polish(callButton);
|
callButton->style()->polish(callButton);
|
||||||
|
callButton->setToolTip(tr("End audio call"));
|
||||||
|
micButton->setObjectName("green");
|
||||||
|
micButton->style()->polish(micButton);
|
||||||
|
micButton->setToolTip(tr("Mute microphone"));
|
||||||
|
volButton->setObjectName("green");
|
||||||
|
volButton->style()->polish(volButton);
|
||||||
|
volButton->setToolTip(tr("Mute call"));
|
||||||
inCall = true;
|
inCall = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -197,12 +208,15 @@ void GroupChatForm::onCallClicked()
|
||||||
Core::getInstance()->leaveGroupCall(group->getGroupId());
|
Core::getInstance()->leaveGroupCall(group->getGroupId());
|
||||||
audioInputFlag = false;
|
audioInputFlag = false;
|
||||||
audioOutputFlag = false;
|
audioOutputFlag = false;
|
||||||
micButton->setObjectName("green");
|
|
||||||
micButton->style()->polish(micButton);
|
|
||||||
volButton->setObjectName("green");
|
|
||||||
volButton->style()->polish(volButton);
|
|
||||||
callButton->setObjectName("green");
|
callButton->setObjectName("green");
|
||||||
callButton->style()->polish(callButton);
|
callButton->style()->polish(callButton);
|
||||||
|
callButton->setToolTip(tr("Start audio call"));
|
||||||
|
micButton->setObjectName("grey");
|
||||||
|
micButton->style()->polish(micButton);
|
||||||
|
micButton->setToolTip("");
|
||||||
|
volButton->setObjectName("grey");
|
||||||
|
volButton->style()->polish(volButton);
|
||||||
|
volButton->setToolTip("");
|
||||||
inCall = false;
|
inCall = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user