Cute Chess  0.1
timecontroldlg.h
1 /*
2  This file is part of Cute Chess.
3  Copyright (C) 2008-2018 Cute Chess authors
4 
5  Cute Chess is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  Cute Chess is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with Cute Chess. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef TIMECONTROLDIALOG_H
20 #define TIMECONTROLDIALOG_H
21 
22 #include <QDialog>
23 #include <timecontrol.h>
24 
25 namespace Ui {
26  class TimeControlDialog;
27 }
28 
32 class TimeControlDialog : public QDialog
33 {
34  Q_OBJECT
35 
36  public:
42  explicit TimeControlDialog(const TimeControl& tc,
43  QWidget *parent = nullptr);
45  virtual ~TimeControlDialog();
46 
48  TimeControl timeControl() const;
49 
50  private slots:
51  void onTournamentSelected();
52  void onTimePerMoveSelected();
53  void onInfiniteSelected();
54 
55  private:
56  enum TimeUnit
57  {
58  Seconds,
59  Minutes,
60  Hours
61  };
62 
63  int timeToMs() const;
64  void setTime(int ms);
65 
66  Ui::TimeControlDialog *ui;
67 };
68 
69 #endif // TIMECONTROLDIALOG_H
Time controls of a chess game.
Definition: timecontrol.h:35
Definition: engineconfigurationdlg.h:30
A dialog for setting a chess game&#39;s time controls.
Definition: timecontroldlg.h:32