next steps votekick gui implementation
This commit is contained in:
1 parent
feb3341f8a
commit
de53c89fca
4 files changed
+52
-16
No files matched your search
@@ -1784,7 +1784,7 @@
|
|||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2" >
|
<layout class="QHBoxLayout" name="horizontalLayout_2" >
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_2" >
|
<widget class="QLabel" name="label_timeout" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Vote Timeout:</string>
|
<string>Vote Timeout:</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -2949,7 +2949,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1000</width>
|
<width>1000</width>
|
||||||
<height>30</height>
|
<height>28</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuView" >
|
<widget class="QMenu" name="menuView" >
|
||||||
|
|||||||
@@ -155,6 +155,7 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
|
|||||||
postRiverRunAnimation6Timer = new QTimer(this);
|
postRiverRunAnimation6Timer = new QTimer(this);
|
||||||
|
|
||||||
blinkingStartButtonAnimationTimer = new QTimer(this);
|
blinkingStartButtonAnimationTimer = new QTimer(this);
|
||||||
|
voteOnKickTimeoutTimer = new QTimer(this);
|
||||||
|
|
||||||
dealFlopCards0Timer->setSingleShot(TRUE);
|
dealFlopCards0Timer->setSingleShot(TRUE);
|
||||||
dealFlopCards1Timer->setSingleShot(TRUE);
|
dealFlopCards1Timer->setSingleShot(TRUE);
|
||||||
@@ -391,6 +392,12 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
|
|||||||
pushButton_break->setStyleSheet("QPushButton:enabled { background-color: #145300; color: #99D500;} QPushButton:disabled { background-color: #145300; color: #486F3E; font-weight: 900;}");
|
pushButton_break->setStyleSheet("QPushButton:enabled { background-color: #145300; color: #99D500;} QPushButton:disabled { background-color: #145300; color: #486F3E; font-weight: 900;}");
|
||||||
label_speedString->setStyleSheet("QLabel { color: #99D500;}");
|
label_speedString->setStyleSheet("QLabel { color: #99D500;}");
|
||||||
label_speedValue->setStyleSheet("QLabel { color: #99D500;}");
|
label_speedValue->setStyleSheet("QLabel { color: #99D500;}");
|
||||||
|
|
||||||
|
pushButton_voteOnKickYes->setStyleSheet("QPushButton:enabled { background-color: #1C7000; color: #99D500;} QPushButton:disabled { background-color: #145300; color: #486F3E; font-weight: 900;}");
|
||||||
|
pushButton_voteOnKickNo->setStyleSheet("QPushButton:enabled { background-color: #1C7000; color: #99D500;} QPushButton:disabled { background-color: #145300; color: #486F3E; font-weight: 900;}");
|
||||||
|
label_timeout->setStyleSheet("QLabel { color: #99D500;}");
|
||||||
|
label_kickVoteTimeout->setStyleSheet("QLabel { color: #99D500;}");
|
||||||
|
label_kickUser->setStyleSheet("QLabel { color: #99D500;}");
|
||||||
|
|
||||||
statusbar->setStyleSheet(" QStatusBar { "+ font1String +" font-size: 12px; color: #B7FF00; }");
|
statusbar->setStyleSheet(" QStatusBar { "+ font1String +" font-size: 12px; color: #B7FF00; }");
|
||||||
|
|
||||||
@@ -508,6 +515,7 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
|
|||||||
connect(postRiverRunAnimation6Timer, SIGNAL(timeout()), this, SLOT( startNewHand() ));
|
connect(postRiverRunAnimation6Timer, SIGNAL(timeout()), this, SLOT( startNewHand() ));
|
||||||
|
|
||||||
connect(blinkingStartButtonAnimationTimer, SIGNAL(timeout()), this, SLOT( blinkingStartButtonAnimationAction()));
|
connect(blinkingStartButtonAnimationTimer, SIGNAL(timeout()), this, SLOT( blinkingStartButtonAnimationAction()));
|
||||||
|
connect(voteOnKickTimeoutTimer, SIGNAL(timeout()), this, SLOT(nextVoteOnKickTimeoutAnimationFrame()));
|
||||||
|
|
||||||
connect( actionConfigure_PokerTH, SIGNAL( triggered() ), this, SLOT( callSettingsDialog() ) );
|
connect( actionConfigure_PokerTH, SIGNAL( triggered() ), this, SLOT( callSettingsDialog() ) );
|
||||||
connect( actionClose, SIGNAL( triggered() ), this, SLOT( closeGameTable()) );
|
connect( actionClose, SIGNAL( triggered() ), this, SLOT( closeGameTable()) );
|
||||||
@@ -2678,6 +2686,14 @@ bool gameTableImpl::eventFilter(QObject *obj, QEvent *event)
|
|||||||
myChat->nickAutoCompletition();
|
myChat->nickAutoCompletition();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_M) { //TESTING UNIT
|
||||||
|
startVoteOnKick(3,60);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_N) { //TESTING UNIT
|
||||||
|
stopVoteOnKickTimeout();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
else if (event->type() == QEvent::Close) {
|
else if (event->type() == QEvent::Close) {
|
||||||
event->ignore();
|
event->ignore();
|
||||||
closeGameTable();
|
closeGameTable();
|
||||||
@@ -2793,8 +2809,7 @@ void gameTableImpl::localGameModification() {
|
|||||||
|
|
||||||
tabWidget_Left->setCurrentIndex(0);
|
tabWidget_Left->setCurrentIndex(0);
|
||||||
tabWidget_Left->removeTab(1);
|
tabWidget_Left->removeTab(1);
|
||||||
if(tabWidget_Left->widget(2) == tab_Kick)
|
tabWidget_Left->removeTab(1);
|
||||||
tabWidget_Left->removeTab(2);
|
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++ ) {
|
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++ ) {
|
||||||
@@ -2818,9 +2833,9 @@ void gameTableImpl::localGameModification() {
|
|||||||
void gameTableImpl::networkGameModification() {
|
void gameTableImpl::networkGameModification() {
|
||||||
|
|
||||||
if(tabWidget_Left->widget(1) != tab_Chat)
|
if(tabWidget_Left->widget(1) != tab_Chat)
|
||||||
tabWidget_Left->insertTab(1, tab_Chat, QString(tr("Chat")));
|
tabWidget_Left->insertTab(1, tab_Chat, QString(tr(" Chat "))); /*TODO text abgeschnitten --> stylesheets*/
|
||||||
if(tabWidget_Left->widget(2) == tab_Kick)
|
|
||||||
tabWidget_Left->removeTab(2);
|
tabWidget_Left->removeTab(2);
|
||||||
|
|
||||||
tabWidget_Left->setCurrentIndex(1);
|
tabWidget_Left->setCurrentIndex(1);
|
||||||
myChat->clearNewGame();
|
myChat->clearNewGame();
|
||||||
@@ -3062,20 +3077,21 @@ void gameTableImpl::triggerVoteOnKick(int id) {
|
|||||||
void gameTableImpl::startVoteOnKick(int playerId, int timeoutSec)
|
void gameTableImpl::startVoteOnKick(int playerId, int timeoutSec)
|
||||||
{
|
{
|
||||||
if(tabWidget_Left->widget(2) != tab_Kick)
|
if(tabWidget_Left->widget(2) != tab_Kick)
|
||||||
tabWidget_Left->insertTab(2, tab_Chat, QString(tr("Kick")));
|
tabWidget_Left->insertTab(2, tab_Kick, QString(tr("Kick")));
|
||||||
|
|
||||||
tabWidget_Left->setCurrentIndex(2);
|
tabWidget_Left->setCurrentIndex(2);
|
||||||
|
|
||||||
PlayerInfo info(myStartWindow->getSession()->getClientPlayerInfo(playerId));
|
PlayerInfo info(myStartWindow->getSession()->getClientPlayerInfo(playerId));
|
||||||
label_kickUser->setText(tr("Do you want to kick %1 \nfrom this game?").arg(QString::fromUtf8(info.playerName.c_str())));
|
label_kickUser->setText(tr("Do you want to kick %1 \nfrom this game?").arg(QString::fromUtf8(info.playerName.c_str())));
|
||||||
|
|
||||||
// TODO timeout timer
|
voteOnKickTimeoutSecs = timeoutSec;
|
||||||
|
startVoteOnKickTimeout();
|
||||||
}
|
}
|
||||||
|
|
||||||
void gameTableImpl::endVoteOnKick()
|
void gameTableImpl::endVoteOnKick()
|
||||||
{
|
{
|
||||||
if(tabWidget_Left->widget(2) == tab_Kick)
|
stopVoteOnKickTimeout();
|
||||||
tabWidget_Left->removeTab(2);
|
tabWidget_Left->removeTab(2);
|
||||||
|
|
||||||
tabWidget_Left->setCurrentIndex(1);
|
tabWidget_Left->setCurrentIndex(1);
|
||||||
}
|
}
|
||||||
@@ -3088,3 +3104,22 @@ void gameTableImpl::voteOnKickNo()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gameTableImpl::startVoteOnKickTimeout()
|
||||||
|
{
|
||||||
|
voteOnKickRealTimer.reset();
|
||||||
|
voteOnKickRealTimer.start();
|
||||||
|
voteOnKickTimeoutTimer->start(1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
void gameTableImpl::stopVoteOnKickTimeout()
|
||||||
|
{
|
||||||
|
voteOnKickRealTimer.reset();
|
||||||
|
voteOnKickTimeoutTimer->stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
void gameTableImpl::nextVoteOnKickTimeoutAnimationFrame()
|
||||||
|
{
|
||||||
|
qDebug() << voteOnKickTimeoutSecs-voteOnKickRealTimer.elapsed().total_seconds();
|
||||||
|
label_kickVoteTimeout->setText(tr("%1 secs left").arg(voteOnKickTimeoutSecs-voteOnKickRealTimer.elapsed().total_seconds()));
|
||||||
|
}
|
||||||
|
|
||||||
@@ -283,6 +283,9 @@ public slots:
|
|||||||
void endVoteOnKick();
|
void endVoteOnKick();
|
||||||
void voteOnKickYes();
|
void voteOnKickYes();
|
||||||
void voteOnKickNo();
|
void voteOnKickNo();
|
||||||
|
void startVoteOnKickTimeout();
|
||||||
|
void stopVoteOnKickTimeout();
|
||||||
|
void nextVoteOnKickTimeoutAnimationFrame();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@@ -328,7 +331,8 @@ private:
|
|||||||
QTimer *postRiverRunAnimation6Timer;
|
QTimer *postRiverRunAnimation6Timer;
|
||||||
|
|
||||||
QTimer *blinkingStartButtonAnimationTimer;
|
QTimer *blinkingStartButtonAnimationTimer;
|
||||||
|
QTimer *voteOnKickTimeoutTimer;
|
||||||
|
boost::timers::portable::microsec_timer voteOnKickRealTimer;
|
||||||
|
|
||||||
QWidget *userWidgetsArray[6];
|
QWidget *userWidgetsArray[6];
|
||||||
QLabel *buttonLabelArray[MAX_NUMBER_OF_PLAYERS];
|
QLabel *buttonLabelArray[MAX_NUMBER_OF_PLAYERS];
|
||||||
@@ -398,7 +402,7 @@ private:
|
|||||||
|
|
||||||
int keyUpDownChatCounter;
|
int keyUpDownChatCounter;
|
||||||
int myLastPreActionBetValue;
|
int myLastPreActionBetValue;
|
||||||
|
int voteOnKickTimeoutSecs;
|
||||||
// StyleSheetReader *myStyleSheetReader;
|
// StyleSheetReader *myStyleSheetReader;
|
||||||
|
|
||||||
friend class GuiWrapper;
|
friend class GuiWrapper;
|
||||||
|
|||||||
@@ -68,6 +68,3 @@ void MyLeftTabWidget::paintEvent(QPaintEvent * event) {
|
|||||||
QTabWidget::paintEvent(event);
|
QTabWidget::paintEvent(event);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in new issue
Block a user