#include <QStackedWidget>
#include <QProcess>
#include <QAction>
-#include "classes/screenlitkeeper.h"
ChessClockWindow::ChessClockWindow(QWidget *parent)
: QMainWindow(parent)
connect( start_, SIGNAL(selected(TimeControl*)), this, SLOT(startGame(TimeControl*)));
- ScreenLitKeeper* keeper = new ScreenLitKeeper(this);
- QAction* keepAction = new QAction( tr("Keep screen lit"), this);
- keepAction->setCheckable(true);
- connect( keepAction, SIGNAL(triggered(bool)), keeper, SLOT(keepScreenLit(bool)));
// Set up menu
- menuBar()->addAction( tr("Pause"), this, SLOT(pause()));
+// menuBar()->addAction( tr("Pause"), this, SLOT(pause())); // UNUSED - Pause button
menuBar()->addAction( tr("New game"), this, SLOT(newGame()));
menuBar()->addAction( keepAction );
menuBar()->addAction( tr("Visit web page"), this, SLOT(visitWeb()));
#include "clockswidget.h"
#include "chessclock.h"
+#include "screenlitkeeper.h"
+
#include <QLabel>
#include <QPixmap>
#include <QApplication>
delayTimer_.start(); // Initial start
recentX = recentY = -1;
+
+ // ScreenLitKeeper to keep screen lit when playing
+ keeper_ = new ScreenLitKeeper(this);
}
ClocksWidget::~ClocksWidget()
white_->pauseTurn();
pauseLabel_->setVisible(true);
pauseButton_->setVisible(false);
+ keeper_->keepScreenLit(false);
+
}
else if( status_ == BlackTurn)
{
black_->pauseTurn();
pauseLabel_->setVisible(true);
pauseButton_->setVisible(false);
+ keeper_->keepScreenLit(false);
}
}
// Start game!
welcomeLabel_->setVisible(false);
pauseButton_->setVisible(true);
+ keeper_->keepScreenLit(true);
white_->startTurn();
status_ = WhiteTurn;
break;
break;
case WhitePause:
// Continue play
+ keeper_->keepScreenLit(true);
pauseLabel_->setVisible(false);
pauseButton_->setVisible(true);
white_->continueTurn();
break;
case BlackPause:
// Continue play
+ keeper_->keepScreenLit();
pauseLabel_->setVisible(false);
pauseButton_->setVisible(true);
black_->continueTurn();
class QLabel;
class TurnInformation;
class QToolButton;
+class ScreenLitKeeper;
class ChessClock;
QLabel* pauseLabel_;
QLabel* welcomeLabel_;
QToolButton* pauseButton_;
+ ScreenLitKeeper* keeper_;
enum GameStatus {
Stopped /*! Not running */,