X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=chessclockwindow.cpp;h=5d42baab2eea379390863495c480effe62bf7ddc;hb=6e19ed2103d7494b00e0cfec81f4bedd7d583d72;hp=b30b5f359a6715f250a80a248593778401865d06;hpb=4ed1a2e50305c7f691ecdc90db19ef77c3380646;p=chessclock diff --git a/chessclockwindow.cpp b/chessclockwindow.cpp index b30b5f3..5d42baa 100644 --- a/chessclockwindow.cpp +++ b/chessclockwindow.cpp @@ -40,6 +40,8 @@ #include #include #include +#include +#include "classes/screenlitkeeper.h" ChessClockWindow::ChessClockWindow(QWidget *parent) : QMainWindow(parent) @@ -61,10 +63,18 @@ ChessClockWindow::ChessClockWindow(QWidget *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("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())); } @@ -78,7 +88,7 @@ void ChessClockWindow::newGame() { pause(); if( clocks_ == 0 || !clocks_->isPlayStarted() || QMessageBox::question(this, tr("Start new game"), - tr("Really quit current game and start new one with current settings?"), + tr("Really quit the current game and start a new one?"), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) { stack_->setCurrentWidget(start_); @@ -93,10 +103,28 @@ void ChessClockWindow::newGame() void ChessClockWindow::visitWeb() { + pause(); QProcess* process = new QProcess(this); process->start(QString("browser --url=chessclock.garage.maemo.org")); } +void ChessClockWindow::about() +{ + pause(); + QMessageBox::about(this, tr("About ChessClock"), + tr("

Chess Clock %1

" + "©Arto Hyvättinen 2010" + "

Chess Clock is free software under the terms of GNU General Public License 3" + "

Bugtracker and instructions at http://chessclock.garage.maemo.org" + ).arg(qApp->applicationVersion())) ; +} + +void ChessClockWindow::aboutQt() +{ + pause(); + qApp->aboutQt(); +} + void ChessClockWindow::initTimeControls() {