Cute Chess  0.1
newtournamentdialog.h
1 /*
2  This file is part of Cute Chess.
3 
4  Cute Chess is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  Cute Chess is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with Cute Chess. If not, see <http://www.gnu.org/licenses/>.
16 */
17 
18 #ifndef NEWTOURNAMENTDIALOG_H
19 #define NEWTOURNAMENTDIALOG_H
20 
21 #include <QDialog>
22 #include <timecontrol.h>
23 
24 class QModelIndex;
25 class QItemSelection;
26 class EngineManager;
29 class GameManager;
30 class Tournament;
31 
32 namespace Ui {
33  class NewTournamentDialog;
34 }
35 
37 {
38  Q_OBJECT
39 
40  public:
41  explicit NewTournamentDialog(EngineManager* engineManager,
42  QWidget* parent = nullptr);
43  virtual ~NewTournamentDialog();
44 
45  Tournament* createTournament(GameManager* gameManager) const;
46 
47  private slots:
48  void addEngine();
49  void removeEngine();
50  void configureEngine(const QModelIndex& index);
51  void onVariantChanged(const QString& variant);
52  void onPlayerSelectionChanged(const QItemSelection& selected,
53  const QItemSelection& deselected);
54 
55  private:
56  void moveEngine(int offset);
57  bool canStart() const;
58  void readSettings();
59 
60  EngineManager* m_srcEngineManager;
61  EngineManager* m_addedEnginesManager;
62  EngineConfigurationModel* m_srcEnginesModel;
63  EngineConfigurationModel* m_addedEnginesModel;
64  EngineConfigurationProxyModel* m_proxyModel;
65  Ui::NewTournamentDialog* ui;
66 };
67 
68 #endif // NEWTOURNAMENTDIALOG_H
Definition: newtournamentdialog.h:36
A proxy model for sorting and filtering engine configurations.
Definition: engineconfigproxymodel.h:31
Definition: engineconfigurationdlg.h:30
Manages chess engines and their configurations.
Definition: enginemanager.h:29
The EngineConfigurationModel class represents a chess engine configuration based model.
Definition: engineconfigurationmodel.h:42
A class for managing chess games and players.
Definition: gamemanager.h:39
Base class for chess tournaments.
Definition: tournament.h:44