2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@gmail.com>
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>
20 #include "themeinfo.h"
21 #include "ui_pref_theme.h"
22 #include "ui_pref_theme_page.h"
28 class PrefTheme
: public QWidget
29 , private Ui::PrefTheme
{
31 friend class PrefThemeCategory
;
32 typedef class PrefThemeCategory Category
;
34 typedef QList
<ThemeInfo
> ThemeInfoList
;
35 typedef std::map
<QString
, Category
*> CategoryMap
;
37 std::map
<QString
, OptList
> m_new_theme_options
;
38 CategoryMap m_categories
;
40 OptList
get_file_options(const QString
&, bool reload_defaults
= false);
41 static ThemeInfoList
to_theme_info_list(const QStringList
& files
, const Settings
& s
);
42 static int theme_ok_for_variant(const ThemeInfo
&, const QString
&);
43 static void update_list_view(QListWidget
* list
, const ThemeInfoList
& themes
,
44 QString variant
, QString settings
);
46 void variantChanged();
49 PrefTheme(const QString
&, QWidget
*parent
= 0);
54 static ThemeInfo
getBestTheme(Variant
* vi
, const QString
&);
58 class PrefThemeCategory
: public QWidget
59 , private Ui::PrefThemePage
{
63 friend class PrefTheme
;
67 PrefTheme::ThemeInfoList m_themes
;
68 std::map
<QString
, QString
> m_new_themes
;
69 std::map
<QString
, bool> m_new_use_def
;
71 QLayout
*m_opt_layout
;
72 QWidget
*m_opt_widget
;
74 PrefThemeCategory(QWidget
* parent
, PrefTheme
* owner
);
79 void themeChecked(bool ck
);
83 #endif //PREFERENCES__THEME_H