Diffstat (limited to 'kmicromail/koprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kmicromail/koprefsdialog.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kmicromail/koprefsdialog.cpp b/kmicromail/koprefsdialog.cpp index 4abf859..13d6681 100644 --- a/kmicromail/koprefsdialog.cpp +++ b/kmicromail/koprefsdialog.cpp | |||
@@ -1,464 +1,465 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2000,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 | #include <kdialog.h> | 23 | #include <kdialog.h> |
24 | #include <qlayout.h> | 24 | #include <qlayout.h> |
25 | #include <qlabel.h> | 25 | #include <qlabel.h> |
26 | #include <qgroupbox.h> | 26 | #include <qgroupbox.h> |
27 | #include <qbuttongroup.h> | 27 | #include <qbuttongroup.h> |
28 | #include <qlineedit.h> | 28 | #include <qlineedit.h> |
29 | #include <qfont.h> | 29 | #include <qfont.h> |
30 | #include <qslider.h> | 30 | #include <qslider.h> |
31 | #include <qfile.h> | 31 | #include <qfile.h> |
32 | #include <qtextstream.h> | 32 | #include <qtextstream.h> |
33 | #include <qcombobox.h> | 33 | #include <qcombobox.h> |
34 | #include <qvbox.h> | 34 | #include <qvbox.h> |
35 | #include <qhbox.h> | 35 | #include <qhbox.h> |
36 | #include <qregexp.h> | 36 | #include <qregexp.h> |
37 | #include <qspinbox.h> | 37 | #include <qspinbox.h> |
38 | #include <qdatetime.h> | 38 | #include <qdatetime.h> |
39 | #include <qcheckbox.h> | 39 | #include <qcheckbox.h> |
40 | #include <qradiobutton.h> | 40 | #include <qradiobutton.h> |
41 | #include <qpushbutton.h> | 41 | #include <qpushbutton.h> |
42 | #include <qstrlist.h> | 42 | #include <qstrlist.h> |
43 | #include <qapplication.h> | 43 | #include <qapplication.h> |
44 | 44 | ||
45 | #include <kcolorbutton.h> | 45 | #include <kcolorbutton.h> |
46 | #include <kdebug.h> | 46 | #include <kdebug.h> |
47 | #include <klocale.h> | 47 | #include <klocale.h> |
48 | #include <kglobal.h> | 48 | #include <kglobal.h> |
49 | #include <kfontdialog.h> | 49 | #include <kfontdialog.h> |
50 | #include <kfiledialog.h> | 50 | #include <kfiledialog.h> |
51 | #include <kmessagebox.h> | 51 | #include <kmessagebox.h> |
52 | #include <kcolordialog.h> | 52 | #include <kcolordialog.h> |
53 | #include <kiconloader.h> | 53 | #include <kiconloader.h> |
54 | #include <kemailsettings.h> | 54 | #include <kemailsettings.h> |
55 | #include <kstandarddirs.h> | 55 | #include <kstandarddirs.h> |
56 | 56 | ||
57 | #include <klineedit.h> | 57 | #include <klineedit.h> |
58 | 58 | ||
59 | 59 | ||
60 | #include "koprefs.h" | 60 | #include "koprefs.h" |
61 | 61 | ||
62 | #include "koprefsdialog.h" | 62 | #include "koprefsdialog.h" |
63 | //#include <kprefswidget.h> | 63 | //#include <kprefswidget.h> |
64 | 64 | ||
65 | 65 | ||
66 | KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : | 66 | KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : |
67 | KPrefsDialog(KOPrefs::instance(),parent,name,true) | 67 | KPrefsDialog(KOPrefs::instance(),parent,name,true) |
68 | { | 68 | { |
69 | 69 | ||
70 | setCaption( i18n("Settings - some need a restart (nr)")); | 70 | setCaption( i18n("Settings - some need a restart (nr)")); |
71 | setupGlobalTab(); | 71 | setupGlobalTab(); |
72 | setupMainTab(); | 72 | setupMainTab(); |
73 | setupMailTab();; | 73 | setupMailTab();; |
74 | setupFontsTab(); | 74 | setupFontsTab(); |
75 | readConfig(); | 75 | readConfig(); |
76 | 76 | ||
77 | #if 0 | 77 | #if 0 |
78 | 78 | ||
79 | setupMainTab(); | 79 | setupMainTab(); |
80 | setupLocaleTab(); | 80 | setupLocaleTab(); |
81 | setupTimeZoneTab(); | 81 | setupTimeZoneTab(); |
82 | setupTimeTab(); | 82 | setupTimeTab(); |
83 | setupLocaleDateTab(); | 83 | setupLocaleDateTab(); |
84 | setupFontsTab(); | 84 | setupFontsTab(); |
85 | setupColorsTab(); | 85 | setupColorsTab(); |
86 | setupViewsTab(); | 86 | setupViewsTab(); |
87 | //setupSyncTab(); | 87 | //setupSyncTab(); |
88 | //setupSyncAlgTab(); | 88 | //setupSyncAlgTab(); |
89 | //setupPrinterTab(); | 89 | //setupPrinterTab(); |
90 | //setupGroupSchedulingTab(); | 90 | //setupGroupSchedulingTab(); |
91 | //setupGroupAutomationTab(); | 91 | //setupGroupAutomationTab(); |
92 | #endif | 92 | #endif |
93 | } | 93 | } |
94 | 94 | ||
95 | #include "kpimglobalprefs.h" | 95 | #include "kpimglobalprefs.h" |
96 | 96 | ||
97 | KOPrefsDialog::~KOPrefsDialog() | 97 | KOPrefsDialog::~KOPrefsDialog() |
98 | { | 98 | { |
99 | } | 99 | } |
100 | void KOPrefsDialog::setupGlobalTab() | 100 | void KOPrefsDialog::setupGlobalTab() |
101 | { | 101 | { |
102 | QFrame *topFrame = addPage(i18n("Global"),0,0); | 102 | QFrame *topFrame = addPage(i18n("Global"),0,0); |
103 | kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); | 103 | kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); |
104 | QVBoxLayout *topLayout = new QVBoxLayout(topFrame); | 104 | QVBoxLayout *topLayout = new QVBoxLayout(topFrame); |
105 | topLayout->addWidget( kdelibcfg ); | 105 | topLayout->addWidget( kdelibcfg ); |
106 | 106 | ||
107 | 107 | ||
108 | } | 108 | } |
109 | void KOPrefsDialog::setupMainTab() | 109 | void KOPrefsDialog::setupMainTab() |
110 | { | 110 | { |
111 | QFrame *topFrame = addPage(i18n("General"),0,0); | 111 | QFrame *topFrame = addPage(i18n("General"),0,0); |
112 | 112 | ||
113 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 113 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
114 | topLayout->setSpacing(spacingHint()); | 114 | topLayout->setSpacing(spacingHint()); |
115 | topLayout->setMargin(marginHint()); | 115 | topLayout->setMargin(marginHint()); |
116 | 116 | ||
117 | 117 | ||
118 | mNameEdit = new QLineEdit(topFrame); | 118 | mNameEdit = new QLineEdit(topFrame); |
119 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); | 119 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); |
120 | topLayout->addWidget(mNameLabel,0,0); | 120 | topLayout->addWidget(mNameLabel,0,0); |
121 | topLayout->addWidget(mNameEdit,0,1); | 121 | topLayout->addWidget(mNameEdit,0,1); |
122 | 122 | ||
123 | mEmailEdit = new QLineEdit(topFrame); | 123 | mEmailEdit = new QLineEdit(topFrame); |
124 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); | 124 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); |
125 | topLayout->addWidget(mEmailLabel,1,0); | 125 | topLayout->addWidget(mEmailLabel,1,0); |
126 | topLayout->addWidget(mEmailEdit,1,1); | 126 | topLayout->addWidget(mEmailEdit,1,1); |
127 | QLabel *lab = new QLabel( i18n("HINT: Separate multiple\neMail addresses by \";\""), topFrame); | 127 | QLabel *lab = new QLabel( i18n("HINT: Separate multiple\neMail addresses by \";\""), topFrame); |
128 | topLayout->addMultiCellWidget(lab,2,2,0,1); | 128 | topLayout->addMultiCellWidget(lab,2,2,0,1); |
129 | KPrefsDialogWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"), | 129 | KPrefsDialogWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"), |
130 | &(KOPrefs::instance()->mUseKapi),topFrame); | 130 | &(KOPrefs::instance()->mUseKapi),topFrame); |
131 | topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1); | 131 | topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1); |
132 | } | 132 | } |
133 | 133 | ||
134 | void KOPrefsDialog::setupMailTab() | 134 | void KOPrefsDialog::setupMailTab() |
135 | { | 135 | { |
136 | QFrame *topFrame = addPage(i18n("Mail"),0,0); | 136 | QFrame *topFrame = addPage(i18n("Mail"),0,0); |
137 | 137 | ||
138 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | 138 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); |
139 | topLayout->setSpacing(spacingHint()); | 139 | topLayout->setSpacing(spacingHint()); |
140 | topLayout->setMargin(marginHint()); | 140 | topLayout->setMargin(marginHint()); |
141 | 141 | ||
142 | KPrefsDialogWidBool* ttt = addWidBool(i18n("View mail as html"), | 142 | KPrefsDialogWidBool* ttt = addWidBool(i18n("View mail as html"), |
143 | &(KOPrefs::instance()->mViewAsHtml),topFrame); | 143 | &(KOPrefs::instance()->mViewAsHtml),topFrame); |
144 | topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1); | 144 | topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1); |
145 | 145 | ||
146 | 146 | ||
147 | ttt = addWidBool(i18n("Send mails later"), | 147 | ttt = addWidBool(i18n("Send mails later"), |
148 | &(KOPrefs::instance()->mSendLater),topFrame); | 148 | &(KOPrefs::instance()->mSendLater),topFrame); |
149 | topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1); | 149 | topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1); |
150 | /* | ||
150 | mCodecEdit = new QLineEdit(topFrame); | 151 | mCodecEdit = new QLineEdit(topFrame); |
151 | topLayout->addMultiCellWidget( new QLabel(mCodecEdit, i18n("User defined codec for new mails:"), topFrame),2,2,0,1); | 152 | topLayout->addMultiCellWidget( new QLabel(mCodecEdit, i18n("User defined codec for new mails:"), topFrame),2,2,0,1); |
152 | topLayout->addMultiCellWidget(mCodecEdit,3,3,0,1); | 153 | topLayout->addMultiCellWidget(mCodecEdit,3,3,0,1); |
153 | topLayout->addMultiCellWidget( new QLabel(0, i18n("Example: iso-8859-15"), topFrame),4,4,0,1); | 154 | topLayout->addMultiCellWidget( new QLabel(0, i18n("Example: iso-8859-15"), topFrame),4,4,0,1); |
154 | 155 | */ | |
155 | } | 156 | } |
156 | void KOPrefsDialog::setupFontsTab() | 157 | void KOPrefsDialog::setupFontsTab() |
157 | { | 158 | { |
158 | 159 | ||
159 | QFrame *topFrame = addPage(i18n("Fonts"),0,0); | 160 | QFrame *topFrame = addPage(i18n("Fonts"),0,0); |
160 | // DesktopIcon("fonts",KIcon::SizeMedium)); | 161 | // DesktopIcon("fonts",KIcon::SizeMedium)); |
161 | 162 | ||
162 | QGridLayout *topLayout = new QGridLayout(topFrame,7,3); | 163 | QGridLayout *topLayout = new QGridLayout(topFrame,7,3); |
163 | topLayout->setSpacing(1); | 164 | topLayout->setSpacing(1); |
164 | topLayout->setMargin(3); | 165 | topLayout->setMargin(3); |
165 | KPrefsDialogWidFont * tVFont; | 166 | KPrefsDialogWidFont * tVFont; |
166 | int i = 0; | 167 | int i = 0; |
167 | KPrefsDialogWidFont *timeLabelsFont = | 168 | KPrefsDialogWidFont *timeLabelsFont = |
168 | addWidFont(i18n("OK"),i18n("Application(nr)"), | 169 | addWidFont(i18n("OK"),i18n("Application(nr)"), |
169 | &(KOPrefs::instance()->mAppFont),topFrame); | 170 | &(KOPrefs::instance()->mAppFont),topFrame); |
170 | topLayout->addWidget(timeLabelsFont->label(),i,0); | 171 | topLayout->addWidget(timeLabelsFont->label(),i,0); |
171 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | 172 | topLayout->addWidget(timeLabelsFont->preview(),i,1); |
172 | topLayout->addWidget(timeLabelsFont->button(),i,2); | 173 | topLayout->addWidget(timeLabelsFont->button(),i,2); |
173 | ++i; | 174 | ++i; |
174 | 175 | ||
175 | 176 | ||
176 | timeLabelsFont = | 177 | timeLabelsFont = |
177 | addWidFont(i18n("Dear Mr."),i18n("Compose mail:"), | 178 | addWidFont(i18n("Dear Mr."),i18n("Compose mail:"), |
178 | &(KOPrefs::instance()->mComposeFont),topFrame); | 179 | &(KOPrefs::instance()->mComposeFont),topFrame); |
179 | topLayout->addWidget(timeLabelsFont->label(),i,0); | 180 | topLayout->addWidget(timeLabelsFont->label(),i,0); |
180 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | 181 | topLayout->addWidget(timeLabelsFont->preview(),i,1); |
181 | topLayout->addWidget(timeLabelsFont->button(),i,2); | 182 | topLayout->addWidget(timeLabelsFont->button(),i,2); |
182 | ++i; | 183 | ++i; |
183 | 184 | ||
184 | KPrefsDialogWidFont *timeBarFont = | 185 | KPrefsDialogWidFont *timeBarFont = |
185 | addWidFont(i18n("Hello"),i18n("Read mail:"), | 186 | addWidFont(i18n("Hello"),i18n("Read mail:"), |
186 | &(KOPrefs::instance()->mReadFont),topFrame); | 187 | &(KOPrefs::instance()->mReadFont),topFrame); |
187 | topLayout->addWidget(timeBarFont->label(),i,0); | 188 | topLayout->addWidget(timeBarFont->label(),i,0); |
188 | topLayout->addWidget(timeBarFont->preview(),i,1); | 189 | topLayout->addWidget(timeBarFont->preview(),i,1); |
189 | topLayout->addWidget(timeBarFont->button(),i,2); | 190 | topLayout->addWidget(timeBarFont->button(),i,2); |
190 | ++i; | 191 | ++i; |
191 | 192 | ||
192 | topLayout->setColStretch(1,1); | 193 | topLayout->setColStretch(1,1); |
193 | topLayout->setRowStretch(4,1); | 194 | topLayout->setRowStretch(4,1); |
194 | 195 | ||
195 | } | 196 | } |
196 | void KOPrefsDialog::usrReadConfig() | 197 | void KOPrefsDialog::usrReadConfig() |
197 | { | 198 | { |
198 | 199 | ||
199 | mNameEdit->setText(KOPrefs::instance()->mName); | 200 | mNameEdit->setText(KOPrefs::instance()->mName); |
200 | mEmailEdit->setText(KOPrefs::instance()->mEmail); | 201 | mEmailEdit->setText(KOPrefs::instance()->mEmail); |
201 | mCodecEdit->setText(KOPrefs::instance()->mSendCodec); | 202 | //mCodecEdit->setText(KOPrefs::instance()->mSendCodec); |
202 | kdelibcfg->readConfig(); | 203 | kdelibcfg->readConfig(); |
203 | } | 204 | } |
204 | void KOPrefsDialog::usrWriteConfig() | 205 | void KOPrefsDialog::usrWriteConfig() |
205 | { | 206 | { |
206 | KOPrefs::instance()->mName = mNameEdit->text(); | 207 | KOPrefs::instance()->mName = mNameEdit->text(); |
207 | KOPrefs::instance()->mEmail = mEmailEdit->text(); | 208 | KOPrefs::instance()->mEmail = mEmailEdit->text(); |
208 | KOPrefs::instance()->mSendCodec = mCodecEdit->text(); | 209 | //KOPrefs::instance()->mSendCodec = mCodecEdit->text(); |
209 | kdelibcfg->writeConfig(); | 210 | kdelibcfg->writeConfig(); |
210 | 211 | ||
211 | 212 | ||
212 | } | 213 | } |
213 | 214 | ||
214 | #if 0 | 215 | #if 0 |
215 | void KOPrefsDialog::setupLocaleDateTab() | 216 | void KOPrefsDialog::setupLocaleDateTab() |
216 | { | 217 | { |
217 | QFrame *topFrame = addPage(i18n("Date Format"),0,0); | 218 | QFrame *topFrame = addPage(i18n("Date Format"),0,0); |
218 | QGridLayout *topLayout = new QGridLayout(topFrame,3,2); | 219 | QGridLayout *topLayout = new QGridLayout(topFrame,3,2); |
219 | topLayout->setSpacing(spacingHint()); | 220 | topLayout->setSpacing(spacingHint()); |
220 | topLayout->setMargin(marginHint()); | 221 | topLayout->setMargin(marginHint()); |
221 | int iii = 0; | 222 | int iii = 0; |
222 | 223 | ||
223 | 224 | ||
224 | KPrefsWidRadios *syncPrefsGroup = | 225 | KPrefsWidRadios *syncPrefsGroup = |
225 | addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); | 226 | addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); |
226 | QString format; | 227 | QString format; |
227 | if ( QApplication::desktop()->width() < 480 ) | 228 | if ( QApplication::desktop()->width() < 480 ) |
228 | format = "(%d.%m.%Y)"; | 229 | format = "(%d.%m.%Y)"; |
229 | else | 230 | else |
230 | format = "(%d.%m.%Y|%A %d %B %Y)"; | 231 | format = "(%d.%m.%Y|%A %d %B %Y)"; |
231 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); | 232 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); |
232 | if ( QApplication::desktop()->width() < 480 ) | 233 | if ( QApplication::desktop()->width() < 480 ) |
233 | format = "(%m.%d.%Y)"; | 234 | format = "(%m.%d.%Y)"; |
234 | else | 235 | else |
235 | format = "(%m.%d.%Y|%A %B %d %Y)"; | 236 | format = "(%m.%d.%Y|%A %B %d %Y)"; |
236 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); | 237 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); |
237 | if ( QApplication::desktop()->width() < 480 ) | 238 | if ( QApplication::desktop()->width() < 480 ) |
238 | format = "(%Y-%m-%d)"; | 239 | format = "(%Y-%m-%d)"; |
239 | else | 240 | else |
240 | format = "(%Y-%m-%d|%A %Y %B %d)"; | 241 | format = "(%Y-%m-%d|%A %Y %B %d)"; |
241 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); | 242 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); |
242 | syncPrefsGroup->addRadio(i18n("User defined")); | 243 | syncPrefsGroup->addRadio(i18n("User defined")); |
243 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 244 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
244 | ++iii; | 245 | ++iii; |
245 | ++iii; | 246 | ++iii; |
246 | QLabel * lab; | 247 | QLabel * lab; |
247 | mUserDateFormatLong = new QLineEdit(topFrame); | 248 | mUserDateFormatLong = new QLineEdit(topFrame); |
248 | lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); | 249 | lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); |
249 | topLayout->addWidget(lab ,iii,0); | 250 | topLayout->addWidget(lab ,iii,0); |
250 | topLayout->addWidget(mUserDateFormatLong,iii,1); | 251 | topLayout->addWidget(mUserDateFormatLong,iii,1); |
251 | ++iii; | 252 | ++iii; |
252 | mUserDateFormatShort = new QLineEdit(topFrame); | 253 | mUserDateFormatShort = new QLineEdit(topFrame); |
253 | lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); | 254 | lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); |
254 | topLayout->addWidget(lab ,iii,0); | 255 | topLayout->addWidget(lab ,iii,0); |
255 | topLayout->addWidget(mUserDateFormatShort,iii,1); | 256 | topLayout->addWidget(mUserDateFormatShort,iii,1); |
256 | ++iii; | 257 | ++iii; |
257 | lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); | 258 | lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); |
258 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 259 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
259 | ++iii; | 260 | ++iii; |
260 | lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); | 261 | lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); |
261 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 262 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
262 | ++iii; | 263 | ++iii; |
263 | lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); | 264 | lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); |
264 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 265 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
265 | ++iii; | 266 | ++iii; |
266 | 267 | ||
267 | } | 268 | } |
268 | 269 | ||
269 | void KOPrefsDialog::setupLocaleTab() | 270 | void KOPrefsDialog::setupLocaleTab() |
270 | { | 271 | { |
271 | QFrame *topFrame = addPage(i18n("Locale"),0,0); | 272 | QFrame *topFrame = addPage(i18n("Locale"),0,0); |
272 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | 273 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); |
273 | topLayout->setSpacing(spacingHint()); | 274 | topLayout->setSpacing(spacingHint()); |
274 | topLayout->setMargin(marginHint()); | 275 | topLayout->setMargin(marginHint()); |
275 | int iii = 0; | 276 | int iii = 0; |
276 | KPrefsWidRadios *syncPrefsGroup = | 277 | KPrefsWidRadios *syncPrefsGroup = |
277 | addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); | 278 | addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); |
278 | syncPrefsGroup->addRadio(i18n("English")); | 279 | syncPrefsGroup->addRadio(i18n("English")); |
279 | syncPrefsGroup->addRadio(i18n("German")); | 280 | syncPrefsGroup->addRadio(i18n("German")); |
280 | syncPrefsGroup->addRadio(i18n("French")); | 281 | syncPrefsGroup->addRadio(i18n("French")); |
281 | syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); | 282 | syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); |
282 | if ( QApplication::desktop()->width() < 300 ) | 283 | if ( QApplication::desktop()->width() < 300 ) |
283 | ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | 284 | ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); |
284 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 285 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
285 | ++iii; | 286 | ++iii; |
286 | 287 | ||
287 | syncPrefsGroup = | 288 | syncPrefsGroup = |
288 | addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); | 289 | addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); |
289 | if ( QApplication::desktop()->width() > 300 ) | 290 | if ( QApplication::desktop()->width() > 300 ) |
290 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | 291 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); |
291 | syncPrefsGroup->addRadio(i18n("24:00")); | 292 | syncPrefsGroup->addRadio(i18n("24:00")); |
292 | syncPrefsGroup->addRadio(i18n("12:00am")); | 293 | syncPrefsGroup->addRadio(i18n("12:00am")); |
293 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | 294 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); |
294 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 295 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
295 | ++iii; | 296 | ++iii; |
296 | KPrefsDialogWidBool *sb; | 297 | KPrefsDialogWidBool *sb; |
297 | if ( QApplication::desktop()->width() < 300 ) { | 298 | if ( QApplication::desktop()->width() < 300 ) { |
298 | sb = | 299 | sb = |
299 | addWidBool(i18n("Week starts on Sunday"), | 300 | addWidBool(i18n("Week starts on Sunday"), |
300 | &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); | 301 | &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); |
301 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 302 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
302 | ++iii; | 303 | ++iii; |
303 | sb = | 304 | sb = |
304 | addWidBool(i18n("Use short date in (WN/E) view"), | 305 | addWidBool(i18n("Use short date in (WN/E) view"), |
305 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); | 306 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); |
306 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 307 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
307 | } | 308 | } |
308 | else { | 309 | else { |
309 | QWidget * hb = new QWidget( topFrame ); | 310 | QWidget * hb = new QWidget( topFrame ); |
310 | QHBoxLayout *hbLayout = new QHBoxLayout(hb); | 311 | QHBoxLayout *hbLayout = new QHBoxLayout(hb); |
311 | sb = | 312 | sb = |
312 | addWidBool(i18n("Week starts on Sunday"), | 313 | addWidBool(i18n("Week starts on Sunday"), |
313 | &(KOPrefs::instance()->mWeekStartsOnSunday),hb); | 314 | &(KOPrefs::instance()->mWeekStartsOnSunday),hb); |
314 | hbLayout->addWidget(sb->checkBox() ); | 315 | hbLayout->addWidget(sb->checkBox() ); |
315 | sb = | 316 | sb = |
316 | addWidBool(i18n("Use short date in (WN/E) view"), | 317 | addWidBool(i18n("Use short date in (WN/E) view"), |
317 | &(KOPrefs::instance()->mShortDateInViewer),hb); | 318 | &(KOPrefs::instance()->mShortDateInViewer),hb); |
318 | hbLayout->addWidget(sb->checkBox() ); | 319 | hbLayout->addWidget(sb->checkBox() ); |
319 | topLayout->addMultiCellWidget(hb, iii,iii,0,1); | 320 | topLayout->addMultiCellWidget(hb, iii,iii,0,1); |
320 | 321 | ||
321 | } | 322 | } |
322 | //#ifndef DESKTOP_VERSION | 323 | //#ifndef DESKTOP_VERSION |
323 | #if 0 | 324 | #if 0 |
324 | ++iii; | 325 | ++iii; |
325 | sb = | 326 | sb = |
326 | addWidBool(i18n("Quick load/save (w/o Unicode)"), | 327 | addWidBool(i18n("Quick load/save (w/o Unicode)"), |
327 | &(KOPrefs::instance()->mUseQuicksave),topFrame); | 328 | &(KOPrefs::instance()->mUseQuicksave),topFrame); |
328 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 329 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
329 | #endif | 330 | #endif |
330 | } | 331 | } |
331 | void KOPrefsDialog::showSyncPage() | 332 | void KOPrefsDialog::showSyncPage() |
332 | { | 333 | { |
333 | showPage ( 2 ) ; | 334 | showPage ( 2 ) ; |
334 | 335 | ||
335 | } | 336 | } |
336 | void KOPrefsDialog::setupSyncAlgTab() | 337 | void KOPrefsDialog::setupSyncAlgTab() |
337 | { | 338 | { |
338 | #if 0 | 339 | #if 0 |
339 | QLabel * lab; | 340 | QLabel * lab; |
340 | QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); | 341 | QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); |
341 | mSetupSyncAlgTab = topFrame; | 342 | mSetupSyncAlgTab = topFrame; |
342 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 343 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
343 | topLayout->setSpacing(spacingHint()); | 344 | topLayout->setSpacing(spacingHint()); |
344 | topLayout->setMargin(marginHint()); | 345 | topLayout->setMargin(marginHint()); |
345 | int iii = 0; | 346 | int iii = 0; |
346 | 347 | ||
347 | KPrefsDialogWidBool *sb = | 348 | KPrefsDialogWidBool *sb = |
348 | addWidBool(i18n("Ask for preferences before syncing"), | 349 | addWidBool(i18n("Ask for preferences before syncing"), |
349 | &(KOPrefs::instance()->mAskForPreferences),topFrame); | 350 | &(KOPrefs::instance()->mAskForPreferences),topFrame); |
350 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 351 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
351 | 352 | ||
352 | ++iii; | 353 | ++iii; |
353 | 354 | ||
354 | KPrefsWidRadios *syncPrefsGroup = | 355 | KPrefsWidRadios *syncPrefsGroup = |
355 | addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs), | 356 | addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs), |
356 | topFrame); | 357 | topFrame); |
357 | syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); | 358 | syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); |
358 | syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); | 359 | syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); |
359 | syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); | 360 | syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); |
360 | syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); | 361 | syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); |
361 | syncPrefsGroup->addRadio(i18n("Force take local entry always")); | 362 | syncPrefsGroup->addRadio(i18n("Force take local entry always")); |
362 | syncPrefsGroup->addRadio(i18n("Force take remote entry always")); | 363 | syncPrefsGroup->addRadio(i18n("Force take remote entry always")); |
363 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 364 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
364 | ++iii; | 365 | ++iii; |
365 | sb = | 366 | sb = |
366 | addWidBool(i18n("Show summary after syncing"), | 367 | addWidBool(i18n("Show summary after syncing"), |
367 | &(KOPrefs::instance()->mShowSyncSummary),topFrame); | 368 | &(KOPrefs::instance()->mShowSyncSummary),topFrame); |
368 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 369 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
369 | 370 | ||
370 | ++iii; | 371 | ++iii; |
371 | #endif | 372 | #endif |
372 | 373 | ||
373 | 374 | ||
374 | 375 | ||
375 | } | 376 | } |
376 | 377 | ||
377 | 378 | ||
378 | void KOPrefsDialog::setupSyncTab() | 379 | void KOPrefsDialog::setupSyncTab() |
379 | { | 380 | { |
380 | #if 0 | 381 | #if 0 |
381 | QLabel * lab; | 382 | QLabel * lab; |
382 | QFrame *topFrame = addPage(i18n("Sync Network"),0,0); | 383 | QFrame *topFrame = addPage(i18n("Sync Network"),0,0); |
383 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 384 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
384 | topLayout->setSpacing(spacingHint()); | 385 | topLayout->setSpacing(spacingHint()); |
385 | topLayout->setMargin(marginHint()); | 386 | topLayout->setMargin(marginHint()); |
386 | lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); | 387 | lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); |
387 | int iii = 0; | 388 | int iii = 0; |
388 | topLayout->addMultiCellWidget(lab , iii,iii,0,1); | 389 | topLayout->addMultiCellWidget(lab , iii,iii,0,1); |
389 | ++iii; | 390 | ++iii; |
390 | 391 | ||
391 | mRemoteIPEdit = new QLineEdit(topFrame); | 392 | mRemoteIPEdit = new QLineEdit(topFrame); |
392 | lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame); | 393 | lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame); |
393 | topLayout->addWidget(lab ,iii,0); | 394 | topLayout->addWidget(lab ,iii,0); |
394 | topLayout->addWidget(mRemoteIPEdit,iii,1); | 395 | topLayout->addWidget(mRemoteIPEdit,iii,1); |
395 | ++iii; | 396 | ++iii; |
396 | mRemoteUser = new QLineEdit(topFrame); | 397 | mRemoteUser = new QLineEdit(topFrame); |
397 | lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame); | 398 | lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame); |
398 | topLayout->addWidget(lab ,iii,0); | 399 | topLayout->addWidget(lab ,iii,0); |
399 | topLayout->addWidget(mRemoteUser, iii,1); | 400 | topLayout->addWidget(mRemoteUser, iii,1); |
400 | ++iii; | 401 | ++iii; |
401 | 402 | ||
402 | mRemoteFile = new QLineEdit(topFrame); | 403 | mRemoteFile = new QLineEdit(topFrame); |
403 | lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame); | 404 | lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame); |
404 | topLayout->addWidget(lab ,iii,0); | 405 | topLayout->addWidget(lab ,iii,0); |
405 | topLayout->addWidget(mRemoteFile,iii,1); | 406 | topLayout->addWidget(mRemoteFile,iii,1); |
406 | ++iii; | 407 | ++iii; |
407 | 408 | ||
408 | mLocalTempFile = new QLineEdit(topFrame); | 409 | mLocalTempFile = new QLineEdit(topFrame); |
409 | lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame); | 410 | lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame); |
410 | topLayout->addWidget(lab ,iii,0); | 411 | topLayout->addWidget(lab ,iii,0); |
411 | topLayout->addWidget(mLocalTempFile,iii,1); | 412 | topLayout->addWidget(mLocalTempFile,iii,1); |
412 | ++iii; | 413 | ++iii; |
413 | 414 | ||
414 | KPrefsDialogWidBool *wb = | 415 | KPrefsDialogWidBool *wb = |
415 | addWidBool(i18n("Write back synced file"), | 416 | addWidBool(i18n("Write back synced file"), |
416 | &(KOPrefs::instance()->mWriteBackFile),topFrame); | 417 | &(KOPrefs::instance()->mWriteBackFile),topFrame); |
417 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); | 418 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); |
418 | ++iii; | 419 | ++iii; |
419 | wb = | 420 | wb = |
420 | addWidBool(i18n("Write back existing entries only"), | 421 | addWidBool(i18n("Write back existing entries only"), |
421 | &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); | 422 | &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); |
422 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); | 423 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); |
423 | ++iii; | 424 | ++iii; |
424 | 425 | ||
425 | #endif | 426 | #endif |
426 | } | 427 | } |
427 | 428 | ||
428 | void KOPrefsDialog::setupMainTab() | 429 | void KOPrefsDialog::setupMainTab() |
429 | { | 430 | { |
430 | QFrame *topFrame = addPage(i18n("General"),0,0); | 431 | QFrame *topFrame = addPage(i18n("General"),0,0); |
431 | // DesktopIcon("identity",KIcon::SizeMedium)); | 432 | // DesktopIcon("identity",KIcon::SizeMedium)); |
432 | 433 | ||
433 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 434 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
434 | topLayout->setSpacing(spacingHint()); | 435 | topLayout->setSpacing(spacingHint()); |
435 | topLayout->setMargin(marginHint()); | 436 | topLayout->setMargin(marginHint()); |
436 | 437 | ||
437 | // KPrefsDialogWidBool *emailControlCenter = | 438 | // KPrefsDialogWidBool *emailControlCenter = |
438 | // addWidBool(i18n("&Use email settings from Control Center"), | 439 | // addWidBool(i18n("&Use email settings from Control Center"), |
439 | // &(KOPrefs::instance()->mEmailControlCenter),topFrame); | 440 | // &(KOPrefs::instance()->mEmailControlCenter),topFrame); |
440 | // topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); | 441 | // topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); |
441 | // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), | 442 | // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), |
442 | // SLOT(toggleEmailSettings(bool))); | 443 | // SLOT(toggleEmailSettings(bool))); |
443 | 444 | ||
444 | mNameEdit = new QLineEdit(topFrame); | 445 | mNameEdit = new QLineEdit(topFrame); |
445 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); | 446 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); |
446 | topLayout->addWidget(mNameLabel,0,0); | 447 | topLayout->addWidget(mNameLabel,0,0); |
447 | topLayout->addWidget(mNameEdit,0,1); | 448 | topLayout->addWidget(mNameEdit,0,1); |
448 | 449 | ||
449 | mEmailEdit = new QLineEdit(topFrame); | 450 | mEmailEdit = new QLineEdit(topFrame); |
450 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); | 451 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); |
451 | topLayout->addWidget(mEmailLabel,1,0); | 452 | topLayout->addWidget(mEmailLabel,1,0); |
452 | topLayout->addWidget(mEmailEdit,1,1); | 453 | topLayout->addWidget(mEmailEdit,1,1); |
453 | KPrefsDialogWidBool *wb; | 454 | KPrefsDialogWidBool *wb; |
454 | QHBox *dummy; | 455 | QHBox *dummy; |
455 | if ( QApplication::desktop()->width() > 480 ) { | 456 | if ( QApplication::desktop()->width() > 480 ) { |
456 | dummy = new QHBox(topFrame); | 457 | dummy = new QHBox(topFrame); |
457 | } else { | 458 | } else { |
458 | dummy = new QVBox(topFrame); | 459 | dummy = new QVBox(topFrame); |
459 | } | 460 | } |
460 | 461 | ||
461 | topLayout->addMultiCellWidget(dummy, 2,2,0,1); | 462 | topLayout->addMultiCellWidget(dummy, 2,2,0,1); |
462 | addWidBool(i18n("Full menu bar(nr)"), | 463 | addWidBool(i18n("Full menu bar(nr)"), |
463 | &(KOPrefs::instance()->mShowFullMenu),dummy); | 464 | &(KOPrefs::instance()->mShowFullMenu),dummy); |
464 | 465 | ||