-rw-r--r-- | kaddressbook/kabprefs.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp index dded2bf..9270a7d 100644 --- a/kaddressbook/kabprefs.cpp +++ b/kaddressbook/kabprefs.cpp | |||
@@ -1,133 +1,135 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> | 3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | //US#ifdef KAB_EMBEDDED | 24 | //US#ifdef KAB_EMBEDDED |
25 | //#include <qstring.h> | 25 | //#include <qstring.h> |
26 | //#endif //KAB_EMBEDDED | 26 | //#endif //KAB_EMBEDDED |
27 | 27 | ||
28 | 28 | ||
29 | #include <kconfig.h> | 29 | #include <kconfig.h> |
30 | #include <klocale.h> | 30 | #include <klocale.h> |
31 | #include <kstaticdeleter.h> | 31 | #include <kstaticdeleter.h> |
32 | //US#include <kdebug.h> // defines kdDebug() | 32 | //US#include <kdebug.h> // defines kdDebug() |
33 | 33 | ||
34 | #include "kabprefs.h" | 34 | #include "kabprefs.h" |
35 | 35 | ||
36 | KABPrefs *KABPrefs::sInstance = 0; | 36 | KABPrefs *KABPrefs::sInstance = 0; |
37 | static KStaticDeleter<KABPrefs> staticDeleter; | 37 | static KStaticDeleter<KABPrefs> staticDeleter; |
38 | 38 | ||
39 | KABPrefs::KABPrefs() | 39 | KABPrefs::KABPrefs() |
40 | : KPimPrefs("kaddressbookrc") | 40 | : KPimPrefs("kaddressbookrc") |
41 | { | 41 | { |
42 | mDetailsFont = QFont("helvetica",12); | ||
42 | KPrefs::setCurrentGroup( "Views" ); | 43 | KPrefs::setCurrentGroup( "Views" ); |
43 | addItemBool( "HonorSingleClick", &mHonorSingleClick, false ); | 44 | addItemBool( "HonorSingleClick", &mHonorSingleClick, false ); |
44 | 45 | ||
45 | KPrefs::setCurrentGroup( "General" ); | 46 | KPrefs::setCurrentGroup( "General" ); |
46 | addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true ); | 47 | addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true ); |
47 | addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 ); | 48 | addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 ); |
48 | 49 | ||
49 | #ifdef KAB_EMBEDDED | 50 | #ifdef KAB_EMBEDDED |
50 | addItemBool("AskForQuit",&mAskForQuit,true); | 51 | addItemBool("AskForQuit",&mAskForQuit,true); |
51 | addItemBool("ToolBarHor",&mToolBarHor, true ); | 52 | addItemBool("ToolBarHor",&mToolBarHor, true ); |
52 | addItemBool("ToolBarUp",&mToolBarUp, false ); | 53 | addItemBool("ToolBarUp",&mToolBarUp, false ); |
53 | addItemBool("SearchWithReturn",&mSearchWithReturn, true ); | 54 | addItemBool("SearchWithReturn",&mSearchWithReturn, true ); |
55 | addItemFont("DetailsFont",&mDetailsFont); | ||
54 | 56 | ||
55 | 57 | ||
56 | #endif //KAB_EMBEDDED | 58 | #endif //KAB_EMBEDDED |
57 | 59 | ||
58 | KPrefs::setCurrentGroup( "MainWindow" ); | 60 | KPrefs::setCurrentGroup( "MainWindow" ); |
59 | addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false ); | 61 | addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false ); |
60 | addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true ); | 62 | addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true ); |
61 | addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter ); | 63 | addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter ); |
62 | addItemIntList( "DetailsSplitter", &mDetailsSplitter ); | 64 | addItemIntList( "DetailsSplitter", &mDetailsSplitter ); |
63 | addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true ); | 65 | addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true ); |
64 | 66 | ||
65 | 67 | ||
66 | KPrefs::setCurrentGroup( "Extensions_General" ); | 68 | KPrefs::setCurrentGroup( "Extensions_General" ); |
67 | QStringList defaultExtensions; | 69 | QStringList defaultExtensions; |
68 | defaultExtensions << "merge"; | 70 | defaultExtensions << "merge"; |
69 | defaultExtensions << "distribution_list_editor"; | 71 | defaultExtensions << "distribution_list_editor"; |
70 | addItemInt( "CurrentExtension", &mCurrentExtension, 0 ); | 72 | addItemInt( "CurrentExtension", &mCurrentExtension, 0 ); |
71 | addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions ); | 73 | addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions ); |
72 | 74 | ||
73 | KPrefs::setCurrentGroup( "Views" ); | 75 | KPrefs::setCurrentGroup( "Views" ); |
74 | QString defaultView = i18n( "Default Table View" ); | 76 | QString defaultView = i18n( "Default Table View" ); |
75 | addItemString( "CurrentView", &mCurrentView, defaultView ); | 77 | addItemString( "CurrentView", &mCurrentView, defaultView ); |
76 | addItemStringList( "ViewNames", &mViewNames, defaultView ); | 78 | addItemStringList( "ViewNames", &mViewNames, defaultView ); |
77 | 79 | ||
78 | KPrefs::setCurrentGroup( "Filters" ); | 80 | KPrefs::setCurrentGroup( "Filters" ); |
79 | addItemInt( "CurrentFilter", &mCurrentFilter, 0 ); | 81 | addItemInt( "CurrentFilter", &mCurrentFilter, 0 ); |
80 | 82 | ||
81 | } | 83 | } |
82 | 84 | ||
83 | KABPrefs::~KABPrefs() | 85 | KABPrefs::~KABPrefs() |
84 | { | 86 | { |
85 | //qDebug("KABPrefs::~KABPrefs() "); | 87 | //qDebug("KABPrefs::~KABPrefs() "); |
86 | } | 88 | } |
87 | 89 | ||
88 | KABPrefs *KABPrefs::instance() | 90 | KABPrefs *KABPrefs::instance() |
89 | { | 91 | { |
90 | if ( !sInstance ) { | 92 | if ( !sInstance ) { |
91 | #ifdef KAB_EMBEDDED | 93 | #ifdef KAB_EMBEDDED |
92 | sInstance = staticDeleter.setObject( new KABPrefs() ); | 94 | sInstance = staticDeleter.setObject( new KABPrefs() ); |
93 | #else //KAB_EMBEDDED | 95 | #else //KAB_EMBEDDED |
94 | //US the following line has changed ???. Why | 96 | //US the following line has changed ???. Why |
95 | staticDeleter.setObject( sInstance, new KABPrefs() ); | 97 | staticDeleter.setObject( sInstance, new KABPrefs() ); |
96 | #endif //KAB_EMBEDDED | 98 | #endif //KAB_EMBEDDED |
97 | sInstance->readConfig(); | 99 | sInstance->readConfig(); |
98 | } | 100 | } |
99 | 101 | ||
100 | return sInstance; | 102 | return sInstance; |
101 | } | 103 | } |
102 | 104 | ||
103 | void KABPrefs::setCategoryDefaults() | 105 | void KABPrefs::setCategoryDefaults() |
104 | { | 106 | { |
105 | mCustomCategories.clear(); | 107 | mCustomCategories.clear(); |
106 | 108 | ||
107 | mCustomCategories << i18n( "Business" ) << i18n( "Family" ) << i18n( "School" ) | 109 | mCustomCategories << i18n( "Business" ) << i18n( "Family" ) << i18n( "School" ) |
108 | << i18n( "Customer" ) << i18n( "Friend" ); | 110 | << i18n( "Customer" ) << i18n( "Friend" ); |
109 | } | 111 | } |
110 | 112 | ||
111 | // US introduce a nonconst way to return the config object. | 113 | // US introduce a nonconst way to return the config object. |
112 | KConfig* KABPrefs::getConfig() | 114 | KConfig* KABPrefs::getConfig() |
113 | { | 115 | { |
114 | return config(); | 116 | return config(); |
115 | } | 117 | } |
116 | 118 | ||
117 | 119 | ||
118 | /*US | 120 | /*US |
119 | void KABPrefs::usrSetDefaults() | 121 | void KABPrefs::usrSetDefaults() |
120 | { | 122 | { |
121 | KPimPrefs::usrSetDefaults(); | 123 | KPimPrefs::usrSetDefaults(); |
122 | } | 124 | } |
123 | 125 | ||
124 | void KABPrefs::usrReadConfig() | 126 | void KABPrefs::usrReadConfig() |
125 | { | 127 | { |
126 | KPimPrefs::usrReadConfig(); | 128 | KPimPrefs::usrReadConfig(); |
127 | } | 129 | } |
128 | 130 | ||
129 | void KABPrefs::usrWriteConfig() | 131 | void KABPrefs::usrWriteConfig() |
130 | { | 132 | { |
131 | KPimPrefs::usrWriteConfig(); | 133 | KPimPrefs::usrWriteConfig(); |
132 | } | 134 | } |
133 | */ | 135 | */ |