Browse Source

Add sound notification on calls

pull/36/head
Tux3 / Mlkj / !Lev.uXFMLA 11 years ago
parent
commit
27d5293d90
  1. 8
      widget/form/chatform.cpp
  2. 15
      widget/widget.cpp
  3. 6
      widget/widget.h

8
widget/form/chatform.cpp

@ -371,6 +371,14 @@ void ChatForm::onAvInvite(int FriendId, int CallId, bool video) @@ -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)

15
widget/widget.cpp

@ -543,3 +543,18 @@ void Widget::onEmptyGroupCreated(int groupId) @@ -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;
}

6
widget/widget.h

@ -18,6 +18,7 @@ class AddFriendForm; @@ -18,6 +18,7 @@ class AddFriendForm;
class SettingsForm;
class FriendWidget;
class Group;
class Friend;
class Widget : public QWidget
{
@ -30,6 +31,9 @@ public: @@ -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: @@ -76,8 +80,6 @@ private slots:
private:
void hideMainForms();
Group* createGroup(int groupId);
void newMessageAlert();
void updateFriendStatusLights(int friendId);
private:
Ui::Widget *ui;

Loading…
Cancel
Save