diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 4aed2c8219774f5d797760606b8489a92ddc5163 (patch) | |
tree | 3f8c130f7d269626bf6a9447407ef6c35954426a /kdeprint/kdeprintfax/confgeneral.cpp | |
download | tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.tar.gz tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdeprint/kdeprintfax/confgeneral.cpp')
-rw-r--r-- | kdeprint/kdeprintfax/confgeneral.cpp | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/kdeprint/kdeprintfax/confgeneral.cpp b/kdeprint/kdeprintfax/confgeneral.cpp new file mode 100644 index 000000000..3f592e694 --- /dev/null +++ b/kdeprint/kdeprintfax/confgeneral.cpp @@ -0,0 +1,90 @@ +/* + * kdeprintfax - a small fax utility + * Copyright (C) 2001 Michael Goffioul + * + * 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 "confgeneral.h" + +#include <qlineedit.h> +#include <qlabel.h> +#include <qlayout.h> +#include <qcheckbox.h> + +#include <kglobal.h> +#include <kconfig.h> +#include <klocale.h> +#include <kseparator.h> + +#include <stdlib.h> + +ConfGeneral::ConfGeneral(QWidget *parent, const char *name) +: QWidget(parent, name) +{ + m_name = new QLineEdit(this); + m_company = new QLineEdit(this); + m_number = new QLineEdit(this); + QLabel *m_namelabel = new QLabel(i18n("&Name:"), this); + m_namelabel->setBuddy(m_name); + QLabel *m_companylabel = new QLabel(i18n("&Company:"), this); + m_companylabel->setBuddy(m_company); + QLabel *m_numberlabel = new QLabel(i18n("N&umber:"), this); + m_numberlabel->setBuddy(m_number); + KSeparator *sep = new KSeparator( this ); + m_replace_int_char = new QCheckBox( i18n( "Replace international prefix '+' with:" ), this ); + m_replace_int_char_val = new QLineEdit( this ); + m_replace_int_char_val->setEnabled( false ); + + connect( m_replace_int_char, SIGNAL( toggled( bool ) ), m_replace_int_char_val, SLOT( setEnabled( bool ) ) ); + + QGridLayout *l0 = new QGridLayout(this, 6, 2, 10, 10); + l0->setColStretch(1, 1); + l0->setRowStretch(5, 1); + l0->addWidget(m_namelabel, 0, 0); + l0->addWidget(m_companylabel, 1, 0); + l0->addWidget(m_numberlabel, 2, 0); + l0->addWidget(m_name, 0, 1); + l0->addWidget(m_company, 1, 1); + l0->addWidget(m_number, 2, 1); + l0->addMultiCellWidget( sep, 3, 3, 0, 1 ); + QHBoxLayout *l1 = new QHBoxLayout( this, 0, 10 ); + l0->addMultiCellLayout( l1, 4, 4, 0, 1 ); + l1->addWidget( m_replace_int_char ); + l1->addWidget( m_replace_int_char_val ); +} + +void ConfGeneral::load() +{ + KConfig *conf = KGlobal::config(); + conf->setGroup("Personal"); + m_name->setText(conf->readEntry("Name", getenv("USER"))); + m_number->setText(conf->readEntry("Number")); + m_company->setText(conf->readEntry("Company")); + m_replace_int_char->setChecked( conf->readBoolEntry( "ReplaceIntChar", false ) ); + m_replace_int_char_val->setText( conf->readEntry( "ReplaceIntCharVal" ) ); +} + +void ConfGeneral::save() +{ + KConfig *conf = KGlobal::config(); + conf->setGroup("Personal"); + conf->writeEntry("Name", m_name->text()); + conf->writeEntry("Number", m_number->text()); + conf->writeEntry("Company", m_company->text()); + conf->writeEntry( "ReplaceIntChar", m_replace_int_char->isChecked() ); + conf->writeEntry( "ReplaceIntCharVal", m_replace_int_char_val->text() ); +} |