Add Sounds on buddy login & logout.
Add Files: buddy_join.wav; buddy_leave.wav
This commit is contained in:
Jeff 2016-01-21 17:17:19 -05:00
parent d2e731bb2b
commit 9767b1f69d
4 changed files with 10 additions and 0 deletions

View file

@ -170,6 +170,8 @@ void SoundEngine::themeChangedSlot()
<< "player_join" << "player_leave" << "player_disconnect" << "player_reconnect" << "player_concede"
// Spectator
<< "spectator_join" << "spectator_leave"
// Buddy
<< "buddy_join" << "buddy_leave"
// Chat & UI
<< "chat_mention" << "all_mention" << "private_message";

View file

@ -2,6 +2,7 @@
#include "userlist.h"
#include "userinfobox.h"
#include "abstractclient.h"
#include "soundengine.h"
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QPushButton>
@ -146,12 +147,19 @@ void TabUserLists::processUserJoinedEvent(const Event_UserJoined &event)
ignoreList->sortItems();
buddyList->sortItems();
if (buddyList->getUsers().keys().contains(userName))
soundEngine->playSound("buddy_join");
emit userJoined(info);
}
void TabUserLists::processUserLeftEvent(const Event_UserLeft &event)
{
QString userName = QString::fromStdString(event.name());
if (buddyList->getUsers().keys().contains(userName))
soundEngine->playSound("buddy_leave");
if (allUsersList->deleteUser(userName)) {
ignoreList->setUserOnline(userName, false);
buddyList->setUserOnline(userName, false);

Binary file not shown.

Binary file not shown.