QTfrontend/ui/widget/chatwidget.cpp
changeset 8395 0b357c57e01c
parent 8179 a1ffcb559f99
child 8396 5123eac2f9d6
equal deleted inserted replaced
8394:26f0d7ab5adf 8395:0b357c57e01c
   185     this->notify = notify;
   185     this->notify = notify;
   186 
   186 
   187     m_isAdmin = false;
   187     m_isAdmin = false;
   188     m_autoKickEnabled = false;
   188     m_autoKickEnabled = false;
   189 
   189 
   190     {
   190     QStringList vpList =
   191         QStringList vpList =
   191          QStringList() << "Classic" << "Default" << "Mobster" << "Russian";
   192              QStringList() << "Classic" << "Default" << "Mobster" << "Russian";
   192 
   193 
   193     foreach (const QString & vp, vpList)
   194         foreach (QString vp, vpList)
   194     {
   195         {
   195         m_helloSounds.append(QString("/Sounds/voices/%1/Hello.ogg").arg(vp));
   196             m_helloSounds.append(QString("physfs://Sounds/voices/%1/Hello.ogg").arg(vp));
   196     }
   197         }
   197 
   198 
   198     m_hilightSound = "/Sounds/beep.ogg";
   199         m_hilightSound = "physfs://Sounds/beep.ogg";
       
   200 
       
   201     }
       
   202 
   199 
   203     mainLayout.setSpacing(1);
   200     mainLayout.setSpacing(1);
   204     mainLayout.setMargin(1);
   201     mainLayout.setMargin(1);
   205     mainLayout.setSizeConstraint(QLayout::SetMinimumSize);
   202     mainLayout.setSizeConstraint(QLayout::SetMinimumSize);
   206     mainLayout.setColumnStretch(0, 76);
   203     mainLayout.setColumnStretch(0, 76);
   498     if ((!isIgnored) && (nick != m_userNick)) // don't auto-complete own name
   495     if ((!isIgnored) && (nick != m_userNick)) // don't auto-complete own name
   499         chatEditLine->addNickname(nick);
   496         chatEditLine->addNickname(nick);
   500 
   497 
   501     emit nickCountUpdate(chatNicks->model()->rowCount());
   498     emit nickCountUpdate(chatNicks->model()->rowCount());
   502 
   499 
   503     if(notifyNick && notify && gameSettings->value("frontend/sound", true).toBool())
   500     if (notifyNick && notify && (m_helloSounds.size() > 0))
   504     {
   501     {
   505         SDLInteraction::instance().playSoundFile(
   502         SDLInteraction::instance().playSoundFile(
   506                             m_helloSounds.at(rand() % m_helloSounds.size()));
   503                             m_helloSounds.at(rand() % m_helloSounds.size()));
   507     }
   504     }
   508 }
   505 }