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->clear();
myGameListSelectionModel->clearSelection(); myGameListSelectionModel->clearSelection();
myGameListSortFilterProxyModel->clear(); myGameListSortFilterProxyModel->clear();
myNickListModel->clear(); myNickListModel->clear();
myNickListSelectionModel->clear(); myNickListSelectionModel->clear();
myNickListSelectionModel->clearSelection();; myNickListSelectionModel->clearSelection();;
@@ -398,19 +397,15 @@ void gameLobbyDialogImpl::refresh(int actionID)
//stop waitStartGameMsgBoxes //stop waitStartGameMsgBoxes
waitStartGameMsgBoxTimer->stop(); waitStartGameMsgBoxTimer->stop();
closeAllChildDialogs(); closeAllChildDialogs();
this->accept(); this->accept();
myW->show(); myW->show();
} else if(actionID == MSG_NET_GAME_CLIENT_SYNCSTART) { } else if(actionID == MSG_NET_GAME_CLIENT_SYNCSTART) {
waitStartGameMsgBoxTimer->start(2000); waitStartGameMsgBoxTimer->start(2000);
} else if(actionID == MSG_NET_GAME_CLIENT_SYNCREJOIN) { } else if(actionID == MSG_NET_GAME_CLIENT_SYNCREJOIN) {
if(this->isVisible()) { if(this->isVisible()) {
//break the autoStartTimer animation //break the autoStartTimer animation
autoStartTimer->stop(); autoStartTimer->stop();
autoStartTimerOverlay->hide(); autoStartTimerOverlay->hide();
//show msg dialog //show msg dialog
waitRejoinStartGameMsgBox->show(); waitRejoinStartGameMsgBox->show();
waitRejoinStartGameMsgBox->raise(); waitRejoinStartGameMsgBox->raise();
@@ -1379,15 +1374,25 @@ void gameLobbyDialogImpl::reject()
void gameLobbyDialogImpl::closeEvent(QCloseEvent *event) void gameLobbyDialogImpl::closeEvent(QCloseEvent *event)
{ {
event->accept();
//stop waitStartGameMsgBoxes //stop waitStartGameMsgBoxes
waitStartGameMsgBoxTimer->stop(); waitStartGameMsgBoxTimer->stop();
waitStartGameMsgBox->hide(); waitStartGameMsgBox->hide();
waitRejoinStartGameMsgBox->hide(); waitRejoinStartGameMsgBox->hide();
//enable leave button again - it was disabled during waitxyzMsgBoxes //enable leave button again - it was disabled during waitxyzMsgBoxes
pushButton_Leave->setEnabled(true); 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) void gameLobbyDialogImpl::writeDialogSettings(int saveMode)
{ {
@@ -118,6 +118,7 @@ public slots:
void joinAnyGameButtonRefresh(); void joinAnyGameButtonRefresh();
void reject(); void reject();
void closeEvent(QCloseEvent *event); void closeEvent(QCloseEvent *event);
void accept();
void writeDialogSettings(int); void writeDialogSettings(int);
void readDialogSettings(); void readDialogSettings();
void changeGameListFilter(int); void changeGameListFilter(int);
+1 -1
View File
@@ -199,7 +199,7 @@ void MyAvatarLabel::refreshTooltips()
if((*it_c)->getMyType() == PLAYER_TYPE_COMPUTER) { if((*it_c)->getMyType() == PLAYER_TYPE_COMPUTER) {
computerPlayer = true; 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()]->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->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())) ); myW->playerAvatarLabelArray[(*it_c)->getMyID()]->setToolTip( getPlayerTip(QString::fromUtf8((*it_c)->getMyName().c_str())) );