From 4aed2c8219774f5d797760606b8489a92ddc5163 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- ksplashml/kcmksplash/main.cpp | 105 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 ksplashml/kcmksplash/main.cpp (limited to 'ksplashml/kcmksplash/main.cpp') diff --git a/ksplashml/kcmksplash/main.cpp b/ksplashml/kcmksplash/main.cpp new file mode 100644 index 000000000..d48923a28 --- /dev/null +++ b/ksplashml/kcmksplash/main.cpp @@ -0,0 +1,105 @@ +/*************************************************************************** + * Copyright Ravikiran Rajagopal 2003 * + * ravi@ee.eng.ohio-state.edu * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License (version 2) as * + * published by the Free Software Foundation. * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include +#include +#include +#include +#include + +#include "installer.h" + +class KSplashThemeMgr : public KCModule +{ +public: + KSplashThemeMgr( QWidget *parent, const char *name, const QStringList &/*unused*/); + ~KSplashThemeMgr(); + + QString quickHelp() const; + + virtual void init(); + virtual void save(); + virtual void load(); + virtual void defaults(); + +private: + SplashInstaller *mInstaller; +}; + +typedef KGenericFactory< KSplashThemeMgr, QWidget > KSplashThemeMgrFactory; +K_EXPORT_COMPONENT_FACTORY( kcm_ksplashthemes, KSplashThemeMgrFactory("ksplashthemes") ) + +// ----------------------------------------------------------------------------------------- + +KSplashThemeMgr::KSplashThemeMgr( QWidget *parent, const char *name, const QStringList &) + : KCModule( KSplashThemeMgrFactory::instance(), parent, name ), mInstaller(new SplashInstaller(this)) +{ + init(); + +#if 0 + QHBoxLayout *box = new QHBoxLayout(this); + QTabWidget *tab = new QTabWidget(this); // There will be more tabs in the future. + box->addWidget(tab); + tab->addTab( mInstaller, i18n("&Theme Installer") ); +#else + QHBoxLayout *box = new QHBoxLayout(this, 0, 0); + box->addWidget(mInstaller); +#endif + connect( mInstaller, SIGNAL(changed(bool)), SIGNAL(changed(bool)) ); + KAboutData *about = new KAboutData( "kcmksplash" + ,I18N_NOOP("KDE splash screen theme manager") + ,"0.1" + ,0 + ,KAboutData::License_GPL + ,I18N_NOOP("(c) 2003 KDE developers") ); + about->addAuthor("Ravikiran Rajagopal", 0, "ravi@ee.eng.ohio-state.edu"); + about->addCredit("Brian Ledbetter", I18N_NOOP("Original KSplash/ML author"), "brian@shadowcom.net"); + about->addCredit(I18N_NOOP("KDE Theme Manager authors" ), I18N_NOOP("Original installer code") ); + // Once string freeze is over, replace second argument with "Icon" + about->addCredit("Hans Karlsson", 0, "karlsson.h@home.se" ); + setAboutData(about); +} + +KSplashThemeMgr::~KSplashThemeMgr() +{ + // Do not delete the installer as it is now owned by the tab widget. +} + +QString KSplashThemeMgr::quickHelp() const +{ + return i18n("

Splash Screen Theme Manager

Install and view splash screen themes."); +} + +void KSplashThemeMgr::init() +{ + KGlobal::dirs()->addResourceType("ksplashthemes", KStandardDirs::kde_default("data") + "ksplash/Themes"); +} + +void KSplashThemeMgr::save() +{ + mInstaller->save(); +} + +void KSplashThemeMgr::load() +{ + mInstaller->load(); +} + +void KSplashThemeMgr::defaults() +{ + mInstaller->defaults(); +} -- cgit v1.2.1