1 // -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
2 /* Copyright (C) 2003 Lukas Tinkl <lukas@kde.org>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef KTHEMEMANAGER_H
20 #define KTHEMEMANAGER_H
27 #include "ui_kthemedlg.h"
34 #define ORIGINAL_THEME "original" // no i18n() here!!!
39 class KThemeDetailsItem: public K3IconViewItem
42 KThemeDetailsItem( K3IconView * parent, const QString & text, const QPixmap & icon, const QString & execString )
43 : K3IconViewItem( parent, text, icon ) { m_exec = execString; }
44 virtual ~KThemeDetailsItem() { };
47 ( void ) new KRun( m_exec );
55 class KThemeDlg
: public QWidget
, public Ui::KThemeDlg
58 KThemeDlg( QWidget
*parent
) : QWidget( parent
) {
65 * This is the for KControl config module for installing,
66 * creating and removing visual themes.
68 * @brief The Theme Manager config module.
69 * @author Lukas Tinkl <lukas@kde.org>
71 class kthememanager
: public KCModule
75 kthememanager( QWidget
*parent
, const QVariantList
&args
);
76 virtual ~kthememanager();
79 * Called on module startup
83 * Called when applying the changes
87 * Called when the user requests the default values
89 virtual void defaults();
92 void dragEnterEvent ( QDragEnterEvent
* ev
);
93 void dropEvent ( QDropEvent
* ev
);
97 * Emitted when some @p urls are dropped onto the kcm
99 void filesDropped(const KUrl::List
&urls
);
103 * Install a theme from a tarball (*.kth)
105 void slotInstallTheme();
108 * Remove an installed theme
110 void slotRemoveTheme();
115 void slotCreateTheme();
118 * Update the theme's info and preview
120 void slotThemeChanged( Q3ListViewItem
* item
);
123 * Invoked when one drag and drops @p urls onto the kcm
124 * @see signal filesDropped
126 void slotFilesDropped( const KUrl::List
& urls
);
130 void startKonqui( const QString
& url
);
131 void startBackground();
141 * List themes available in the system and insert them into the listview.
146 * Performs the actual theme installation.
148 void addNewTheme( const KUrl
& url
);
151 * Perform internal initialization of paths.
156 * Try to find out whether a theme is installed and get its version number
157 * @param themeName The theme name
158 * @return The theme's version number or -1 if not installed
160 static float getThemeVersion( const QString
& themeName
);
162 void queryLNFModules();
165 * Updates the preview widget
167 void updatePreview( const QString
& pixFile
);
168 bool themeExist(const QString
&_themeName
);
172 KTheme
* m_origTheme
;