not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / ksplash / kcm / main.cpp
blob17db6e6c14e05637b0c70dcb4d414cfc4d439b93
1 /***************************************************************************
2 * Copyright Ravikiran Rajagopal 2003 *
3 * ravi@ee.eng.ohio-state.edu *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License (version 2) as *
7 * published by the Free Software Foundation. *
8 * *
9 ***************************************************************************/
11 #include <config-workspace.h>
13 #include <QLayout>
14 #include <QTabWidget>
15 //Added by qt3to4:
16 #include <QHBoxLayout>
18 #include <kaboutdata.h>
19 #include <kcmodule.h>
20 #include <kdebug.h>
21 #include <kstandarddirs.h>
23 #include "installer.h"
24 #include <KPluginFactory>
25 #include <KPluginLoader>
27 class KSplashThemeMgr : public KCModule
29 Q_OBJECT
30 public:
31 KSplashThemeMgr( QWidget *parent, const QVariantList &/*unused*/);
32 ~KSplashThemeMgr();
34 QString quickHelp() const;
36 virtual void init();
37 virtual void save();
38 virtual void load();
39 virtual void defaults();
41 private:
42 SplashInstaller *mInstaller;
45 K_PLUGIN_FACTORY(KSplashThemeMgrFactory,
46 registerPlugin< KSplashThemeMgr>();
48 K_EXPORT_PLUGIN(KSplashThemeMgrFactory("ksplashthemes"))
50 // -----------------------------------------------------------------------------------------
52 KSplashThemeMgr::KSplashThemeMgr( QWidget *parent, const QVariantList &args)
53 : KCModule( KSplashThemeMgrFactory::componentData(), parent, args ), mInstaller(new SplashInstaller(this))
55 init();
57 #if 0
58 QHBoxLayout *box = new QHBoxLayout(this);
59 QTabWidget *tab = new QTabWidget(this); // There will be more tabs in the future.
60 box->addWidget(tab);
61 tab->addTab( mInstaller, i18n("&Theme Installer") );
62 #else
63 QHBoxLayout *box = new QHBoxLayout(this);
64 box->setMargin(0);
65 box->addWidget(mInstaller);
66 #endif
67 connect( mInstaller, SIGNAL(changed(bool)), SIGNAL(changed(bool)) );
68 KAboutData *about = new KAboutData( "kcmksplash"
69 , 0,ki18n("KDE splash screen theme manager")
70 ,"0.1"
71 ,KLocalizedString()
72 ,KAboutData::License_GPL
73 ,ki18n("(c) 2003 KDE developers") );
74 about->addAuthor(ki18n("Ravikiran Rajagopal"), KLocalizedString(), "ravi@ee.eng.ohio-state.edu");
75 about->addCredit(ki18n("Brian Ledbetter"), ki18n("Original KSplash/ML author"), "brian@shadowcom.net");
76 about->addCredit(ki18n("KDE Theme Manager authors" ), ki18n("Original installer code") );
77 // Once string freeze is over, replace second argument with "Icon"
78 about->addCredit(ki18n("Hans Karlsson"), KLocalizedString(), "karlsson.h@home.se" );
79 setAboutData(about);
80 //setButtons( KCModule::Default|KCModule::Apply );
83 KSplashThemeMgr::~KSplashThemeMgr()
85 // Do not delete the installer as it is now owned by the tab widget.
88 QString KSplashThemeMgr::quickHelp() const
90 return i18n("<h1>Splash Screen Theme Manager </h1> Install and view splash screen themes.");
93 void KSplashThemeMgr::init()
95 KGlobal::dirs()->addResourceType("ksplashthemes", "data", "ksplash/Themes");
98 void KSplashThemeMgr::save()
100 mInstaller->save();
103 void KSplashThemeMgr::load()
105 mInstaller->load();
108 void KSplashThemeMgr::defaults()
110 mInstaller->defaults();
113 #include "main.moc"