2
* This file is part of the KDE project, module kcmdisplay.
3
* Copyright (C) 1999 Geert Jansen <g.t.jansen@stud.tue.nl>
5
* Modified 2000.07.14 by Brad Hughes <bhughes@trolltech.com>
6
* Improve layout and consistency with KDesktop's background selection
8
* Based on old backgnd.cpp:
10
* Copyright (c) Martin R. Jones 1996
11
* Converted to a kcc module by Matthias Hoelzer 1997
12
* Gradient backgrounds by Mark Donohoe 1997
13
* Pattern backgrounds by Stephan Kulow 1998
14
* Randomizing & dnd & new display modes by Matej Koss 1998
16
* You can Freely distribute this program under the GNU General Public
17
* License. See the file "COPYING" for the exact licensing terms.
20
#include "background.h"
22
#include <config-workspace.h>
24
#include "../background/bgdialog.h"
30
#include <QVBoxLayout>
32
extern KConfig *config;
34
KBackground::KBackground(KSharedConfigPtr backgroundConfig, QWidget *parent)
35
: QWidget(parent), m_simpleConf(backgroundConfig)
39
m_pCBEnable = new QCheckBox(i18n("E&nable background"), this);
40
m_pCBEnable->setWhatsThis(i18n(
41
"If this is checked, KDM will use the settings below for the background."
42
" If it is disabled, you have to look after the background yourself."
43
" This is done by running some program (possibly xsetroot) in the script"
44
" specified in the Setup= option in kdmrc (usually Xsetup)."));
45
m_background = new BGDialog(this, m_simpleConf);
47
connect(m_background, SIGNAL(changed(bool)), SIGNAL(changed()));
50
QVBoxLayout *top = new QVBoxLayout(this);
51
top->setMargin(KDialog::marginHint());
52
top->setSpacing(KDialog::spacingHint());
53
top->addWidget(m_pCBEnable);
54
top->addWidget(m_background);
56
connect(m_pCBEnable, SIGNAL(toggled(bool)), SLOT(slotEnableChanged()));
59
KBackground::~KBackground()
63
void KBackground::slotEnableChanged()
65
bool en = m_pCBEnable->isChecked();
66
m_background->setEnabled(en);
70
void KBackground::load()
72
m_pCBEnable->setChecked(config->group("X-*-Greeter").readEntry("UseBackground", true));
78
void KBackground::save()
80
config->group("X-*-Greeter").writeEntry("UseBackground", m_pCBEnable->isChecked());
84
void KBackground::defaults()
86
m_pCBEnable->setChecked(true);
88
m_background->defaults();
91
#include "background.moc"