Skip to content

Commit

Permalink
GNUChess.
Browse files Browse the repository at this point in the history
  • Loading branch information
textbrowser committed Jan 7, 2025
1 parent d8911f1 commit f5ffa81
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Source/qtchess_communications.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ static QByteArray s_eof = "\n";

qtchess_communications::qtchess_communications(void):QObject()
{
qRegisterMetaType<QProcess::ExitStatus> ("QProcess::ExitStatus");
connect(&m_gnuchess,
SIGNAL(finished(int, QProcess::ExitStatus)),
this,
SLOT(slot_gnuchess_finished(int, QProcess::ExitStatus)),
Qt::QueuedConnection);
SLOT(slot_gnuchess_finished(int, QProcess::ExitStatus)));
connect(&m_gnuchess,
SIGNAL(readyReadStandardOutput(void)),
this,
Expand Down
22 changes: 17 additions & 5 deletions Source/qtchess_gui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -654,11 +654,23 @@ void qtchess_gui::show_error_message(const char *message)
void qtchess_gui::show_game_over(const int turn)
{
Q_UNUSED(turn);
QMessageBox::information
(this,
tr("QtChess: Game Over"),
tr("Game Over. Please enjoy another game."),
QMessageBox::Default | QMessageBox::Ok);

auto mb = findChild<QMessageBox *> ("game_over");

if(!mb)
{
mb = new QMessageBox(this);
mb->setDefaultButton(QMessageBox::Ok);
mb->setIcon(QMessageBox::Information);
mb->setModal(false);
mb->setObjectName("game_over");
mb->setStandardButtons(QMessageBox::Ok);
mb->setText(tr("Game Over! Please enjoy another game!"));
mb->setWindowTitle(tr("QtChess: Game Over"));
}

mb->show();
QTimer::singleShot(10000, mb, SLOT(deleteLater(void)));
}

void qtchess_gui::slot_about(void)
Expand Down

0 comments on commit f5ffa81

Please sign in to comment.