projects
/
chessclock
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added pause button and screen lit function
[chessclock]
/
chessclockwindow.cpp
diff --git
a/chessclockwindow.cpp
b/chessclockwindow.cpp
index
571f8ec
..
5d42baa
100644
(file)
--- a/
chessclockwindow.cpp
+++ b/
chessclockwindow.cpp
@@
-40,6
+40,8
@@
#include <QMessageBox>
#include <QStackedWidget>
#include <QProcess>
#include <QMessageBox>
#include <QStackedWidget>
#include <QProcess>
+#include <QAction>
+#include "classes/screenlitkeeper.h"
ChessClockWindow::ChessClockWindow(QWidget *parent)
: QMainWindow(parent)
ChessClockWindow::ChessClockWindow(QWidget *parent)
: QMainWindow(parent)
@@
-61,9
+63,15
@@
ChessClockWindow::ChessClockWindow(QWidget *parent)
connect( start_, SIGNAL(selected(TimeControl*)), this, SLOT(startGame(TimeControl*)));
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("New game"), this, SLOT(newGame()));
// Set up menu
menuBar()->addAction( tr("Pause"), this, SLOT(pause()));
menuBar()->addAction( tr("New game"), this, SLOT(newGame()));
+ menuBar()->addAction( keepAction );
menuBar()->addAction( tr("Visit web page"), this, SLOT(visitWeb()));
menuBar()->addAction( tr("About"),this, SLOT(about()));
menuBar()->addAction(tr("About Qt"), this, SLOT(aboutQt()));
menuBar()->addAction( tr("Visit web page"), this, SLOT(visitWeb()));
menuBar()->addAction( tr("About"),this, SLOT(about()));
menuBar()->addAction(tr("About Qt"), this, SLOT(aboutQt()));