Time controls ready to use.
classes/timecontrol/notimecontrol.cpp \
classes/startwidget.cpp \
classes/timecontrol/fischertimecontrol.cpp \
- classes/timecontrol/fischerclock.cpp
+ classes/timecontrol/fischerclock.cpp \
+ classes/timecontrol/fischerafterclock.cpp \
+ classes/timecontrol/fischeraftertimecontrol.cpp \
+ classes/timecontrol/delayclock.cpp \
+ classes/timecontrol/delaytimecontrol.cpp \
+ classes/timecontrol/delayafterclock.cpp \
+ classes/timecontrol/delayaftertimecontrol.cpp \
+ classes/timecontrol/hourglassclock.cpp \
+ classes/timecontrol/hourglasstimecontrol.cpp
HEADERS += chessclockwindow.h \
classes/turninformation.h \
classes/timecontrol/notimecontrol.h \
classes/startwidget.h \
classes/timecontrol/fischertimecontrol.h \
- classes/timecontrol/fischerclock.h
+ classes/timecontrol/fischerclock.h \
+ classes/timecontrol/fischerafterclock.h \
+ classes/timecontrol/fischeraftertimecontrol.h \
+ classes/timecontrol/delayclock.h \
+ classes/timecontrol/delaytimecontrol.h \
+ classes/timecontrol/delayafterclock.h \
+ classes/timecontrol/delayaftertimecontrol.h \
+ classes/timecontrol/hourglasstimecontrol.h \
+ classes/timecontrol/hourglassclock.h
CONFIG += mobility
MOBILITY =
#include "classes/startwidget.h"
#include "classes/timecontrol.h"
+// Time controls
#include "classes/timecontrol/notimecontrol.h"
#include "classes/timecontrol/fischertimecontrol.h"
+#include "classes/timecontrol/fischeraftertimecontrol.h"
+#include "classes/timecontrol/delaytimecontrol.h"
+#include "classes/timecontrol/delayaftertimecontrol.h"
+#include "classes/timecontrol/hourglasstimecontrol.h"
#include <QIcon>
#include <QApplication>
{
start_->addTimeControl( new NoTimeControl );
start_->addTimeControl( new FischerTimeControl);
+ start_->addTimeControl( new FischerAfterTimeControl);
+ start_->addTimeControl( new DelayTimeControl );
+ start_->addTimeControl( new DelayAfterTimeControl);
+ start_->addTimeControl( new HourGlassTimeControl);
}
void ChessClockWindow::startGame(TimeControl *timecontrol)
/*! Update clock information, check looser state and refresh */
virtual void updateClock();
-private:
+protected:
ChessClock* another_; /*! Another player's clock */
bool loser_; /*! Is player losed because of timeout */
void ChessClockWidget::repaintClock()
{
// Set picture
- if( getStatus() == Running )
+ if( getStatus() == Running || getStatus() == Paused)
pictureLabel_->setPixmap( picActive_);
else
pictureLabel_->setPixmap(picPassive_);
QLabel* titleLabel = new QLabel( qApp->applicationName() );
titleLabel->setFont(QFont("Helvetica",32,QFont::Bold));
- QLabel* copyLabel = new QLabel( tr("© Arto Hyvättinen 2010"));
+ QLabel* copyLabel = new QLabel( tr("© Arto Hyvättinen 2010<br>Free software GPL3"));
copyLabel->setTextFormat(Qt::RichText);
copyLabel->setWordWrap(true);
QVBoxLayout* leftLayout = new QVBoxLayout;
leftLayout->addWidget(titleLabel);
- leftLayout->addWidget(copyLabel);
leftLayout->addWidget(logoLabel);
-
+ leftLayout->addWidget(copyLabel);
modeSelect_ = new QListWidget();
modeSelect_->setViewMode(QListView::IconMode);
--- /dev/null
+ /**************************************************************************
+
+ Chess Clock
+
+ Copyright (c) Arto Hyvättinen 2010
+
+ This file is part of Chess Clock software.
+
+ Chess Clock is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Chess Clock is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+
+**************************************************************************/
+
+#include "delayafterclock.h"
+
+DelayAfterClock::DelayAfterClock(bool white, int delay, QWidget *parent) :
+ ChessClockWidget(white, parent)
+{
+ delay_ = delay;
+ setGreenTime( delay_);
+}
+
+TurnInformation* DelayAfterClock::endTurn()
+{
+ int turntime = currentTurnPlayed();
+
+ if( turntime > delay_ )
+ addTime( delay_ ); // Add whole delay
+ else
+ addTime( currentTurnPlayed()); // Add time of turn
+
+ return ChessClock::endTurn();
+
+}
--- /dev/null
+ /**************************************************************************
+
+ Chess Clock
+
+ Copyright (c) Arto Hyvättinen 2010
+
+ This file is part of Chess Clock software.
+
+ Chess Clock is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Chess Clock is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+
+**************************************************************************/
+
+#ifndef DELAYAFTERCLOCK_H
+#define DELAYAFTERCLOCK_H
+
+#include "../chessclockwidget.h"
+
+
+/*! Delay after (Bronstein delay)
+
+ @author Arto Hyvättinen
+ @date 2010-08-16
+
+ */
+class DelayAfterClock : public ChessClockWidget
+{
+ Q_OBJECT
+public:
+ DelayAfterClock(bool white, int delay, QWidget *parent = 0);
+
+ TurnInformation* endTurn();
+signals:
+
+public slots:
+
+protected:
+ int delay_;
+
+};
+
+#endif // DELAYAFTERCLOCK_H
--- /dev/null
+ /**************************************************************************
+
+ Chess Clock
+
+ Copyright (c) Arto Hyvättinen 2010
+
+ This file is part of Chess Clock software.
+
+ Chess Clock is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Chess Clock is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+
+**************************************************************************/
+
+#include "delayaftertimecontrol.h"
+#include "delayafterclock.h"
+#include "../clockswidget.h"
+#include "basicdialog.h"
+
+#include <QApplication>
+
+DelayAfterTimeControl::DelayAfterTimeControl()
+{
+}
+
+QString DelayAfterTimeControl::getName()
+{
+ return qApp->translate("Delay after","Delay after");
+}
+
+QString DelayAfterTimeControl::getDescription()
+{
+ return qApp->translate("Delay","Time up to special increment is added after turn");
+}
+
+ClocksWidget* DelayAfterTimeControl::initGame(bool useLastSettings)
+{
+ BasicDialog dialog(getName());
+ dialog.disablePerTurns();
+ dialog.init();
+
+ if( useLastSettings || dialog.exec() == QDialog::Accepted)
+ {
+ dialog.store();
+ DelayAfterClock* white = new DelayAfterClock( true, dialog.getWhiteAddition());
+ white->setTimeAvailable(dialog.getWhiteInitial());
+
+ DelayAfterClock* black = new DelayAfterClock( false, dialog.getBlackAddition());
+ black->setTimeAvailable( dialog.getBlackInitial());
+
+ return( new ClocksWidget(white,black));
+
+ }
+ else
+ return 0;
+}
--- /dev/null
+ /**************************************************************************
+
+ Chess Clock
+
+ Copyright (c) Arto Hyvättinen 2010
+
+ This file is part of Chess Clock software.
+
+ Chess Clock is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Chess Clock is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+
+**************************************************************************/
+
+#ifndef DELAYAFTERTIMECONTROL_H
+#define DELAYAFTERTIMECONTROL_H
+
+#include "../timecontrol.h"
+
+class DelayAfterTimeControl : public TimeControl
+{
+public:
+ DelayAfterTimeControl();
+
+ QString getName();
+ QString getDescription();
+ ClocksWidget* initGame(bool useLastSettings);
+};
+
+#endif // DELAYAFTERTIMECONTROL_H
--- /dev/null
+ /**************************************************************************
+
+ Chess Clock
+
+ Copyright (c) Arto Hyvättinen 2010
+
+ This file is part of Chess Clock software.
+
+ Chess Clock is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Chess Clock is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+
+**************************************************************************/
+
+#include "delayclock.h"
+
+DelayClock::DelayClock(bool white, int delay, QWidget *parent) :
+ ChessClockWidget(white, parent)
+{
+ delay_ = delay;
+ setGreenTime( delay_ );
+}
+
+int DelayClock::getTimeAvailable()
+{
+ if( currentTurn_)
+ {
+ int played = currentTurnPlayed();
+ if( played > delay_)
+ {
+ // Will add the whole delay
+ return timeAvailableBeforeTurn_ + delay_ - played;
+ }
+ }
+ // in delay or not in turn.
+ return timeAvailableBeforeTurn_;
+}
--- /dev/null
+ /**************************************************************************
+
+ Chess Clock
+
+ Copyright (c) Arto Hyvättinen 2010
+
+ This file is part of Chess Clock software.
+
+ Chess Clock is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Chess Clock is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+
+**************************************************************************/
+
+#ifndef DELAYCLOCK_H
+#define DELAYCLOCK_H
+
+#include "../chessclockwidget.h"
+/*! Simple delay
+
+ @author Arto Hyvättinen
+ @date 2010-08-16
+
+
+
+ */
+class DelayClock : public ChessClockWidget
+{
+ Q_OBJECT
+public:
+ DelayClock(bool white, int delay, QWidget *parent = 0);
+
+ int getTimeAvailable();
+signals:
+
+public slots:
+
+protected:
+ int delay_;
+
+
+};
+
+#endif // DELAYCLOCK_H
--- /dev/null
+ /**************************************************************************
+
+ Chess Clock
+
+ Copyright (c) Arto Hyvättinen 2010
+
+ This file is part of Chess Clock software.
+
+ Chess Clock is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Chess Clock is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+
+**************************************************************************/
+
+#include "delaytimecontrol.h"
+#include "delayclock.h"
+#include "../clockswidget.h"
+#include "basicdialog.h"
+
+#include <QApplication>
+
+DelayTimeControl::DelayTimeControl()
+{
+}
+
+QString DelayTimeControl::getName()
+{
+ return qApp->translate("Delay","Delay");
+}
+
+QString DelayTimeControl::getDescription()
+{
+ return qApp->translate("Delay","The clock waits for the delay period before starting");
+}
+
+ClocksWidget* DelayTimeControl::initGame(bool useLastSettings)
+{
+ BasicDialog dialog(getName());
+ dialog.disablePerTurns();
+ dialog.init();
+
+ if( useLastSettings || dialog.exec() == QDialog::Accepted)
+ {
+ dialog.store();
+ DelayClock* white = new DelayClock( true, dialog.getWhiteAddition());
+ white->setTimeAvailable(dialog.getWhiteInitial());
+
+ DelayClock* black = new DelayClock( false, dialog.getBlackAddition());
+ black->setTimeAvailable( dialog.getBlackInitial());
+
+ return( new ClocksWidget(white,black));
+
+ }
+ else
+ return 0;
+}
--- /dev/null
+ /**************************************************************************
+
+ Chess Clock
+
+ Copyright (c) Arto Hyvättinen 2010
+
+ This file is part of Chess Clock software.
+
+ Chess Clock is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Chess Clock is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+
+**************************************************************************/
+
+#ifndef DELAYTIMECONTROL_H
+#define DELAYTIMECONTROL_H
+
+#include "../timecontrol.h"
+
+class DelayTimeControl : public TimeControl
+{
+public:
+ DelayTimeControl();
+
+ QString getName();
+ QString getDescription();
+ ClocksWidget* initGame(bool useLastSettings);
+};
+
+#endif // DELAYTIMECONTROL_H
--- /dev/null
+ /**************************************************************************
+
+ Chess Clock
+
+ Copyright (c) Arto Hyvättinen 2010
+
+ This file is part of Chess Clock software.
+
+ Chess Clock is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Chess Clock is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+
+**************************************************************************/
+
+#include "fischerafterclock.h"
+
+FischerAfterClock::FischerAfterClock(bool white, int addition, int perTurns, QWidget *parent) :
+ ChessClockWidget(white, parent)
+{
+ addition_ = addition;
+ perTurns_ = perTurns;
+
+ setGreenTime( addition );
+}
+
+TurnInformation* FischerAfterClock::endTurn()
+{
+ if( getTurn() % perTurns_ == 0)
+ addTime( addition_ );
+ return ChessClock::endTurn() ;
+}
--- /dev/null
+ /**************************************************************************
+
+ Chess Clock
+
+ Copyright (c) Arto Hyvättinen 2010
+
+ This file is part of Chess Clock software.
+
+ Chess Clock is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Chess Clock is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+
+**************************************************************************/
+
+#ifndef FISCHERAFTERCLOCK_H
+#define FISCHERAFTERCLOCK_H
+
+#include "../chessclockwidget.h"
+
+class TurnInformation;
+
+/*! Insert specified time after turn
+
+ @author Arto Hyvättinen
+ @date 2010-08-16
+ */
+class FischerAfterClock : public ChessClockWidget
+{
+ Q_OBJECT
+public:
+ FischerAfterClock(bool white, int addition, int perTurns, QWidget *parent = 0);
+ TurnInformation* endTurn();
+
+signals:
+
+public slots:
+
+protected:
+ int addition_;
+ int perTurns_;
+
+
+};
+
+#endif // FISCHERAFTERCLOCK_H
--- /dev/null
+ /**************************************************************************
+
+ Chess Clock
+
+ Copyright (c) Arto Hyvättinen 2010
+
+ This file is part of Chess Clock software.
+
+ Chess Clock is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Chess Clock is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+
+**************************************************************************/
+
+#include "fischeraftertimecontrol.h"
+#include "fischerafterclock.h"
+#include "../clockswidget.h"
+#include "basicdialog.h"
+
+
+FischerAfterTimeControl::FischerAfterTimeControl()
+{
+}
+
+QString FischerAfterTimeControl::getDescription()
+{
+ return qApp->translate("FischerAfter","Specified time increment is added to clock after turn.");
+}
+
+ClocksWidget* FischerAfterTimeControl::initGame(bool useLastSettings)
+{
+ BasicDialog dialog(getName());
+ dialog.init();
+
+ if( useLastSettings || dialog.exec() == QDialog::Accepted)
+ {
+ dialog.store();
+ FischerAfterClock* white = new FischerAfterClock( true, dialog.getWhiteAddition(), dialog.getWhitePerTurns());
+ white->setTimeAvailable(dialog.getWhiteInitial());
+
+ FischerAfterClock* black = new FischerAfterClock( false, dialog.getBlackAddition(), dialog.getBlackPerTurns());
+ black->setTimeAvailable( dialog.getBlackInitial());
+
+ return( new ClocksWidget(white,black));
+
+ }
+ else
+ return 0;
+}
--- /dev/null
+ /**************************************************************************
+
+ Chess Clock
+
+ Copyright (c) Arto Hyvättinen 2010
+
+ This file is part of Chess Clock software.
+
+ Chess Clock is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Chess Clock is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+
+**************************************************************************/
+
+#ifndef FISCHERAFTERTIMECONTROL_H
+#define FISCHERAFTERTIMECONTROL_H
+
+#include "../timecontrol.h"
+#include <QApplication>
+
+class FischerAfterTimeControl : public TimeControl
+{
+public:
+ FischerAfterTimeControl();
+
+ QString getName() { return qApp->translate("FischerAfter","Addition after"); }
+ QString getDescription();
+ ClocksWidget* initGame( bool useLastSettings);
+
+};
+
+#endif // FISCHERAFTERTIMECONTROL_H
--- /dev/null
+ /**************************************************************************
+
+ Chess Clock
+
+ Copyright (c) Arto Hyvättinen 2010
+
+ This file is part of Chess Clock software.
+
+ Chess Clock is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Chess Clock is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+
+**************************************************************************/
+
+#include "hourglassclock.h"
+#include "../turninformation.h"
+
+HourGlassClock::HourGlassClock(bool white, QWidget *parent) :
+ ChessClockWidget(white, parent)
+{
+}
+
+
+int HourGlassClock::getTimeAvailable()
+{
+ if( !another_)
+ return timeAvailableBeforeTurn_;
+
+ if( currentTurn_ )
+ {
+ return timeAvailableBeforeTurn_ - currentTurnPlayed();
+ }
+ else
+ {
+ return timeAvailableBeforeTurn_ + another_->currentTurnPlayed();
+ }
+}
+
+
+TurnInformation* HourGlassClock::endTurn()
+{
+ updateTimer_.stop();
+ status_ = NotRunning;
+
+ updateClock();
+
+ timePlayedBeforeTurn_ = getTimePlayed();
+
+ // Count available times of BOTH the clocks!
+ setTimeAvailable( getTimeAvailable() );
+ another_->setTimeAvailable( another_->getTimeAvailable());
+
+ // Close and return turn information
+ currentTurn_->turnReady(timeAvailableBeforeTurn_ );
+ TurnInformation* information = currentTurn_;
+ currentTurn_ = 0;
+
+ emit turnEnded();
+ return information;
+}
+
+void HourGlassClock::updateClock()
+{
+ ChessClock::updateClock();
+ another_->ChessClock::updateClock();
+}
--- /dev/null
+ /**************************************************************************
+
+ Chess Clock
+
+ Copyright (c) Arto Hyvättinen 2010
+
+ This file is part of Chess Clock software.
+
+ Chess Clock is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Chess Clock is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+
+**************************************************************************/
+
+#ifndef HOURGLASSCLOCK_H
+#define HOURGLASSCLOCK_H
+
+#include "../chessclockwidget.h"
+
+
+class HourGlassClock : public ChessClockWidget
+{
+ Q_OBJECT
+public:
+ HourGlassClock(bool white, QWidget *parent = 0);
+
+ int getTimeAvailable();
+ TurnInformation* endTurn();
+
+public slots:
+ void updateClock();
+
+};
+
+#endif // HOURGLASSCLOCK_H
--- /dev/null
+ /**************************************************************************
+
+ Chess Clock
+
+ Copyright (c) Arto Hyvättinen 2010
+
+ This file is part of Chess Clock software.
+
+ Chess Clock is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Chess Clock is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+
+**************************************************************************/
+
+#include "hourglasstimecontrol.h"
+#include "hourglassclock.h"
+#include "../clockswidget.h"
+#include "basicdialog.h"
+
+#include <QApplication>
+#include <QTime>
+
+HourGlassTimeControl::HourGlassTimeControl()
+{
+}
+
+
+QString HourGlassTimeControl::getName()
+{
+ return qApp->translate("Hour Glass","Hour Glass");
+}
+
+QString HourGlassTimeControl::getDescription()
+{
+ return qApp->translate("Hour Glass","Time added to clock is substracted to another");
+}
+
+ClocksWidget* HourGlassTimeControl::initGame(bool useLastSettings)
+{
+ BasicDialog dialog(getName());
+ dialog.disableAddition();
+ dialog.init(QTime(0,30),QTime(0,30));
+
+ if( useLastSettings || dialog.exec() == QDialog::Accepted)
+ {
+ dialog.store();
+ HourGlassClock* white = new HourGlassClock( true);
+ white->setTimeAvailable(dialog.getWhiteInitial());
+
+ HourGlassClock* black = new HourGlassClock( false);
+ black->setTimeAvailable( dialog.getBlackInitial());
+
+ return( new ClocksWidget(white,black));
+
+ }
+ else
+ return 0;
+}
--- /dev/null
+ /**************************************************************************
+
+ Chess Clock
+
+ Copyright (c) Arto Hyvättinen 2010
+
+ This file is part of Chess Clock software.
+
+ Chess Clock is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Chess Clock is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+
+**************************************************************************/
+
+#ifndef HOURGLASSTIMECONTROL_H
+#define HOURGLASSTIMECONTROL_H
+
+#include "../timecontrol.h"
+
+class HourGlassTimeControl : public TimeControl
+{
+public:
+ HourGlassTimeControl();
+
+ QString getName();
+ QString getDescription();
+ ClocksWidget* initGame(bool useLastSettings);
+};
+
+#endif // HOURGLASSTIMECONTROL_H
/*! @mainpage Chess Clock
@author Arto Hyvättinen
- @version 0.1.0
Chess Clock
a.setApplicationName( a.tr("Chess Clock","Application name") );
a.setOrganizationName("Chess Clock");
a.setOrganizationDomain("chessclock.garage.maemo.org");
- a.setApplicationVersion("0.1.0");
+ a.setApplicationVersion("0.1.1");
ChessClockWindow w;