-rw-r--r-- | kmicromail/koprefs.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kmicromail/koprefs.cpp b/kmicromail/koprefs.cpp index 342bbf3..2bae5f6 100644 --- a/kmicromail/koprefs.cpp +++ b/kmicromail/koprefs.cpp | |||
@@ -1,125 +1,126 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
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 | #include <time.h> | 24 | #include <time.h> |
25 | #ifndef _WIN32_ | 25 | #ifndef _WIN32_ |
26 | #include <unistd.h> | 26 | #include <unistd.h> |
27 | #endif | 27 | #endif |
28 | #include <qdir.h> | 28 | #include <qdir.h> |
29 | #include <qtextstream.h> | 29 | #include <qtextstream.h> |
30 | #include <qtextcodec.h> | 30 | #include <qtextcodec.h> |
31 | #include <qstring.h> | 31 | #include <qstring.h> |
32 | #include <qregexp.h> | 32 | #include <qregexp.h> |
33 | #include <qfont.h> | 33 | #include <qfont.h> |
34 | #include <qcolor.h> | 34 | #include <qcolor.h> |
35 | #include <qstringlist.h> | 35 | #include <qstringlist.h> |
36 | #include <stdlib.h> | 36 | #include <stdlib.h> |
37 | 37 | ||
38 | #include <kglobal.h> | 38 | #include <kglobal.h> |
39 | #include <kconfig.h> | 39 | #include <kconfig.h> |
40 | #include <klocale.h> | 40 | #include <klocale.h> |
41 | #include <kdebug.h> | 41 | #include <kdebug.h> |
42 | #include <kemailsettings.h> | 42 | #include <kemailsettings.h> |
43 | #include <kstaticdeleter.h> | 43 | #include <kstaticdeleter.h> |
44 | 44 | ||
45 | #include "koprefs.h" | 45 | #include "koprefs.h" |
46 | #include "mainwindow.h" | 46 | #include "mainwindow.h" |
47 | 47 | ||
48 | 48 | ||
49 | KOPrefs *KOPrefs::mInstance = 0; | 49 | KOPrefs *KOPrefs::mInstance = 0; |
50 | static KStaticDeleter<KOPrefs> insd; | 50 | static KStaticDeleter<KOPrefs> insd; |
51 | 51 | ||
52 | KOPrefs::KOPrefs() : | 52 | KOPrefs::KOPrefs() : |
53 | KPimPrefs("kopiemailrc") | 53 | KPimPrefs("kopiemailrc") |
54 | { | 54 | { |
55 | mAppFont = QFont("helvetica",12); | 55 | mAppFont = QFont("helvetica",12); |
56 | mComposeFont = QFont("helvetica",12); | 56 | mComposeFont = QFont("helvetica",12); |
57 | mReadFont = QFont("helvetica",12); | 57 | mReadFont = QFont("helvetica",12); |
58 | 58 | ||
59 | KPrefs::setCurrentGroup("General"); | 59 | KPrefs::setCurrentGroup("General"); |
60 | addItemString("SendCodec",&mSendCodec,i18n ("userdefined") ); | 60 | addItemString("SendCodec",&mSendCodec,i18n ("userdefined") ); |
61 | addItemString("SenderName",&mName,i18n ("Please set at") ); | 61 | addItemString("SenderName",&mName,i18n ("Please set at") ); |
62 | addItemString("SenderEmail",&mEmail,i18n ("Settings@General TAB") ); | 62 | addItemString("SenderEmail",&mEmail,i18n ("Settings@General TAB") ); |
63 | addItemBool("ViewMailAsHtml",&mViewAsHtml,false); | 63 | addItemBool("ViewMailAsHtml",&mViewAsHtml,false); |
64 | addItemBool("SendMailLater",&mSendLater,true); | 64 | addItemBool("SendMailLater",&mSendLater,true); |
65 | addItemBool("ShowToField",&mShowToField,false); | ||
65 | addItemBool("UseKapi",&mUseKapi,false); | 66 | addItemBool("UseKapi",&mUseKapi,false); |
66 | addItemInt("CurrentCodec",&mCurrentCodec,0); | 67 | addItemInt("CurrentCodec",&mCurrentCodec,0); |
67 | 68 | ||
68 | KPrefs::setCurrentGroup("Fonts"); | 69 | KPrefs::setCurrentGroup("Fonts"); |
69 | addItemFont("Application Font",&mAppFont); | 70 | addItemFont("Application Font",&mAppFont); |
70 | addItemFont("Compose Font",&mComposeFont); | 71 | addItemFont("Compose Font",&mComposeFont); |
71 | addItemFont("Read Font",&mReadFont); | 72 | addItemFont("Read Font",&mReadFont); |
72 | fillMailDefaults(); | 73 | fillMailDefaults(); |
73 | isDirty = false; | 74 | isDirty = false; |
74 | } | 75 | } |
75 | 76 | ||
76 | 77 | ||
77 | KOPrefs::~KOPrefs() | 78 | KOPrefs::~KOPrefs() |
78 | { | 79 | { |
79 | if ( isDirty ) | 80 | if ( isDirty ) |
80 | writeConfig(); | 81 | writeConfig(); |
81 | if (mInstance == this) | 82 | if (mInstance == this) |
82 | mInstance = insd.setObject(0); | 83 | mInstance = insd.setObject(0); |
83 | 84 | ||
84 | } | 85 | } |
85 | 86 | ||
86 | 87 | ||
87 | KOPrefs *KOPrefs::instance() | 88 | KOPrefs *KOPrefs::instance() |
88 | { | 89 | { |
89 | if (!mInstance) { | 90 | if (!mInstance) { |
90 | mInstance = insd.setObject(new KOPrefs()); | 91 | mInstance = insd.setObject(new KOPrefs()); |
91 | mInstance->readConfig(); | 92 | mInstance->readConfig(); |
92 | } | 93 | } |
93 | 94 | ||
94 | return mInstance; | 95 | return mInstance; |
95 | } | 96 | } |
96 | 97 | ||
97 | void KOPrefs::usrSetDefaults() | 98 | void KOPrefs::usrSetDefaults() |
98 | { | 99 | { |
99 | 100 | ||
100 | } | 101 | } |
101 | 102 | ||
102 | void KOPrefs::fillMailDefaults() | 103 | void KOPrefs::fillMailDefaults() |
103 | { | 104 | { |
104 | if (mName.isEmpty()) mName = i18n ("Please set at"); | 105 | if (mName.isEmpty()) mName = i18n ("Please set at"); |
105 | if (mEmail.isEmpty()) mEmail = i18n ("Settings@General TAB"); | 106 | if (mEmail.isEmpty()) mEmail = i18n ("Settings@General TAB"); |
106 | } | 107 | } |
107 | 108 | ||
108 | void KOPrefs::usrReadConfig() | 109 | void KOPrefs::usrReadConfig() |
109 | { | 110 | { |
110 | 111 | ||
111 | KPimPrefs::usrReadConfig(); | 112 | KPimPrefs::usrReadConfig(); |
112 | } | 113 | } |
113 | 114 | ||
114 | 115 | ||
115 | void KOPrefs::usrWriteConfig() | 116 | void KOPrefs::usrWriteConfig() |
116 | { | 117 | { |
117 | KPimPrefs::usrWriteConfig(); | 118 | KPimPrefs::usrWriteConfig(); |
118 | } | 119 | } |
119 | 120 | ||
120 | 121 | ||
121 | 122 | ||
122 | KConfig* KOPrefs::getConfig() | 123 | KConfig* KOPrefs::getConfig() |
123 | { | 124 | { |
124 | return config(); | 125 | return config(); |
125 | } | 126 | } |