author | koda |
Thu, 09 Feb 2012 19:06:43 +0100 | |
changeset 6660 | 99ecc7e17c4f |
parent 6584 | 5bb48450b978 |
child 6700 | e04da46ee43c |
permissions | -rw-r--r-- |
6572 | 1 |
#include <QMessageBox> |
2 |
#include <QDir> |
|
6584
5bb48450b978
simplify qpushbuttonwithsound and add a mouseover sound (I tried selecting the least annoying ones, maybe it'd be better to look for proper button sound effects)
koda
parents:
6583
diff
changeset
|
3 |
|
5bb48450b978
simplify qpushbuttonwithsound and add a mouseover sound (I tried selecting the least annoying ones, maybe it'd be better to look for proper button sound effects)
koda
parents:
6583
diff
changeset
|
4 |
#include "qpushbuttonwithsound.h" |
5bb48450b978
simplify qpushbuttonwithsound and add a mouseover sound (I tried selecting the least annoying ones, maybe it'd be better to look for proper button sound effects)
koda
parents:
6583
diff
changeset
|
5 |
#include "HWDataManager.h" |
5bb48450b978
simplify qpushbuttonwithsound and add a mouseover sound (I tried selecting the least annoying ones, maybe it'd be better to look for proper button sound effects)
koda
parents:
6583
diff
changeset
|
6 |
#include "SDLInteraction.h" |
5bb48450b978
simplify qpushbuttonwithsound and add a mouseover sound (I tried selecting the least annoying ones, maybe it'd be better to look for proper button sound effects)
koda
parents:
6583
diff
changeset
|
7 |
#include "hwform.h" |
5bb48450b978
simplify qpushbuttonwithsound and add a mouseover sound (I tried selecting the least annoying ones, maybe it'd be better to look for proper button sound effects)
koda
parents:
6583
diff
changeset
|
8 |
#include "gameuiconfig.h" |
6572 | 9 |
|
10 |
QPushButtonWithSound::QPushButtonWithSound(QWidget *parent) : |
|
6583 | 11 |
QPushButton(parent), |
12 |
isSoundEnabled(true) |
|
6572 | 13 |
{ |
14 |
connect(this, SIGNAL(clicked()), this, SLOT(buttonClicked())); |
|
15 |
} |
|
16 |
||
17 |
void QPushButtonWithSound::buttonClicked() |
|
18 |
{ |
|
6583 | 19 |
if ( !isSoundEnabled || !HWForm::config->isFrontendSoundEnabled()) |
6572 | 20 |
return; |
21 |
||
22 |
HWDataManager & dataMgr = HWDataManager::instance(); |
|
23 |
||
6584
5bb48450b978
simplify qpushbuttonwithsound and add a mouseover sound (I tried selecting the least annoying ones, maybe it'd be better to look for proper button sound effects)
koda
parents:
6583
diff
changeset
|
24 |
if (this->isEnabled()) |
5bb48450b978
simplify qpushbuttonwithsound and add a mouseover sound (I tried selecting the least annoying ones, maybe it'd be better to look for proper button sound effects)
koda
parents:
6583
diff
changeset
|
25 |
SDLInteraction::instance().playSoundFile(dataMgr.findFileForRead("Sounds/roperelease.ogg")); |
6572 | 26 |
} |