diff options
Diffstat (limited to 'kaddressbook/kcmconfigs')
20 files changed, 2171 insertions, 0 deletions
diff --git a/kaddressbook/kcmconfigs/Makefile.am b/kaddressbook/kcmconfigs/Makefile.am new file mode 100644 index 000000000..a465740c0 --- /dev/null +++ b/kaddressbook/kcmconfigs/Makefile.am @@ -0,0 +1,38 @@ +INCLUDES= -I$(top_builddir)/kaddressbook -I$(top_srcdir)/kaddressbook \ + -I$(top_srcdir)/kaddressbook/common \ + -I$(top_srcdir)/kaddressbook/interfaces \ + -I$(top_srcdir) -I$(top_builddir)/kaddressbook/common $(all_includes) + +kde_module_LTLIBRARIES = kcm_kabconfig.la kcm_kabldapconfig.la \ + kcm_kabcustomfields.la + +kcm_kabconfig_la_SOURCES = kcmkabconfig.cpp kabconfigwidget.cpp \ + extensionconfigdialog.cpp addresseewidget.cpp +kcm_kabconfig_la_LDFLAGS = -module $(KDE_PLUGIN) $(KDE_RPATH) $(all_libraries) \ + -avoid-version -no-undefined +kcm_kabconfig_la_LIBADD = $(LIB_KIO) \ + $(top_builddir)/kaddressbook/interfaces/libkabinterfaces.la \ + $(top_builddir)/libkdepim/libkdepim.la \ + $(top_builddir)/kaddressbook/common/libkabcommon.la +kcm_kabconfig_la_COMPILE_FIRST = $(top_builddir)/kaddressbook/common/kabprefs_base.h + +kcm_kabldapconfig_la_SOURCES = addhostdialog.cpp kcmkabldapconfig.cpp \ + ldapoptionswidget.cpp +kcm_kabldapconfig_la_LDFLAGS = -module $(KDE_PLUGIN) $(KDE_RPATH) $(all_libraries) \ + -avoid-version -no-undefined +kcm_kabldapconfig_la_LIBADD = $(LIB_KIO) $(LIB_KABC) $(top_builddir)/libkdepim/libkdepim.la + +kcm_kabcustomfields_la_SOURCES = kcmkabcustomfields.cpp +kcm_kabcustomfields_la_LDFLAGS = -module $(KDE_PLUGIN) $(KDE_RPATH) $(all_libraries) \ + -avoid-version -no-undefined +kcm_kabcustomfields_la_LIBADD = $(LIB_KDEUI) -lqui \ + $(top_builddir)/kaddressbook/common/libkabcommon.la +kcm_kabcustomfields_la_COMPILE_FIRST = $(top_builddir)/kaddressbook/common/kabprefs_base.h + +METASOURCES = AUTO + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kcmkabconfig.pot + +kde_services_DATA = kabconfig.desktop kabldapconfig.desktop \ + kabcustomfields.desktop diff --git a/kaddressbook/kcmconfigs/addhostdialog.cpp b/kaddressbook/kcmconfigs/addhostdialog.cpp new file mode 100644 index 000000000..b3eb60bcf --- /dev/null +++ b/kaddressbook/kcmconfigs/addhostdialog.cpp @@ -0,0 +1,127 @@ +/* + This file is part of KAddressBook. + Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> + + 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. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. +*/ + +#include <qlabel.h> +#include <qlayout.h> +#include <qpushbutton.h> +#include <qspinbox.h> +#include <qtooltip.h> + +#include <kaccelmanager.h> +#include <kbuttonbox.h> +#include <klineedit.h> +#include <klocale.h> +#include "addhostdialog.h" + +AddHostDialog::AddHostDialog( KPIM::LdapServer *server, QWidget* parent, const char* name ) + : KDialogBase( Plain, i18n( "Add Host" ), Ok | Cancel, Ok, parent, name, true, true ) +{ + mServer = server; + + QWidget *page = plainPage(); + QHBoxLayout *layout = new QHBoxLayout( page, marginHint(), spacingHint() ); + + mCfg = new KABC::LdapConfigWidget( + KABC::LdapConfigWidget::W_USER | + KABC::LdapConfigWidget::W_PASS | + KABC::LdapConfigWidget::W_BINDDN | + KABC::LdapConfigWidget::W_REALM | + KABC::LdapConfigWidget::W_HOST | + KABC::LdapConfigWidget::W_PORT | + KABC::LdapConfigWidget::W_VER | + KABC::LdapConfigWidget::W_TIMELIMIT | + KABC::LdapConfigWidget::W_SIZELIMIT | + KABC::LdapConfigWidget::W_DN | + KABC::LdapConfigWidget::W_SECBOX | + KABC::LdapConfigWidget::W_AUTHBOX, + page ); + + layout->addWidget( mCfg ); + mCfg->setHost( mServer->host() ); + mCfg->setPort( mServer->port() ); + mCfg->setDn( mServer->baseDN() ); + mCfg->setUser( mServer->user() ); + mCfg->setBindDN( mServer->bindDN() ); + mCfg->setPassword( mServer->pwdBindDN() ); + mCfg->setTimeLimit( mServer->timeLimit() ); + mCfg->setSizeLimit( mServer->sizeLimit() ); + mCfg->setVer( mServer->version() ); + + switch ( mServer->security() ) { + case KPIM::LdapServer::TLS: + mCfg->setSecTLS(); + break; + case KPIM::LdapServer::SSL: + mCfg->setSecSSL(); + break; + default: + mCfg->setSecNO(); + } + + switch ( mServer->auth() ) { + case KPIM::LdapServer::Simple: + mCfg->setAuthSimple(); + break; + case KPIM::LdapServer::SASL: + mCfg->setAuthSASL(); + break; + default: + mCfg->setAuthAnon(); + } + mCfg->setMech( mServer->mech() ); + + KAcceleratorManager::manage( this ); + +} + +AddHostDialog::~AddHostDialog() +{ +} + +void AddHostDialog::slotHostEditChanged( const QString &text ) +{ + enableButtonOK( !text.isEmpty() ); +} + +void AddHostDialog::slotOk() +{ + mServer->setHost( mCfg->host() ); + mServer->setPort( mCfg->port() ); + mServer->setBaseDN( mCfg->dn().stripWhiteSpace() ); + mServer->setUser( mCfg->user() ); + mServer->setBindDN( mCfg->bindDN() ); + mServer->setPwdBindDN( mCfg->password() ); + mServer->setTimeLimit( mCfg->timeLimit() ); + mServer->setSizeLimit( mCfg->sizeLimit() ); + mServer->setVersion( mCfg->ver() ); + mServer->setSecurity( KPIM::LdapServer::Sec_None ); + if ( mCfg->isSecTLS() ) mServer->setSecurity( KPIM::LdapServer::TLS ); + if ( mCfg->isSecSSL() ) mServer->setSecurity( KPIM::LdapServer::SSL ); + mServer->setAuth( KPIM::LdapServer::Anonymous ); + if ( mCfg->isAuthSimple() ) mServer->setAuth( KPIM::LdapServer::Simple ); + if ( mCfg->isAuthSASL() ) mServer->setAuth( KPIM::LdapServer::SASL ); + mServer->setMech( mCfg->mech() ); + KDialog::accept(); +} + +#include "addhostdialog.moc" diff --git a/kaddressbook/kcmconfigs/addhostdialog.h b/kaddressbook/kcmconfigs/addhostdialog.h new file mode 100644 index 000000000..84f5a0c9e --- /dev/null +++ b/kaddressbook/kcmconfigs/addhostdialog.h @@ -0,0 +1,54 @@ +/* + This file is part of KAddressBook. + Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> + + 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. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. +*/ + +#ifndef ADDHOSTDIALOG_H +#define ADDHOSTDIALOG_H + +#include <kdialogbase.h> +#include <kabc/ldapconfigwidget.h> +#include <libkdepim/ldapclient.h> + +class KLineEdit; +class QPushButton; +class QSpinBox; + +class AddHostDialog : public KDialogBase +{ + Q_OBJECT + + public: + AddHostDialog( KPIM::LdapServer* server, QWidget* parent = 0, const char* name = 0 ); + ~AddHostDialog(); + + signals: + void changed( bool ); + + private slots: + void slotHostEditChanged( const QString& ); + virtual void slotOk(); + private: + KABC::LdapConfigWidget *mCfg; + KPIM::LdapServer *mServer; +}; + +#endif // ADDHOSTDIALOG_H diff --git a/kaddressbook/kcmconfigs/addresseewidget.cpp b/kaddressbook/kcmconfigs/addresseewidget.cpp new file mode 100644 index 000000000..610b94b80 --- /dev/null +++ b/kaddressbook/kcmconfigs/addresseewidget.cpp @@ -0,0 +1,202 @@ +/* + This file is part of KAddressBook. + Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> + + 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. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. +*/ + +#include <qcstring.h> +#include <qgroupbox.h> +#include <qlabel.h> +#include <qlayout.h> +#include <qlistbox.h> +#include <qpushbutton.h> + +#include <dcopclient.h> + +#include <kbuttonbox.h> +#include <kcombobox.h> +#include <kconfig.h> +#include <kdialog.h> +#include <kinputdialog.h> +#include <klocale.h> +#include <klineedit.h> + +#include "addresseewidget.h" + +NamePartWidget::NamePartWidget( const QString &title, const QString &label, + QWidget *parent, const char *name ) + : QWidget( parent, name ), mTitle( title ), mLabel( label ) +{ + QHBoxLayout *layout = new QHBoxLayout( this ); + + QGroupBox *group = new QGroupBox( 0, Qt::Vertical, title, this ); + QGridLayout *groupLayout = new QGridLayout( group->layout(), 2, 2, + KDialog::spacingHint() ); + + mBox = new QListBox( group ); + connect( mBox, SIGNAL( selectionChanged( QListBoxItem* ) ), + SLOT( selectionChanged( QListBoxItem* ) ) ); + groupLayout->addWidget( mBox, 0, 0 ); + + KButtonBox *bbox = new KButtonBox( group, Qt::Vertical ); + mAddButton = bbox->addButton( i18n( "Add..." ), this, SLOT( add() ) ); + mEditButton = bbox->addButton( i18n( "Edit..." ), this, SLOT( edit() ) ); + mEditButton->setEnabled( false ); + mRemoveButton = bbox->addButton( i18n( "Remove" ), this, SLOT( remove() ) ); + mRemoveButton->setEnabled( false ); + bbox->layout(); + groupLayout->addWidget( bbox, 0, 1 ); + + layout->addWidget( group ); +} + +NamePartWidget::~NamePartWidget() +{ +} + +void NamePartWidget::setNameParts( const QStringList &list ) +{ + mBox->clear(); + mBox->insertStringList( list ); +} + +QStringList NamePartWidget::nameParts() const +{ + QStringList parts; + for ( uint i = 0; i < mBox->count(); ++i ) + parts.append( mBox->text( i ) ); + + return parts; +} + +void NamePartWidget::add() +{ + bool ok; + + QString namePart = KInputDialog::getText( i18n( "New" ), mLabel, + QString::null, &ok ); + if ( ok && !namePart.isEmpty() ) { + mBox->insertItem( namePart ); + emit modified(); + } +} + +void NamePartWidget::edit() +{ + bool ok; + + int index = mBox->currentItem(); + if ( index == -1 ) + return; + + QString namePart = KInputDialog::getText( i18n( "Edit" ), mLabel, + mBox->text( index ), &ok ); + if ( ok && !namePart.isEmpty() ) { + mBox->changeItem( namePart, index ); + emit modified(); + } +} + +void NamePartWidget::remove() +{ + mBox->removeItem( mBox->currentItem() ); + if ( mBox->count() == 0 ) + selectionChanged( 0 ); + + emit modified(); +} + +void NamePartWidget::selectionChanged( QListBoxItem *item ) +{ + mEditButton->setEnabled( item != 0 ); + mRemoveButton->setEnabled( item != 0 ); +} + + + +AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name ) + : QWidget( parent, name ) +{ + QGridLayout *layout = new QGridLayout( this, 2, 3, KDialog::marginHint(), + KDialog::spacingHint() ); + + mPrefix = new NamePartWidget( i18n( "Prefixes"), i18n( "Enter prefix:" ), this ); + layout->addWidget( mPrefix, 0, 0 ); + + mInclusion = new NamePartWidget( i18n( "Inclusions"), i18n( "Enter inclusion:" ), this ); + layout->addWidget( mInclusion, 0, 1 ); + + mSuffix = new NamePartWidget( i18n( "Suffixes" ), i18n( "Enter suffix:" ), this ); + layout->addWidget( mSuffix, 0, 2 ); + + QLabel *label = new QLabel( i18n( "Default formatted name:" ), this ); + layout->addWidget( label, 1, 0 ); + + mFormattedNameCombo = new KComboBox( this ); + mFormattedNameCombo->insertItem( i18n( "Empty" ) ); + mFormattedNameCombo->insertItem( i18n( "Simple Name" ) ); + mFormattedNameCombo->insertItem( i18n( "Full Name" ) ); + mFormattedNameCombo->insertItem( i18n( "Reverse Name with Comma" ) ); + mFormattedNameCombo->insertItem( i18n( "Reverse Name" ) ); + layout->addMultiCellWidget( mFormattedNameCombo, 1, 1, 1, 2 ); + + connect( mPrefix, SIGNAL( modified() ), SIGNAL( modified() ) ); + connect( mInclusion, SIGNAL( modified() ), SIGNAL( modified() ) ); + connect( mSuffix, SIGNAL( modified() ), SIGNAL( modified() ) ); + connect( mFormattedNameCombo, SIGNAL( activated( int ) ), SIGNAL( modified() ) ); +} + +AddresseeWidget::~AddresseeWidget() +{ +} + +void AddresseeWidget::restoreSettings() +{ + KConfig config( "kabcrc" ); + config.setGroup( "General" ); + + mPrefix->setNameParts( config.readListEntry( "Prefixes" ) ); + mInclusion->setNameParts( config.readListEntry( "Inclusions" ) ); + mSuffix->setNameParts( config.readListEntry( "Suffixes" ) ); + + KConfig cfg( "kaddressbookrc" ); + cfg.setGroup( "General" ); + mFormattedNameCombo->setCurrentItem( cfg.readNumEntry( "FormattedNameType", 1 ) ); +} + +void AddresseeWidget::saveSettings() +{ + KConfig config( "kabcrc" ); + config.setGroup( "General" ); + + config.writeEntry( "Prefixes", mPrefix->nameParts() ); + config.writeEntry( "Inclusions", mInclusion->nameParts() ); + config.writeEntry( "Suffixes", mSuffix->nameParts() ); + + KConfig cfg( "kaddressbookrc" ); + cfg.setGroup( "General" ); + cfg.writeEntry( "FormattedNameType", mFormattedNameCombo->currentItem() ); + + DCOPClient *client = DCOPClient::mainClient(); + if ( client ) + client->emitDCOPSignal( "KABC::AddressBookConfig", "changed()", QByteArray() ); +} + +#include "addresseewidget.moc" diff --git a/kaddressbook/kcmconfigs/addresseewidget.h b/kaddressbook/kcmconfigs/addresseewidget.h new file mode 100644 index 000000000..c942ee42b --- /dev/null +++ b/kaddressbook/kcmconfigs/addresseewidget.h @@ -0,0 +1,89 @@ +/* + This file is part of KAddressBook. + Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> + + 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. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. +*/ + +#ifndef ADDRESSEEWIDGET_H +#define ADDRESSEEWIDGET_H + +#include <qwidget.h> + +class KComboBox; +class KLineEdit; + +class QListBox; +class QListBoxItem; +class QPushButton; + +class NamePartWidget : public QWidget +{ + Q_OBJECT + + public: + NamePartWidget( const QString &title, const QString &label, QWidget *parent, + const char *name = 0 ); + ~NamePartWidget(); + + void setNameParts( const QStringList &list ); + QStringList nameParts() const; + + signals: + void modified(); + + private slots: + void add(); + void edit(); + void remove(); + + void selectionChanged( QListBoxItem* ); + + private: + QListBox *mBox; + QPushButton *mAddButton; + QPushButton *mEditButton; + QPushButton *mRemoveButton; + + QString mTitle; + QString mLabel; +}; + +class AddresseeWidget : public QWidget +{ + Q_OBJECT + + public: + AddresseeWidget( QWidget *parent, const char *name = 0 ); + ~AddresseeWidget(); + + void restoreSettings(); + void saveSettings(); + + signals: + void modified(); + + private: + KComboBox *mFormattedNameCombo; + NamePartWidget *mPrefix; + NamePartWidget *mInclusion; + NamePartWidget *mSuffix; +}; + +#endif diff --git a/kaddressbook/kcmconfigs/extensionconfigdialog.cpp b/kaddressbook/kcmconfigs/extensionconfigdialog.cpp new file mode 100644 index 000000000..70a8d1afc --- /dev/null +++ b/kaddressbook/kcmconfigs/extensionconfigdialog.cpp @@ -0,0 +1,57 @@ +/* + This file is part of KAddressBook. + Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> + + 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. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. +*/ + +#include <qlayout.h> + +#include <klocale.h> + +#include "configurewidget.h" +#include "extensionconfigdialog.h" +#include "extensionwidget.h" + +ExtensionConfigDialog::ExtensionConfigDialog( KAB::ExtensionFactory *factory, KConfig *config, + QWidget *parent, const char *name ) + : KDialogBase( Plain, i18n( "Extension Settings" ), Ok | Cancel, Ok, parent, + name, true, true ), mWidget( 0 ), mConfig( config ) +{ + QFrame *page = plainPage(); + QGridLayout *layout = new QGridLayout( page, 1, 1, marginHint(), spacingHint() ); + + mWidget = factory->configureWidget( page, "ExtensionConfigWidget" ); + layout->addWidget( mWidget, 0, 0 ); + + mWidget->restoreSettings( mConfig ); +} + +ExtensionConfigDialog::~ExtensionConfigDialog() +{ +} + +void ExtensionConfigDialog::slotOk() +{ + mWidget->saveSettings( mConfig ); + + KDialogBase::slotOk(); +} + +#include "extensionconfigdialog.moc" diff --git a/kaddressbook/kcmconfigs/extensionconfigdialog.h b/kaddressbook/kcmconfigs/extensionconfigdialog.h new file mode 100644 index 000000000..1547647a9 --- /dev/null +++ b/kaddressbook/kcmconfigs/extensionconfigdialog.h @@ -0,0 +1,52 @@ +/* + This file is part of KAddressBook. + Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> + + 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. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. +*/ + +#ifndef EXTENSIONCONFIGDIALOG_H +#define EXTENSIONCONFIGDIALOG_H + +#include <kdialogbase.h> + +#include "extensionwidget.h" + +namespace KAB { +class ConfigureWidget; +} + +class ExtensionConfigDialog : public KDialogBase +{ + Q_OBJECT + + public: + ExtensionConfigDialog( KAB::ExtensionFactory *factory, KConfig *config, + QWidget *parent, const char *name = 0 ); + ~ExtensionConfigDialog(); + + protected slots: + void slotOk(); + + private: + KAB::ConfigureWidget *mWidget; + KConfig *mConfig; +}; + +#endif diff --git a/kaddressbook/kcmconfigs/kabconfig.desktop b/kaddressbook/kcmconfigs/kabconfig.desktop new file mode 100644 index 000000000..17a0b1b5a --- /dev/null +++ b/kaddressbook/kcmconfigs/kabconfig.desktop @@ -0,0 +1,180 @@ +[Desktop Entry] +Icon=kaddressbook +Type=Service +ServiceTypes=KCModule +DocPath=kaddressbook/preferences.html + +X-KDE-ModuleType=Library +X-KDE-Library=kabconfig +X-KDE-FactoryName=kabconfig +X-KDE-HasReadOnlyMode=false +X-KDE-ParentApp=kaddressbook +X-KDE-ParentComponents=kaddressbook,kontact_kaddressbookplugin +X-KDE-CfgDlgHierarchy=KAB + +Name=General +Name[af]=Algemeen +Name[ar]=عام +Name[bg]=Общи +Name[br]=Pennañ +Name[cs]=Obecné +Name[cy]=Cyffredinol +Name[da]=Generelt +Name[de]=Allgemein +Name[el]=Γενικά +Name[eo]=Ĝenerala +Name[et]=Üldine +Name[eu]=Orokorra +Name[fa]=عمومی +Name[fi]=Yleinen +Name[fr]=Général +Name[fy]=Algemien +Name[ga]=Ginearálta +Name[gl]=Xeral +Name[he]=כללי +Name[hu]=Általános +Name[is]=Almennt +Name[it]=Generale +Name[ja]=全般 +Name[ka]=ზოგადი +Name[kk]=Жалпы +Name[km]=ទូទៅ +Name[lt]=Bendras +Name[mk]=Општо +Name[ms]=Umum +Name[nb]=Generelt +Name[nds]=Allgemeen +Name[ne]=साधारण +Name[nl]=Algemeen +Name[nn]=Generelt +Name[pa]=ਸਧਾਰਨ +Name[pl]=Ogólne +Name[pt]=Geral +Name[pt_BR]=Geral +Name[ru]=Общие +Name[se]=Oppalaš +Name[sk]=Všeobecné +Name[sl]=Splošno +Name[sr]=Опште +Name[sr@Latn]=Opšte +Name[sv]=Allmänt +Name[ta]=பொதுவான +Name[th]=ทั่วไป +Name[tr]=Genel +Name[uk]=Загальні +Name[uz]=Umumiy +Name[uz@cyrillic]=Умумий +Name[zh_CN]=常规 +Comment=Configure the Address Book +Comment[af]=Stel die adres boek op +Comment[ar]=إعداد دفتر العناوين +Comment[be]=Настроіць адрасную кнігу +Comment[bg]=Настройки на адресника +Comment[br]=Kefluniañ ar c'harned chomlec'hioù +Comment[bs]=Podesite Adresar +Comment[ca]=Configura la Llibreta d'adreces +Comment[cs]=Nastavit knihu adres +Comment[cy]=Ffurfweddu'r Llyfr Cyfeiriadau +Comment[da]=Indstil adressebogen +Comment[de]=Adressbuch einrichten +Comment[el]=Ρύθμιση του Βιβλίου διευθύνσεων +Comment[eo]=Agordi la Adreslibron +Comment[es]=Configura la libreta de direcciones +Comment[et]=Aadressiraamatu seadistamine +Comment[eu]=Konfiguratu helbide-liburua +Comment[fa]=پیکربندی کتاب نشانی +Comment[fi]=Muokkaa osoitekirjan asetuksia +Comment[fr]=Configurer le carnet d'adresses +Comment[fy]=Hjir kinne jo, jo adresboek oanpasse +Comment[ga]=Cumraigh an Leabhar Seoltaí +Comment[gl]=Configurar o Caderno de Enderezos +Comment[he]=הגדרת הפנקס כתובת +Comment[hi]=पता पुस्तिका कॉन्फ़िगर करें +Comment[hu]=A címjegyzék beállítása +Comment[is]=Stilla vistfangaskrána +Comment[it]=Configura la rubrica indirizzi +Comment[ja]=アドレス帳設定 +Comment[ka]=წიგნაკის კონფიგურაცია +Comment[kk]=Адрестік кітапшаны баптау +Comment[km]=កំណត់រចនាសម្ព័ន្ធសៀវភៅអាសយដ្ឋាន +Comment[lt]=Konfigūruoti adresų knygelę +Comment[mk]=Конфигурирајте го адресарот +Comment[ms]=Konfigurkan Buku Alamat +Comment[nb]=Oppsett for adresseboka +Comment[nds]=Adressbook instellen +Comment[ne]=ठेगाना पुस्तिका कन्फिगर गर्नुहोस् +Comment[nl]=Hier kunt u uw adresboek aanpassen +Comment[nn]=Setja opp adressebok +Comment[pl]=Konfiguracja Książki adresowej +Comment[pt]=Configuração do Livro de Endereços +Comment[pt_BR]=Configurar o Livro de Endereços +Comment[ro]=Configurează cartea de adrese +Comment[ru]=Настройка адресной книги +Comment[se]=Heivet čujuhusgirjji +Comment[sk]=Nastavenie Adresára +Comment[sl]=Nastavi Adresar +Comment[sr]=Подешавање адресара +Comment[sr@Latn]=Podešavanje adresara +Comment[sv]=Anpassa adressboken +Comment[ta]=கேமுகவரிப்புத்தகத்தை கட்டமை +Comment[tg]=Танзимоти китоби адрес +Comment[tr]=Adres Defterini Yapılandır +Comment[uk]=Налаштування адресної книги +Comment[uz]=Manzillar daftarini moslash +Comment[uz@cyrillic]=Манзиллар дафтарини мослаш +Comment[zh_CN]=配置地址簿 +Comment[zh_TW]=設定通訊錄 +Keywords=kaddressbook, configure, settings +Keywords[af]=kaddressbook, configure,settings,adres +Keywords[be]=K Адрасная кніга, настроіць, настаўленні, kaddressbook, configure, settings +Keywords[bg]=адресни,адресна,книга,визитник,визитка,картичка,kaddressbook, configure, settings +Keywords[br]=kaddressbook, kefluniañ, dibarzhoù +Keywords[bs]=kaddressbook, configure, settings, podesi, podesite, postavke, konfiguracija +Keywords[ca]=llibreta d'adreces, configura, opcions +Keywords[cs]=kniha adres,nastavení +Keywords[cy]=kaddressbook, ffurfweddu,godosiadau +Keywords[da]=kaddressbook, indstil, opsætning +Keywords[de]=KAddressbook,Adressbuch +Keywords[el]=kaddressbook, ρύθμιση, ρυθμίσεις +Keywords[eo]=kaddressbook,adresaro,agordo +Keywords[es]=kaddressbook, configurar, opciones +Keywords[et]=kde aadressiraamat, seadistamine, seadistused +Keywords[eu]=kaddressbook, konfiguratu, ezarpenak +Keywords[fa]=kaddressbook، پیکربندی، تنظیمات +Keywords[fi]=kaddressbook, aseta, asetukset +Keywords[fr]=carnet d'adresses,adresses,kab,kaddressbook,configurer,paramètres,paramètre +Keywords[fy]=adresboek,KAB,kab,kaddressbook,ynstellings,configuratie +Keywords[ga]=kaddressbook, cumraigh, cumraíocht, socruithe +Keywords[gl]=kaddressbook, configurar, opcións +Keywords[hi]=केएड्रेसबुक, कॉन्फ़िगर, विन्यास +Keywords[hu]=kaddressbook, konfigurálás, beállítások +Keywords[is]=kaddressbook, stillingar, stilla +Keywords[it]=kaddressbook, configura, impostazioni +Keywords[ja]=kaddressbook 設定 +Keywords[ka]=kaddressbook,კონფიგურაცია, პარამეტრები +Keywords[km]=kaddressbook,កំណត់រចនាសម្ព័ន្ធ,ការកំណត់ +Keywords[lt]=kaddressbook, configure, settings, konfigūravimas, nustatymai +Keywords[mk]=kaddressbook, configure, settings, КАдресар, конфигурирање, конфигурација, поставување +Keywords[ms]=,selaraskan, tetapan, kaddressbook, configure, settings +Keywords[nb]=kaddressbook, sette opp, innstillinger +Keywords[nds]=KAddressbook,KAdressbook,Adressbook,instellen +Keywords[ne]=केडीई ठेगाना पुस्तिका, कन्फिगर, सेटिङ +Keywords[nl]=adresboek,KAB,kab,kaddressbook,instellingen,configuratie +Keywords[nn]=adressebok, oppsett, innstillingar +Keywords[pl]=kaddressbook, książka adresowa,adresy,konfiguracja,ustawienia,opcje +Keywords[pt]=kaddressbook, configurar, configuração +Keywords[pt_BR]=kaddressbook, configurar, configurações +Keywords[ro]=kaddressbook,configurare,setări +Keywords[ru]=kaddressbook,адресная книга,настройка +Keywords[se]=čujuhusgirji,heivehus,heivehusat +Keywords[sl]=kaddressbook, adresar, nastavi, nastavitve +Keywords[sr]=kaddressbook, configure, settings, подеси, поставке +Keywords[sr@Latn]=kaddressbook, configure, settings, podesi, postavke +Keywords[sv]=adressbok, anpassa, inställningar +Keywords[ta]=கேமுகவரிப்புத்தகம்,கட்டமைப்பு,அமைவுகள் +Keywords[tg]=kaddressbook,китоби адрес,танзимот +Keywords[tr]=kadresdefteri, yapılandırma, ayarlar +Keywords[uk]=kaddressbook, налаштування, параметри +Keywords[uz]=kaddressbook, moslash, moslamalar, manzillar daftari +Keywords[uz@cyrillic]=kaddressbook, мослаш, мосламалар, манзиллар дафтари +Keywords[zh_CN]=kaddressbook, configure, settings, 配置, 设置 diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp new file mode 100644 index 000000000..7c57a926c --- /dev/null +++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp @@ -0,0 +1,223 @@ +/* + This file is part of KAddressBook. + Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> + + 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. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. +*/ + +#include <qcheckbox.h> +#include <qframe.h> +#include <qgroupbox.h> +#include <qlabel.h> +#include <qlayout.h> +#include <qlineedit.h> +#include <qpushbutton.h> +#include <qtabwidget.h> +#include <qtooltip.h> +#include <qcombobox.h> + +#include <kconfig.h> +#include <kdebug.h> +#include <kdialog.h> +#include <klistview.h> +#include <klocale.h> +#include <kmessagebox.h> +#include <ktrader.h> + +#include "addresseewidget.h" +#include "kabprefs.h" + +#include "kabconfigwidget.h" + +KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name ) + : QWidget( parent, name ) +{ + QVBoxLayout *topLayout = new QVBoxLayout( this, 0, + KDialog::spacingHint() ); + + QTabWidget *tabWidget = new QTabWidget( this ); + topLayout->addWidget( tabWidget ); + + // General page + QWidget *generalPage = new QWidget( this ); + QVBoxLayout *layout = new QVBoxLayout( generalPage, KDialog::marginHint(), + KDialog::spacingHint() ); + + QGroupBox *groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "General" ), generalPage ); + QBoxLayout *boxLayout = new QVBoxLayout( groupBox->layout() ); + boxLayout->setAlignment( Qt::AlignTop ); + + mViewsSingleClickBox = new QCheckBox( i18n( "Honor KDE single click" ), groupBox, "msingle" ); + boxLayout->addWidget( mViewsSingleClickBox ); + + mNameParsing = new QCheckBox( i18n( "Automatic name parsing for new addressees" ), groupBox, "mparse" ); + boxLayout->addWidget( mNameParsing ); + + mTradeAsFamilyName = new QCheckBox( i18n( "Trade single name component as family name" ), groupBox, "mtrade" ); + boxLayout->addWidget( mTradeAsFamilyName ); +/** + TODO: show the checkbox when we can compile agains kdelibs from HEAD, atm it + doesn't work and would just confuse the users ;) +*/ + mTradeAsFamilyName->hide(); + + mLimitContactDisplay = new QCheckBox( i18n( "Limit unfiltered display to 100 contacts" ), groupBox, "mlimit" ); + boxLayout->addWidget( mLimitContactDisplay ); + + QBoxLayout *editorLayout = new QHBoxLayout( boxLayout, KDialog::spacingHint() ); + + QLabel *label = new QLabel( i18n( "Addressee editor type:" ), groupBox ); + editorLayout->addWidget( label ); + + mEditorCombo = new QComboBox( groupBox ); + mEditorCombo->insertItem( i18n( "Full Editor" ) ); + mEditorCombo->insertItem( i18n( "Simple Editor" ) ); + label->setBuddy( mEditorCombo ); + editorLayout->addWidget( mEditorCombo ); + + editorLayout->addStretch( 1 ); + + + layout->addWidget( groupBox ); + + groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Script-Hooks" ), generalPage ); + QGridLayout *grid = new QGridLayout( groupBox->layout(), 3, 2, + KDialog::spacingHint() ); + label = new QLabel( i18n( "Phone:" ), groupBox ); + grid->addWidget( label, 0, 0 ); + + mPhoneHook = new QLineEdit( groupBox ); + QToolTip::add( mPhoneHook, i18n( "<ul><li>%N: Phone Number</li></ul>" ) ); + grid->addWidget( mPhoneHook, 0, 1 ); + + label = new QLabel( i18n( "Fax:" ), groupBox ); + grid->addWidget( label, 1, 0 ); + + mFaxHook = new QLineEdit( groupBox ); + QToolTip::add( mFaxHook, i18n( "<ul><li>%N: Fax Number</li></ul>" ) ); + grid->addWidget( mFaxHook, 1, 1 ); + + + label = new QLabel( i18n( "SMS Text:" ), groupBox ); + grid->addWidget( label, 2, 0 ); + + mSMSHook = new QLineEdit( groupBox ); + QToolTip::add( mSMSHook, i18n( "<ul><li>%N: Phone Number</li><li>%F: File containing the text message(s)</li></ul>" ) ); + grid->addWidget( mSMSHook, 2, 1 ); + + + grid->setColStretch( 1, 1 ); + + layout->addWidget( groupBox ); + + groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Location Map" ), generalPage ); + boxLayout = new QVBoxLayout( groupBox->layout(), KDialog::spacingHint() ); + boxLayout->setAlignment( Qt::AlignTop ); + + mLocationMapURL = new QComboBox( true, groupBox ); + mLocationMapURL->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed ) ); + QToolTip::add( mLocationMapURL, i18n( "<ul> <li>%s: Street</li>" + "<li>%r: Region</li>" + "<li>%l: Location</li>" + "<li>%z: Zip Code</li>" + "<li>%c: Country ISO Code</li> </ul>" ) ); + mLocationMapURL->insertStringList( KABPrefs::instance()->locationMapURLs() ); + boxLayout->addWidget( mLocationMapURL ); + layout->addWidget( groupBox ); + + connect( mNameParsing, SIGNAL( toggled( bool ) ), SLOT( modified() ) ); + connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), SLOT( modified() ) ); + connect( mTradeAsFamilyName, SIGNAL( toggled( bool ) ), SLOT( modified() ) ); + connect( mLimitContactDisplay, SIGNAL( toggled( bool ) ), SLOT( modified() ) ); + connect( mPhoneHook, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) ); + connect( mSMSHook, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) ); + connect( mFaxHook, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) ); + connect( mLocationMapURL, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) ); + connect( mEditorCombo, SIGNAL( activated( int ) ), SLOT( modified() ) ); + + tabWidget->addTab( generalPage, i18n( "General" ) ); + + // Addressee page + mAddresseeWidget = new AddresseeWidget( this ); + tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) ); + connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) ); +} + +void KABConfigWidget::restoreSettings() +{ + bool blocked = signalsBlocked(); + blockSignals( true ); + + mNameParsing->setChecked( KABPrefs::instance()->automaticNameParsing() ); + mViewsSingleClickBox->setChecked( KABPrefs::instance()->honorSingleClick() ); + mPhoneHook->setText( KABPrefs::instance()->phoneHookApplication() ); + mSMSHook->setText( KABPrefs::instance()->sMSHookApplication() ); + mFaxHook->setText( KABPrefs::instance()->faxHookApplication() ); + mAddresseeWidget->restoreSettings(); + mEditorCombo->setCurrentItem( KABPrefs::instance()->editorType() ); + mLocationMapURL->setCurrentText( KABPrefs::instance()->locationMapURL().arg( KGlobal::locale()->country() ) ); + mLocationMapURL->lineEdit()->setCursorPosition( 0 ); + + KConfig config( "kabcrc", false, false ); + config.setGroup( "General" ); + mTradeAsFamilyName->setChecked( config.readBoolEntry( "TradeAsFamilyName", true ) ); + mLimitContactDisplay->setChecked( config.readBoolEntry( "LimitContactDisplay", true ) ); + + blockSignals( blocked ); + + emit changed( false ); +} + +void KABConfigWidget::saveSettings() +{ + KABPrefs::instance()->setAutomaticNameParsing( mNameParsing->isChecked() ); + KABPrefs::instance()->setHonorSingleClick( mViewsSingleClickBox->isChecked() ); + KABPrefs::instance()->setPhoneHookApplication( mPhoneHook->text() ); + KABPrefs::instance()->setSMSHookApplication( mSMSHook->text() ); + KABPrefs::instance()->setFaxHookApplication( mFaxHook->text() ); + KABPrefs::instance()->setEditorType( mEditorCombo->currentItem() ); + KABPrefs::instance()->setLocationMapURL( mLocationMapURL->currentText() ); + mAddresseeWidget->saveSettings(); + + KABPrefs::instance()->writeConfig(); + + KConfig config( "kabcrc", false, false ); + config.setGroup( "General" ); + config.writeEntry( "TradeAsFamilyName", mTradeAsFamilyName->isChecked() ); + config.writeEntry( "LimitContactDisplay", mLimitContactDisplay->isChecked() ); + + emit changed( false ); +} + +void KABConfigWidget::defaults() +{ + mNameParsing->setChecked( true ); + mViewsSingleClickBox->setChecked( false ); + mEditorCombo->setCurrentItem( 0 ); + mLimitContactDisplay->setChecked( true ); + + emit changed( true ); +} + +void KABConfigWidget::modified() +{ + emit changed( true ); +} + +#include "kabconfigwidget.moc" diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.h b/kaddressbook/kcmconfigs/kabconfigwidget.h new file mode 100644 index 000000000..72b3e88f3 --- /dev/null +++ b/kaddressbook/kcmconfigs/kabconfigwidget.h @@ -0,0 +1,70 @@ +/* + This file is part of KAddressBook. + Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> + + 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. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. +*/ + +#ifndef KABCONFIGWIDGET_H +#define KABCONFIGWIDGET_H + +#include <qwidget.h> + +class QCheckBox; +class QLineEdit; +class QListViewItem; +class QPushButton; +class QComboBox; + +class KListView; + +class AddresseeWidget; + +class KABConfigWidget : public QWidget +{ + Q_OBJECT + + public: + KABConfigWidget( QWidget *parent, const char *name = 0 ); + + void restoreSettings(); + void saveSettings(); + void defaults(); + + signals: + void changed( bool ); + + public slots: + void modified(); + + private: + QCheckBox *mNameParsing; + QCheckBox *mViewsSingleClickBox; + QCheckBox *mTradeAsFamilyName; + QComboBox *mEditorCombo; + QLineEdit *mPhoneHook; + QLineEdit *mFaxHook; + QLineEdit *mSMSHook; + QCheckBox *mLimitContactDisplay; + QComboBox *mLocationMapURL; + + AddresseeWidget *mAddresseeWidget; +}; + +#endif diff --git a/kaddressbook/kcmconfigs/kabcustomfields.desktop b/kaddressbook/kcmconfigs/kabcustomfields.desktop new file mode 100644 index 000000000..f0b7cf1ff --- /dev/null +++ b/kaddressbook/kcmconfigs/kabcustomfields.desktop @@ -0,0 +1,163 @@ +[Desktop Entry] +Icon=dlgedit +Type=Service +ServiceTypes=KCModule +DocPath=kaddressbook/preferences.html + +X-KDE-ModuleType=Library +X-KDE-Library=kabcustomfields +X-KDE-FactoryName=kabcustomfields +X-KDE-ParentApp=kaddressbook +X-KDE-ParentComponents=kaddressbook,kontact_kaddressbookplugin +X-KDE-CfgDlgHierarchy=KAB + +Name=Custom Pages +Name[af]=Pasmaak Blaaie +Name[ar]=الصفحات المعتادة +Name[bg]=Потребителски полета +Name[br]=Pajennoù dre ziouer +Name[bs]=Vlastite stranice +Name[ca]=Pàgines a mida +Name[cs]=Vlastní stránky +Name[da]=Brugervalgte sider +Name[de]=Benutzerdefinierte Seiten +Name[el]=Προσαρμοσμένες σελίδες +Name[eo]=Propraj Paĝoj +Name[es]=Páginas personalizadas +Name[et]=Omaloodud leheküljed +Name[eu]=Orri pertsonalizatuak +Name[fa]=صفحات سفارشی +Name[fi]=Omat sivut +Name[fr]=Pages personnalisées +Name[fy]=Oanpaste siden +Name[ga]=Leathanaigh Shaincheaptha +Name[gl]=Páxinas Personalizadas +Name[he]=דפים מותאמים אישית +Name[hu]=Egyéni lapok +Name[is]=Sérsniðnar síður +Name[it]=Pagine personalizzate +Name[ja]=カスタムページ +Name[ka]=სამომხმარებლო გვერდები +Name[kk]=Қосымша парақтар +Name[km]=ទំព័រផ្ទាល់ខ្លួន +Name[lt]=Pasirinkti puslapiai +Name[mk]=Сопствени страници +Name[ms]=Halaman Kebiasaan +Name[nb]=Tilpassede sider +Name[nds]=Egen Sieden +Name[ne]=अनुकूल पृष्ठ +Name[nl]=Aangepaste pagina's +Name[nn]=Tilpassa sider +Name[pl]=Własne strony +Name[pt]=Páginas Personalizadas +Name[pt_BR]=Páginas personalizadas +Name[ru]=Дополнительные поля +Name[se]=Iežat siiddut +Name[sk]=Vlastné stránky +Name[sl]=Prilagojene strani +Name[sr]=Посебне странице +Name[sr@Latn]=Posebne stranice +Name[sv]=Egna sidor +Name[ta]=தனிபயன் பக்கங்கள் +Name[tg]=Варақаҳои замимавии истифодашаванда +Name[tr]=Özel Sayfa +Name[uk]=Нетипові сторінки +Name[zh_CN]=定制页 +Comment=Configure the Custom Pages +Comment[af]=Stel die pasmaak blaaie op +Comment[ar]=إعداد الصفحات المعتادة +Comment[bg]=Настройки на потребителските полета +Comment[br]=Kefluniañ ar pajennoù diouzhoc'h +Comment[bs]=Podesite vlastite stranice +Comment[ca]=Configura les pàgines a mida +Comment[cs]=Nastavení vlastních stránek +Comment[da]=Indstil de selvvalgte sider +Comment[de]=Einstellungen für benutzerdefinierte Seiten +Comment[el]=Ρύθμιση των προσαρμοσμένων σελίδων +Comment[eo]=Agordi la proprajn paĝojn +Comment[es]=Configura las páginas personalizadas +Comment[et]=Omaloodud lehekülgede seadistamine +Comment[eu]=Konfiguratu orri pertsonalizatuak +Comment[fa]=پیکربندی صفحات سفارشی +Comment[fi]=Muokkaa omia sivuja +Comment[fr]=Configurer les pages personnalisées +Comment[fy]=Hjir kinne jo de oanpaste siden ynstelle +Comment[ga]=Cumraigh na Leathanaigh Shaincheaptha +Comment[gl]=Configurar as Páxinas Personalizadas +Comment[he]=הגדר את הדפים המותאמים אישית +Comment[hu]=Az egyéni lapok beállítása +Comment[is]=Stilla sérsniðnu síðurnar +Comment[it]=Configura le pagine personalizzate +Comment[ja]=カスタムページの設定 +Comment[ka]=სამომხმარებლო გვერდების კონფიგურაცია +Comment[kk]=Қосымша парақтарды баптау +Comment[km]=កំណត់រចនាសម្ព័ន្ធទំព័រផ្ទាល់ខ្លួន +Comment[lt]=Konfigūruoti darbastalių skaičių ir pavadinimus +Comment[mk]=Конфигурирајте ги сопствените страници +Comment[ms]=Konfigurkan Halaman Langganan +Comment[nb]=Stille inn de tilpassede sidene +Comment[nds]=Egen Sieden instellen +Comment[ne]=अनुकूल पृष्ठ कन्फिगर गर्नुहोस् +Comment[nl]=Hier kunt u de aangepaste pagina's instellen +Comment[nn]=Set opp dei tilpassa sidene +Comment[pl]=Konfiguracja własnych stron +Comment[pt]=Configurar as Páginas Personalizadas +Comment[pt_BR]=Configurar Páginas personalizadas +Comment[ru]=Настройка пользовательских вкладок +Comment[se]=Heivet iežat siidduid +Comment[sk]=Nastavenie vlastných stránok +Comment[sl]=Nastavi prilagojene strani +Comment[sr]=Подешавање посебних страница +Comment[sr@Latn]=Podešavanje posebnih stranica +Comment[sv]=Anpassa egna sidor +Comment[ta]=தனிபயன் பக்கங்களை கட்டமை +Comment[tg]=Танзимоти варақаҳои замимавии истифодашаванда +Comment[tr]=Özel Sayfaları Yapılandır +Comment[uk]=Налаштування нетипових сторінок +Comment[zh_CN]=配置定制页 +Comment[zh_TW]=設定 Custom Pages +Keywords=kaddressbook, configure, settings, custom fields +Keywords[bg]=адресник, потребителски, полета, настройки, настройване, kaddressbook, configure, settings, custom fields +Keywords[bs]=kaddressbook, configure, settings, custom fields, podesite, postavke, vlastite, vlastito +Keywords[ca]=llibreta d'adreces, configura, opcions, camps a mida +Keywords[cs]=kniha adres,nastavení,vlastní pole +Keywords[da]=kaddressbook, indstil, opsætning, brugervalgte felter +Keywords[de]=KAddressbook,Konfigurieren,Einstellungen,benutzerdefinierte Felder,Einrichten +Keywords[el]=kaddressbook, ρύθμιση, ρυθμίσεις, προσαρμοσμένα πεδία +Keywords[es]=kaddressbook, configurar, opciones, campos personalizados +Keywords[et]=kde aadressiraamat, seadistamine, seadistused, omaloodud väljad +Keywords[eu]=kaddressbook, konfiguratu, ezarpenak, eremu pertsonalizatuak +Keywords[fa]=kaddresAPsbook، پیکربندی، تنظیمات، حوزههای سفارشی +Keywords[fi]=osoitekirja, aseta, asetukset, omat kentät +Keywords[fr]=carnet d'adresses,adresses,kab,kaddressbook,configurer,paramètres,paramètre,champ,personnalisé +Keywords[fy]=adresboek,KAB,kab,kaddressbook,ynstellings,konfiguraasje,oanpaste fjilden +Keywords[ga]=kaddressbook, cumraith, cumraíocht, socruithe, réimsí saincheaptha +Keywords[gl]=kaddressbook, configurar, opcións, campos personalizados +Keywords[hu]=kaddressbook, beállítás, beállítások, egyéni mezők +Keywords[is]=kaddressbook, stillingar, stilla, sérsniðnir reitir +Keywords[it]=kaddressbook, configura, impostazioni, campi personalizzati +Keywords[ja]=kaddressbook、設定、設定,カスタムフィールド +Keywords[ka]=kaddressbook,კონფიგურაცია,პარამეტრები,სამომხმარებლო ველები +Keywords[km]=kaddressbook,កំណត់រចនាសម្ព័ន្ធ,ការកំណត់,វាលផ្ទាល់ខ្លួន +Keywords[lt]=kaddressbook, configure, settings, custom fields, pasirinkti laukai,konfigūruoti, nustatymai +Keywords[mk]=kaddressbook, configure, settings, custom fields, КАдресар, конфигурација, конфигурирање, сопствени полиња +Keywords[ms]=kaddressbook, konfigur, seting, medan kebiasaan +Keywords[nb]=kaddressbook, sette opp, innstillinger +Keywords[nds]=KAddressbook,KAdressbook,Adressbook,instellen,egen Feller +Keywords[ne]=केडीई ठेगाना पुस्तिका, कन्फिगर, सेटिङ, अनुकूल फिल्ड +Keywords[nl]=adresboek,KAB,kab,kaddressbook,instellingen,configuratie,aangepaste velden +Keywords[nn]=adressebok, oppsett, innstillingar, tilpassa felt +Keywords[pl]=kaddressbook,książka adresowa,konfiguracja,ustawienia, własne pola +Keywords[pt]=kaddressbook, configurar, configuração, campos personalizados +Keywords[pt_BR]=kaddressbook,configurar,configurações, campos personalizados +Keywords[ru]=kaddressbook,адресная книга,настройка +Keywords[sk]=kaddressbook,nastavenie,vlastné polia +Keywords[sl]=kaddressbook, adresar, nastavi, nastavitve, polja, prilagojena +Keywords[sr]=kaddressbook, подеси, поставке, посебна поља +Keywords[sr@Latn]=kaddressbook, podesi, postavke, posebna polja +Keywords[sv]=adressbok, anpassa, inställningar, egna fält +Keywords[ta]=கேமுகவரிப்புத்தகம்,கட்டமை, அமைவுகள், தனிபயன் புலங்கள் +Keywords[tg]=kaddressbook,китоби адрес,танзимот +Keywords[tr]=kaddressbook,adres defteri,yapılandır,yapılandırma,özel alanlar +Keywords[uk]=kaddressbook, налаштування, параметри, нетипові поля +Keywords[zh_CN]=kaddressbook, configure, settings, custom fields, 配置, 设置, 定制项 diff --git a/kaddressbook/kcmconfigs/kabldapconfig.desktop b/kaddressbook/kcmconfigs/kabldapconfig.desktop new file mode 100644 index 000000000..a13645a98 --- /dev/null +++ b/kaddressbook/kcmconfigs/kabldapconfig.desktop @@ -0,0 +1,171 @@ +[Desktop Entry] +Icon=find +Type=Service +ServiceTypes=KCModule +DocPath=kaddressbook/preferences.html#preferences-ldap-lookup + +X-KDE-ModuleType=Library +X-KDE-Library=kabldapconfig +X-KDE-FactoryName=kabldapconfig +X-KDE-ParentApp=kaddressbook +X-KDE-ParentComponents=kaddressbook,kontact_kaddressbookplugin +X-KDE-CfgDlgHierarchy=KAB + +Name=LDAP Lookup +Name[af]=LDAP Opkyk +Name[ar]=البحث في LDAP +Name[bg]=Търсене в LDAP +Name[br]=Klask LDAP +Name[bs]=LDAP pretraga +Name[ca]=Recerca LDAP +Name[cs]=LDAP vyhledávání +Name[cy]=Chwiliad LDAP +Name[da]=LDAP-Opslag +Name[de]=LDAP-Nachschlagefunktion +Name[el]=Αναζήτηση LDAP +Name[eo]=LDAP-Serĉo +Name[es]=Búsqueda LDAP +Name[et]=LDAP otsing +Name[eu]=LDAP bilaketa +Name[fa]=مراجعه به LDAP +Name[fi]=LDAP-haku +Name[fr]=Consultation LDAP +Name[fy]=LDAP-sykasksje +Name[ga]=Cuardach LDAP +Name[gl]=Procura LDAP +Name[hi]=एलडीएपी तलाश +Name[hu]=LDAP-lekérdezés +Name[is]=LDAP uppfletting +Name[it]=Ricerca LDAP +Name[ja]=LDAP 検索 +Name[ka]= ძებნა LDAP-ში +Name[kk]=LDAP іздеу +Name[km]=ស្វែងរក LDAP +Name[lt]=LDAP paieška +Name[mk]=Пребарување во LDAP +Name[nb]=LDAP oppslag +Name[nds]=LDAP-Naslaan +Name[ne]=एलडीएपी खोजी गर्नुहोस् +Name[nl]=LDAP-zoekactie +Name[nn]=LDAP oppslag +Name[pa]=LDAP ਖੋਜ +Name[pl]=Wyszukiwanie LDAP +Name[pt]=Pesquisa na LDAP +Name[pt_BR]=Procura LDAP +Name[ro]=Căutare LDAP +Name[ru]=Каталоги LDAP +Name[sk]=LDAP hľadanie +Name[sl]=Vpogled v LDAP +Name[sr]=LDAP потрага +Name[sr@Latn]=LDAP potraga +Name[sv]=LDAP-uppslagning +Name[ta]=LDAP லுக்கப் +Name[tg]=Ҷустуҷӯ дар каталогҳои LDAP +Name[tr]=LDAP Tarama +Name[uk]=Пошук через LDAP +Name[zh_CN]=LDAP 查询 +Comment=Configure the Address Book LDAP Settings +Comment[af]=Stel die adres boek se LDAP opstelling op. +Comment[bg]=Настройки на адресника за използване на сървър LDAP +Comment[bs]=Podesite LDAP postavke Adresara +Comment[ca]=Configura les opcions de la Llibreta d'adreces LDAP +Comment[cs]=Nastavit LDAP pro Knihu adres +Comment[cy]=Ffurfweddu gosodiadau LDAP y Llyfr Cyfeiriadau +Comment[da]=Indstil adressebogens LDAP-opsætning +Comment[de]=Adressbuch-Modul für LDAP-Einstellungen +Comment[el]=Αλλάξτε τις ρυθμίσεις LDAP του Βιβλίου διευθύνσεων +Comment[eo]=Agordo de tenejo +Comment[es]=Configura las opciones de búsqueda LDAP en la libreta de direcciones +Comment[et]=Aadressiraamatu LDAP seadistused +Comment[eu]=Konfiguratu Helbide-liburuaren LDAP ezarpenak +Comment[fa]=پیکربندی تنظیمات LDAP کتاب نشانی +Comment[fi]=Aseta osoitekirjan LDAP-asetuksia +Comment[fr]=Configurer les paramètres du carnet d'adresses LDAP +Comment[fy]=Hjir kinne jo de LDAP-ynstellings foar jo adresboek ynstelle +Comment[gl]=Configurar as opcións do Caderno de Enderezos de LDAP +Comment[he]=הגדר את פנקס הכתובות מבוסס LDAP +Comment[hi]=पता पुस्तिका एलडीएपी विन्यास कॉन्फ़िगर करें +Comment[hu]=A címjegyzék LDAP-beállításainak megváltoztatása +Comment[is]=Breyta LDAP stillingum vistfangaskráarinnar +Comment[it]=Configurare le impostazioni LDAP della rubrica indirizzi +Comment[ja]=アドレス帳 LDAP 設定 +Comment[ka]=LDAP წიგნაკის პარამეტრების კონფიგურაცია +Comment[kk]=Адрестік кітапшаның LDAP параметрлерін баптау +Comment[km]=កំណត់រចនាសម្ព័ន្ធការកំណត់ LDAP របស់សៀវភៅអាសយដ្ឋាន +Comment[lt]=Konfigūruoti adresų knygelės LDAP nustatymus +Comment[mk]=Конфигурирајте ги поставувањата за LDAP за адресарот +Comment[ms]=Konfigurkan Seting Buku Alamat LDAP +Comment[nb]=Sett opp LDAP-innstillinger for adresseboka +Comment[nds]=LDAP-Instellen för KAdressbook +Comment[ne]=ठेगाना पुस्तिका एलडीएपी सेटिङ कन्फिगर गर्नुहोस् +Comment[nl]=Hier kunt u de LDAP-instellingen voor uw adresboek instellen +Comment[nn]=Setja opp LDAP-innstillingar for adresseboka +Comment[pl]=Konfiguracja ustawień LDAP dla Książki adresowej +Comment[pt]=Configurar as opções de LDAP do Livro de Endereços +Comment[pt_BR]=Configurar as Definições para LDAP do Livro de Endereços +Comment[ru]=Настройка серверов LDAP адресной книги +Comment[sk]=Nastavenie LDAP volieb Adresára +Comment[sl]=Prilagodi nastavitve LDAP v Adresarju +Comment[sr]=Подешавање LDAP поставки адресара +Comment[sr@Latn]=Podešavanje LDAP postavki adresara +Comment[sv]=Anpassa adressbokens LDAP-inställningar +Comment[ta]=கேமுகவரிபுத்தகத்தை உருவமை LDAP அமைவுகள் +Comment[tg]=Танзимоти серверҳои LDAP-и китоби адрес +Comment[tr]=Adres Defteri LDAP Ayarlarını Yapılandır +Comment[uk]=Налаштування параметрів LDAP для адресної книги +Comment[uz]=LDAP manzillar daftarini moslash +Comment[uz@cyrillic]=LDAP манзиллар дафтарини мослаш +Comment[zh_CN]=配置地址簿 LDAP 设置 +Comment[zh_TW]=設定通訊錄 LDAP 設定 +Keywords=kaddressbook, configure, settings, LDAP +Keywords[be]=K Адрасная кніга, настроіць, настраўленні, kaddressbook, configure, settings, LDAP +Keywords[bg]=адресник,адрес,адресна,книга,сървър,всички,kaddressbook, configure, settings, LDAP +Keywords[br]=kaddressbook, kefluniañ, dibarzhoù, LDAP +Keywords[bs]=kaddressbook, configure, settings, LDAP, podesi, postavke, podesite, konfiguracija +Keywords[ca]=llibreta d'adreces, configura, opcions, LDAP +Keywords[cs]=kniha adres,nastavení,LDAP +Keywords[cy]=kaddressbook,ffurfweddu, gosodiadau,LDAP +Keywords[da]=kaddressbook, indstil, opsætning, LDAP +Keywords[de]=KAddressbook,LDAP,Einstellungen, Einrichten +Keywords[el]=kaddressbook, ρύθμιση, ρυθμίσεις, LDAP +Keywords[es]=kaddressbook, configurar, opciones, LDAP +Keywords[et]=kde aadressiraamat, seadistamine, seadistused, LDAP +Keywords[eu]=kaddressbook, konfiguratu,ezarpenak, LDAP +Keywords[fa]=kaddressbook، پیکربندی، تنظیمات، LDAP +Keywords[fi]=kaddressbook, aseta, asetukset, LDAP +Keywords[fr]=carnet d'adresses,adresses,kab,kaddressbook,configurer,paramètres,paramètre,LDAP +Keywords[fy]=adresboek,kaddressbook,LDAP +Keywords[ga]=kaddressbook, cumraigh, cumraíocht, socruithe, LDAP +Keywords[gl]=kaddressbook, configurar,opcións, LDAP +Keywords[hi]=केएड्रेसबुक, कॉन्फ़िगर, विन्यास,एलडीएपी +Keywords[hu]=kaddressbook, konfiguráció, beállítások, LDAP +Keywords[is]=kaddressbook, stillingar, stilla, LDAP +Keywords[it]=kaddressbook, configura, impostazioni, LDAP +Keywords[ja]=kaddressbook LDAP 設定 +Keywords[ka]=kaddressbook,კონფიგურაცია,პარამეტრები, LDAP +Keywords[km]=kaddressbook,កំណត់រចនាសម្ព័ន្ធ,ការកំណត់,LDAP +Keywords[lt]=kaddressbook, configure, settings, LDAP, nustatymai, konfigūruoti +Keywords[mk]=kaddressbook, configure, settings, LDAP, кадресар, конфигурација, конфигурирање, поставувања +Keywords[ms]=selaraskan, tetapan, kaddressbook, configure, settings, LDAP +Keywords[nb]=kaddressbook, sette opp, innstillinger, LDAP +Keywords[nds]=KAdressbook,Adressbook,LDAP,instellen +Keywords[ne]=केडीई ठेगाना पुस्तिका, कन्फिगर, सेटिङ, एलडीएपी +Keywords[nl]=adresboek,kaddressbook,LDAP +Keywords[nn]=adressebok, oppsett, innstillingar, LDAP +Keywords[pl]=kaddressbook, książka adresowa,konfiguracja,ustawienia,opcje, LDAP +Keywords[pt]=kaddressbook, configurar, configuração, LDAP +Keywords[pt_BR]=kaddressbook, configurar, configurações, LDAP +Keywords[ro]=kaddressbook,configurare,setări,LDAP +Keywords[ru]=kaddressbook, configure, settings, LDAP, адресная книга, настройки +Keywords[se]=čujuhusgirji,heivehus,heivehit,LDAP +Keywords[sl]=kaddressbook,adresar, nastavi, nastavitve, LDAP +Keywords[sr]=kaddressbook, configure, settings, подеси, поставке, LDAP +Keywords[sr@Latn]=kaddressbook, configure, settings, podesi, postavke, LDAP +Keywords[sv]=adressbok, anpassa, inställningar, LDAP +Keywords[ta]=கேமுகவரிபுத்தகம்,கட்டமைப்பு,அமைவுகள்,LDAP +Keywords[tg]=kaddressbook, configure, settings, LDAP, китоби адрес, танзимот +Keywords[tr]=adres defteri,yapılandırma,ayarlar,LDAP +Keywords[uk]=kaddressbook, налаштування, параметри, LDAP +Keywords[uz]=kaddressbook, moslash, moslamalar, manzillar daftari, LDAP +Keywords[uz@cyrillic]=kaddressbook, мослаш, мосламалар, манзиллар дафтари, LDAP +Keywords[zh_CN]=kaddressbook, configure, settings, LDAP, 配置, 设置 diff --git a/kaddressbook/kcmconfigs/kcmkabconfig.cpp b/kaddressbook/kcmconfigs/kcmkabconfig.cpp new file mode 100644 index 000000000..97fee4661 --- /dev/null +++ b/kaddressbook/kcmconfigs/kcmkabconfig.cpp @@ -0,0 +1,78 @@ +/* + This file is part of KAddressBook. + Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> + + 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. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. +*/ + +#include <qlayout.h> + +#include <kaboutdata.h> +#include <kdebug.h> +#include <klocale.h> + +#include "kabconfigwidget.h" + +#include "kcmkabconfig.h" + +#include <kdepimmacros.h> + +extern "C" +{ + KDE_EXPORT KCModule *create_kabconfig( QWidget *parent, const char * ) { + return new KCMKabConfig( parent, "kcmkabconfig" ); + } +} + +KCMKabConfig::KCMKabConfig( QWidget *parent, const char *name ) + : KCModule( parent, name ) +{ + QVBoxLayout *layout = new QVBoxLayout( this ); + mConfigWidget = new KABConfigWidget( this, "mConfigWidget" ); + layout->addWidget( mConfigWidget ); + + connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) ); + + load(); + + KAboutData *about = new KAboutData( I18N_NOOP( "kcmkabconfig" ), + I18N_NOOP( "KAddressBook Configure Dialog" ), + 0, 0, KAboutData::License_GPL, + I18N_NOOP( "(c), 2003 - 2004 Tobias Koenig" ) ); + + about->addAuthor( "Tobias Koenig", 0, "tokoe@kde.org" ); + setAboutData( about ); +} + +void KCMKabConfig::load() +{ + mConfigWidget->restoreSettings(); +} + +void KCMKabConfig::save() +{ + mConfigWidget->saveSettings(); +} + +void KCMKabConfig::defaults() +{ + mConfigWidget->defaults(); +} + +#include "kcmkabconfig.moc" diff --git a/kaddressbook/kcmconfigs/kcmkabconfig.h b/kaddressbook/kcmconfigs/kcmkabconfig.h new file mode 100644 index 000000000..a42dff08b --- /dev/null +++ b/kaddressbook/kcmconfigs/kcmkabconfig.h @@ -0,0 +1,46 @@ +/* + This file is part of KAddressBook. + Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> + + 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. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. +*/ + +#ifndef KCMKABCONFIG_H +#define KCMKABCONFIG_H + +#include <kcmodule.h> + +class KABConfigWidget; + +class KCMKabConfig : public KCModule +{ + Q_OBJECT + + public: + KCMKabConfig( QWidget *parent = 0, const char *name = 0 ); + + virtual void load(); + virtual void save(); + virtual void defaults(); + + private: + KABConfigWidget *mConfigWidget; +}; + +#endif diff --git a/kaddressbook/kcmconfigs/kcmkabcustomfields.cpp b/kaddressbook/kcmconfigs/kcmkabcustomfields.cpp new file mode 100644 index 000000000..0c70b08bd --- /dev/null +++ b/kaddressbook/kcmconfigs/kcmkabcustomfields.cpp @@ -0,0 +1,77 @@ +/* + This file is part of KAddressbook. + Copyright (c) 2004 Tobias Koenig <tokoe@kde.org> + + 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. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. +*/ + +#include "kcmkabcustomfields.h" + +#include "kabprefs.h" + +#include <kstandarddirs.h> + +#include <qregexp.h> + +#include <kdepimmacros.h> + +extern "C" +{ + KDE_EXPORT KCModule *create_kabcustomfields( QWidget *parent, const char * ) { + return new KCMKabCustomFields( parent, "kcmkabcustomfields" ); + } +} + +KCMKabCustomFields::KCMKabCustomFields( QWidget *parent, const char *name ) + : KCMDesignerFields( parent, name ) +{ +} + +QString KCMKabCustomFields::localUiDir() +{ + return kabLocalDir() + "contacteditorpages/"; +} + +QString KCMKabCustomFields::uiPath() +{ + return "kaddressbook/contacteditorpages/"; +} + +void KCMKabCustomFields::writeActivePages( const QStringList &activePages ) +{ + KABPrefs::instance()->setAdvancedCustomFields( activePages ); + KABPrefs::instance()->writeConfig(); +} + +QStringList KCMKabCustomFields::readActivePages() +{ + return KABPrefs::instance()->advancedCustomFields(); +} + +QString KCMKabCustomFields::applicationName() +{ + return "KADDRESSBOOK"; +} + +QString KCMKabCustomFields::kabLocalDir() +{ + QStringList kabdirs = locateLocal("data", "kaddressbook/"); + return kabdirs.grep( QRegExp( "^"+KGlobal::dirs()->localkdedir() ) ).first(); +} + diff --git a/kaddressbook/kcmconfigs/kcmkabcustomfields.h b/kaddressbook/kcmconfigs/kcmkabcustomfields.h new file mode 100644 index 000000000..1501c42ed --- /dev/null +++ b/kaddressbook/kcmconfigs/kcmkabcustomfields.h @@ -0,0 +1,43 @@ +/* + This file is part of KAddressbook. + Copyright (c) 2004 Tobias Koenig <tokoe@kde.org> + + 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. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. +*/ +#ifndef KCMKABCUSTOMFIELDS_H +#define KCMKABCUSTOMFIELDS_H + +#include <libkdepim/kcmdesignerfields.h> + +class KCMKabCustomFields : public KPIM::KCMDesignerFields +{ + public: + KCMKabCustomFields( QWidget *parent = 0, const char *name = 0 ); + + protected: + QString localUiDir(); + QString uiPath(); + void writeActivePages( const QStringList & ); + QStringList readActivePages(); + QString applicationName(); + + QString kabLocalDir(); +}; + +#endif diff --git a/kaddressbook/kcmconfigs/kcmkabldapconfig.cpp b/kaddressbook/kcmconfigs/kcmkabldapconfig.cpp new file mode 100644 index 000000000..48c83a543 --- /dev/null +++ b/kaddressbook/kcmconfigs/kcmkabldapconfig.cpp @@ -0,0 +1,79 @@ +/* + This file is part of KAddressBook. + Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> + + 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. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. +*/ + +#include <qcheckbox.h> +#include <qframe.h> +#include <qlayout.h> + +#include <kaboutdata.h> +#include <klocale.h> + +#include "ldapoptionswidget.h" + +#include "kcmkabldapconfig.h" + +#include <kdepimmacros.h> + +extern "C" +{ + KDE_EXPORT KCModule *create_kabldapconfig( QWidget *parent, const char * ) { + return new KCMKabLdapConfig( parent, "kcmkabldapconfig" ); + } +} + +KCMKabLdapConfig::KCMKabLdapConfig( QWidget *parent, const char *name ) + : KCModule( parent, name ) +{ + QVBoxLayout *layout = new QVBoxLayout( this ); + mConfigWidget = new LDAPOptionsWidget( this ); + layout->addWidget( mConfigWidget ); + + connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) ); + + load(); + + KAboutData *about = new KAboutData( I18N_NOOP( "kcmkabldapconfig" ), + I18N_NOOP( "KAB LDAP Configure Dialog" ), + 0, 0, KAboutData::License_GPL, + I18N_NOOP( "(c), 2003 - 2004 Tobias Koenig" ) ); + + about->addAuthor( "Tobias Koenig", 0, "tokoe@kde.org" ); + setAboutData( about ); +} + +void KCMKabLdapConfig::load() +{ + mConfigWidget->restoreSettings(); +} + +void KCMKabLdapConfig::save() +{ + mConfigWidget->saveSettings(); +} + +void KCMKabLdapConfig::defaults() +{ + mConfigWidget->defaults(); +} + +#include "kcmkabldapconfig.moc" diff --git a/kaddressbook/kcmconfigs/kcmkabldapconfig.h b/kaddressbook/kcmconfigs/kcmkabldapconfig.h new file mode 100644 index 000000000..85e67053a --- /dev/null +++ b/kaddressbook/kcmconfigs/kcmkabldapconfig.h @@ -0,0 +1,48 @@ +/* + This file is part of KAddressBook. + Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> + + 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. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. +*/ + +#ifndef KCMKABLDAPCONFIG_H +#define KCMKABLDAPCONFIG_H + +#include <kcmodule.h> + +#include <qwidget.h> + +class LDAPOptionsWidget; + +class KCMKabLdapConfig : public KCModule +{ + Q_OBJECT + + public: + KCMKabLdapConfig( QWidget *parent = 0, const char *name = 0 ); + + virtual void load(); + virtual void save(); + virtual void defaults(); + + private: + LDAPOptionsWidget *mConfigWidget; +}; + +#endif diff --git a/kaddressbook/kcmconfigs/ldapoptionswidget.cpp b/kaddressbook/kcmconfigs/ldapoptionswidget.cpp new file mode 100644 index 000000000..df80ad872 --- /dev/null +++ b/kaddressbook/kcmconfigs/ldapoptionswidget.cpp @@ -0,0 +1,303 @@ +/* + This file is part of KAddressBook. + Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> + + 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. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. +*/ + +#include <qgroupbox.h> +#include <qheader.h> +#include <qlabel.h> +#include <qlayout.h> +#include <qpushbutton.h> +#include <qtoolbutton.h> +#include <qstring.h> + +#include <kapplication.h> +#include <kbuttonbox.h> +#include <kconfig.h> +#include <klistview.h> +#include <klocale.h> + +#include "addhostdialog.h" +#include "ldapoptionswidget.h" +#include <qvgroupbox.h> +#include <qhbox.h> +#include <qvbox.h> +#include <kiconloader.h> + +class LDAPItem : public QCheckListItem +{ + public: + LDAPItem( QListView *parent, const KPIM::LdapServer &server, bool isActive = false ) + : QCheckListItem( parent, parent->lastItem(), QString::null, QCheckListItem::CheckBox ), + mIsActive( isActive ) + { + setServer( server ); + } + + void setServer( const KPIM::LdapServer &server ) + { + mServer = server; + + setText( 0, mServer.host() ); + } + + const KPIM::LdapServer &server() const { return mServer; } + + void setIsActive( bool isActive ) { mIsActive = isActive; } + bool isActive() const { return mIsActive; } + + private: + KPIM::LdapServer mServer; + bool mIsActive; +}; + +LDAPOptionsWidget::LDAPOptionsWidget( QWidget* parent, const char* name ) + : QWidget( parent, name ) +{ + initGUI(); + + mHostListView->setSorting( -1 ); + mHostListView->setAllColumnsShowFocus( true ); + mHostListView->setFullWidth( true ); + mHostListView->addColumn( QString::null ); + mHostListView->header()->hide(); + + connect( mHostListView, SIGNAL( selectionChanged( QListViewItem* ) ), + SLOT( slotSelectionChanged( QListViewItem* ) ) ); + connect( mHostListView, SIGNAL(doubleClicked( QListViewItem *, const QPoint &, int )), this, SLOT(slotEditHost())); + connect( mHostListView, SIGNAL( clicked( QListViewItem* ) ), + SLOT( slotItemClicked( QListViewItem* ) ) ); + + connect( mUpButton, SIGNAL( clicked() ), this, SLOT( slotMoveUp() ) ); + connect( mDownButton, SIGNAL( clicked() ), this, SLOT( slotMoveDown() ) ); +} + +LDAPOptionsWidget::~LDAPOptionsWidget() +{ +} + +void LDAPOptionsWidget::slotSelectionChanged( QListViewItem *item ) +{ + bool state = ( item != 0 ); + mEditButton->setEnabled( state ); + mRemoveButton->setEnabled( state ); + mDownButton->setEnabled( item && item->itemBelow() ); + mUpButton->setEnabled( item && item->itemAbove() ); +} + +void LDAPOptionsWidget::slotItemClicked( QListViewItem *item ) +{ + LDAPItem *ldapItem = dynamic_cast<LDAPItem*>( item ); + if ( !ldapItem ) + return; + + if ( ldapItem->isOn() != ldapItem->isActive() ) { + emit changed( true ); + ldapItem->setIsActive( ldapItem->isOn() ); + } +} + +void LDAPOptionsWidget::slotAddHost() +{ + KPIM::LdapServer server; + AddHostDialog dlg( &server, this ); + + if ( dlg.exec() && !server.host().isEmpty() ) { + new LDAPItem( mHostListView, server ); + + emit changed( true ); + } +} + +void LDAPOptionsWidget::slotEditHost() +{ + LDAPItem *item = dynamic_cast<LDAPItem*>( mHostListView->currentItem() ); + if ( !item ) + return; + + KPIM::LdapServer server = item->server(); + AddHostDialog dlg( &server, this ); + dlg.setCaption( i18n( "Edit Host" ) ); + + if ( dlg.exec() && !server.host().isEmpty() ) { + item->setServer( server ); + + emit changed( true ); + } +} + +void LDAPOptionsWidget::slotRemoveHost() +{ + QListViewItem *item = mHostListView->currentItem(); + if ( !item ) + return; + + mHostListView->takeItem( item ); + delete item; + + slotSelectionChanged( mHostListView->currentItem() ); + + emit changed( true ); +} + +static void swapItems( LDAPItem *item, LDAPItem *other ) +{ + KPIM::LdapServer server = item->server(); + bool isActive = item->isActive(); + item->setServer( other->server() ); + item->setIsActive( other->isActive() ); + item->setOn( other->isActive() ); + other->setServer( server ); + other->setIsActive( isActive ); + other->setOn( isActive ); +} + +void LDAPOptionsWidget::slotMoveUp() +{ + LDAPItem *item = static_cast<LDAPItem *>( mHostListView->selectedItem() ); + if ( !item ) return; + LDAPItem *above = static_cast<LDAPItem *>( item->itemAbove() ); + if ( !above ) return; + swapItems( item, above ); + mHostListView->setCurrentItem( above ); + mHostListView->setSelected( above, true ); + emit changed( true ); +} + +void LDAPOptionsWidget::slotMoveDown() +{ + LDAPItem *item = static_cast<LDAPItem *>( mHostListView->selectedItem() ); + if ( !item ) return; + LDAPItem *below = static_cast<LDAPItem *>( item->itemBelow() ); + if ( !below ) return; + swapItems( item, below ); + mHostListView->setCurrentItem( below ); + mHostListView->setSelected( below, true ); + emit changed( true ); +} + +void LDAPOptionsWidget::restoreSettings() +{ + mHostListView->clear(); + KConfig *config = KPIM::LdapSearch::config(); + KConfigGroupSaver saver( config, "LDAP" ); + + QString host; + + uint count = config->readUnsignedNumEntry( "NumSelectedHosts"); + for ( uint i = 0; i < count; ++i ) { + KPIM::LdapServer server; + KPIM::LdapSearch::readConfig( server, config, i, true ); + LDAPItem *item = new LDAPItem( mHostListView, server, true ); + item->setOn( true ); + } + + count = config->readUnsignedNumEntry( "NumHosts" ); + for ( uint i = 0; i < count; ++i ) { + KPIM::LdapServer server; + KPIM::LdapSearch::readConfig( server, config, i, false ); + new LDAPItem( mHostListView, server ); + } + + emit changed( false ); +} + +void LDAPOptionsWidget::saveSettings() +{ + KConfig *config = KPIM::LdapSearch::config(); + config->deleteGroup( "LDAP" ); + + KConfigGroupSaver saver( config, "LDAP" ); + + uint selected = 0; uint unselected = 0; + QListViewItemIterator it( mHostListView ); + for ( ; it.current(); ++it ) { + LDAPItem *item = dynamic_cast<LDAPItem*>( it.current() ); + if ( !item ) + continue; + + KPIM::LdapServer server = item->server(); + if ( item->isOn() ) { + KPIM::LdapSearch::writeConfig( server, config, selected, true ); + selected++; + } else { + KPIM::LdapSearch::writeConfig( server, config, unselected, false ); + unselected++; + } + } + + config->writeEntry( "NumSelectedHosts", selected ); + config->writeEntry( "NumHosts", unselected ); + config->sync(); + + emit changed( false ); +} + +void LDAPOptionsWidget::defaults() +{ + // add default configuration here +} + +void LDAPOptionsWidget::initGUI() +{ + QVBoxLayout *layout = new QVBoxLayout( this, 0, KDialog::spacingHint() ); + + QVGroupBox *groupBox = new QVGroupBox( i18n( "LDAP Servers" ), this ); + groupBox->setInsideSpacing( KDialog::spacingHint() ); + groupBox->setInsideMargin( KDialog::marginHint() ); + + // Contents of the QVGroupBox: label and hbox + /*QLabel *label =*/ new QLabel( i18n( "Check all servers that should be used:" ), groupBox ); + + QHBox* hBox = new QHBox( groupBox ); + hBox->setSpacing( 6 ); + // Contents of the hbox: listview and up/down buttons on the right (vbox) + mHostListView = new KListView( hBox ); + + QVBox* upDownBox = new QVBox( hBox ); + upDownBox->setSpacing( 6 ); + mUpButton = new QToolButton( upDownBox, "mUpButton" ); + mUpButton->setIconSet( BarIconSet( "up", KIcon::SizeSmall ) ); + mUpButton->setEnabled( false ); // b/c no item is selected yet + + mDownButton = new QToolButton( upDownBox, "mDownButton" ); + mDownButton->setIconSet( BarIconSet( "down", KIcon::SizeSmall ) ); + mDownButton->setEnabled( false ); // b/c no item is selected yet + + QWidget* spacer = new QWidget( upDownBox ); + upDownBox->setStretchFactor( spacer, 100 ); + + layout->addWidget( groupBox ); + + KButtonBox *buttons = new KButtonBox( this ); + buttons->addButton( i18n( "&Add Host..." ), this, SLOT( slotAddHost() ) ); + mEditButton = buttons->addButton( i18n( "&Edit Host..." ), this, SLOT( slotEditHost() ) ); + mEditButton->setEnabled( false ); + mRemoveButton = buttons->addButton( i18n( "&Remove Host" ), this, SLOT( slotRemoveHost() ) ); + mRemoveButton->setEnabled( false ); + buttons->layout(); + + layout->addWidget( buttons ); + + resize( QSize( 460, 300 ).expandedTo( sizeHint() ) ); +} + +#include "ldapoptionswidget.moc" diff --git a/kaddressbook/kcmconfigs/ldapoptionswidget.h b/kaddressbook/kcmconfigs/ldapoptionswidget.h new file mode 100644 index 000000000..c63b96dd7 --- /dev/null +++ b/kaddressbook/kcmconfigs/ldapoptionswidget.h @@ -0,0 +1,71 @@ +/* + This file is part of KAddressBook. + Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> + + 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. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. +*/ + +#ifndef LDAPOPTIONSWIDGET_H +#define LDAPOPTIONSWIDGET_H + +#include <qwidget.h> + +class QToolButton; +class KListView; +class QListViewItem; +class QPushButton; + +class LDAPOptionsWidget : public QWidget +{ + Q_OBJECT + + public: + LDAPOptionsWidget( QWidget* parent = 0, const char* name = 0 ); + ~LDAPOptionsWidget(); + + void restoreSettings(); + void saveSettings(); + void defaults(); + + signals: + void changed( bool ); + + private slots: + void slotAddHost(); + void slotEditHost(); + void slotRemoveHost(); + void slotSelectionChanged( QListViewItem* ); + void slotItemClicked( QListViewItem* ); + void slotMoveUp(); + void slotMoveDown(); + + private: + void initGUI(); + + KListView* mHostListView; + + QPushButton* mAddButton; + QPushButton* mEditButton; + QPushButton* mRemoveButton; + + QToolButton* mUpButton; + QToolButton* mDownButton; +}; + +#endif |