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>
20 #include "ui_pref_theme.h"
21 #include "ui_pref_theme_page.h"
27 class PrefTheme
: public QWidget
28 , private Ui::PrefTheme
{
30 friend class PrefThemeCategory
;
31 typedef class PrefThemeCategory Category
;
39 QDateTime last_modified
;
42 ThemeInfo(const QString
& f
, const QString
& n
,
43 const QString
& d
, const QStringList
& v
, const QDateTime
& t
)
51 typedef QList
<ThemeInfo
> ThemeInfoList
;
52 typedef std::map
<QString
, Category
*> CategoryMap
;
54 std::map
<QString
, boost::shared_ptr
<OptList
> > m_new_theme_options
;
55 CategoryMap m_categories
;
57 OptList
get_file_options(const QString
&, bool reload_defaults
= false);
58 static ThemeInfoList
to_theme_info_list(const QStringList
& files
, const Settings
& s
);
59 static void update_list_view(QListWidget
* list
, const ThemeInfoList
& themes
,
60 QString variant
, QString settings
);
63 void variantChanged();
66 PrefTheme(QWidget
*parent
= 0);
71 static QString
getBestTheme(VariantInfo
* vi
, const QString
&);
75 class PrefThemeCategory
: public QWidget
76 , private Ui::PrefThemePage
{
80 friend class PrefTheme
;
84 PrefTheme::ThemeInfoList m_themes
;
85 std::map
<QString
, QString
> m_new_themes
;
86 std::map
<QString
, bool> m_new_use_def
;
88 QLayout
*m_opt_layout
;
89 QWidget
*m_opt_widget
;
91 PrefThemeCategory(QWidget
* parent
, PrefTheme
* owner
);
96 void themeChecked(bool ck
);
100 #endif //PREFERENCES__THEME_H