QTfrontend/ui/widget/chatwidget.cpp
changeset 8179 a1ffcb559f99
parent 8049 133e22b5c410
child 8395 0b357c57e01c
equal deleted inserted replaced
8178:8bd087478b48 8179:a1ffcb559f99
   175     // scroll to the end
   175     // scroll to the end
   176     chatText->moveCursor(QTextCursor::End);
   176     chatText->moveCursor(QTextCursor::End);
   177 }
   177 }
   178 
   178 
   179 
   179 
   180 HWChatWidget::HWChatWidget(QWidget* parent, QSettings * gameSettings, bool notify) :
   180 HWChatWidget::HWChatWidget(QWidget* parent, bool notify) :
   181     QWidget(parent),
   181     QWidget(parent),
   182     mainLayout(this)
   182     mainLayout(this)
   183 {
   183 {
   184     this->gameSettings = gameSettings;
   184     this->gameSettings = gameSettings;
   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     if(gameSettings->value("frontend/sound", true).toBool())
       
   191     {
   190     {
   192         QStringList vpList =
   191         QStringList vpList =
   193              QStringList() << "Classic" << "Default" << "Mobster" << "Russian";
   192              QStringList() << "Classic" << "Default" << "Mobster" << "Russian";
   194 
   193 
   195         foreach (QString vp, vpList)
   194         foreach (QString vp, vpList)
   279     m_nicksMenu = new QMenu(this);
   278     m_nicksMenu = new QMenu(this);
   280 
   279 
   281     clear();
   280     clear();
   282 }
   281 }
   283 
   282 
       
   283 void HWChatWidget::setSettings(QSettings * settings)
       
   284 {
       
   285     gameSettings = settings;
       
   286 }
   284 
   287 
   285 void HWChatWidget::linkClicked(const QUrl & link)
   288 void HWChatWidget::linkClicked(const QUrl & link)
   286 {
   289 {
   287     if (link.scheme() == "http")
   290     if (link.scheme() == "http")
   288         QDesktopServices::openUrl(link);
   291         QDesktopServices::openUrl(link);