QTfrontend/ui/widget/chatwidget.cpp
changeset 6930 d187ea93fc4f
parent 6929 c305d31642ac
child 6952 7f70f37bbf08
equal deleted inserted replaced
6929:c305d31642ac 6930:d187ea93fc4f
    35 #include <QTime>
    35 #include <QTime>
    36 
    36 
    37 #include <QMessageBox>
    37 #include <QMessageBox>
    38 
    38 
    39 
    39 
    40 #include "HWDataManager.h"
    40 #include "DataManager.h"
    41 #include "hwconsts.h"
    41 #include "hwconsts.h"
    42 #include "gameuiconfig.h"
    42 #include "gameuiconfig.h"
    43 
    43 
    44 #include "chatwidget.h"
    44 #include "chatwidget.h"
    45 
    45 
   124 
   124 
   125     // no stylesheet supplied, search for one or use default
   125     // no stylesheet supplied, search for one or use default
   126     if (orgStyleSheet.isEmpty())
   126     if (orgStyleSheet.isEmpty())
   127     {
   127     {
   128         // load external stylesheet if there is any
   128         // load external stylesheet if there is any
   129         QFile extFile(HWDataManager::instance().findFileForRead("css/chat.css"));
   129         QFile extFile(DataManager::instance().findFileForRead("css/chat.css"));
   130 
   130 
   131         QFile resFile(":/res/css/chat.css");
   131         QFile resFile(":/res/css/chat.css");
   132 
   132 
   133         QFile & file = (extFile.exists()?extFile:resFile);
   133         QFile & file = (extFile.exists()?extFile:resFile);
   134 
   134 
   254         QStringList vpList =
   254         QStringList vpList =
   255              QStringList() << "Classic" << "Default" << "Mobster" << "Russian";
   255              QStringList() << "Classic" << "Default" << "Mobster" << "Russian";
   256 
   256 
   257         foreach (QString vp, vpList)
   257         foreach (QString vp, vpList)
   258         {
   258         {
   259             m_helloSounds.append(HWDataManager::instance().findFileForRead(
   259             m_helloSounds.append(DataManager::instance().findFileForRead(
   260                                QString("Sounds/voices/%1/Hello.ogg").arg(vp)));
   260                                QString("Sounds/voices/%1/Hello.ogg").arg(vp)));
   261         }
   261         }
   262 
   262 
   263         m_hilightSound = HWDataManager::instance().findFileForRead(
   263         m_hilightSound = DataManager::instance().findFileForRead(
   264                              "Sounds/beep.ogg");
   264                              "Sounds/beep.ogg");
   265 
   265 
   266     }
   266     }
   267 
   267 
   268     mainLayout.setSpacing(1);
   268     mainLayout.setSpacing(1);
   984 
   984 
   985 
   985 
   986 void HWChatWidget::saveStyleSheet()
   986 void HWChatWidget::saveStyleSheet()
   987 {
   987 {
   988     QString dest =
   988     QString dest =
   989         HWDataManager::instance().findFileForWrite("css/chat.css");
   989         DataManager::instance().findFileForWrite("css/chat.css");
   990 
   990 
   991     QFile file(dest);
   991     QFile file(dest);
   992     if (file.open(QIODevice::WriteOnly | QIODevice::Text))
   992     if (file.open(QIODevice::WriteOnly | QIODevice::Text))
   993     {
   993     {
   994         QTextStream out(&file);
   994         QTextStream out(&file);