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.
11 #ifndef PREFERENCES__THEME_H
12 #define PREFERENCES__THEME_H
16 #include <boost/shared_ptr.hpp>
19 #include "ui_pref_theme.h"
24 class PrefTheme
: public QWidget
25 , private Ui::PrefTheme
{
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
);
50 void variantChanged();
51 void piecesThemeChanged();
52 void squaresThemeChanged();
53 void piecesThemeChecked(bool ck
);
54 void squaresThemeChecked(bool ck
);
57 PrefTheme(QWidget
*parent
= 0);
66 static QString
getBestTheme(VariantInfo
* vi
, ThemeType type
= Pieces
);
71 #endif //PREFERENCES__THEME_H