QTfrontend/chatwidget.cpp
changeset 2779 e1ae0019d43f
parent 2777 95a1a69d491c
child 2845 19db164dd20d
equal deleted inserted replaced
2778:d106ea17b3f9 2779:e1ae0019d43f
    39     this->notify = notify;
    39     this->notify = notify;
    40     if(notify && gameSettings->value("audio/frontendsound", true).toBool()) {
    40     if(notify && gameSettings->value("audio/frontendsound", true).toBool()) {
    41        QDir tmpdir;
    41        QDir tmpdir;
    42 
    42 
    43        tmpdir.cd(datadir->absolutePath());
    43        tmpdir.cd(datadir->absolutePath());
    44        tmpdir.cd("Sounds/");
    44        tmpdir.cd("Sounds/voices");
    45        sdli->SDLMusicInit();
    45        sdli->SDLMusicInit();
    46        sound = Mix_LoadWAV(QString(tmpdir.absolutePath() + "/switchhog.ogg").toLocal8Bit().constData());
    46        sound[0] = Mix_LoadWAV(QString(tmpdir.absolutePath() + "/Classic/Hello.ogg").toLocal8Bit().constData());
       
    47        sound[1] = Mix_LoadWAV(QString(tmpdir.absolutePath() + "/Default/Hello.ogg").toLocal8Bit().constData());
       
    48        sound[2] = Mix_LoadWAV(QString(tmpdir.absolutePath() + "/Mobster/Hello.ogg").toLocal8Bit().constData());
       
    49        sound[3] = Mix_LoadWAV(QString(tmpdir.absolutePath() + "/Russian/Hello.ogg").toLocal8Bit().constData());
    47     }
    50     }
    48 
    51 
    49 	mainLayout.setSpacing(1);
    52 	mainLayout.setSpacing(1);
    50 	mainLayout.setMargin(1);
    53 	mainLayout.setMargin(1);
    51 	mainLayout.setSizeConstraint(QLayout::SetMinimumSize);
    54 	mainLayout.setSizeConstraint(QLayout::SetMinimumSize);
   131 	QListWidgetItem * item = new QListWidgetItem(nick);
   134 	QListWidgetItem * item = new QListWidgetItem(nick);
   132 	item->setIcon(QIcon(":/res/hh_small.png"));
   135 	item->setIcon(QIcon(":/res/hh_small.png"));
   133 	chatNicks->addItem(item);
   136 	chatNicks->addItem(item);
   134 
   137 
   135     if(notifyNick && notify && gameSettings->value("audio/frontendsound", true).toBool()) {
   138     if(notifyNick && notify && gameSettings->value("audio/frontendsound", true).toBool()) {
   136        Mix_PlayChannel(-1, sound, 0);
   139        Mix_PlayChannel(-1, sound[rand()%4], 0);
   137     }
   140     }
   138 }
   141 }
   139 
   142 
   140 void HWChatWidget::nickRemoved(const QString& nick)
   143 void HWChatWidget::nickRemoved(const QString& nick)
   141 {
   144 {