QTfrontend/ui/widget/chatwidget.cpp
changeset 6928 9562ace15141
parent 6700 e04da46ee43c
child 6929 c305d31642ac
--- a/QTfrontend/ui/widget/chatwidget.cpp	Tue Apr 24 17:16:18 2012 -0400
+++ b/QTfrontend/ui/widget/chatwidget.cpp	Wed Apr 25 08:23:48 2012 +0200
@@ -250,14 +250,18 @@
 
     if(gameSettings->value("frontend/sound", true).toBool())
     {
-        if (notify)
-            m_helloSound = HWDataManager::instance().findFileForRead(
-                               "Sounds/voices/Classic/Hello.ogg");
+        QStringList vpList =
+             QStringList() << "Classic" << "Default" << "Mobster" << "Russian";
+
+        foreach (QString vp, vpList)
+        {
+            m_helloSounds.append(HWDataManager::instance().findFileForRead(
+                               QString("Sounds/voices/%1/Hello.ogg").arg(vp)));
+        }
 
         m_hilightSound = HWDataManager::instance().findFileForRead(
                              "Sounds/beep.ogg");
 
-        //m_hilightSound = m_helloSound;//"Sounds/beep.ogg";
     }
 
     mainLayout.setSpacing(1);
@@ -643,7 +647,8 @@
 
     if(notifyNick && notify && gameSettings->value("frontend/sound", true).toBool())
     {
-        SDLInteraction::instance().playSoundFile(m_helloSound);
+        SDLInteraction::instance().playSoundFile(
+                            m_helloSounds.at(rand() % m_helloSounds.size()));
     }
 }