timoutcallback to mainwindow

This commit is contained in:
doitux
2007-05-30 07:21:24 +00:00
parent ba82acbd06
commit 1f70aeeefe
4 changed files with 28 additions and 3 deletions
+10 -1
View File
@@ -364,6 +364,7 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
setLabelArray[4] = textLabel_Set4; setLabelArray[4] = textLabel_Set4;
setLabelArray[5] = textLabel_Set5; setLabelArray[5] = textLabel_Set5;
setLabelArray[6] = textLabel_Set6; setLabelArray[6] = textLabel_Set6;
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) { setLabelArray[i]->setMyW(this); }
// statusLabelArray init // statusLabelArray init
actionLabelArray[0] = textLabel_Status0; actionLabelArray[0] = textLabel_Status0;
@@ -1762,6 +1763,15 @@ void mainWindowImpl::myAllIn(){
myActionDone(); myActionDone();
} }
void mainWindowImpl::userActionTimeOutReached() {
//TODO
// automatic check, fold
cout << "timeoutaction" << endl;
}
void mainWindowImpl::myActionDone() { void mainWindowImpl::myActionDone() {
// If a network client is running, we need // If a network client is running, we need
@@ -2624,4 +2634,3 @@ void mainWindowImpl::playSound() {
} }
+2
View File
@@ -251,6 +251,8 @@ public slots:
void localGameModification(); void localGameModification();
void networkGameModification(); void networkGameModification();
void userActionTimeOutReached();
//SOUND TESTING //SOUND TESTING
void playSound(); void playSound();
void musicDone(); void musicDone();
+8 -2
View File
@@ -11,7 +11,9 @@
// //
#include "mysetlabel.h" #include "mysetlabel.h"
// using namespace std; #include "mainwindowimpl.h"
using namespace std;
MySetLabel::MySetLabel(QGroupBox* parent) MySetLabel::MySetLabel(QGroupBox* parent)
: QLabel(parent), timeOutAnimation(FALSE), timeOutValue(0), timeOutFrame(0) : QLabel(parent), timeOutAnimation(FALSE), timeOutValue(0), timeOutFrame(0)
@@ -54,7 +56,11 @@ void MySetLabel::nextTimeOutAnimationFrame() {
timeOutFrame++; timeOutFrame++;
update(); update();
} }
else stopTimeOutAnimation(); else {
stopTimeOutAnimation();
//callback
myW->userActionTimeOutReached();
}
} }
+8
View File
@@ -17,6 +17,9 @@
#include <iostream> #include <iostream>
class mainWindowImpl;
class MySetLabel : public QLabel class MySetLabel : public QLabel
{ {
Q_OBJECT Q_OBJECT
@@ -25,6 +28,9 @@ public:
~MySetLabel(); ~MySetLabel();
void setMyW ( mainWindowImpl* theValue ) { myW = theValue; }
void startTimeOutAnimation(int secs); void startTimeOutAnimation(int secs);
void stopTimeOutAnimation(); void stopTimeOutAnimation();
@@ -34,8 +40,10 @@ public slots:
void nextTimeOutAnimationFrame(); void nextTimeOutAnimationFrame();
private: private:
mainWindowImpl *myW;
QTimer *timeOutAnimationTimer; QTimer *timeOutAnimationTimer;
bool timeOutAnimation; bool timeOutAnimation;