QTfrontend/ui/widget/qpushbuttonwithsound.cpp
changeset 6577 9e49e6a8585b
parent 6572 0d0af531c1c7
child 6584 5bb48450b978
equal deleted inserted replaced
6576:d998c378dac3 6577:9e49e6a8585b
     6 #include <hwform.h>
     6 #include <hwform.h>
     7 #include <QSettings>
     7 #include <QSettings>
     8 #include <gameuiconfig.h>
     8 #include <gameuiconfig.h>
     9 
     9 
    10 QPushButtonWithSound::QPushButtonWithSound(QWidget *parent) :
    10 QPushButtonWithSound::QPushButtonWithSound(QWidget *parent) :
    11     QPushButton(parent)
    11     QPushButton(parent),
       
    12     isSoundEnabled(true)
    12 {
    13 {
    13     connect(this, SIGNAL(clicked()), this, SLOT(buttonClicked()));
    14     connect(this, SIGNAL(clicked()), this, SLOT(buttonClicked()));
    14 }
    15 }
    15 
    16 
    16 void QPushButtonWithSound::buttonClicked()
    17 void QPushButtonWithSound::buttonClicked()
    17 {
    18 {
    18     if (!HWForm::config->isFrontendSoundEnabled())
    19     if ( !isSoundEnabled || !HWForm::config->isFrontendSoundEnabled())
    19         return;
    20         return;
    20 
    21 
    21     HWDataManager & dataMgr = HWDataManager::instance();
    22     HWDataManager & dataMgr = HWDataManager::instance();
    22 
    23 
    23     QString soundsDir = QString("Sounds/");
    24     QString soundsDir = QString("Sounds/");