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
26class EngineOption;
28class ChessEngine;
29
30namespace Ui {
31 class EngineConfigurationDialog;
32}
33
39{
40 Q_OBJECT
41
42 public:
51
56 EngineConfigurationDialog(DialogMode mode, QWidget* parent = nullptr);
59
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
An artificial intelligence chess player.
Definition chessengine.h:42
void applyEngineInformation(const EngineConfiguration &engine)
Definition engineconfigurationdlg.cpp:112
void setReservedNames(const QSet< QString > &names)
Definition engineconfigurationdlg.cpp:165
DialogMode
Definition engineconfigurationdlg.h:45
@ AddEngine
Definition engineconfigurationdlg.h:47
@ ConfigureEngine
Definition engineconfigurationdlg.h:49
EngineConfigurationDialog(DialogMode mode, QWidget *parent=nullptr)
Definition engineconfigurationdlg.cpp:41
EngineConfiguration engineConfiguration()
Definition engineconfigurationdlg.cpp:140
virtual ~EngineConfigurationDialog()
Definition engineconfigurationdlg.cpp:106
The EngineConfiguration class defines a chess engine configuration.
Definition engineconfiguration.h:34
Definition engineoptionmodel.h:27
Definition engineoption.h:26