Cute Chess  0.1
gamedatabasedlg.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 GAME_DATABASE_DIALOG_H
19 #define GAME_DATABASE_DIALOG_H
20 
21 #include <QDialog>
22 #include <QTimer>
23 #include <QItemSelection>
24 
25 #include <pgngame.h>
26 
28 class PgnDatabaseModel;
29 class PgnGameEntryModel;
30 class PgnDatabase;
31 class GameViewer;
32 
33 namespace Ui {
34  class GameDatabaseDialog;
35 }
36 
43 {
44  Q_OBJECT
45 
46  public:
49  QWidget* parent = nullptr);
51  virtual ~GameDatabaseDialog();
52 
53  private slots:
54  void databaseSelectionChanged(const QItemSelection& selected,
55  const QItemSelection& deselected);
56  void gameSelectionChanged(const QModelIndex& current,
57  const QModelIndex& previous);
58  void updateSearch(const QString& terms = QString());
59  void onSearchTimeout();
60  void onAdvancedSearch();
61  void exportPgn(const QString& filename);
62  void createOpeningBook();
63  void updateUi();
64 
65  private:
66  friend class PgnGameIterator;
67  int databaseIndexFromGame(int game) const;
68 
69  GameViewer* m_gameViewer;
71 
72  GameDatabaseManager* m_dbManager;
73  PgnDatabaseModel* m_pgnDatabaseModel;
74  PgnGameEntryModel* m_pgnGameEntryModel;
75  QMap<int, PgnDatabase*> m_selectedDatabases;
76 
77  QTimer m_searchTimer;
78  QString m_searchTerms;
79  Ui::GameDatabaseDialog* ui;
80 };
81 
82 #endif // GAME_DATABASE_DIALOG_H
Manages chess game databases.
Definition: gamedatabasemanager.h:33
Definition: engineconfigurationdlg.h:30
Supplies PGN database information to views.
Definition: pgndatabasemodel.h:32
PGN database.
Definition: pgndatabase.h:36
Definition: gameviewer.h:38
Dialog for viewing game databases.
Definition: gamedatabasedlg.h:42
virtual ~GameDatabaseDialog()
Definition: gamedatabasedlg.cpp:330
GameDatabaseDialog(GameDatabaseManager *dbManager, QWidget *parent=nullptr)
Definition: gamedatabasedlg.cpp:249
Supplies PGN game entry information to views.
Definition: pgngameentrymodel.h:31