summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/details/detailsviewcontainer.cpp3
-rw-r--r--kaddressbook/details/look_html.cpp3
-rw-r--r--kaddressbook/kabprefs.cpp2
-rw-r--r--kaddressbook/kabprefs.h1
-rw-r--r--kaddressbook/kcmconfigs/kabconfigwidget.cpp13
5 files changed, 19 insertions, 3 deletions
diff --git a/kaddressbook/details/detailsviewcontainer.cpp b/kaddressbook/details/detailsviewcontainer.cpp
index a42499f..ceffc77 100644
--- a/kaddressbook/details/detailsviewcontainer.cpp
+++ b/kaddressbook/details/detailsviewcontainer.cpp
@@ -95,51 +95,48 @@ void ViewContainer::registerLooks()
if ( !mLookFactories.isEmpty() )
slotStyleSelected( 0 );
}
void ViewContainer::slotStyleSelected( int index )
{
#ifndef KAB_EMBEDDED
KConfig *config = kapp->config();
#else //KAB_EMBEDDED
//US I hope I got the same config object as above expected.
KConfig *config = KABPrefs::instance()->getConfig();
#endif //KAB_EMBEDDED
KABC::Addressee addr;
if ( index >= 0 && index < mStyleCombo->count() ) {
if ( mCurrentLook != 0 ) {
mCurrentLook->saveSettings( config );
addr = mCurrentLook->addressee();
delete mCurrentLook;
mCurrentLook = 0;
}
KABLookFactory *factory = mLookFactories.at( index );
- kdDebug(5720) << "ViewContainer::slotStyleSelected: "
- << "creating look "
- << factory->description() << endl;
mCurrentLook = factory->create();
mDetailsStack->raiseWidget( mCurrentLook );
connect( mCurrentLook, SIGNAL( sendEmail( const QString& ) ), this,
SIGNAL( sendEmail( const QString& ) ) );
connect( mCurrentLook, SIGNAL( browse( const QString& ) ), this,
SIGNAL( browse( const QString& ) ) );
}
mCurrentLook->restoreSettings( config );
mCurrentLook->setAddressee( addr );
}
void ViewContainer::refreshView()
{
if ( mCurrentLook ) {
mCurrentLook->setAddressee( mCurrentAddressee );
}
}
void ViewContainer::setAddressee( const KABC::Addressee& addressee )
{
if ( mCurrentLook != 0 ) {
if ( addressee == mCurrentAddressee )
diff --git a/kaddressbook/details/look_html.cpp b/kaddressbook/details/look_html.cpp
index 63364a7..64987b8 100644
--- a/kaddressbook/details/look_html.cpp
+++ b/kaddressbook/details/look_html.cpp
@@ -4,42 +4,45 @@
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,
without including the source code for Qt in the source distribution.
*/
#include <addresseeview.h>
#include "look_html.h"
#include <qscrollview.h>
+#include "kabprefs.h"
KABHtmlView::KABHtmlView( QWidget *parent, const char *name )
: KABBasicLook( parent, name )
{
mView = new KPIM::AddresseeView( this );
+ mView->setFont( KABPrefs::instance()->mDetailsFont );
}
KABHtmlView::~KABHtmlView()
{
}
void KABHtmlView::setAddressee( const KABC::Addressee &addr )
{
+ mView->setFont( KABPrefs::instance()->mDetailsFont );
mView->setAddressee( addr );
}
#ifndef KAB_EMBEDDED
#include "look_html.moc"
#endif //KAB_EMBEDDED
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp
index dded2bf..9270a7d 100644
--- a/kaddressbook/kabprefs.cpp
+++ b/kaddressbook/kabprefs.cpp
@@ -18,60 +18,62 @@
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.
*/
//US#ifdef KAB_EMBEDDED
//#include <qstring.h>
//#endif //KAB_EMBEDDED
#include <kconfig.h>
#include <klocale.h>
#include <kstaticdeleter.h>
//US#include <kdebug.h> // defines kdDebug()
#include "kabprefs.h"
KABPrefs *KABPrefs::sInstance = 0;
static KStaticDeleter<KABPrefs> staticDeleter;
KABPrefs::KABPrefs()
: KPimPrefs("kaddressbookrc")
{
+ mDetailsFont = QFont("helvetica",12);
KPrefs::setCurrentGroup( "Views" );
addItemBool( "HonorSingleClick", &mHonorSingleClick, false );
KPrefs::setCurrentGroup( "General" );
addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true );
addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 );
#ifdef KAB_EMBEDDED
addItemBool("AskForQuit",&mAskForQuit,true);
addItemBool("ToolBarHor",&mToolBarHor, true );
addItemBool("ToolBarUp",&mToolBarUp, false );
addItemBool("SearchWithReturn",&mSearchWithReturn, true );
+ addItemFont("DetailsFont",&mDetailsFont);
#endif //KAB_EMBEDDED
KPrefs::setCurrentGroup( "MainWindow" );
addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false );
addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true );
addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter );
addItemIntList( "DetailsSplitter", &mDetailsSplitter );
addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true );
KPrefs::setCurrentGroup( "Extensions_General" );
QStringList defaultExtensions;
defaultExtensions << "merge";
defaultExtensions << "distribution_list_editor";
addItemInt( "CurrentExtension", &mCurrentExtension, 0 );
addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions );
KPrefs::setCurrentGroup( "Views" );
QString defaultView = i18n( "Default Table View" );
addItemString( "CurrentView", &mCurrentView, defaultView );
addItemStringList( "ViewNames", &mViewNames, defaultView );
diff --git a/kaddressbook/kabprefs.h b/kaddressbook/kabprefs.h
index e4f359c..4a3b6e2 100644
--- a/kaddressbook/kabprefs.h
+++ b/kaddressbook/kabprefs.h
@@ -61,32 +61,33 @@ class KABPrefs : public KPimPrefs
// void usrWriteConfig();
#endif //KAB_EMBEDDED
// GUI
bool mJumpButtonBarVisible;
bool mDetailsPageVisible;
bool mMultipleViewsAtOnce;
bool mSearchWithReturn;
QValueList<int> mExtensionsSplitter;
QValueList<int> mDetailsSplitter;
// Extensions stuff
int mCurrentExtension;
QStringList mActiveExtensions;
// Views stuff
QString mCurrentView;
QStringList mViewNames;
// Filter
int mCurrentFilter;
void setCategoryDefaults();
+ QFont mDetailsFont;
private:
KABPrefs();
static KABPrefs *sInstance;
};
#endif
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
index e970c3d..c8b68c7 100644
--- a/kaddressbook/kcmconfigs/kabconfigwidget.cpp
+++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
@@ -77,48 +77,61 @@ class ExtensionItem : public QCheckListItem
#ifndef KAB_EMBEDDED
KService::Ptr mPtr;
#else //KAB_EMBEDDED
ExtensionFactory* mFactory;
QString mName;
QString mComment;
#endif //KAB_EMBEDDED
};
KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *name )
: KPrefsWidget( prefs, 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::marginHintSmall(),
KDialog::spacingHintSmall() );
+
+ QWidget *hBox = new QWidget( generalPage, "qhbox" );
+ QHBoxLayout *hboxLayout = new QHBoxLayout( hBox);
+ KPrefsWidFont *detailsFont =
+ addWidFont(i18n("phone:123"),i18n("Details view font"),
+ &(KABPrefs::instance()->mDetailsFont),hBox);
+ hboxLayout->addWidget(detailsFont->label());
+ hboxLayout->addWidget(detailsFont->preview());
+ hboxLayout->addWidget(detailsFont->button());
+ hboxLayout->setMargin(KDialog::marginHintSmall() );
+ hboxLayout->setSpacing(KDialog::spacingHintSmall());
+ layout->addWidget( hBox );
+
//general groupbox
QVBox *vBox = new QVBox( generalPage, "qvbox" );
QVBoxLayout *boxLayout = new QVBoxLayout( vBox->layout(), -1, "qvboxlayout" );
boxLayout->setAlignment( Qt::AlignTop );
boxLayout->setMargin(KDialog::marginHintSmall() );
vBox->layout()->setMargin(KDialog::marginHintSmall()) ;
vBox->layout()->setSpacing(KDialog::spacingHintSmall());
boxLayout->setSpacing( KDialog::spacingHintSmall() );
mSearchReturnBox = new QCheckBox( i18n( "Search only after <return> key pressed" ), vBox, "mreturn" );
boxLayout->addWidget( mSearchReturnBox );
mViewsSingleClickBox = new QCheckBox( i18n( "Honor KDE single click" ), vBox, "msingle" );
boxLayout->addWidget( mViewsSingleClickBox );
mNameParsing = new QCheckBox( i18n( "Automatic name parsing for new addressees" ), vBox, "mparse" );
boxLayout->addWidget( mNameParsing );
mMultipleViewsAtOnce = new QCheckBox( i18n( "Display List and Details at once (restart)" ), vBox, "mdisplay" );
boxLayout->addWidget( mMultipleViewsAtOnce );
mAskForQuit = new QCheckBox( i18n( "Ask for quit when closing Ka/Pi" ), vBox, "mquit" );
boxLayout->addWidget( mAskForQuit );
layout->addWidget( vBox );