Cleaned up CrazyhouseMove.
[tagua/yd.git] / src / pref_theme.h
blobe8f182c83ff7bb73c6fe72d105d100902b77c230
1 /*
2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@sns.it>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program 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 2 of the License, or
8 (at your option) any later version.
9 */
11 #ifndef PREFERENCES__THEME_H
12 #define PREFERENCES__THEME_H
14 #include <set>
15 #include <map>
16 #include <boost/shared_ptr.hpp>
17 #include <QDir>
18 #include "option.h"
19 #include "ui_pref_theme.h"
21 class VariantInfo;
22 class Settings;
24 class PrefTheme : public QWidget
25 , private Ui::PrefTheme {
26 Q_OBJECT
28 class ThemeInfo;
29 typedef QList<ThemeInfo> ThemeInfoList;
31 ThemeInfoList m_pieces_themes;
32 ThemeInfoList m_squares_themes;
33 std::map<QString, boost::shared_ptr<OptList> > m_new_theme_options;
34 std::map<QString, QString> m_new_piece_themes;
35 std::map<QString, QString> m_new_square_themes;
36 std::map<QString, bool> m_new_use_def_pieces;
37 std::map<QString, bool> m_new_use_def_squares;
39 QLayout *m_pieces_opt_layout;
40 QLayout *m_squares_opt_layout;
41 QWidget *m_pieces_opt_widget;
42 QWidget *m_squares_opt_widget;
44 OptList get_file_options(const QString&);
45 static ThemeInfoList to_theme_info_list(const QStringList& files, const Settings& s);
46 static void update_list_view(QListWidget* list, const ThemeInfoList& themes,
47 QString variant, QString settings);
49 private slots:
50 void variantChanged();
51 void piecesThemeChanged();
52 void squaresThemeChanged();
53 void piecesThemeChecked(bool ck);
54 void squaresThemeChecked(bool ck);
56 public:
57 PrefTheme(QWidget *parent = 0);
58 ~PrefTheme();
60 enum ThemeType {
61 Pieces,
62 Squares,
63 Figurines
66 static QString getBestTheme(VariantInfo* vi, ThemeType type = Pieces);
68 void apply();
71 #endif //PREFERENCES__THEME_H