Cute Chess  0.1
engineconfigurationdlg.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 ENGINECONFIGURATIONDIALOG_H
19 #define ENGINECONFIGURATIONDIALOG_H
20 
21 #include <QDialog>
22 #include <QSet>
23 #include <engineconfiguration.h>
24 
25 class QTimer;
26 class EngineOption;
27 class EngineOptionModel;
28 class ChessEngine;
29 
30 namespace Ui {
32 }
33 
39 {
40  Q_OBJECT
41 
42  public:
45  {
50  };
51 
56  EngineConfigurationDialog(DialogMode mode, QWidget* parent = nullptr);
59 
63  void applyEngineInformation(const EngineConfiguration& engine);
68 
75  void setReservedNames(const QSet<QString>& names);
76 
77  signals:
78  void detectionFinished();
79 
80  private slots:
81  void browseCommand();
82  void setExecutable(const QString& file);
83  void browseWorkingDir();
84  void detectEngineOptions();
85  void restoreDefaults();
86  void onEngineReady();
87  void onEngineQuit();
88  void onTabChanged(int index);
89  void onNameOrCommandChanged();
90  void onAccepted();
91  void resizeColumns();
92 
93  private:
94  EngineOptionModel* m_engineOptionModel;
95  QString m_oldCommand;
96  QString m_oldPath;
97  QString m_oldProtocol;
98  QList<EngineOption*> m_options;
99  QStringList m_variants;
100  QTimer* m_optionDetectionTimer;
101  ChessEngine* m_engine;
102  Ui::EngineConfigurationDialog* ui;
103  QSet<QString> m_reservedNames;
104 };
105 
106 #endif // ENGINECONFIGURATIONDIALOG_H
virtual ~EngineConfigurationDialog()
Definition: engineconfigurationdlg.cpp:108
The EngineConfiguration class defines a chess engine configuration.
Definition: engineconfiguration.h:32
Definition: engineconfigurationdlg.h:30
Definition: engineconfigurationdlg.h:49
DialogMode
Definition: engineconfigurationdlg.h:44
Definition: engineconfigurationdlg.h:47
void setReservedNames(const QSet< QString > &names)
Definition: engineconfigurationdlg.cpp:168
The EngineConfigurationDialog class provides a dialog for chess engine configuration.
Definition: engineconfigurationdlg.h:38
Definition: engineoptionmodel.h:25
An artificial intelligence chess player.
Definition: chessengine.h:40
EngineConfiguration engineConfiguration()
Definition: engineconfigurationdlg.cpp:142
Definition: engineoption.h:24
EngineConfigurationDialog(DialogMode mode, QWidget *parent=nullptr)
Definition: engineconfigurationdlg.cpp:40
void applyEngineInformation(const EngineConfiguration &engine)
Definition: engineconfigurationdlg.cpp:114