From 1f70aeeefe1703fb656c4c8fb51c498e9fdbe553 Mon Sep 17 00:00:00 2001 From: doitux Date: Wed, 30 May 2007 07:21:24 +0000 Subject: [PATCH] timoutcallback to mainwindow --- src/gui/qt/mainwindow/mainwindowimpl.cpp | 11 ++++++++++- src/gui/qt/mainwindow/mainwindowimpl.h | 2 ++ src/gui/qt/mainwindow/mysetlabel.cpp | 10 ++++++++-- src/gui/qt/mainwindow/mysetlabel.h | 8 ++++++++ 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index 5bf931a2..0d6eb60b 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -364,6 +364,7 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent) setLabelArray[4] = textLabel_Set4; setLabelArray[5] = textLabel_Set5; setLabelArray[6] = textLabel_Set6; + for (i=0; isetMyW(this); } // statusLabelArray init actionLabelArray[0] = textLabel_Status0; @@ -1762,6 +1763,15 @@ void mainWindowImpl::myAllIn(){ myActionDone(); } +void mainWindowImpl::userActionTimeOutReached() { + + //TODO +// automatic check, fold + cout << "timeoutaction" << endl; + +} + + void mainWindowImpl::myActionDone() { // If a network client is running, we need @@ -2624,4 +2634,3 @@ void mainWindowImpl::playSound() { } - diff --git a/src/gui/qt/mainwindow/mainwindowimpl.h b/src/gui/qt/mainwindow/mainwindowimpl.h index c97df685..243c64a8 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.h +++ b/src/gui/qt/mainwindow/mainwindowimpl.h @@ -251,6 +251,8 @@ public slots: void localGameModification(); void networkGameModification(); + void userActionTimeOutReached(); + //SOUND TESTING void playSound(); void musicDone(); diff --git a/src/gui/qt/mainwindow/mysetlabel.cpp b/src/gui/qt/mainwindow/mysetlabel.cpp index 53f7110c..ddda4dbe 100644 --- a/src/gui/qt/mainwindow/mysetlabel.cpp +++ b/src/gui/qt/mainwindow/mysetlabel.cpp @@ -11,7 +11,9 @@ // #include "mysetlabel.h" -// using namespace std; +#include "mainwindowimpl.h" + +using namespace std; MySetLabel::MySetLabel(QGroupBox* parent) : QLabel(parent), timeOutAnimation(FALSE), timeOutValue(0), timeOutFrame(0) @@ -54,7 +56,11 @@ void MySetLabel::nextTimeOutAnimationFrame() { timeOutFrame++; update(); } - else stopTimeOutAnimation(); + else { + stopTimeOutAnimation(); + //callback + myW->userActionTimeOutReached(); + } } diff --git a/src/gui/qt/mainwindow/mysetlabel.h b/src/gui/qt/mainwindow/mysetlabel.h index 84d7c4cf..8b99794f 100644 --- a/src/gui/qt/mainwindow/mysetlabel.h +++ b/src/gui/qt/mainwindow/mysetlabel.h @@ -17,6 +17,9 @@ #include + +class mainWindowImpl; + class MySetLabel : public QLabel { Q_OBJECT @@ -25,6 +28,9 @@ public: ~MySetLabel(); + + void setMyW ( mainWindowImpl* theValue ) { myW = theValue; } + void startTimeOutAnimation(int secs); void stopTimeOutAnimation(); @@ -33,9 +39,11 @@ public: public slots: void nextTimeOutAnimationFrame(); + private: + mainWindowImpl *myW; QTimer *timeOutAnimationTimer; bool timeOutAnimation;