kabprefs.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <kconfig.h>
00025 #include <klocale.h>
00026 #include <kstaticdeleter.h>
00027
00028 #include "kabprefs.h"
00029
00030 KABPrefs *KABPrefs::sInstance = 0;
00031 static KStaticDeleter<KABPrefs> staticDeleter;
00032
00033 KABPrefs::KABPrefs()
00034 : KPimPrefs("kaddressbookrc")
00035 {
00036 KConfigSkeleton::setCurrentGroup( "Views" );
00037 addItemBool( "HonorSingleClick", mHonorSingleClick, false );
00038
00039 KConfigSkeleton::setCurrentGroup( "General" );
00040 addItemBool( "AutomaticNameParsing", mAutomaticNameParsing, true );
00041 addItemInt( "CurrentIncSearchField", mCurrentIncSearchField, 0 );
00042 addItemString( "PhoneHookApplication", mPhoneHookApplication, "" );
00043 addItemString( "FaxHookApplication", mFaxHookApplication,
00044 "kdeprintfax --phone %N" );
00045
00046 KConfigSkeleton::setCurrentGroup( "MainWindow" );
00047 addItemBool( "JumpButtonBarVisible", mJumpButtonBarVisible, false );
00048 addItemBool( "DetailsPageVisible", mDetailsPageVisible, true );
00049 addItemIntList( "ExtensionsSplitter", mExtensionsSplitter );
00050 addItemIntList( "DetailsSplitter", mDetailsSplitter );
00051
00052 KConfigSkeleton::setCurrentGroup( "Extensions_General" );
00053 QStringList defaultExtensions;
00054 defaultExtensions << "merge";
00055 defaultExtensions << "distribution_list_editor";
00056 addItemInt( "CurrentExtension", mCurrentExtension, 0 );
00057 addItemStringList( "ActiveExtensions", mActiveExtensions, defaultExtensions );
00058
00059 KConfigSkeleton::setCurrentGroup( "Views" );
00060 QString defaultView = i18n( "Default Table View" );
00061 addItemString( "CurrentView", mCurrentView, defaultView );
00062 addItemStringList( "ViewNames", mViewNames, defaultView );
00063
00064 KConfigSkeleton::setCurrentGroup( "Filters" );
00065 addItemInt( "CurrentFilter", mCurrentFilter, 0 );
00066 }
00067
00068 KABPrefs::~KABPrefs()
00069 {
00070 }
00071
00072 KABPrefs *KABPrefs::instance()
00073 {
00074 if ( !sInstance ) {
00075 staticDeleter.setObject( sInstance, new KABPrefs() );
00076 sInstance->readConfig();
00077 }
00078
00079 return sInstance;
00080 }
00081
00082 void KABPrefs::setCategoryDefaults()
00083 {
00084 mCustomCategories.clear();
00085
00086 mCustomCategories << i18n( "Business" ) << i18n( "Family" ) << i18n( "School" )
00087 << i18n( "Customer" ) << i18n( "Friend" );
00088 }
This file is part of the documentation for kaddressbook Library Version 3.2.2.