summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kabprefs.cpp
authorulf69 <ulf69>2004-09-02 23:07:29 (UTC)
committer ulf69 <ulf69>2004-09-02 23:07:29 (UTC)
commita2d8fcc8f1fcd64c01e41cb8ba31ae17a5ea5a8b (patch) (unidiff)
tree80ecec37a7aa38ece91ac77409bf9f504e8e009e /kaddressbook/kabprefs.cpp
parent436f0b8e6b73d7c3db1ac17da5ff245e6b12a18c (diff)
downloadkdepimpi-a2d8fcc8f1fcd64c01e41cb8ba31ae17a5ea5a8b.zip
kdepimpi-a2d8fcc8f1fcd64c01e41cb8ba31ae17a5ea5a8b.tar.gz
kdepimpi-a2d8fcc8f1fcd64c01e41cb8ba31ae17a5ea5a8b.tar.bz2
sourceforge 1014892, quit dialog now configurable
Diffstat (limited to 'kaddressbook/kabprefs.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabprefs.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp
index 03c5e76..2425158 100644
--- a/kaddressbook/kabprefs.cpp
+++ b/kaddressbook/kabprefs.cpp
@@ -1,130 +1,130 @@
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
36KABPrefs *KABPrefs::sInstance = 0; 36KABPrefs *KABPrefs::sInstance = 0;
37static KStaticDeleter<KABPrefs> staticDeleter; 37static KStaticDeleter<KABPrefs> staticDeleter;
38 38
39KABPrefs::KABPrefs() 39KABPrefs::KABPrefs()
40 : KPimPrefs("kaddressbookrc") 40 : KPimPrefs("kaddressbookrc")
41{ 41{
42 KPrefs::setCurrentGroup( "Views" ); 42 KPrefs::setCurrentGroup( "Views" );
43 addItemBool( "HonorSingleClick", &mHonorSingleClick, false ); 43 addItemBool( "HonorSingleClick", &mHonorSingleClick, false );
44 44
45 KPrefs::setCurrentGroup( "General" ); 45 KPrefs::setCurrentGroup( "General" );
46 addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true ); 46 addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true );
47 addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 ); 47 addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 );
48 48
49#ifdef KAB_EMBEDDED 49#ifdef KAB_EMBEDDED
50 addItemBool("AskForQuit",&mAskForQuit,false); 50 addItemBool("AskForQuit",&mAskForQuit,true);
51 addItemBool("ToolBarHor",&mToolBarHor, true ); 51 addItemBool("ToolBarHor",&mToolBarHor, true );
52 addItemBool("ToolBarUp",&mToolBarUp, false ); 52 addItemBool("ToolBarUp",&mToolBarUp, false );
53 53
54#endif //KAB_EMBEDDED 54#endif //KAB_EMBEDDED
55 55
56 KPrefs::setCurrentGroup( "MainWindow" ); 56 KPrefs::setCurrentGroup( "MainWindow" );
57 addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false ); 57 addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false );
58 addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true ); 58 addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true );
59 addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter ); 59 addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter );
60 addItemIntList( "DetailsSplitter", &mDetailsSplitter ); 60 addItemIntList( "DetailsSplitter", &mDetailsSplitter );
61 addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true ); 61 addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true );
62 62
63 63
64 KPrefs::setCurrentGroup( "Extensions_General" ); 64 KPrefs::setCurrentGroup( "Extensions_General" );
65 QStringList defaultExtensions; 65 QStringList defaultExtensions;
66 defaultExtensions << "merge"; 66 defaultExtensions << "merge";
67 defaultExtensions << "distribution_list_editor"; 67 defaultExtensions << "distribution_list_editor";
68 addItemInt( "CurrentExtension", &mCurrentExtension, 0 ); 68 addItemInt( "CurrentExtension", &mCurrentExtension, 0 );
69 addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions ); 69 addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions );
70 70
71 KPrefs::setCurrentGroup( "Views" ); 71 KPrefs::setCurrentGroup( "Views" );
72 QString defaultView = i18n( "Default Table View" ); 72 QString defaultView = i18n( "Default Table View" );
73 addItemString( "CurrentView", &mCurrentView, defaultView ); 73 addItemString( "CurrentView", &mCurrentView, defaultView );
74 addItemStringList( "ViewNames", &mViewNames, defaultView ); 74 addItemStringList( "ViewNames", &mViewNames, defaultView );
75 75
76 KPrefs::setCurrentGroup( "Filters" ); 76 KPrefs::setCurrentGroup( "Filters" );
77 addItemInt( "CurrentFilter", &mCurrentFilter, 0 ); 77 addItemInt( "CurrentFilter", &mCurrentFilter, 0 );
78 78
79} 79}
80 80
81KABPrefs::~KABPrefs() 81KABPrefs::~KABPrefs()
82{ 82{
83} 83}
84 84
85KABPrefs *KABPrefs::instance() 85KABPrefs *KABPrefs::instance()
86{ 86{
87 if ( !sInstance ) { 87 if ( !sInstance ) {
88#ifdef KAB_EMBEDDED 88#ifdef KAB_EMBEDDED
89 sInstance = staticDeleter.setObject( new KABPrefs() ); 89 sInstance = staticDeleter.setObject( new KABPrefs() );
90#else //KAB_EMBEDDED 90#else //KAB_EMBEDDED
91 //US the following line has changed ???. Why 91 //US the following line has changed ???. Why
92 staticDeleter.setObject( sInstance, new KABPrefs() ); 92 staticDeleter.setObject( sInstance, new KABPrefs() );
93#endif //KAB_EMBEDDED 93#endif //KAB_EMBEDDED
94 sInstance->readConfig(); 94 sInstance->readConfig();
95 } 95 }
96 96
97 return sInstance; 97 return sInstance;
98} 98}
99 99
100void KABPrefs::setCategoryDefaults() 100void KABPrefs::setCategoryDefaults()
101{ 101{
102 mCustomCategories.clear(); 102 mCustomCategories.clear();
103 103
104 mCustomCategories << i18n( "Business" ) << i18n( "Family" ) << i18n( "School" ) 104 mCustomCategories << i18n( "Business" ) << i18n( "Family" ) << i18n( "School" )
105 << i18n( "Customer" ) << i18n( "Friend" ); 105 << i18n( "Customer" ) << i18n( "Friend" );
106} 106}
107 107
108 // US introduce a nonconst way to return the config object. 108 // US introduce a nonconst way to return the config object.
109KConfig* KABPrefs::getConfig() 109KConfig* KABPrefs::getConfig()
110{ 110{
111 return config(); 111 return config();
112} 112}
113 113
114 114
115/*US 115/*US
116void KABPrefs::usrSetDefaults() 116void KABPrefs::usrSetDefaults()
117{ 117{
118 KPimPrefs::usrSetDefaults(); 118 KPimPrefs::usrSetDefaults();
119} 119}
120 120
121void KABPrefs::usrReadConfig() 121void KABPrefs::usrReadConfig()
122{ 122{
123 KPimPrefs::usrReadConfig(); 123 KPimPrefs::usrReadConfig();
124} 124}
125 125
126void KABPrefs::usrWriteConfig() 126void KABPrefs::usrWriteConfig()
127{ 127{
128 KPimPrefs::usrWriteConfig(); 128 KPimPrefs::usrWriteConfig();
129} 129}
130*/ 130*/