summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Side-by-side diff
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp16
-rw-r--r--kaddressbook/kabprefs.cpp2
-rw-r--r--kaddressbook/kabprefs.h10
-rw-r--r--kaddressbook/kaddressbook.pro2
-rw-r--r--kaddressbook/kaddressbookE.pro2
-rw-r--r--kaddressbook/kcmconfigs/kabconfigwidget.cpp110
-rw-r--r--kaddressbook/kcmconfigs/kabconfigwidget.h10
-rw-r--r--kaddressbook/kcmconfigs/kcmkabconfig.cpp60
-rw-r--r--kaddressbook/kcmconfigs/kcmkabconfig.h50
9 files changed, 78 insertions, 184 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 2494aa2..1667400 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -71,29 +71,29 @@
#include <qmenubar.h>
//#include <qtoolbar.h>
#include <qmessagebox.h>
#include <kdebug.h>
#include <kiconloader.h> // needed for SmallIcon
#include <kresources/kcmkresources.h>
#include <ktoolbar.h>
-#include <kcmkabconfig.h>
//#include <qlabel.h>
#ifdef Q_WS_QWS
#include <qtopia/services.h>
#include <qtopia/qcopenvelope_qws.h>
#endif
#include <qpe/ir.h>
#endif // KAB_EMBEDDED
-#include <kcmkabconfig.h>
+#include "kcmconfigs/kcmkabconfig.h"
+#include "kcmconfigs/kcmkdepimconfig.h"
#include <kresources/selectdialog.h>
#include <kmessagebox.h>
#include <picture.h>
#include <resource.h>
@@ -1192,19 +1192,25 @@ QString KABCore::getNameByPhone( const QString &phone )
qDebug("KABCore::getNameByPhone finsih method");
return "";
#endif //KAB_EMBEDDED
}
void KABCore::openConfigDialog()
{
- KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true );
+ KABPrefs* prefs = KABPrefs::instance();
+ KCMultiDialog* ConfigureDialog = new KCMultiDialog( prefs, "PIM", this ,"kabconfigdialog", true );
KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" );
ConfigureDialog->addModule(kabcfg );
+ KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Pim")) , "KCMKdeLibConfig" );
+ ConfigureDialog->addModule(kdelibcfg );
+
+
+
connect( ConfigureDialog, SIGNAL( applyClicked() ),
this, SLOT( configurationChanged() ) );
connect( ConfigureDialog, SIGNAL( okClicked() ),
this, SLOT( configurationChanged() ) );
saveSettings();
ConfigureDialog->showMaximized();
if ( ConfigureDialog->exec() )
KMessageBox::information( this, i18n("If you configured \nExtensions,\nplease restart!\n") );
@@ -1509,17 +1515,17 @@ void KABCore::initActions()
mActionBeamVCard = 0;
mActionBeam = 0;
#ifndef DESKTOP_VERSION
if ( Ir::supported() ) {
mActionBeamVCard = new KAction( i18n( "Beam selected v&Card(s)" ), "beam", 0, this,
SLOT( beamVCard() ), actionCollection(),
"kaddressbook_beam_vcard" );
-
+
mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this,
SLOT( beamMySelf() ), actionCollection(),
"kaddressbook_beam_myself" );
}
#endif
mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0,
this, SLOT( editContact2() ),
@@ -1616,17 +1622,17 @@ void KABCore::initActions()
//qDebug("KABCore::initActions() LDAP has to be implemented");
#endif //KAB_EMBEDDED
mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this,
SLOT( setWhoAmI() ), actionCollection(),
"set_personal" );
-
+
mActionCategories = new KAction( i18n( "Set Categories" ), 0, this,
SLOT( setCategories() ), actionCollection(),
"edit_set_categories" );
mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this,
SLOT( removeVoice() ), actionCollection(),
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp
index 8bd4b15..0c192dd 100644
--- a/kaddressbook/kabprefs.cpp
+++ b/kaddressbook/kabprefs.cpp
@@ -45,18 +45,16 @@ KABPrefs::KABPrefs()
KPrefs::setCurrentGroup( "General" );
addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true );
addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 );
#ifdef KAB_EMBEDDED
addItemBool("AskForQuit",&mAskForQuit,false);
addItemBool("ToolBarHor",&mToolBarHor, true );
addItemBool("ToolBarUp",&mToolBarUp, false );
- addItemInt( "EmailChannelType", &mEmailClient, OMPI );
- addItemString( "EmailChannelOther", &mEmailChannel, "" );
#endif //KAB_EMBEDDED
KPrefs::setCurrentGroup( "MainWindow" );
addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false );
addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true );
addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter );
addItemIntList( "DetailsSplitter", &mDetailsSplitter );
diff --git a/kaddressbook/kabprefs.h b/kaddressbook/kabprefs.h
index c81a9a9..8f149ac 100644
--- a/kaddressbook/kabprefs.h
+++ b/kaddressbook/kabprefs.h
@@ -32,39 +32,29 @@ class KConfig;
class KABPrefs : public KPimPrefs
{
public:
virtual ~KABPrefs();
static KABPrefs *instance();
- enum EMailClients {
- OMPI = 0,
- QTOPIA = 1,
- OPIE = 2,
- OTHER = 3
- };
-
-
// General
bool mHonorSingleClick;
bool mAutomaticNameParsing;
int mCurrentIncSearchField;
#ifdef KAB_EMBEDDED
// US introduce a nonconst way to return the config object.
KConfig* getConfig();
bool mToolBarHor;
bool mToolBarUp;
bool mAskForQuit;
- int mEmailClient;
- QString mEmailChannel;
/** Set preferences to default values */
// void usrSetDefaults();
/** Read preferences from config file */
// void usrReadConfig();
/** Write preferences to config file */
diff --git a/kaddressbook/kaddressbook.pro b/kaddressbook/kaddressbook.pro
index 0da5842..b57317f 100644
--- a/kaddressbook/kaddressbook.pro
+++ b/kaddressbook/kaddressbook.pro
@@ -1,17 +1,17 @@
TEMPLATE = app
CONFIG = qt warn_on
TARGET = kapi
DESTDIR= ../bin
include( ../variables.pri )
-INCLUDEPATH += . ./details ./features ./kcmconfigs ./xxport ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../ interfaces
+INCLUDEPATH += . ./details ./features ./xxport ../libkdepim ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../ interfaces
DEFINES += KAB_EMBEDDED KAB_NOSPLITTER DESKTOP_VERSION
unix : {
LIBS += ../bin/libmicrokdepim.so
LIBS += ../bin/libmicrokde.so
LIBS += ../bin/libmicrokabc.so
LIBS += ../bin/libmicrokcal.so
LIBS += -lldap
diff --git a/kaddressbook/kaddressbookE.pro b/kaddressbook/kaddressbookE.pro
index 95e6641..41f293d 100644
--- a/kaddressbook/kaddressbookE.pro
+++ b/kaddressbook/kaddressbookE.pro
@@ -5,17 +5,17 @@ CONFIG += qt warn_on
TARGET = kapi
OBJECTS_DIR = obj/$(PLATFORM)
MOC_DIR = moc/$(PLATFORM)
DESTDIR=$(QPEDIR)/bin
#LFLAGS += -Wl,-export-dynamic
-INCLUDEPATH += . ./details ./features ./kcmconfigs ./xxport ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../qtcompat ../ interfaces $(QPEDIR)/include
+INCLUDEPATH += . ./details ./features ./xxport ../libkdepim ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../qtcompat ../ interfaces $(QPEDIR)/include
DEFINES += KAB_EMBEDDED KAB_NOSPLITTER
#DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOKABC KORG_NOARCHIVE KORG_NOMAIL
#DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER
#DEFINES += KORG_NOLVALTERNATION
LIBS += -lmicrokdepim
#LIBS += -lmicrokcal
LIBS += -lmicrokde
LIBS += -lmicrokcal
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
index 1bac26f..b5309c0 100644
--- a/kaddressbook/kcmconfigs/kabconfigwidget.cpp
+++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
@@ -148,150 +148,56 @@ KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name )
tabWidget->addTab( generalPage, i18n( "General" ) );
// Addressee page
mAddresseeWidget = new AddresseeWidget( this );
tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) );
connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) );
- // mailclient page
- QWidget *mailclientPage = new QWidget( this );
- layout = new QVBoxLayout( mailclientPage, KDialog::marginHintSmall(),
- KDialog::spacingHintSmall() );
-
- groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), mailclientPage );
- boxLayout = new QVBoxLayout( groupBox->layout() );
- boxLayout->setAlignment( Qt::AlignTop );
-// boxLayout->setMargin(KDialog::marginHintSmall() );
-// groupBox->layout()->setMargin(KDialog::marginHintSmall()) ;
-// groupBox->layout()->setSpacing(KDialog::spacingHintSmall());
-// boxLayout->setSpacing( KDialog::spacingHintSmall() );
-
- mEmailClient = new QComboBox( groupBox );
- mEmailClient->insertItem( i18n("OM/Pi"), KABPrefs::OMPI );
- mEmailClient->insertItem( i18n("Qtopia mail"), KABPrefs::QTOPIA );
- mEmailClient->insertItem( i18n("Opie mail"), KABPrefs::OPIE );
- mEmailClient->insertItem( i18n("Other"), KABPrefs::OTHER );
- boxLayout->addWidget( mEmailClient );
-
- connect( mEmailClient, SIGNAL( activated( int ) ),
- this, SLOT (emailclient_changed( int ) ) );
-
- QLabel* lab = new QLabel( i18n("Channel:"), groupBox);
- boxLayout->addWidget( lab );
- mEmailChannel = new QLineEdit(groupBox);
- mEmailChannel->setReadOnly(true);
- boxLayout->addWidget( mEmailChannel );
-
- layout->addWidget( groupBox );
- tabWidget->addTab( mailclientPage, i18n( "Mail" ) );
-
-
-
}
-
-void KABConfigWidget::emailclient_changed( int newClient )
+void KABConfigWidget::restoreSettings(KABPrefs* prefs)
{
- if (newClient == KABPrefs::OTHER)
- mEmailChannel->setReadOnly(false);
- else
- mEmailChannel->setReadOnly(true);
-
- QString opiepath = QString::fromLatin1( getenv("OPIEDIR") );
- QString qtopiapath = QString::fromLatin1( getenv("QPEDIR") );
-
- if (opiepath.isEmpty())
- opiepath = qtopiapath;
-
- QString text = mEmailChannel->text();
-
- if (newClient == KABPrefs::OPIE)
- {
- if ( QFile::exists( opiepath + "/bin/opiemail" ))
- text = "QPE/Application/opiemail";
- else
- text = "FILENOTFOUND: " + opiepath + "/bin/opiemail";
- }
- else if (newClient == KABPrefs::QTOPIA)
- {
- if ( QFile::exists( qtopiapath + "/bin/qtmail" ))
- text = "QPE/Application/qtmail";
- else
- text = "FILENOTFOUND: " + qtopiapath + "/bin/qtmail";
+//US prefs was KABPrefs::instance() before
- }
- else if (newClient == KABPrefs::OMPI)
- {
- if ( QFile::exists( qtopiapath + "/bin/ompi" ))
- text = "QPE/Application/ompi";
- else if ( QFile::exists( opiepath + "/bin/ompi" ))
- text = "QPE/Application/ompi";
- else
- text = "FILENOTFOUND: " + qtopiapath + "/bin/ompi";
-
- }
- else
- {
- //do nothing if we choosed other
- }
-
- mEmailChannel->setText( text );
-
-
-}
-
-
-void KABConfigWidget::restoreSettings()
-{
bool blocked = signalsBlocked();
blockSignals( true );
- mNameParsing->setChecked( KABPrefs::instance()->mAutomaticNameParsing );
- mViewsSingleClickBox->setChecked( KABPrefs::instance()->mHonorSingleClick );
-
- mEmailChannel->setText( KABPrefs::instance()->mEmailChannel );
- mEmailClient->setCurrentItem(KABPrefs::instance()->mEmailClient);
+ mNameParsing->setChecked( prefs->mAutomaticNameParsing );
+ mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick );
mAddresseeWidget->restoreSettings();
restoreExtensionSettings();
blockSignals( blocked );
emit changed( false );
}
-void KABConfigWidget::saveSettings()
+void KABConfigWidget::saveSettings(KABPrefs* prefs)
{
- KABPrefs::instance()->mAutomaticNameParsing = mNameParsing->isChecked();
- KABPrefs::instance()->mHonorSingleClick = mViewsSingleClickBox->isChecked();
-
- KABPrefs::instance()->mEmailClient = mEmailClient->currentItem();
- KABPrefs::instance()->mEmailChannel = mEmailChannel->text();
+ prefs->mAutomaticNameParsing = mNameParsing->isChecked();
+ prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked();
mAddresseeWidget->saveSettings();
saveExtensionSettings();
KABPrefs::instance()->writeConfig();
emit changed( false );
}
-void KABConfigWidget::defaults()
+void KABConfigWidget::defaults(KABPrefs* prefs)
{
mNameParsing->setChecked( true );
mViewsSingleClickBox->setChecked( false );
- mEmailClient->setCurrentItem(KABPrefs::OMPI);
- emailclient_changed( KABPrefs::OMPI );
-
-
emit changed( true );
}
void KABConfigWidget::modified()
{
emit changed( true );
}
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.h b/kaddressbook/kcmconfigs/kabconfigwidget.h
index 9d1363b..8c0c436 100644
--- a/kaddressbook/kcmconfigs/kabconfigwidget.h
+++ b/kaddressbook/kcmconfigs/kabconfigwidget.h
@@ -27,52 +27,50 @@
#include <qwidget.h>
class QCheckBox;
class QListViewItem;
class QPushButton;
class QComboBox;
class QLineEdit;
class KListView;
+class KABPrefs;
class AddresseeWidget;
class KABConfigWidget : public QWidget
{
Q_OBJECT
public:
KABConfigWidget( QWidget *parent, const char *name = 0 );
- void restoreSettings();
- void saveSettings();
- void defaults();
+ void restoreSettings(KABPrefs* prefs);
+ void saveSettings(KABPrefs* prefs);
+ void defaults(KABPrefs* prefs);
signals:
void changed( bool );
public slots:
void modified();
private slots:
void configureExtension();
void selectionChanged( QListViewItem* );
void itemClicked( QListViewItem* );
- void emailclient_changed( int newClient );
private:
void restoreExtensionSettings();
void saveExtensionSettings();
KListView *mExtensionView;
QCheckBox *mNameParsing;
QCheckBox *mViewsSingleClickBox;
QPushButton *mConfigureButton;
- QComboBox* mEmailClient;
- QLineEdit* mEmailChannel;
AddresseeWidget *mAddresseeWidget;
};
#endif
diff --git a/kaddressbook/kcmconfigs/kcmkabconfig.cpp b/kaddressbook/kcmconfigs/kcmkabconfig.cpp
index a278042..26398f8 100644
--- a/kaddressbook/kcmconfigs/kcmkabconfig.cpp
+++ b/kaddressbook/kcmconfigs/kcmkabconfig.cpp
@@ -1,90 +1,92 @@
-/*
- This file is part of KAddressBook.
+/*
+ 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
- As a special exception, permission is given to link this program
- with any edition of Qt, and distribute the resulting executable,
+ 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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>
#ifndef KAB_EMBEDDED
#include <kaboutdata.h>
#endif //KAB_EMBEDDED
#include <kdebug.h>
-#include <klocale.h>
-#include <stdlib.h>
+//#include <klocale.h>
+//#include <stdlib.h>
#include "kabconfigwidget.h"
#include "kcmkabconfig.h"
+#include "kabprefs.h"
+#include "kprefs.h"
+
extern "C"
{
KCModule *create_kabconfig( QWidget *parent, const char * ) {
return new KCMKabConfig( parent, "kcmkabconfig" );
}
}
KCMKabConfig::KCMKabConfig( QWidget *parent, const char *name )
: KCModule( parent, name )
{
//abort();
QVBoxLayout *layout = new QVBoxLayout( this );
mConfigWidget = new KABConfigWidget( this, "mConfigWidget" );
layout->addWidget( mConfigWidget );
layout->setSpacing( 0 );
layout->setMargin( 0 );
-
+
connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) );
- load();
}
-void KCMKabConfig::load()
+void KCMKabConfig::load(KPrefs* prefs)
{
- mConfigWidget->restoreSettings();
+ mConfigWidget->restoreSettings((KABPrefs*)prefs);
}
-void KCMKabConfig::save()
+void KCMKabConfig::save(KPrefs* prefs)
{
- mConfigWidget->saveSettings();
+ mConfigWidget->saveSettings((KABPrefs*)prefs);
}
-void KCMKabConfig::defaults()
+void KCMKabConfig::defaults(KPrefs* prefs)
{
- mConfigWidget->defaults();
+ mConfigWidget->defaults((KABPrefs*)prefs);
}
#ifndef KAB_EMBEDDED
const KAboutData* KCMKabConfig::aboutData() const
{
KAboutData *about = new KAboutData( I18N_NOOP( "kcmkabconfig" ),
I18N_NOOP( "KAddressBook Configure Dialog" ),
0, 0, KAboutData::License_GPL,
I18N_NOOP( "(c), 2003 Tobias Koenig" ) );
about->addAuthor( "Tobias Koenig", 0, "tokoe@kde.org" );
return about;
-
+
}
#endif //KAB_EMBEDDED
#ifndef KAB_EMBEDDED
#include "kcmkabconfig.moc"
#endif //KAB_EMBEDDED
diff --git a/kaddressbook/kcmconfigs/kcmkabconfig.h b/kaddressbook/kcmconfigs/kcmkabconfig.h
index be345b8..b4858c1 100644
--- a/kaddressbook/kcmconfigs/kcmkabconfig.h
+++ b/kaddressbook/kcmconfigs/kcmkabconfig.h
@@ -1,53 +1,47 @@
-/*
- This file is part of KAddressBook.
+/*
+ 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
- As a special exception, permission is given to link this program
- with any edition of Qt, and distribute the resulting executable,
+ 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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;
-
-#ifndef KAB_EMBEDDED
-class KAboutData;
-#endif //KAB_EMBEDDED
+class KPrefs;
class KCMKabConfig : public KCModule
{
Q_OBJECT
public:
KCMKabConfig( QWidget *parent = 0, const char *name = 0 );
- virtual void load();
- virtual void save();
- virtual void defaults();
-#ifndef KAB_EMBEDDED
- virtual const KAboutData* aboutData() const;
-#endif //KAB_EMBEDDED
+ virtual void load(KPrefs* prefs);
+ virtual void save(KPrefs* prefs);
+ virtual void defaults(KPrefs* prefs);
private:
KABConfigWidget *mConfigWidget;
};
#endif