summaryrefslogtreecommitdiffstats
path: root/libksirtet/base/factory.cpp
blob: 5bf272ac0407617d20584e13130d7fe15fea0da9 (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
#include "factory.h"

#include <kaboutdata.h>
#include <kapplication.h>
#include <kcmdlineargs.h>
#include <kglobal.h>
#include <klocale.h>

#include "settings.h"


BaseFactory *BaseFactory::_self = 0;

BaseFactory::BaseFactory(const MainData &md, const BaseBoardInfo &bi)
    : mainData(md), bbi(bi)
{
    Q_ASSERT( _self==0 );
    _self = this;
    _aboutData =
        new TDEAboutData(md.appName, md.trName, md.longVersion, md.description,
                       TDEAboutData::License_GPL,
                       "(c) 1995, Eirik Eng\n(c) 1996-2004, Nicolas Hadacek",
                       0, md.homepage);
    _aboutData->addAuthor("Nicolas Hadacek", 0, "hadacek@kde.org");
    _aboutData->addCredit("Eirik Eng", I18N_NOOP("Core engine"));
}

void BaseFactory::init(int argc, char **argv)
{
    TDECmdLineArgs::init(argc, argv, _aboutData);
    (void)new TDEApplication;
    KGlobal::locale()->insertCatalogue("libtdegames");
    KGlobal::locale()->insertCatalogue("libksirtet");
}

BaseFactory::~BaseFactory()
{
    delete kapp;
    delete _aboutData;
    Q_ASSERT(_self);
    _self = 0;
}

TQWidget *BaseFactory::createAppearanceConfig()
{
    return new BaseAppearanceConfig;
}

TQWidget *BaseFactory::createColorConfig()
{
    return new ColorConfig;
}