~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to ksplash/kcm/main.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 ***************************************************************************/
 
10
 
 
11
#include <config-workspace.h>
 
12
 
 
13
#include <QLayout>
 
14
#include <QTabWidget>
 
15
//Added by qt3to4:
 
16
#include <QHBoxLayout>
 
17
 
 
18
#include <kaboutdata.h>
 
19
#include <kcmodule.h>
 
20
#include <kdebug.h>
 
21
#include <kstandarddirs.h>
 
22
 
 
23
#include "installer.h"
 
24
#include <KPluginFactory>
 
25
#include <KPluginLoader>
 
26
 
 
27
class KSplashThemeMgr : public KCModule
 
28
{
 
29
    Q_OBJECT
 
30
public:
 
31
  KSplashThemeMgr( QWidget *parent, const QVariantList &/*unused*/);
 
32
  ~KSplashThemeMgr();
 
33
 
 
34
  QString quickHelp() const;
 
35
 
 
36
  virtual void init();
 
37
  virtual void save();
 
38
  virtual void load();
 
39
  virtual void defaults();
 
40
 
 
41
private:
 
42
  SplashInstaller *mInstaller;
 
43
};
 
44
 
 
45
K_PLUGIN_FACTORY(KSplashThemeMgrFactory,
 
46
        registerPlugin< KSplashThemeMgr>();
 
47
        )
 
48
K_EXPORT_PLUGIN(KSplashThemeMgrFactory("ksplashthemes"))
 
49
 
 
50
// -----------------------------------------------------------------------------------------
 
51
 
 
52
KSplashThemeMgr::KSplashThemeMgr( QWidget *parent, const QVariantList &args)
 
53
  : KCModule( KSplashThemeMgrFactory::componentData(), parent, args ), mInstaller(new SplashInstaller(this))
 
54
{
 
55
  init();
 
56
 
 
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 );
 
81
}
 
82
 
 
83
KSplashThemeMgr::~KSplashThemeMgr()
 
84
{
 
85
  // Do not delete the installer as it is now owned by the tab widget.
 
86
}
 
87
 
 
88
QString KSplashThemeMgr::quickHelp() const
 
89
{
 
90
  return i18n("<h1>Splash Screen Theme Manager </h1> Install and view splash screen themes.");
 
91
}
 
92
 
 
93
void KSplashThemeMgr::init()
 
94
{
 
95
  KGlobal::dirs()->addResourceType("ksplashthemes", "data", "ksplash/Themes");
 
96
}
 
97
 
 
98
void KSplashThemeMgr::save()
 
99
{
 
100
  mInstaller->save();
 
101
}
 
102
 
 
103
void KSplashThemeMgr::load()
 
104
{
 
105
  mInstaller->load();
 
106
}
 
107
 
 
108
void KSplashThemeMgr::defaults()
 
109
{
 
110
  mInstaller->defaults();
 
111
}
 
112
 
 
113
#include "main.moc"