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"
29 class PrefTheme
: public QWidget
30 , private Ui::PrefTheme
{
32 friend class PrefThemeCategory
;
33 typedef class PrefThemeCategory Category
;
35 typedef QList
<ThemeInfo
> ThemeInfoList
;
36 typedef std::map
<QString
, Category
*> CategoryMap
;
38 std::map
<QString
, OptList
> m_new_theme_options
;
39 CategoryMap m_categories
;
41 OptList
get_file_options(const QString
&, bool reload_defaults
= false);
42 static ThemeInfoList
to_theme_info_list(const QStringList
& files
, const Settings
& s
);
43 static int theme_ok_for_variant(const ThemeInfo
&, const QString
&);
44 static void update_list_view(QListWidget
* list
, const ThemeInfoList
& themes
,
45 QString variant
, QString settings
);
47 void variantChanged();
50 PrefTheme(const QString
&, QWidget
*parent
= 0);
55 static ThemeInfo
getBestTheme(const VariantPtr
& vi
, const QString
&);
59 class PrefThemeCategory
: public QWidget
60 , private Ui::PrefThemePage
{
64 friend class PrefTheme
;
68 PrefTheme::ThemeInfoList m_themes
;
69 std::map
<QString
, QString
> m_new_themes
;
70 std::map
<QString
, bool> m_new_use_def
;
72 QLayout
*m_opt_layout
;
73 QWidget
*m_opt_widget
;
75 PrefThemeCategory(QWidget
* parent
, PrefTheme
* owner
);
80 void themeChecked(bool ck
);
84 #endif //PREFERENCES__THEME_H