summaryrefslogtreecommitdiffstats
path: root/ksplashml/kcmksplash/main.cpp
blob: 4a2f9cf5c62abb9372de475e45a4757b66e0242b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
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 <tqlayout.h>
#include <tqtabwidget.h>

#include <tdeaboutdata.h>
#include <tdecmodule.h>
#include <kdebug.h>
#include <kgenericfactory.h>
#include <kstandarddirs.h>

#include "installer.h"

class KSplashThemeMgr : public TDECModule
{
public:
  KSplashThemeMgr( TQWidget *parent, const char *name, const TQStringList &/*unused*/);
  ~KSplashThemeMgr();

  TQString quickHelp() const;

  virtual void init();
  virtual void save();
  virtual void load();
  virtual void defaults();

private:
  SplashInstaller *mInstaller;
};

typedef KGenericFactory< KSplashThemeMgr, TQWidget > KSplashThemeMgrFactory;
K_EXPORT_COMPONENT_FACTORY( kcm_ksplashthemes, KSplashThemeMgrFactory("ksplashthemes") )

// -----------------------------------------------------------------------------------------

KSplashThemeMgr::KSplashThemeMgr( TQWidget *parent, const char *name, const TQStringList &)
  : TDECModule( KSplashThemeMgrFactory::instance(), parent, name ), mInstaller(new SplashInstaller(this))
{
  init();

#if 0
  TQHBoxLayout *box = new TQHBoxLayout(this);
  TQTabWidget *tab = new TQTabWidget(this); // There will be more tabs in the future.
  box->addWidget(tab);
  tab->addTab( mInstaller, i18n("&Theme Installer") );
#else
  TQHBoxLayout *box = new TQHBoxLayout(this, 0, 0);
  box->addWidget(mInstaller);
#endif
  connect( mInstaller, TQ_SIGNAL(changed(bool)), TQ_SIGNAL(changed(bool)) );
  TDEAboutData *about = new TDEAboutData( "kcmksplash"
                                      ,I18N_NOOP("TDE splash screen theme manager")
                                      ,"0.1"
                                      ,0
                                      ,TDEAboutData::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("TDE 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.
}

TQString KSplashThemeMgr::quickHelp() const
{
  return i18n("<h1>Splash Screen Theme Manager </h1> Install and view splash screen themes.");
}

void KSplashThemeMgr::init()
{
  TDEGlobal::dirs()->addResourceType("ksplashthemes", TDEStandardDirs::kde_default("data") + "ksplash/Themes");
}

void KSplashThemeMgr::save()
{
  mInstaller->save();
}

void KSplashThemeMgr::load()
{
  mInstaller->load();
}

void KSplashThemeMgr::defaults()
{
  mInstaller->defaults();
}