mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Add sound notification on calls
This commit is contained in:
parent
b547cdbaea
commit
27d5293d90
|
@ -371,6 +371,14 @@ void ChatForm::onAvInvite(int FriendId, int CallId, bool video)
|
|||
videoButton->style()->polish(videoButton);
|
||||
connect(callButton, SIGNAL(clicked()), this, SLOT(onAnswerCallTriggered()));
|
||||
}
|
||||
|
||||
Widget* w = Widget::getInstance();
|
||||
if (!w->isFriendWidgetCurActiveWidget(f))
|
||||
{
|
||||
w->newMessageAlert();
|
||||
f->hasNewMessages=true;
|
||||
w->updateFriendStatusLights(f->friendId);
|
||||
}
|
||||
}
|
||||
|
||||
void ChatForm::onAvStart(int FriendId, int CallId, bool video)
|
||||
|
|
|
@ -543,3 +543,18 @@ void Widget::onEmptyGroupCreated(int groupId)
|
|||
{
|
||||
createGroup(groupId);
|
||||
}
|
||||
|
||||
bool Widget::isFriendWidgetCurActiveWidget(Friend* f)
|
||||
{
|
||||
if (!f)
|
||||
return false;
|
||||
if (activeFriendWidget != nullptr)
|
||||
{
|
||||
Friend* f2 = FriendList::findFriend(activeFriendWidget->friendId);
|
||||
if ((f->friendId != f2->friendId) || isFriendWidgetActive == 0)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ class AddFriendForm;
|
|||
class SettingsForm;
|
||||
class FriendWidget;
|
||||
class Group;
|
||||
class Friend;
|
||||
|
||||
class Widget : public QWidget
|
||||
{
|
||||
|
@ -30,6 +31,9 @@ public:
|
|||
Camera* getCamera();
|
||||
static Widget* getInstance();
|
||||
void showTestCamview();
|
||||
void newMessageAlert();
|
||||
bool isFriendWidgetCurActiveWidget(Friend* f);
|
||||
void updateFriendStatusLights(int friendId);
|
||||
~Widget();
|
||||
|
||||
signals:
|
||||
|
@ -76,8 +80,6 @@ private slots:
|
|||
private:
|
||||
void hideMainForms();
|
||||
Group* createGroup(int groupId);
|
||||
void newMessageAlert();
|
||||
void updateFriendStatusLights(int friendId);
|
||||
|
||||
private:
|
||||
Ui::Widget *ui;
|
||||
|
|
Loading…
Reference in New Issue
Block a user