Cute Chess  0.1
engineconfigurationdlg.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 ENGINECONFIGURATIONDIALOG_H
20 #define ENGINECONFIGURATIONDIALOG_H
21 
22 #include <QDialog>
23 #include <QSet>
24 #include <engineconfiguration.h>
25 
26 class EngineOption;
27 class EngineOptionModel;
28 class ChessEngine;
29 
30 namespace Ui {
32 }
33 
39 {
40  Q_OBJECT
41 
42  public:
45  {
49  ConfigureEngine
50  };
51 
56  EngineConfigurationDialog(DialogMode mode, QWidget* parent = nullptr);
58  virtual ~EngineConfigurationDialog();
59 
63  void applyEngineInformation(const EngineConfiguration& engine);
67  EngineConfiguration engineConfiguration();
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 onDetectionFinished();
87  void onEngineReady();
88  void onEngineQuit();
89  void onTabChanged(int index);
90  void onNameOrCommandChanged();
91  void onAccepted();
92  void resizeColumns();
93 
94  private:
95  bool m_hasError;
96  EngineOptionModel* m_engineOptionModel;
97  QString m_oldCommand;
98  QString m_oldPath;
99  QString m_oldProtocol;
100  QList<EngineOption*> m_options;
101  QStringList m_variants;
102  ChessEngine* m_engine;
103  Ui::EngineConfigurationDialog* ui;
104  QSet<QString> m_reservedNames;
105 };
106 
107 #endif // ENGINECONFIGURATIONDIALOG_H
The EngineConfiguration class defines a chess engine configuration.
Definition: engineconfiguration.h:33
Definition: engineconfigurationdlg.h:30
DialogMode
Definition: engineconfigurationdlg.h:44
Definition: engineconfigurationdlg.h:47
The EngineConfigurationDialog class provides a dialog for chess engine configuration.
Definition: engineconfigurationdlg.h:38
Definition: engineoptionmodel.h:26
An artificial intelligence chess player.
Definition: chessengine.h:41
Definition: engineoption.h:25