1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-08-29 18:16:16 +02:00
parent 84d6c1063e
commit bd1ca80ffd

View File

@ -411,6 +411,7 @@ void ChatForm::onAvInvite(int FriendId, int CallId, bool video)
void ChatForm::onAvStart(int FriendId, int CallId, bool video) void ChatForm::onAvStart(int FriendId, int CallId, bool video)
{ {
audioInputFlag = true;
if (FriendId != f->friendId) if (FriendId != f->friendId)
return; return;
callId = CallId; callId = CallId;
@ -437,6 +438,7 @@ void ChatForm::onAvStart(int FriendId, int CallId, bool video)
void ChatForm::onAvCancel(int FriendId, int) void ChatForm::onAvCancel(int FriendId, int)
{ {
audioInputFlag = false;
if (FriendId != f->friendId) if (FriendId != f->friendId)
return; return;
callButton->disconnect(); callButton->disconnect();
@ -452,6 +454,7 @@ void ChatForm::onAvCancel(int FriendId, int)
void ChatForm::onAvEnd(int FriendId, int) void ChatForm::onAvEnd(int FriendId, int)
{ {
audioInputFlag = false;
if (FriendId != f->friendId) if (FriendId != f->friendId)
return; return;
callButton->disconnect(); callButton->disconnect();
@ -492,6 +495,7 @@ void ChatForm::onAvRinging(int FriendId, int CallId, bool video)
void ChatForm::onAvStarting(int FriendId, int, bool video) void ChatForm::onAvStarting(int FriendId, int, bool video)
{ {
audioInputFlag = true;
if (FriendId != f->friendId) if (FriendId != f->friendId)
return; return;
callButton->disconnect(); callButton->disconnect();
@ -517,6 +521,7 @@ void ChatForm::onAvStarting(int FriendId, int, bool video)
void ChatForm::onAvEnding(int FriendId, int) void ChatForm::onAvEnding(int FriendId, int)
{ {
audioInputFlag = false;
if (FriendId != f->friendId) if (FriendId != f->friendId)
return; return;
callButton->disconnect(); callButton->disconnect();
@ -534,6 +539,7 @@ void ChatForm::onAvEnding(int FriendId, int)
void ChatForm::onAvRequestTimeout(int FriendId, int) void ChatForm::onAvRequestTimeout(int FriendId, int)
{ {
audioInputFlag = false;
if (FriendId != f->friendId) if (FriendId != f->friendId)
return; return;
callButton->disconnect(); callButton->disconnect();
@ -551,6 +557,7 @@ void ChatForm::onAvRequestTimeout(int FriendId, int)
void ChatForm::onAvPeerTimeout(int FriendId, int) void ChatForm::onAvPeerTimeout(int FriendId, int)
{ {
audioInputFlag = false;
if (FriendId != f->friendId) if (FriendId != f->friendId)
return; return;
callButton->disconnect(); callButton->disconnect();
@ -568,13 +575,13 @@ void ChatForm::onAvPeerTimeout(int FriendId, int)
void ChatForm::onAnswerCallTriggered() void ChatForm::onAnswerCallTriggered()
{ {
audioInputFlag = !audioInputFlag; audioInputFlag = true;
emit answerCall(callId); emit answerCall(callId);
} }
void ChatForm::onHangupCallTriggered() void ChatForm::onHangupCallTriggered()
{ {
audioInputFlag = !audioInputFlag; audioInputFlag = false;
emit hangupCall(callId); emit hangupCall(callId);
micButton->setObjectName("green"); micButton->setObjectName("green");
micButton->style()->polish(micButton); micButton->style()->polish(micButton);
@ -582,7 +589,7 @@ void ChatForm::onHangupCallTriggered()
void ChatForm::onCallTriggered() void ChatForm::onCallTriggered()
{ {
audioInputFlag = !audioInputFlag; audioInputFlag = true;
callButton->disconnect(); callButton->disconnect();
videoButton->disconnect(); videoButton->disconnect();
emit startCall(f->friendId); emit startCall(f->friendId);
@ -590,6 +597,7 @@ void ChatForm::onCallTriggered()
void ChatForm::onVideoCallTriggered() void ChatForm::onVideoCallTriggered()
{ {
audioInputFlag = true;
callButton->disconnect(); callButton->disconnect();
videoButton->disconnect(); videoButton->disconnect();
emit startVideoCall(f->friendId, true); emit startVideoCall(f->friendId, true);
@ -597,7 +605,7 @@ void ChatForm::onVideoCallTriggered()
void ChatForm::onCancelCallTriggered() void ChatForm::onCancelCallTriggered()
{ {
audioInputFlag = !audioInputFlag; audioInputFlag = false;
callButton->disconnect(); callButton->disconnect();
videoButton->disconnect(); videoButton->disconnect();
callButton->setObjectName("green"); callButton->setObjectName("green");
@ -682,18 +690,18 @@ void ChatForm::onEmoteInsertRequested(QString str)
void ChatForm::onMicMuteToggle() void ChatForm::onMicMuteToggle()
{ {
if (audioInputFlag == true) if (audioInputFlag == true)
{ {
emit micMuteToggle(callId); emit micMuteToggle(callId);
if (micButton->objectName() == "red") if (micButton->objectName() == "red")
{ {
micButton->setObjectName("green"); micButton->setObjectName("green");
micButton->style()->polish(micButton); micButton->style()->polish(micButton);
} }
else else
{ {
micButton->setObjectName("red"); micButton->setObjectName("red");
micButton->style()->polish(micButton); micButton->style()->polish(micButton);
} }
} }
} }