author | zautrix <zautrix> | 2004-10-13 02:34:50 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-13 02:34:50 (UTC) |
commit | e7833b80c28e38bfe6316ee5fce150635cdebe03 (patch) (side-by-side diff) | |
tree | bc52de370428ef240e370da516077e883283d398 | |
parent | d56ca1073ce493afdeb54e33425638f7147d4bca (diff) | |
download | kdepimpi-e7833b80c28e38bfe6316ee5fce150635cdebe03.zip kdepimpi-e7833b80c28e38bfe6316ee5fce150635cdebe03.tar.gz kdepimpi-e7833b80c28e38bfe6316ee5fce150635cdebe03.tar.bz2 |
added font setting in KA
-rw-r--r-- | kaddressbook/details/detailsviewcontainer.cpp | 3 | ||||
-rw-r--r-- | kaddressbook/details/look_html.cpp | 3 | ||||
-rw-r--r-- | kaddressbook/kabprefs.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/kabprefs.h | 1 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kabconfigwidget.cpp | 13 |
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 @@ -87,67 +87,64 @@ void ViewContainer::registerLooks() { mLookFactories.append( new KABHtmlViewFactory( mDetailsStack ) ); // mLookFactories.append( new KABDetailedViewFactory( mDetailsStack ) ); mStyleCombo->clear(); for ( uint i = 0; i < mLookFactories.count(); ++i ) mStyleCombo->insertItem( mLookFactories.at( i )->description() ); 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 ) return; else { mCurrentAddressee = addressee; mCurrentLook->setAddressee( 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 @@ -1,45 +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., 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 @@ -10,76 +10,78 @@ 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. */ //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 ); KPrefs::setCurrentGroup( "Filters" ); addItemInt( "CurrentFilter", &mCurrentFilter, 0 ); } KABPrefs::~KABPrefs() { //qDebug("KABPrefs::~KABPrefs() "); diff --git a/kaddressbook/kabprefs.h b/kaddressbook/kabprefs.h index e4f359c..4a3b6e2 100644 --- a/kaddressbook/kabprefs.h +++ b/kaddressbook/kabprefs.h @@ -53,40 +53,41 @@ class KABPrefs : public KPimPrefs /** Set preferences to default values */ // void usrSetDefaults(); /** Read preferences from config file */ // void usrReadConfig(); /** Write preferences to config file */ // 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 @@ -69,64 +69,77 @@ class ExtensionItem : public QCheckListItem #endif //KAB_EMBEDDED bool configWidgetAvailable() const; ExtensionFactory *factory() const; virtual QString text( int column ) const; private: #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 ); tabWidget->addTab( generalPage, i18n( "General" ) ); // Extension page QWidget *extensionPage = new QWidget( this ); QVBoxLayout *extensionLayout = new QVBoxLayout( extensionPage, KDialog::marginHintSmall(), KDialog::spacingHintSmall() ); //extensions groupbox |