summaryrefslogtreecommitdiffstats
path: root/kcontrol/icons/main.cpp
blob: 214e85a702d0fa3edb84fee2e1aac2b0b66c2b86 (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*
 * main.cpp
 *
 * Copyright (c) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
 *
 * Requires the Qt widget libraries, available at no cost at
 * http://www.troll.no/
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#include <tqlayout.h>

#include <kgenericfactory.h>
#include <tdeaboutdata.h>

#include "icons.h"
#include "iconthemes.h"
#include "main.h"

/**** DLL Interface ****/
typedef KGenericFactory<IconModule, TQWidget> IconsFactory;
K_EXPORT_COMPONENT_FACTORY( kcm_icons, IconsFactory("kcmicons") )

/**** IconModule ****/

IconModule::IconModule(TQWidget *parent, const char *name, const TQStringList &)
  : TDECModule(IconsFactory::instance(), parent, name)
{
  TQVBoxLayout *layout = new TQVBoxLayout(this);
  tab = new TQTabWidget(this);
  layout->addWidget(tab);

  tab1 = new IconThemesConfig(this, "themes");
  tab->addTab(tab1, i18n("&Theme"));
  connect(tab1, TQ_SIGNAL(changed(bool)), this, TQ_SLOT(moduleChanged(bool)));

  tab2 = new TDEIconConfig(this, "effects");
  tab->addTab(tab2, i18n("Ad&vanced"));
  connect(tab2, TQ_SIGNAL(changed(bool)), this, TQ_SLOT(moduleChanged(bool)));

  TDEAboutData* about = new TDEAboutData("kcmicons", I18N_NOOP("Icons"), "3.0",
	      I18N_NOOP("Icons Control Panel Module"),
	      TDEAboutData::License_GPL,
 	      I18N_NOOP("(c) 2000-2003 Geert Jansen"), 0, 0);
  about->addAuthor("Geert Jansen", 0, "jansen@kde.org");
  about->addAuthor("Antonio Larrosa Jimenez", 0, "larrosa@kde.org");
  about->addCredit("Torsten Rahn", 0, "torsten@kde.org");
  setAboutData( about );
}


void IconModule::load()
{
  tab1->load();
  tab2->load();
}


void IconModule::save()
{
  tab1->save();
  tab2->save();
}


void IconModule::defaults()
{
  tab1->defaults();
  tab2->defaults();
}


void IconModule::moduleChanged(bool state)
{
  emit changed(state);
}

TQString IconModule::quickHelp() const
{
  return i18n("<h1>Icons</h1>"
    "This module allows you to choose the icons for your desktop.<p>"
    "To choose an icon theme, click on its name and apply your choice by pressing the \"Apply\" button below. If you do not want to apply your choice you can press the \"Reset\" button to discard your changes.</p>"
    "<p>By pressing the \"Install New Theme\" button you can install your new icon theme by writing its location in the box or browsing to the location."
    " Press the \"OK\" button to finish the installation.</p>"
    "<p>The \"Remove Theme\" button will only be activated if you select a theme that you installed using this module."
    " You are not able to remove globally installed themes here.</p>"
    "<p>You can also specify effects that should be applied to the icons.</p>");
}

TQString IconModule::handbookSection() const
{
  int index = tab->currentPageIndex();
  if (index == 0) {
    //return "icon-theme";
    return TQString::null;
  }
  else if (index == 1) {
    return "icons-use";
  }
  else {
    return TQString::null;
  }
}



#include "main.moc"