really fix leave game button bug

This commit is contained in:
doitux
2011-12-31 13:33:34 +00:00
parent 2e88f132d3
commit ce5b83acf9
3 changed files with 13 additions and 7 deletions
@@ -377,7 +377,6 @@ void gameLobbyDialogImpl::refresh(int actionID)
myGameListSelectionModel->clear();
myGameListSelectionModel->clearSelection();
myGameListSortFilterProxyModel->clear();
myNickListModel->clear();
myNickListSelectionModel->clear();
myNickListSelectionModel->clearSelection();;
@@ -398,19 +397,15 @@ void gameLobbyDialogImpl::refresh(int actionID)
//stop waitStartGameMsgBoxes
waitStartGameMsgBoxTimer->stop();
closeAllChildDialogs();
this->accept();
myW->show();
} else if(actionID == MSG_NET_GAME_CLIENT_SYNCSTART) {
waitStartGameMsgBoxTimer->start(2000);
} else if(actionID == MSG_NET_GAME_CLIENT_SYNCREJOIN) {
if(this->isVisible()) {
//break the autoStartTimer animation
autoStartTimer->stop();
autoStartTimerOverlay->hide();
//show msg dialog
waitRejoinStartGameMsgBox->show();
waitRejoinStartGameMsgBox->raise();
@@ -1379,15 +1374,25 @@ void gameLobbyDialogImpl::reject()
void gameLobbyDialogImpl::closeEvent(QCloseEvent *event)
{
event->accept();
//stop waitStartGameMsgBoxes
waitStartGameMsgBoxTimer->stop();
waitStartGameMsgBox->hide();
waitRejoinStartGameMsgBox->hide();
//enable leave button again - it was disabled during waitxyzMsgBoxes
pushButton_Leave->setEnabled(true);
event->accept();
}
void gameLobbyDialogImpl::accept()
{
//stop waitStartGameMsgBoxes
waitStartGameMsgBoxTimer->stop();
closeAllChildDialogs();
//enable leave button again - it was disabled during waitxyzMsgBoxes
pushButton_Leave->setEnabled(true);
qDebug() << "hide";
QDialog::accept();
}
void gameLobbyDialogImpl::writeDialogSettings(int saveMode)
{
@@ -118,6 +118,7 @@ public slots:
void joinAnyGameButtonRefresh();
void reject();
void closeEvent(QCloseEvent *event);
void accept();
void writeDialogSettings(int);
void readDialogSettings();
void changeGameListFilter(int);
+1 -1
View File
@@ -199,7 +199,7 @@ void MyAvatarLabel::refreshTooltips()
if((*it_c)->getMyType() == PLAYER_TYPE_COMPUTER) {
computerPlayer = true;
}
if(!computerPlayer && getPlayerTip(QString::fromUtf8((*it_c)->getMyName().c_str()))!="") {
if(!computerPlayer && getPlayerTip(QString::fromUtf8((*it_c)->getMyName().c_str()))!="" && seatPlace!=0) {
myW->playerTipLabelArray[(*it_c)->getMyID()]->setText(QString("<a style='text-decoration: none; color: #"+myW->getMyGameTableStyle()->getPlayerInfoHintTextColor()+"; font-size: 14px; font-weight: bold; font-family:serif;' href=\'")+QString::fromUtf8((*it_c)->getMyName().c_str())+"\'>i</a>");
myW->playerTipLabelArray[(*it_c)->getMyID()]->setToolTip( getPlayerTip(QString::fromUtf8((*it_c)->getMyName().c_str())) );
myW->playerAvatarLabelArray[(*it_c)->getMyID()]->setToolTip( getPlayerTip(QString::fromUtf8((*it_c)->getMyName().c_str())) );