2
* kdeprintfax - a small fax utility
3
* Copyright (C) 2001 Michael Goffioul
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
#include "confgeneral.h"
23
#include <qlineedit.h>
33
ConfGeneral::ConfGeneral(QWidget *parent, const char *name)
34
: QWidget(parent, name)
36
m_name = new QLineEdit(this);
37
m_company = new QLineEdit(this);
38
m_number = new QLineEdit(this);
39
QLabel *m_namelabel = new QLabel(i18n("&Name:"), this);
40
m_namelabel->setBuddy(m_name);
41
QLabel *m_companylabel = new QLabel(i18n("&Company:"), this);
42
m_companylabel->setBuddy(m_company);
43
QLabel *m_numberlabel = new QLabel(i18n("N&umber:"), this);
44
m_numberlabel->setBuddy(m_number);
46
QGridLayout *l0 = new QGridLayout(this, 4, 2, 10, 10);
47
l0->setColStretch(1, 1);
48
l0->setRowStretch(3, 1);
49
l0->addWidget(m_namelabel, 0, 0);
50
l0->addWidget(m_companylabel, 1, 0);
51
l0->addWidget(m_numberlabel, 2, 0);
52
l0->addWidget(m_name, 0, 1);
53
l0->addWidget(m_company, 1, 1);
54
l0->addWidget(m_number, 2, 1);
57
void ConfGeneral::load()
59
KConfig *conf = KGlobal::config();
60
conf->setGroup("Personal");
61
m_name->setText(conf->readEntry("Name", getenv("USER")));
62
m_number->setText(conf->readEntry("Number"));
63
m_company->setText(conf->readEntry("Company"));
66
void ConfGeneral::save()
68
KConfig *conf = KGlobal::config();
69
conf->setGroup("Personal");
70
conf->writeEntry("Name", m_name->text());
71
conf->writeEntry("Number", m_number->text());
72
conf->writeEntry("Company", m_company->text());