blinking start-stop button

This commit is contained in:
doitux
2007-05-01 22:51:10 +00:00
parent 89a4e06edf
commit 5e3e73789d
2 changed files with 28 additions and 8 deletions
+24 -5
View File
@@ -264,6 +264,8 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent)
potDistributeTimer = new QTimer(this); potDistributeTimer = new QTimer(this);
postRiverRunAnimation6Timer = new QTimer(this); postRiverRunAnimation6Timer = new QTimer(this);
blinkingStartButtonAnimationTimer = new QTimer(this);
dealFlopCards0Timer->setSingleShot(TRUE); dealFlopCards0Timer->setSingleShot(TRUE);
dealFlopCards1Timer->setSingleShot(TRUE); dealFlopCards1Timer->setSingleShot(TRUE);
dealFlopCards2Timer->setSingleShot(TRUE); dealFlopCards2Timer->setSingleShot(TRUE);
@@ -525,6 +527,8 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent)
connect(postRiverRunAnimation5Timer, SIGNAL(timeout()), this, SLOT( postRiverRunAnimation6() )); connect(postRiverRunAnimation5Timer, SIGNAL(timeout()), this, SLOT( postRiverRunAnimation6() ));
connect(postRiverRunAnimation6Timer, SIGNAL(timeout()), this, SLOT( startNewHand() )); connect(postRiverRunAnimation6Timer, SIGNAL(timeout()), this, SLOT( startNewHand() ));
connect(blinkingStartButtonAnimationTimer, SIGNAL(timeout()), this, SLOT( blinkingStartButtonAnimationAction()));
connect( actionNewGame, SIGNAL( triggered() ), this, SLOT( callNewGameDialog() ) ); connect( actionNewGame, SIGNAL( triggered() ), this, SLOT( callNewGameDialog() ) );
connect( actionAboutPokerth, SIGNAL( triggered() ), this, SLOT( callAboutPokerthDialog() ) ); connect( actionAboutPokerth, SIGNAL( triggered() ), this, SLOT( callAboutPokerthDialog() ) );
connect( actionSettings, SIGNAL( triggered() ), this, SLOT( callSettingsDialog() ) ); connect( actionSettings, SIGNAL( triggered() ), this, SLOT( callSettingsDialog() ) );
@@ -1999,6 +2003,8 @@ void mainWindowImpl::startNewHand() {
pushButton_break->setDisabled(FALSE); pushButton_break->setDisabled(FALSE);
pushButton_break->setText("Start"); pushButton_break->setText("Start");
breakAfterActualHand=FALSE; breakAfterActualHand=FALSE;
blinkingStartButtonAnimationTimer->start(500);
} }
} }
@@ -2111,6 +2117,13 @@ void mainWindowImpl::breakButtonClicked() {
breakAfterActualHand=TRUE; breakAfterActualHand=TRUE;
} }
else { else {
blinkingStartButtonAnimationTimer->stop();
//Set default Color
QPalette tempPalette = pushButton_break->palette();
tempPalette.setColor(QPalette::Button, QColor(40,82,0));
tempPalette.setColor(QPalette::ButtonText, QColor(240,240,240));
pushButton_break->setPalette(tempPalette);
pushButton_break->setText("Stop"); pushButton_break->setText("Stop");
startNewHand(); startNewHand();
} }
@@ -2326,9 +2339,15 @@ void mainWindowImpl::switchFullscreen() {
void mainWindowImpl::blinkingStartButtonAnimationAction() { void mainWindowImpl::blinkingStartButtonAnimationAction() {
// QPalette tempPalette = groupBoxArray[i]->palette(); QPalette tempPalette = pushButton_break->palette();
// tempPalette.setColor(QPalette::Window, inactive);
// groupBoxArray[i]->setPalette(tempPalette); if(tempPalette.color(QPalette::Button).red()==40) {
// pushButton_break-> tempPalette.setColor(QPalette::Button, QColor(113,162,0));
// pushButton_break-> tempPalette.setColor(QPalette::ButtonText, QColor(0,0,0));
}
else {
tempPalette.setColor(QPalette::Button, QColor(40,82,0));
tempPalette.setColor(QPalette::ButtonText, QColor(240,240,240));
}
pushButton_break->setPalette(tempPalette);
} }
+3 -2
View File
@@ -167,9 +167,7 @@ public slots:
void postRiverRunAnimation5(); void postRiverRunAnimation5();
void postRiverRunAnimation6(); void postRiverRunAnimation6();
// void blinkingStartButtonAnimationStart();
void blinkingStartButtonAnimationAction(); void blinkingStartButtonAnimationAction();
// void blinkingStartButtonAnimationStop();
void flipHolecardsAllIn(); void flipHolecardsAllIn();
void showMyCards(); void showMyCards();
@@ -263,6 +261,9 @@ private:
QTimer *postRiverRunAnimation5Timer; QTimer *postRiverRunAnimation5Timer;
QTimer *postRiverRunAnimation6Timer; QTimer *postRiverRunAnimation6Timer;
QTimer *blinkingStartButtonAnimationTimer;
QWidget *userWidgetsArray[4]; QWidget *userWidgetsArray[4];
QLabel *buttonLabelArray[MAX_NUMBER_OF_PLAYERS]; QLabel *buttonLabelArray[MAX_NUMBER_OF_PLAYERS];
QLabel *cashLabelArray[MAX_NUMBER_OF_PLAYERS]; QLabel *cashLabelArray[MAX_NUMBER_OF_PLAYERS];