author | zautrix <zautrix> | 2005-06-10 11:53:12 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-10 11:53:12 (UTC) |
commit | d2f00fc2034450bc9a3cd1d2c3510bef1758d3bc (patch) (unidiff) | |
tree | 0764371abfdb5d663ffebf408d47d49f0ca919f3 /kmicromail | |
parent | e5ca8e0d8d6d08b597253f43de401aa1a99a6abe (diff) | |
download | kdepimpi-d2f00fc2034450bc9a3cd1d2c3510bef1758d3bc.zip kdepimpi-d2f00fc2034450bc9a3cd1d2c3510bef1758d3bc.tar.gz kdepimpi-d2f00fc2034450bc9a3cd1d2c3510bef1758d3bc.tar.bz2 |
config dialog changes
-rw-r--r-- | kmicromail/koprefsdialog.cpp | 7 | ||||
-rw-r--r-- | kmicromail/koprefsdialog.h | 1 | ||||
-rw-r--r-- | kmicromail/mainwindow.cpp | 15 | ||||
-rw-r--r-- | kmicromail/mainwindow.h | 1 | ||||
-rw-r--r-- | kmicromail/opiemail.cpp | 5 | ||||
-rw-r--r-- | kmicromail/opiemail.h | 1 |
6 files changed, 22 insertions, 8 deletions
diff --git a/kmicromail/koprefsdialog.cpp b/kmicromail/koprefsdialog.cpp index 7de7064..017f1f7 100644 --- a/kmicromail/koprefsdialog.cpp +++ b/kmicromail/koprefsdialog.cpp | |||
@@ -1,1006 +1,1001 @@ | |||
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 | #include <kglobalsettings.h> | 56 | #include <kglobalsettings.h> |
57 | 57 | ||
58 | #include <klineedit.h> | 58 | #include <klineedit.h> |
59 | 59 | ||
60 | 60 | ||
61 | #include "koprefs.h" | 61 | #include "koprefs.h" |
62 | 62 | ||
63 | #include "koprefsdialog.h" | 63 | #include "koprefsdialog.h" |
64 | //#include <kprefswidget.h> | 64 | //#include <kprefswidget.h> |
65 | 65 | ||
66 | 66 | ||
67 | KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : | 67 | KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : |
68 | KPrefsDialog(KOPrefs::instance(),parent,name,true) | 68 | KPrefsDialog(KOPrefs::instance(),parent,name,true) |
69 | { | 69 | { |
70 | 70 | ||
71 | setFont( KGlobalSettings::generalMaxFont() ); | 71 | setFont( KGlobalSettings::generalMaxFont() ); |
72 | setCaption( i18n("Settings - some need a restart (nr)")); | 72 | setCaption( i18n("Settings - some need a restart (nr)")); |
73 | setupGlobalTab(); | 73 | setupGlobalTab(); |
74 | setupMainTab(); | 74 | setupMainTab(); |
75 | setupMailTab();; | 75 | setupMailTab();; |
76 | setupFontsTab(); | 76 | setupFontsTab(); |
77 | readConfig(); | 77 | readConfig(); |
78 | #ifndef DESKTOP_VERSION | 78 | #ifndef DESKTOP_VERSION |
79 | if ( QApplication::desktop()->height() == 480 ) | 79 | if ( QApplication::desktop()->height() == 480 ) |
80 | hideButtons(); | 80 | hideButtons(); |
81 | #endif | 81 | #endif |
82 | 82 | ||
83 | #if 0 | 83 | #if 0 |
84 | 84 | ||
85 | setupMainTab(); | 85 | setupMainTab(); |
86 | setupLocaleTab(); | 86 | setupLocaleTab(); |
87 | setupTimeZoneTab(); | 87 | setupTimeZoneTab(); |
88 | setupTimeTab(); | 88 | setupTimeTab(); |
89 | setupLocaleDateTab(); | 89 | setupLocaleDateTab(); |
90 | setupFontsTab(); | 90 | setupFontsTab(); |
91 | setupColorsTab(); | 91 | setupColorsTab(); |
92 | setupViewsTab(); | 92 | setupViewsTab(); |
93 | //setupSyncTab(); | 93 | //setupSyncTab(); |
94 | //setupSyncAlgTab(); | 94 | //setupSyncAlgTab(); |
95 | //setupPrinterTab(); | 95 | //setupPrinterTab(); |
96 | //setupGroupSchedulingTab(); | 96 | //setupGroupSchedulingTab(); |
97 | //setupGroupAutomationTab(); | 97 | //setupGroupAutomationTab(); |
98 | #endif | 98 | #endif |
99 | } | 99 | } |
100 | 100 | ||
101 | #include "kpimglobalprefs.h" | 101 | #include "kpimglobalprefs.h" |
102 | 102 | ||
103 | KOPrefsDialog::~KOPrefsDialog() | 103 | KOPrefsDialog::~KOPrefsDialog() |
104 | { | 104 | { |
105 | } | 105 | } |
106 | void KOPrefsDialog::setupGlobalTab() | 106 | void KOPrefsDialog::setupGlobalTab() |
107 | { | 107 | { |
108 | QFrame *topFrame = addPage(i18n("Global"),0,0); | 108 | |
109 | kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); | ||
110 | QVBoxLayout *topLayout = new QVBoxLayout(topFrame); | ||
111 | topLayout->addWidget( kdelibcfg ); | ||
112 | 109 | ||
113 | 110 | ||
114 | } | 111 | } |
115 | void KOPrefsDialog::setupMainTab() | 112 | void KOPrefsDialog::setupMainTab() |
116 | { | 113 | { |
117 | QFrame *topFrame = addPage(i18n("General"),0,0); | 114 | QFrame *topFrame = addPage(i18n("General"),0,0); |
118 | 115 | ||
119 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 116 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
120 | topLayout->setSpacing(spacingHint()); | 117 | topLayout->setSpacing(spacingHint()); |
121 | topLayout->setMargin(marginHint()); | 118 | topLayout->setMargin(marginHint()); |
122 | 119 | ||
123 | 120 | ||
124 | mNameEdit = new QLineEdit(topFrame); | 121 | mNameEdit = new QLineEdit(topFrame); |
125 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); | 122 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); |
126 | topLayout->addWidget(mNameLabel,0,0); | 123 | topLayout->addWidget(mNameLabel,0,0); |
127 | topLayout->addWidget(mNameEdit,0,1); | 124 | topLayout->addWidget(mNameEdit,0,1); |
128 | 125 | ||
129 | mEmailEdit = new QLineEdit(topFrame); | 126 | mEmailEdit = new QLineEdit(topFrame); |
130 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); | 127 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); |
131 | topLayout->addWidget(mEmailLabel,1,0); | 128 | topLayout->addWidget(mEmailLabel,1,0); |
132 | topLayout->addWidget(mEmailEdit,1,1); | 129 | topLayout->addWidget(mEmailEdit,1,1); |
133 | QLabel *lab = new QLabel( i18n("HINT: Separate multiple\neMail addresses by \";\""), topFrame); | 130 | QLabel *lab = new QLabel( i18n("HINT: Separate multiple\neMail addresses by \";\""), topFrame); |
134 | topLayout->addMultiCellWidget(lab,2,2,0,1); | 131 | topLayout->addMultiCellWidget(lab,2,2,0,1); |
135 | KPrefsDialogWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"), | 132 | KPrefsDialogWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"), |
136 | &(KOPrefs::instance()->mUseKapi),topFrame); | 133 | &(KOPrefs::instance()->mUseKapi),topFrame); |
137 | topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1); | 134 | topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1); |
138 | } | 135 | } |
139 | 136 | ||
140 | void KOPrefsDialog::setupMailTab() | 137 | void KOPrefsDialog::setupMailTab() |
141 | { | 138 | { |
142 | QFrame *topFrame = addPage(i18n("Mail"),0,0); | 139 | QFrame *topFrame = addPage(i18n("Mail"),0,0); |
143 | 140 | ||
144 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | 141 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); |
145 | topLayout->setSpacing(spacingHint()); | 142 | topLayout->setSpacing(spacingHint()); |
146 | topLayout->setMargin(marginHint()); | 143 | topLayout->setMargin(marginHint()); |
147 | 144 | ||
148 | KPrefsDialogWidBool* ttt = addWidBool(i18n("View mail as html"), | 145 | KPrefsDialogWidBool* ttt = addWidBool(i18n("View mail as html"), |
149 | &(KOPrefs::instance()->mViewAsHtml),topFrame); | 146 | &(KOPrefs::instance()->mViewAsHtml),topFrame); |
150 | topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1); | 147 | topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1); |
151 | 148 | ||
152 | 149 | ||
153 | ttt = addWidBool(i18n("Send mails later"), | 150 | ttt = addWidBool(i18n("Send mails later"), |
154 | &(KOPrefs::instance()->mSendLater),topFrame); | 151 | &(KOPrefs::instance()->mSendLater),topFrame); |
155 | topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1); | 152 | topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1); |
156 | ttt = addWidBool(i18n("Show \"To\" field in list view"), | 153 | ttt = addWidBool(i18n("Show \"To\" field in list view"), |
157 | &(KOPrefs::instance()->mShowToField),topFrame); | 154 | &(KOPrefs::instance()->mShowToField),topFrame); |
158 | topLayout->addMultiCellWidget(ttt->checkBox(),2,2,0,1); | 155 | topLayout->addMultiCellWidget(ttt->checkBox(),2,2,0,1); |
159 | 156 | ||
160 | int iii =3; | 157 | int iii =3; |
161 | ttt = addWidBool(i18n("Show info fields at startup"), | 158 | ttt = addWidBool(i18n("Show info fields at startup"), |
162 | &(KOPrefs::instance()->mShowInfoStart),topFrame); | 159 | &(KOPrefs::instance()->mShowInfoStart),topFrame); |
163 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); | 160 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); |
164 | ++iii; | 161 | ++iii; |
165 | ttt = addWidBool(i18n("Show \"Subject\" info field"), | 162 | ttt = addWidBool(i18n("Show \"Subject\" info field"), |
166 | &(KOPrefs::instance()->mShowInfoSub),topFrame); | 163 | &(KOPrefs::instance()->mShowInfoSub),topFrame); |
167 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); | 164 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); |
168 | ++iii; | 165 | ++iii; |
169 | ttt = addWidBool(i18n("Show \"From\" info field"), | 166 | ttt = addWidBool(i18n("Show \"From\" info field"), |
170 | &(KOPrefs::instance()->mShowInfoFrom),topFrame); | 167 | &(KOPrefs::instance()->mShowInfoFrom),topFrame); |
171 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); | 168 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); |
172 | ++iii; | 169 | ++iii; |
173 | ttt = addWidBool(i18n("Show \"To\" info field"), | 170 | ttt = addWidBool(i18n("Show \"To\" info field"), |
174 | &(KOPrefs::instance()->mShowInfoTo),topFrame); | 171 | &(KOPrefs::instance()->mShowInfoTo),topFrame); |
175 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); | 172 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); |
176 | ++iii; | 173 | ++iii; |
177 | 174 | ||
178 | /* | 175 | /* |
179 | mCodecEdit = new QLineEdit(topFrame); | 176 | mCodecEdit = new QLineEdit(topFrame); |
180 | topLayout->addMultiCellWidget( new QLabel(mCodecEdit, i18n("User defined codec for new mails:"), topFrame),2,2,0,1); | 177 | topLayout->addMultiCellWidget( new QLabel(mCodecEdit, i18n("User defined codec for new mails:"), topFrame),2,2,0,1); |
181 | topLayout->addMultiCellWidget(mCodecEdit,3,3,0,1); | 178 | topLayout->addMultiCellWidget(mCodecEdit,3,3,0,1); |
182 | topLayout->addMultiCellWidget( new QLabel(0, i18n("Example: iso-8859-15"), topFrame),4,4,0,1); | 179 | topLayout->addMultiCellWidget( new QLabel(0, i18n("Example: iso-8859-15"), topFrame),4,4,0,1); |
183 | */ | 180 | */ |
184 | } | 181 | } |
185 | void KOPrefsDialog::setupFontsTab() | 182 | void KOPrefsDialog::setupFontsTab() |
186 | { | 183 | { |
187 | 184 | ||
188 | QFrame *topFrame = addPage(i18n("Fonts"),0,0); | 185 | QFrame *topFrame = addPage(i18n("Fonts"),0,0); |
189 | // DesktopIcon("fonts",KIcon::SizeMedium)); | 186 | // DesktopIcon("fonts",KIcon::SizeMedium)); |
190 | 187 | ||
191 | QGridLayout *topLayout = new QGridLayout(topFrame,7,3); | 188 | QGridLayout *topLayout = new QGridLayout(topFrame,7,3); |
192 | topLayout->setSpacing(1); | 189 | topLayout->setSpacing(1); |
193 | topLayout->setMargin(3); | 190 | topLayout->setMargin(3); |
194 | KPrefsDialogWidFont * tVFont; | 191 | KPrefsDialogWidFont * tVFont; |
195 | int i = 0; | 192 | int i = 0; |
196 | KPrefsDialogWidFont *timeLabelsFont = | 193 | KPrefsDialogWidFont *timeLabelsFont = |
197 | addWidFont(i18n("OK"),i18n("Application(nr)"), | 194 | addWidFont(i18n("OK"),i18n("Application(nr)"), |
198 | &(KOPrefs::instance()->mAppFont),topFrame); | 195 | &(KOPrefs::instance()->mAppFont),topFrame); |
199 | topLayout->addWidget(timeLabelsFont->label(),i,0); | 196 | topLayout->addWidget(timeLabelsFont->label(),i,0); |
200 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | 197 | topLayout->addWidget(timeLabelsFont->preview(),i,1); |
201 | topLayout->addWidget(timeLabelsFont->button(),i,2); | 198 | topLayout->addWidget(timeLabelsFont->button(),i,2); |
202 | ++i; | 199 | ++i; |
203 | 200 | ||
204 | 201 | ||
205 | timeLabelsFont = | 202 | timeLabelsFont = |
206 | addWidFont(i18n("Dear Mr."),i18n("Compose mail:"), | 203 | addWidFont(i18n("Dear Mr."),i18n("Compose mail:"), |
207 | &(KOPrefs::instance()->mComposeFont),topFrame); | 204 | &(KOPrefs::instance()->mComposeFont),topFrame); |
208 | topLayout->addWidget(timeLabelsFont->label(),i,0); | 205 | topLayout->addWidget(timeLabelsFont->label(),i,0); |
209 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | 206 | topLayout->addWidget(timeLabelsFont->preview(),i,1); |
210 | topLayout->addWidget(timeLabelsFont->button(),i,2); | 207 | topLayout->addWidget(timeLabelsFont->button(),i,2); |
211 | ++i; | 208 | ++i; |
212 | 209 | ||
213 | KPrefsDialogWidFont *timeBarFont = | 210 | KPrefsDialogWidFont *timeBarFont = |
214 | addWidFont(i18n("Hello"),i18n("Read mail:"), | 211 | addWidFont(i18n("Hello"),i18n("Read mail:"), |
215 | &(KOPrefs::instance()->mReadFont),topFrame); | 212 | &(KOPrefs::instance()->mReadFont),topFrame); |
216 | topLayout->addWidget(timeBarFont->label(),i,0); | 213 | topLayout->addWidget(timeBarFont->label(),i,0); |
217 | topLayout->addWidget(timeBarFont->preview(),i,1); | 214 | topLayout->addWidget(timeBarFont->preview(),i,1); |
218 | topLayout->addWidget(timeBarFont->button(),i,2); | 215 | topLayout->addWidget(timeBarFont->button(),i,2); |
219 | ++i; | 216 | ++i; |
220 | 217 | ||
221 | topLayout->setColStretch(1,1); | 218 | topLayout->setColStretch(1,1); |
222 | topLayout->setRowStretch(4,1); | 219 | topLayout->setRowStretch(4,1); |
223 | 220 | ||
224 | } | 221 | } |
225 | void KOPrefsDialog::usrReadConfig() | 222 | void KOPrefsDialog::usrReadConfig() |
226 | { | 223 | { |
227 | 224 | ||
228 | mNameEdit->setText(KOPrefs::instance()->mName); | 225 | mNameEdit->setText(KOPrefs::instance()->mName); |
229 | mEmailEdit->setText(KOPrefs::instance()->mEmail); | 226 | mEmailEdit->setText(KOPrefs::instance()->mEmail); |
230 | //mCodecEdit->setText(KOPrefs::instance()->mSendCodec); | 227 | //mCodecEdit->setText(KOPrefs::instance()->mSendCodec); |
231 | kdelibcfg->readConfig(); | ||
232 | } | 228 | } |
233 | void KOPrefsDialog::usrWriteConfig() | 229 | void KOPrefsDialog::usrWriteConfig() |
234 | { | 230 | { |
235 | KOPrefs::instance()->mName = mNameEdit->text(); | 231 | KOPrefs::instance()->mName = mNameEdit->text(); |
236 | KOPrefs::instance()->mEmail = mEmailEdit->text(); | 232 | KOPrefs::instance()->mEmail = mEmailEdit->text(); |
237 | //KOPrefs::instance()->mSendCodec = mCodecEdit->text(); | 233 | //KOPrefs::instance()->mSendCodec = mCodecEdit->text(); |
238 | kdelibcfg->writeConfig(); | ||
239 | 234 | ||
240 | 235 | ||
241 | } | 236 | } |
242 | 237 | ||
243 | #if 0 | 238 | #if 0 |
244 | void KOPrefsDialog::setupLocaleDateTab() | 239 | void KOPrefsDialog::setupLocaleDateTab() |
245 | { | 240 | { |
246 | QFrame *topFrame = addPage(i18n("Date Format"),0,0); | 241 | QFrame *topFrame = addPage(i18n("Date Format"),0,0); |
247 | QGridLayout *topLayout = new QGridLayout(topFrame,3,2); | 242 | QGridLayout *topLayout = new QGridLayout(topFrame,3,2); |
248 | topLayout->setSpacing(spacingHint()); | 243 | topLayout->setSpacing(spacingHint()); |
249 | topLayout->setMargin(marginHint()); | 244 | topLayout->setMargin(marginHint()); |
250 | int iii = 0; | 245 | int iii = 0; |
251 | 246 | ||
252 | 247 | ||
253 | KPrefsWidRadios *syncPrefsGroup = | 248 | KPrefsWidRadios *syncPrefsGroup = |
254 | addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); | 249 | addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); |
255 | QString format; | 250 | QString format; |
256 | if ( QApplication::desktop()->width() < 480 ) | 251 | if ( QApplication::desktop()->width() < 480 ) |
257 | format = "(%d.%m.%Y)"; | 252 | format = "(%d.%m.%Y)"; |
258 | else | 253 | else |
259 | format = "(%d.%m.%Y|%A %d %B %Y)"; | 254 | format = "(%d.%m.%Y|%A %d %B %Y)"; |
260 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); | 255 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); |
261 | if ( QApplication::desktop()->width() < 480 ) | 256 | if ( QApplication::desktop()->width() < 480 ) |
262 | format = "(%m.%d.%Y)"; | 257 | format = "(%m.%d.%Y)"; |
263 | else | 258 | else |
264 | format = "(%m.%d.%Y|%A %B %d %Y)"; | 259 | format = "(%m.%d.%Y|%A %B %d %Y)"; |
265 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); | 260 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); |
266 | if ( QApplication::desktop()->width() < 480 ) | 261 | if ( QApplication::desktop()->width() < 480 ) |
267 | format = "(%Y-%m-%d)"; | 262 | format = "(%Y-%m-%d)"; |
268 | else | 263 | else |
269 | format = "(%Y-%m-%d|%A %Y %B %d)"; | 264 | format = "(%Y-%m-%d|%A %Y %B %d)"; |
270 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); | 265 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); |
271 | syncPrefsGroup->addRadio(i18n("User defined")); | 266 | syncPrefsGroup->addRadio(i18n("User defined")); |
272 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 267 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
273 | ++iii; | 268 | ++iii; |
274 | ++iii; | 269 | ++iii; |
275 | QLabel * lab; | 270 | QLabel * lab; |
276 | mUserDateFormatLong = new QLineEdit(topFrame); | 271 | mUserDateFormatLong = new QLineEdit(topFrame); |
277 | lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); | 272 | lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); |
278 | topLayout->addWidget(lab ,iii,0); | 273 | topLayout->addWidget(lab ,iii,0); |
279 | topLayout->addWidget(mUserDateFormatLong,iii,1); | 274 | topLayout->addWidget(mUserDateFormatLong,iii,1); |
280 | ++iii; | 275 | ++iii; |
281 | mUserDateFormatShort = new QLineEdit(topFrame); | 276 | mUserDateFormatShort = new QLineEdit(topFrame); |
282 | lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); | 277 | lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); |
283 | topLayout->addWidget(lab ,iii,0); | 278 | topLayout->addWidget(lab ,iii,0); |
284 | topLayout->addWidget(mUserDateFormatShort,iii,1); | 279 | topLayout->addWidget(mUserDateFormatShort,iii,1); |
285 | ++iii; | 280 | ++iii; |
286 | lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); | 281 | lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); |
287 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 282 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
288 | ++iii; | 283 | ++iii; |
289 | lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); | 284 | lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); |
290 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 285 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
291 | ++iii; | 286 | ++iii; |
292 | lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); | 287 | lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); |
293 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 288 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
294 | ++iii; | 289 | ++iii; |
295 | 290 | ||
296 | } | 291 | } |
297 | 292 | ||
298 | void KOPrefsDialog::setupLocaleTab() | 293 | void KOPrefsDialog::setupLocaleTab() |
299 | { | 294 | { |
300 | QFrame *topFrame = addPage(i18n("Locale"),0,0); | 295 | QFrame *topFrame = addPage(i18n("Locale"),0,0); |
301 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | 296 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); |
302 | topLayout->setSpacing(spacingHint()); | 297 | topLayout->setSpacing(spacingHint()); |
303 | topLayout->setMargin(marginHint()); | 298 | topLayout->setMargin(marginHint()); |
304 | int iii = 0; | 299 | int iii = 0; |
305 | KPrefsWidRadios *syncPrefsGroup = | 300 | KPrefsWidRadios *syncPrefsGroup = |
306 | addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); | 301 | addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); |
307 | syncPrefsGroup->addRadio(i18n("English")); | 302 | syncPrefsGroup->addRadio(i18n("English")); |
308 | syncPrefsGroup->addRadio(i18n("German")); | 303 | syncPrefsGroup->addRadio(i18n("German")); |
309 | syncPrefsGroup->addRadio(i18n("French")); | 304 | syncPrefsGroup->addRadio(i18n("French")); |
310 | syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); | 305 | syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); |
311 | if ( QApplication::desktop()->width() < 300 ) | 306 | if ( QApplication::desktop()->width() < 300 ) |
312 | ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | 307 | ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); |
313 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 308 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
314 | ++iii; | 309 | ++iii; |
315 | 310 | ||
316 | syncPrefsGroup = | 311 | syncPrefsGroup = |
317 | addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); | 312 | addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); |
318 | if ( QApplication::desktop()->width() > 300 ) | 313 | if ( QApplication::desktop()->width() > 300 ) |
319 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | 314 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); |
320 | syncPrefsGroup->addRadio(i18n("24:00")); | 315 | syncPrefsGroup->addRadio(i18n("24:00")); |
321 | syncPrefsGroup->addRadio(i18n("12:00am")); | 316 | syncPrefsGroup->addRadio(i18n("12:00am")); |
322 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | 317 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); |
323 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 318 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
324 | ++iii; | 319 | ++iii; |
325 | KPrefsDialogWidBool *sb; | 320 | KPrefsDialogWidBool *sb; |
326 | if ( QApplication::desktop()->width() < 300 ) { | 321 | if ( QApplication::desktop()->width() < 300 ) { |
327 | sb = | 322 | sb = |
328 | addWidBool(i18n("Week starts on Sunday"), | 323 | addWidBool(i18n("Week starts on Sunday"), |
329 | &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); | 324 | &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); |
330 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 325 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
331 | ++iii; | 326 | ++iii; |
332 | sb = | 327 | sb = |
333 | addWidBool(i18n("Use short date in (WN/E) view"), | 328 | addWidBool(i18n("Use short date in (WN/E) view"), |
334 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); | 329 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); |
335 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 330 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
336 | } | 331 | } |
337 | else { | 332 | else { |
338 | QWidget * hb = new QWidget( topFrame ); | 333 | QWidget * hb = new QWidget( topFrame ); |
339 | QHBoxLayout *hbLayout = new QHBoxLayout(hb); | 334 | QHBoxLayout *hbLayout = new QHBoxLayout(hb); |
340 | sb = | 335 | sb = |
341 | addWidBool(i18n("Week starts on Sunday"), | 336 | addWidBool(i18n("Week starts on Sunday"), |
342 | &(KOPrefs::instance()->mWeekStartsOnSunday),hb); | 337 | &(KOPrefs::instance()->mWeekStartsOnSunday),hb); |
343 | hbLayout->addWidget(sb->checkBox() ); | 338 | hbLayout->addWidget(sb->checkBox() ); |
344 | sb = | 339 | sb = |
345 | addWidBool(i18n("Use short date in (WN/E) view"), | 340 | addWidBool(i18n("Use short date in (WN/E) view"), |
346 | &(KOPrefs::instance()->mShortDateInViewer),hb); | 341 | &(KOPrefs::instance()->mShortDateInViewer),hb); |
347 | hbLayout->addWidget(sb->checkBox() ); | 342 | hbLayout->addWidget(sb->checkBox() ); |
348 | topLayout->addMultiCellWidget(hb, iii,iii,0,1); | 343 | topLayout->addMultiCellWidget(hb, iii,iii,0,1); |
349 | 344 | ||
350 | } | 345 | } |
351 | //#ifndef DESKTOP_VERSION | 346 | //#ifndef DESKTOP_VERSION |
352 | #if 0 | 347 | #if 0 |
353 | ++iii; | 348 | ++iii; |
354 | sb = | 349 | sb = |
355 | addWidBool(i18n("Quick load/save (w/o Unicode)"), | 350 | addWidBool(i18n("Quick load/save (w/o Unicode)"), |
356 | &(KOPrefs::instance()->mUseQuicksave),topFrame); | 351 | &(KOPrefs::instance()->mUseQuicksave),topFrame); |
357 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 352 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
358 | #endif | 353 | #endif |
359 | } | 354 | } |
360 | void KOPrefsDialog::showSyncPage() | 355 | void KOPrefsDialog::showSyncPage() |
361 | { | 356 | { |
362 | showPage ( 2 ) ; | 357 | showPage ( 2 ) ; |
363 | 358 | ||
364 | } | 359 | } |
365 | void KOPrefsDialog::setupSyncAlgTab() | 360 | void KOPrefsDialog::setupSyncAlgTab() |
366 | { | 361 | { |
367 | #if 0 | 362 | #if 0 |
368 | QLabel * lab; | 363 | QLabel * lab; |
369 | QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); | 364 | QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); |
370 | mSetupSyncAlgTab = topFrame; | 365 | mSetupSyncAlgTab = topFrame; |
371 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 366 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
372 | topLayout->setSpacing(spacingHint()); | 367 | topLayout->setSpacing(spacingHint()); |
373 | topLayout->setMargin(marginHint()); | 368 | topLayout->setMargin(marginHint()); |
374 | int iii = 0; | 369 | int iii = 0; |
375 | 370 | ||
376 | KPrefsDialogWidBool *sb = | 371 | KPrefsDialogWidBool *sb = |
377 | addWidBool(i18n("Ask for preferences before syncing"), | 372 | addWidBool(i18n("Ask for preferences before syncing"), |
378 | &(KOPrefs::instance()->mAskForPreferences),topFrame); | 373 | &(KOPrefs::instance()->mAskForPreferences),topFrame); |
379 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 374 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
380 | 375 | ||
381 | ++iii; | 376 | ++iii; |
382 | 377 | ||
383 | KPrefsWidRadios *syncPrefsGroup = | 378 | KPrefsWidRadios *syncPrefsGroup = |
384 | addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs), | 379 | addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs), |
385 | topFrame); | 380 | topFrame); |
386 | syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); | 381 | syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); |
387 | syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); | 382 | syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); |
388 | syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); | 383 | syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); |
389 | syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); | 384 | syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); |
390 | syncPrefsGroup->addRadio(i18n("Force take local entry always")); | 385 | syncPrefsGroup->addRadio(i18n("Force take local entry always")); |
391 | syncPrefsGroup->addRadio(i18n("Force take remote entry always")); | 386 | syncPrefsGroup->addRadio(i18n("Force take remote entry always")); |
392 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 387 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
393 | ++iii; | 388 | ++iii; |
394 | sb = | 389 | sb = |
395 | addWidBool(i18n("Show summary after syncing"), | 390 | addWidBool(i18n("Show summary after syncing"), |
396 | &(KOPrefs::instance()->mShowSyncSummary),topFrame); | 391 | &(KOPrefs::instance()->mShowSyncSummary),topFrame); |
397 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 392 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
398 | 393 | ||
399 | ++iii; | 394 | ++iii; |
400 | #endif | 395 | #endif |
401 | 396 | ||
402 | 397 | ||
403 | 398 | ||
404 | } | 399 | } |
405 | 400 | ||
406 | 401 | ||
407 | void KOPrefsDialog::setupSyncTab() | 402 | void KOPrefsDialog::setupSyncTab() |
408 | { | 403 | { |
409 | #if 0 | 404 | #if 0 |
410 | QLabel * lab; | 405 | QLabel * lab; |
411 | QFrame *topFrame = addPage(i18n("Sync Network"),0,0); | 406 | QFrame *topFrame = addPage(i18n("Sync Network"),0,0); |
412 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 407 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
413 | topLayout->setSpacing(spacingHint()); | 408 | topLayout->setSpacing(spacingHint()); |
414 | topLayout->setMargin(marginHint()); | 409 | topLayout->setMargin(marginHint()); |
415 | lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); | 410 | lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); |
416 | int iii = 0; | 411 | int iii = 0; |
417 | topLayout->addMultiCellWidget(lab , iii,iii,0,1); | 412 | topLayout->addMultiCellWidget(lab , iii,iii,0,1); |
418 | ++iii; | 413 | ++iii; |
419 | 414 | ||
420 | mRemoteIPEdit = new QLineEdit(topFrame); | 415 | mRemoteIPEdit = new QLineEdit(topFrame); |
421 | lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame); | 416 | lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame); |
422 | topLayout->addWidget(lab ,iii,0); | 417 | topLayout->addWidget(lab ,iii,0); |
423 | topLayout->addWidget(mRemoteIPEdit,iii,1); | 418 | topLayout->addWidget(mRemoteIPEdit,iii,1); |
424 | ++iii; | 419 | ++iii; |
425 | mRemoteUser = new QLineEdit(topFrame); | 420 | mRemoteUser = new QLineEdit(topFrame); |
426 | lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame); | 421 | lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame); |
427 | topLayout->addWidget(lab ,iii,0); | 422 | topLayout->addWidget(lab ,iii,0); |
428 | topLayout->addWidget(mRemoteUser, iii,1); | 423 | topLayout->addWidget(mRemoteUser, iii,1); |
429 | ++iii; | 424 | ++iii; |
430 | 425 | ||
431 | mRemoteFile = new QLineEdit(topFrame); | 426 | mRemoteFile = new QLineEdit(topFrame); |
432 | lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame); | 427 | lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame); |
433 | topLayout->addWidget(lab ,iii,0); | 428 | topLayout->addWidget(lab ,iii,0); |
434 | topLayout->addWidget(mRemoteFile,iii,1); | 429 | topLayout->addWidget(mRemoteFile,iii,1); |
435 | ++iii; | 430 | ++iii; |
436 | 431 | ||
437 | mLocalTempFile = new QLineEdit(topFrame); | 432 | mLocalTempFile = new QLineEdit(topFrame); |
438 | lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame); | 433 | lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame); |
439 | topLayout->addWidget(lab ,iii,0); | 434 | topLayout->addWidget(lab ,iii,0); |
440 | topLayout->addWidget(mLocalTempFile,iii,1); | 435 | topLayout->addWidget(mLocalTempFile,iii,1); |
441 | ++iii; | 436 | ++iii; |
442 | 437 | ||
443 | KPrefsDialogWidBool *wb = | 438 | KPrefsDialogWidBool *wb = |
444 | addWidBool(i18n("Write back synced file"), | 439 | addWidBool(i18n("Write back synced file"), |
445 | &(KOPrefs::instance()->mWriteBackFile),topFrame); | 440 | &(KOPrefs::instance()->mWriteBackFile),topFrame); |
446 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); | 441 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); |
447 | ++iii; | 442 | ++iii; |
448 | wb = | 443 | wb = |
449 | addWidBool(i18n("Write back existing entries only"), | 444 | addWidBool(i18n("Write back existing entries only"), |
450 | &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); | 445 | &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); |
451 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); | 446 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); |
452 | ++iii; | 447 | ++iii; |
453 | 448 | ||
454 | #endif | 449 | #endif |
455 | } | 450 | } |
456 | 451 | ||
457 | void KOPrefsDialog::setupMainTab() | 452 | void KOPrefsDialog::setupMainTab() |
458 | { | 453 | { |
459 | QFrame *topFrame = addPage(i18n("General"),0,0); | 454 | QFrame *topFrame = addPage(i18n("General"),0,0); |
460 | // DesktopIcon("identity",KIcon::SizeMedium)); | 455 | // DesktopIcon("identity",KIcon::SizeMedium)); |
461 | 456 | ||
462 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 457 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
463 | topLayout->setSpacing(spacingHint()); | 458 | topLayout->setSpacing(spacingHint()); |
464 | topLayout->setMargin(marginHint()); | 459 | topLayout->setMargin(marginHint()); |
465 | 460 | ||
466 | // KPrefsDialogWidBool *emailControlCenter = | 461 | // KPrefsDialogWidBool *emailControlCenter = |
467 | // addWidBool(i18n("&Use email settings from Control Center"), | 462 | // addWidBool(i18n("&Use email settings from Control Center"), |
468 | // &(KOPrefs::instance()->mEmailControlCenter),topFrame); | 463 | // &(KOPrefs::instance()->mEmailControlCenter),topFrame); |
469 | // topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); | 464 | // topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); |
470 | // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), | 465 | // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), |
471 | // SLOT(toggleEmailSettings(bool))); | 466 | // SLOT(toggleEmailSettings(bool))); |
472 | 467 | ||
473 | mNameEdit = new QLineEdit(topFrame); | 468 | mNameEdit = new QLineEdit(topFrame); |
474 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); | 469 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); |
475 | topLayout->addWidget(mNameLabel,0,0); | 470 | topLayout->addWidget(mNameLabel,0,0); |
476 | topLayout->addWidget(mNameEdit,0,1); | 471 | topLayout->addWidget(mNameEdit,0,1); |
477 | 472 | ||
478 | mEmailEdit = new QLineEdit(topFrame); | 473 | mEmailEdit = new QLineEdit(topFrame); |
479 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); | 474 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); |
480 | topLayout->addWidget(mEmailLabel,1,0); | 475 | topLayout->addWidget(mEmailLabel,1,0); |
481 | topLayout->addWidget(mEmailEdit,1,1); | 476 | topLayout->addWidget(mEmailEdit,1,1); |
482 | KPrefsDialogWidBool *wb; | 477 | KPrefsDialogWidBool *wb; |
483 | QHBox *dummy; | 478 | QHBox *dummy; |
484 | if ( QApplication::desktop()->width() > 480 ) { | 479 | if ( QApplication::desktop()->width() > 480 ) { |
485 | dummy = new QHBox(topFrame); | 480 | dummy = new QHBox(topFrame); |
486 | } else { | 481 | } else { |
487 | dummy = new QVBox(topFrame); | 482 | dummy = new QVBox(topFrame); |
488 | } | 483 | } |
489 | 484 | ||
490 | topLayout->addMultiCellWidget(dummy, 2,2,0,1); | 485 | topLayout->addMultiCellWidget(dummy, 2,2,0,1); |
491 | addWidBool(i18n("Full menu bar(nr)"), | 486 | addWidBool(i18n("Full menu bar(nr)"), |
492 | &(KOPrefs::instance()->mShowFullMenu),dummy); | 487 | &(KOPrefs::instance()->mShowFullMenu),dummy); |
493 | 488 | ||
494 | 489 | ||
495 | addWidBool(i18n("Mini icons in toolbar(nr)"), | 490 | addWidBool(i18n("Mini icons in toolbar(nr)"), |
496 | &(KOPrefs::instance()->mToolBarMiniIcons),dummy); | 491 | &(KOPrefs::instance()->mToolBarMiniIcons),dummy); |
497 | 492 | ||
498 | 493 | ||
499 | dummy = new QHBox(topFrame); | 494 | dummy = new QHBox(topFrame); |
500 | new QLabel(i18n("Days in What's Next:"),dummy); | 495 | new QLabel(i18n("Days in What's Next:"),dummy); |
501 | mWhatsNextSpin = new QSpinBox(1,14,1,dummy); | 496 | mWhatsNextSpin = new QSpinBox(1,14,1,dummy); |
502 | 497 | ||
503 | topLayout->addMultiCellWidget(dummy,3,3,0,1); | 498 | topLayout->addMultiCellWidget(dummy,3,3,0,1); |
504 | 499 | ||
505 | 500 | ||
506 | 501 | ||
507 | dummy = new QHBox(topFrame); | 502 | dummy = new QHBox(topFrame); |
508 | new QLabel(i18n("Days in Next-X-Days:"),dummy); | 503 | new QLabel(i18n("Days in Next-X-Days:"),dummy); |
509 | mNextXDaysSpin = new QSpinBox(2,14,1,dummy); | 504 | mNextXDaysSpin = new QSpinBox(2,14,1,dummy); |
510 | 505 | ||
511 | topLayout->addMultiCellWidget(dummy,4,4,0,1); | 506 | topLayout->addMultiCellWidget(dummy,4,4,0,1); |
512 | 507 | ||
513 | QHBox *prioBox = new QHBox(topFrame); | 508 | QHBox *prioBox = new QHBox(topFrame); |
514 | // intervalBox->setSpacing(spacingHint()); | 509 | // intervalBox->setSpacing(spacingHint()); |
515 | topLayout->addMultiCellWidget(prioBox,5,5,0,1); | 510 | topLayout->addMultiCellWidget(prioBox,5,5,0,1); |
516 | QString messa = i18n("Show topmost todo prios in What's Next:"); | 511 | QString messa = i18n("Show topmost todo prios in What's Next:"); |
517 | 512 | ||
518 | if ( QApplication::desktop()->width() < 300 ) | 513 | if ( QApplication::desktop()->width() < 300 ) |
519 | messa = i18n("Show topmost todo prios in What's N.:"); | 514 | messa = i18n("Show topmost todo prios in What's N.:"); |
520 | QLabel *prioLabel = new QLabel(messa, prioBox); | 515 | QLabel *prioLabel = new QLabel(messa, prioBox); |
521 | mPrioSpin = new QSpinBox(0,5,1,prioBox); | 516 | mPrioSpin = new QSpinBox(0,5,1,prioBox); |
522 | if ( QApplication::desktop()->width() < 300 ) | 517 | if ( QApplication::desktop()->width() < 300 ) |
523 | mPrioSpin->setFixedWidth( 40 ); | 518 | mPrioSpin->setFixedWidth( 40 ); |
524 | 519 | ||
525 | // KPrefsDialogWidBool *bcc = | 520 | // KPrefsDialogWidBool *bcc = |
526 | // addWidBool(i18n("Send copy to owner when mailing events"), | 521 | // addWidBool(i18n("Send copy to owner when mailing events"), |
527 | // &(KOPrefs::instance()->mBcc),topFrame); | 522 | // &(KOPrefs::instance()->mBcc),topFrame); |
528 | // topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); | 523 | // topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); |
529 | 524 | ||
530 | 525 | ||
531 | // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); | 526 | // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); |
532 | //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); | 527 | //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); |
533 | 528 | ||
534 | // addWidBool(i18n("Enable automatic saving of calendar"), | 529 | // addWidBool(i18n("Enable automatic saving of calendar"), |
535 | // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); | 530 | // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); |
536 | 531 | ||
537 | QHBox *intervalBox = new QHBox(topFrame); | 532 | QHBox *intervalBox = new QHBox(topFrame); |
538 | // intervalBox->setSpacing(spacingHint()); | 533 | // intervalBox->setSpacing(spacingHint()); |
539 | topLayout->addMultiCellWidget(intervalBox,6,6,0,1); | 534 | topLayout->addMultiCellWidget(intervalBox,6,6,0,1); |
540 | QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); | 535 | QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); |
541 | mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); | 536 | mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); |
542 | autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); | 537 | autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); |
543 | /* | 538 | /* |
544 | QHBox * agendasize = new QHBox ( topFrame ); | 539 | QHBox * agendasize = new QHBox ( topFrame ); |
545 | 540 | ||
546 | new QLabel (i18n("AllDayAgenda Height:"), agendasize ); | 541 | new QLabel (i18n("AllDayAgenda Height:"), agendasize ); |
547 | 542 | ||
548 | 543 | ||
549 | mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); | 544 | mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); |
550 | topLayout->addMultiCellWidget(agendasize,7,7,0,1); | 545 | topLayout->addMultiCellWidget(agendasize,7,7,0,1); |
551 | */ | 546 | */ |
552 | KPrefsDialogWidBool *verticalScreen = | 547 | KPrefsDialogWidBool *verticalScreen = |
553 | addWidBool(i18n("Show vertical screen (Needs restart)"), | 548 | addWidBool(i18n("Show vertical screen (Needs restart)"), |
554 | &(KOPrefs::instance()->mVerticalScreen),topFrame); | 549 | &(KOPrefs::instance()->mVerticalScreen),topFrame); |
555 | //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); | 550 | //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); |
556 | topLayout->addMultiCellWidget(verticalScreen->checkBox(),7,7,0,1); | 551 | topLayout->addMultiCellWidget(verticalScreen->checkBox(),7,7,0,1); |
557 | 552 | ||
558 | KPrefsDialogWidBool *ask = | 553 | KPrefsDialogWidBool *ask = |
559 | addWidBool(i18n("Ask for quit when closing KO/Pi"), | 554 | addWidBool(i18n("Ask for quit when closing KO/Pi"), |
560 | &(KOPrefs::instance()->mAskForQuit),topFrame); | 555 | &(KOPrefs::instance()->mAskForQuit),topFrame); |
561 | topLayout->addMultiCellWidget(ask->checkBox(),8,8,0,1); | 556 | topLayout->addMultiCellWidget(ask->checkBox(),8,8,0,1); |
562 | 557 | ||
563 | 558 | ||
564 | /* | 559 | /* |
565 | KPrefsDialogWidBool *confirmCheck = | 560 | KPrefsDialogWidBool *confirmCheck = |
566 | addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), | 561 | addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), |
567 | topFrame); | 562 | topFrame); |
568 | topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); | 563 | topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); |
569 | 564 | ||
570 | 565 | ||
571 | mEnableGroupScheduling = | 566 | mEnableGroupScheduling = |
572 | addWidBool(i18n("Enable group scheduling"), | 567 | addWidBool(i18n("Enable group scheduling"), |
573 | &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); | 568 | &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); |
574 | topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); | 569 | topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); |
575 | connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), | 570 | connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), |
576 | SLOT(warningGroupScheduling())); | 571 | SLOT(warningGroupScheduling())); |
577 | 572 | ||
578 | mEnableProjectView = | 573 | mEnableProjectView = |
579 | addWidBool(i18n("Enable project view"), | 574 | addWidBool(i18n("Enable project view"), |
580 | &(KOPrefs::instance()->mEnableProjectView),topFrame); | 575 | &(KOPrefs::instance()->mEnableProjectView),topFrame); |
581 | topLayout->addWidget(mEnableProjectView->checkBox(),9,0); | 576 | topLayout->addWidget(mEnableProjectView->checkBox(),9,0); |
582 | connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), | 577 | connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), |
583 | SLOT(warningProjectView())); | 578 | SLOT(warningProjectView())); |
584 | 579 | ||
585 | // Can't be disabled anymore | 580 | // Can't be disabled anymore |
586 | mEnableGroupScheduling->checkBox()->hide(); | 581 | mEnableGroupScheduling->checkBox()->hide(); |
587 | 582 | ||
588 | // Disable setting, because this feature now becomes stable | 583 | // Disable setting, because this feature now becomes stable |
589 | mEnableProjectView->checkBox()->hide(); | 584 | mEnableProjectView->checkBox()->hide(); |
590 | 585 | ||
591 | KPrefsWidRadios *defaultFormatGroup = | 586 | KPrefsWidRadios *defaultFormatGroup = |
592 | addWidRadios(i18n("Default Calendar Format"), | 587 | addWidRadios(i18n("Default Calendar Format"), |
593 | &(KOPrefs::instance()->mDefaultFormat),topFrame); | 588 | &(KOPrefs::instance()->mDefaultFormat),topFrame); |
594 | defaultFormatGroup->addRadio(i18n("vCalendar")); | 589 | defaultFormatGroup->addRadio(i18n("vCalendar")); |
595 | defaultFormatGroup->addRadio(i18n("iCalendar")); | 590 | defaultFormatGroup->addRadio(i18n("iCalendar")); |
596 | 591 | ||
597 | topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); | 592 | topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); |
598 | 593 | ||
599 | // Default format unconditionally is iCalendar | 594 | // Default format unconditionally is iCalendar |
600 | defaultFormatGroup->groupBox()->hide(); | 595 | defaultFormatGroup->groupBox()->hide(); |
601 | 596 | ||
602 | KPrefsWidRadios *mailClientGroup = | 597 | KPrefsWidRadios *mailClientGroup = |
603 | addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), | 598 | addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), |
604 | topFrame); | 599 | topFrame); |
605 | mailClientGroup->addRadio(i18n("KMail")); | 600 | mailClientGroup->addRadio(i18n("KMail")); |
606 | mailClientGroup->addRadio(i18n("Sendmail")); | 601 | mailClientGroup->addRadio(i18n("Sendmail")); |
607 | topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); | 602 | topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); |
608 | 603 | ||
609 | KPrefsDialogWidBool *htmlsave = | 604 | KPrefsDialogWidBool *htmlsave = |
610 | addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), | 605 | addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), |
611 | topFrame); | 606 | topFrame); |
612 | topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); | 607 | topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); |
613 | 608 | ||
614 | KPrefsWidRadios *destinationGroup = | 609 | KPrefsWidRadios *destinationGroup = |
615 | addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), | 610 | addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), |
616 | topFrame); | 611 | topFrame); |
617 | destinationGroup->addRadio(i18n("be added to the standard resource")); | 612 | destinationGroup->addRadio(i18n("be added to the standard resource")); |
618 | destinationGroup->addRadio(i18n("be asked which resource to use")); | 613 | destinationGroup->addRadio(i18n("be asked which resource to use")); |
619 | topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); | 614 | topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); |
620 | 615 | ||
621 | topLayout->setRowStretch(14,1); | 616 | topLayout->setRowStretch(14,1); |
622 | */ | 617 | */ |
623 | } | 618 | } |
624 | 619 | ||
625 | 620 | ||
626 | void KOPrefsDialog::setupTimeTab() | 621 | void KOPrefsDialog::setupTimeTab() |
627 | { | 622 | { |
628 | QFrame *topFrame = addPage(i18n("Time"),0,0); | 623 | QFrame *topFrame = addPage(i18n("Time"),0,0); |
629 | // DesktopIcon("clock",KIcon::SizeMedium)); | 624 | // DesktopIcon("clock",KIcon::SizeMedium)); |
630 | 625 | ||
631 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | 626 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); |
632 | topLayout->setSpacing(spacingHint()); | 627 | topLayout->setSpacing(spacingHint()); |
633 | topLayout->setMargin(marginHint()); | 628 | topLayout->setMargin(marginHint()); |
634 | 629 | ||
635 | QHBox *dummy = new QHBox(topFrame); | 630 | QHBox *dummy = new QHBox(topFrame); |
636 | KPrefsWidTime *dayBegins = | 631 | KPrefsWidTime *dayBegins = |
637 | addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), | 632 | addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), |
638 | dummy); | 633 | dummy); |
639 | //topLayout->addWidget(dayBegins->label(),2,0); | 634 | //topLayout->addWidget(dayBegins->label(),2,0); |
640 | 635 | ||
641 | //topLayout->addWidget(dayBegins->spinBox(),2,1); | 636 | //topLayout->addWidget(dayBegins->spinBox(),2,1); |
642 | topLayout->addMultiCellWidget(dummy,0,0,0,1); | 637 | topLayout->addMultiCellWidget(dummy,0,0,0,1); |
643 | 638 | ||
644 | topLayout->addWidget(new QLabel(i18n("Default appointment time:"), | 639 | topLayout->addWidget(new QLabel(i18n("Default appointment time:"), |
645 | topFrame),1,0); | 640 | topFrame),1,0); |
646 | mStartTimeSpin = new QSpinBox(0,23,1,topFrame); | 641 | mStartTimeSpin = new QSpinBox(0,23,1,topFrame); |
647 | mStartTimeSpin->setSuffix(":00"); | 642 | mStartTimeSpin->setSuffix(":00"); |
648 | topLayout->addWidget(mStartTimeSpin,1,1); | 643 | topLayout->addWidget(mStartTimeSpin,1,1); |
649 | 644 | ||
650 | topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), | 645 | topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), |
651 | topFrame),2,0); | 646 | topFrame),2,0); |
652 | mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); | 647 | mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); |
653 | mDefaultDurationSpin->setSuffix(":00"); | 648 | mDefaultDurationSpin->setSuffix(":00"); |
654 | topLayout->addWidget(mDefaultDurationSpin,2,1); | 649 | topLayout->addWidget(mDefaultDurationSpin,2,1); |
655 | 650 | ||
656 | QStringList alarmList; | 651 | QStringList alarmList; |
657 | alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") | 652 | alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") |
658 | << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; | 653 | << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; |
659 | topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), | 654 | topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), |
660 | 3,0); | 655 | 3,0); |
661 | mAlarmTimeCombo = new QComboBox(topFrame); | 656 | mAlarmTimeCombo = new QComboBox(topFrame); |
662 | mAlarmTimeCombo->insertStringList(alarmList); | 657 | mAlarmTimeCombo->insertStringList(alarmList); |
663 | topLayout->addWidget(mAlarmTimeCombo,3,1); | 658 | topLayout->addWidget(mAlarmTimeCombo,3,1); |
664 | 659 | ||
665 | 660 | ||
666 | QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, | 661 | QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, |
667 | i18n("Working Hours"), | 662 | i18n("Working Hours"), |
668 | topFrame); | 663 | topFrame); |
669 | topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); | 664 | topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); |
670 | workingHoursGroup->layout()->setSpacing( 0 ); | 665 | workingHoursGroup->layout()->setSpacing( 0 ); |
671 | workingHoursGroup->layout()->setMargin( 4 ); | 666 | workingHoursGroup->layout()->setMargin( 4 ); |
672 | QHBox *workStartBox = new QHBox(workingHoursGroup); | 667 | QHBox *workStartBox = new QHBox(workingHoursGroup); |
673 | // workStartBox->setMargin( 0 ); | 668 | // workStartBox->setMargin( 0 ); |
674 | addWidTime(i18n("Daily starting hour:"), | 669 | addWidTime(i18n("Daily starting hour:"), |
675 | &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); | 670 | &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); |
676 | 671 | ||
677 | QHBox *workEndBox = new QHBox(workingHoursGroup); | 672 | QHBox *workEndBox = new QHBox(workingHoursGroup); |
678 | //workEndBox->setMargin( 0 ); | 673 | //workEndBox->setMargin( 0 ); |
679 | addWidTime(i18n("Daily ending hour:"), | 674 | addWidTime(i18n("Daily ending hour:"), |
680 | &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); | 675 | &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); |
681 | QVBox *excludeBox = new QVBox(workingHoursGroup); | 676 | QVBox *excludeBox = new QVBox(workingHoursGroup); |
682 | //excludeBox->setMargin( 0 ); | 677 | //excludeBox->setMargin( 0 ); |
683 | addWidBool(i18n("Exclude holidays"), | 678 | addWidBool(i18n("Exclude holidays"), |
684 | &(KOPrefs::instance()->mExcludeHolidays),excludeBox); | 679 | &(KOPrefs::instance()->mExcludeHolidays),excludeBox); |
685 | 680 | ||
686 | addWidBool(i18n("Exclude Saturdays"), | 681 | addWidBool(i18n("Exclude Saturdays"), |
687 | &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); | 682 | &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); |
688 | 683 | ||
689 | // KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), | 684 | // KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), |
690 | // &(KOPrefs::instance()->mMarcusBainsShowSeconds), | 685 | // &(KOPrefs::instance()->mMarcusBainsShowSeconds), |
691 | // topFrame); | 686 | // topFrame); |
692 | // topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); | 687 | // topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); |
693 | 688 | ||
694 | // topLayout->setRowStretch(6,1); | 689 | // topLayout->setRowStretch(6,1); |
695 | } | 690 | } |
696 | 691 | ||
697 | 692 | ||
698 | void KOPrefsDialog::setupViewsTab() | 693 | void KOPrefsDialog::setupViewsTab() |
699 | { | 694 | { |
700 | 695 | ||
701 | QFrame *topFrame = addPage(i18n("Views"),0,0); | 696 | QFrame *topFrame = addPage(i18n("Views"),0,0); |
702 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 697 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
703 | 698 | ||
704 | QGridLayout *topLayout = new QGridLayout(topFrame,6,1); | 699 | QGridLayout *topLayout = new QGridLayout(topFrame,6,1); |
705 | topLayout->setSpacing(spacingHint()); | 700 | topLayout->setSpacing(spacingHint()); |
706 | topLayout->setMargin(marginHint()); | 701 | topLayout->setMargin(marginHint()); |
707 | 702 | ||
708 | // QBoxLayout *dayBeginsLayout = new QHBoxLayout; | 703 | // QBoxLayout *dayBeginsLayout = new QHBoxLayout; |
709 | // topLayout->addLayout(dayBeginsLayout,0,0); | 704 | // topLayout->addLayout(dayBeginsLayout,0,0); |
710 | 705 | ||
711 | // KPrefsWidTime *dayBegins = | 706 | // KPrefsWidTime *dayBegins = |
712 | // addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), | 707 | // addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), |
713 | // topFrame); | 708 | // topFrame); |
714 | // dayBeginsLayout->addWidget(dayBegins->label()); | 709 | // dayBeginsLayout->addWidget(dayBegins->label()); |
715 | // dayBeginsLayout->addStretch(1); | 710 | // dayBeginsLayout->addStretch(1); |
716 | // dayBeginsLayout->addWidget(dayBegins->spinBox()); | 711 | // dayBeginsLayout->addWidget(dayBegins->spinBox()); |
717 | 712 | ||
718 | // QBoxLayout *nextDaysLayout = new QHBoxLayout; | 713 | // QBoxLayout *nextDaysLayout = new QHBoxLayout; |
719 | // topLayout->addLayout(nextDaysLayout,1,0); | 714 | // topLayout->addLayout(nextDaysLayout,1,0); |
720 | // nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); | 715 | // nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); |
721 | // mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); | 716 | // mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); |
722 | // nextDaysLayout->addStretch(1); | 717 | // nextDaysLayout->addStretch(1); |
723 | // nextDaysLayout->addWidget(mNextXDaysSpin); | 718 | // nextDaysLayout->addWidget(mNextXDaysSpin); |
724 | 719 | ||
725 | 720 | ||
726 | int ii = 0; | 721 | int ii = 0; |
727 | KPrefsDialogWidBool *dummy = | 722 | KPrefsDialogWidBool *dummy = |
728 | addWidBool(i18n("Edit item on doubleclick (if not, show)"), | 723 | addWidBool(i18n("Edit item on doubleclick (if not, show)"), |
729 | &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); | 724 | &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); |
730 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 725 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
731 | 726 | ||
732 | dummy = | 727 | dummy = |
733 | addWidBool(i18n("Highlight current day in agenda"), | 728 | addWidBool(i18n("Highlight current day in agenda"), |
734 | &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); | 729 | &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); |
735 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 730 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
736 | 731 | ||
737 | dummy = | 732 | dummy = |
738 | addWidBool(i18n("Use light color for highlight current day"), | 733 | addWidBool(i18n("Use light color for highlight current day"), |
739 | &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); | 734 | &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); |
740 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 735 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
741 | 736 | ||
742 | KPrefsDialogWidBool *dailyRecur = | 737 | KPrefsDialogWidBool *dailyRecur = |
743 | addWidBool(i18n("Show events that recur daily in date nav."), | 738 | addWidBool(i18n("Show events that recur daily in date nav."), |
744 | &(KOPrefs::instance()->mDailyRecur),topFrame); | 739 | &(KOPrefs::instance()->mDailyRecur),topFrame); |
745 | topLayout->addWidget(dailyRecur->checkBox(),ii++,0); | 740 | topLayout->addWidget(dailyRecur->checkBox(),ii++,0); |
746 | 741 | ||
747 | KPrefsDialogWidBool *weeklyRecur = | 742 | KPrefsDialogWidBool *weeklyRecur = |
748 | addWidBool(i18n("Show ev. that recur weekly in date nav."), | 743 | addWidBool(i18n("Show ev. that recur weekly in date nav."), |
749 | &(KOPrefs::instance()->mWeeklyRecur),topFrame); | 744 | &(KOPrefs::instance()->mWeeklyRecur),topFrame); |
750 | topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); | 745 | topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); |
751 | if ( QApplication::desktop()->width() > 640 ) { | 746 | if ( QApplication::desktop()->width() > 640 ) { |
752 | 747 | ||
753 | KPrefsDialogWidBool *enableToolTips = | 748 | KPrefsDialogWidBool *enableToolTips = |
754 | addWidBool(i18n("Enable tooltips displaying summary of ev."), | 749 | addWidBool(i18n("Enable tooltips displaying summary of ev."), |
755 | &(KOPrefs::instance()->mEnableToolTips),topFrame); | 750 | &(KOPrefs::instance()->mEnableToolTips),topFrame); |
756 | topLayout->addWidget(enableToolTips->checkBox(),ii++,0); | 751 | topLayout->addWidget(enableToolTips->checkBox(),ii++,0); |
757 | 752 | ||
758 | } | 753 | } |
759 | KPrefsDialogWidBool *passwdk = | 754 | KPrefsDialogWidBool *passwdk = |
760 | addWidBool(i18n("Show parent To-Do's in What's Next view"), | 755 | addWidBool(i18n("Show parent To-Do's in What's Next view"), |
761 | &(KOPrefs::instance()->mWNViewShowsParents),topFrame); | 756 | &(KOPrefs::instance()->mWNViewShowsParents),topFrame); |
762 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 757 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
763 | 758 | ||
764 | passwdk = | 759 | passwdk = |
765 | addWidBool(i18n("Show location in What's Next view"), | 760 | addWidBool(i18n("Show location in What's Next view"), |
766 | &(KOPrefs::instance()->mWNViewShowLocation),topFrame); | 761 | &(KOPrefs::instance()->mWNViewShowLocation),topFrame); |
767 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 762 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
768 | 763 | ||
769 | passwdk = | 764 | passwdk = |
770 | addWidBool(i18n("Show Sync Events in WN/Agenda view"), | 765 | addWidBool(i18n("Show Sync Events in WN/Agenda view"), |
771 | &(KOPrefs::instance()->mShowSyncEvents),topFrame); | 766 | &(KOPrefs::instance()->mShowSyncEvents),topFrame); |
772 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 767 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
773 | 768 | ||
774 | 769 | ||
775 | KPrefsDialogWidBool *marcusBainsEnabled = | 770 | KPrefsDialogWidBool *marcusBainsEnabled = |
776 | addWidBool(i18n("Show Marcus Bains line"), | 771 | addWidBool(i18n("Show Marcus Bains line"), |
777 | &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); | 772 | &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); |
778 | topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); | 773 | topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); |
779 | 774 | ||
780 | 775 | ||
781 | // topLayout->addWidget(hourSizeGroup,ii++,0); | 776 | // topLayout->addWidget(hourSizeGroup,ii++,0); |
782 | // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); | 777 | // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); |
783 | //topLayout->setRowStretch(11,1); | 778 | //topLayout->setRowStretch(11,1); |
784 | 779 | ||
785 | 780 | ||
786 | 781 | ||
787 | 782 | ||
788 | 783 | ||
789 | 784 | ||
790 | topFrame = addPage(i18n("ViewChange"),0,0); | 785 | topFrame = addPage(i18n("ViewChange"),0,0); |
791 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 786 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
792 | 787 | ||
793 | topLayout = new QGridLayout(topFrame,6,1); | 788 | topLayout = new QGridLayout(topFrame,6,1); |
794 | topLayout->setSpacing(spacingHint()); | 789 | topLayout->setSpacing(spacingHint()); |
795 | topLayout->setMargin(marginHint()); | 790 | topLayout->setMargin(marginHint()); |
796 | ii = 0; | 791 | ii = 0; |
797 | 792 | ||
798 | 793 | ||
799 | dummy = | 794 | dummy = |
800 | addWidBool(i18n("Hold fullscreen on view change"), | 795 | addWidBool(i18n("Hold fullscreen on view change"), |
801 | &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); | 796 | &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); |
802 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 797 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
803 | 798 | ||
804 | dummy = | 799 | dummy = |
805 | addWidBool(i18n("Hold non-fullscreen on view change"), | 800 | addWidBool(i18n("Hold non-fullscreen on view change"), |
806 | &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); | 801 | &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); |
807 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 802 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
808 | 803 | ||
809 | 804 | ||
810 | KPrefsDialogWidBool *fullViewTodo = | 805 | KPrefsDialogWidBool *fullViewTodo = |
811 | addWidBool(i18n("Event list view uses full window"), | 806 | addWidBool(i18n("Event list view uses full window"), |
812 | &(KOPrefs::instance()->mFullViewTodo),topFrame); | 807 | &(KOPrefs::instance()->mFullViewTodo),topFrame); |
813 | topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); | 808 | topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); |
814 | 809 | ||
815 | KPrefsDialogWidBool *fullViewMonth = | 810 | KPrefsDialogWidBool *fullViewMonth = |
816 | addWidBool(i18n("Next days view uses full window"), | 811 | addWidBool(i18n("Next days view uses full window"), |
817 | &(KOPrefs::instance()->mFullViewMonth),topFrame); | 812 | &(KOPrefs::instance()->mFullViewMonth),topFrame); |
818 | topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); | 813 | topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); |
819 | 814 | ||
820 | dummy = | 815 | dummy = |
821 | addWidBool(i18n("Set agenda to DayBeginsAt on change"), | 816 | addWidBool(i18n("Set agenda to DayBeginsAt on change"), |
822 | &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); | 817 | &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); |
823 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 818 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
824 | 819 | ||
825 | dummy = | 820 | dummy = |
826 | addWidBool(i18n("Set agenda to current time on change"), | 821 | addWidBool(i18n("Set agenda to current time on change"), |
827 | &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); | 822 | &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); |
828 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 823 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
829 | 824 | ||
830 | dummy = | 825 | dummy = |
831 | addWidBool(i18n("Listview uses monthly timespan"), | 826 | addWidBool(i18n("Listview uses monthly timespan"), |
832 | &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); | 827 | &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); |
833 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 828 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
834 | dummy = | 829 | dummy = |
835 | addWidBool(i18n("Highlight selection in Time Edit"), | 830 | addWidBool(i18n("Highlight selection in Time Edit"), |
836 | &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); | 831 | &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); |
837 | topLayout->addWidget( dummy->checkBox(), ii++,0); | 832 | topLayout->addWidget( dummy->checkBox(), ii++,0); |
838 | 833 | ||
839 | 834 | ||
840 | 835 | ||
841 | 836 | ||
842 | 837 | ||
843 | topFrame = addPage(i18n("Month View"),0,0); | 838 | topFrame = addPage(i18n("Month View"),0,0); |
844 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 839 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
845 | 840 | ||
846 | topLayout = new QGridLayout(topFrame,5,1); | 841 | topLayout = new QGridLayout(topFrame,5,1); |
847 | topLayout->setSpacing(spacingHint()); | 842 | topLayout->setSpacing(spacingHint()); |
848 | topLayout->setMargin(marginHint()); | 843 | topLayout->setMargin(marginHint()); |
849 | ii = 0; | 844 | ii = 0; |
850 | QLabel *lab; | 845 | QLabel *lab; |
851 | QHBox *habo = new QHBox( topFrame ); | 846 | QHBox *habo = new QHBox( topFrame ); |
852 | if ( QApplication::desktop()->width() < 320 ) { | 847 | if ( QApplication::desktop()->width() < 320 ) { |
853 | lab = new QLabel ( i18n("Show events that recur "), topFrame ); | 848 | lab = new QLabel ( i18n("Show events that recur "), topFrame ); |
854 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); | 849 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); |
855 | ii++; | 850 | ii++; |
856 | 851 | ||
857 | } else { | 852 | } else { |
858 | new QLabel ( i18n("Show events that recur "), habo ); | 853 | new QLabel ( i18n("Show events that recur "), habo ); |
859 | 854 | ||
860 | } | 855 | } |
861 | dailyRecur = | 856 | dailyRecur = |
862 | addWidBool(i18n("daily"), | 857 | addWidBool(i18n("daily"), |
863 | &(KOPrefs::instance()->mMonthDailyRecur),habo); | 858 | &(KOPrefs::instance()->mMonthDailyRecur),habo); |
864 | // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); | 859 | // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); |
865 | 860 | ||
866 | weeklyRecur = | 861 | weeklyRecur = |
867 | addWidBool(i18n("weekly"), | 862 | addWidBool(i18n("weekly"), |
868 | &(KOPrefs::instance()->mMonthWeeklyRecur),habo); | 863 | &(KOPrefs::instance()->mMonthWeeklyRecur),habo); |
869 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); | 864 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); |
870 | ii++; | 865 | ii++; |
871 | 866 | ||
872 | 867 | ||
873 | habo = new QHBox( topFrame ); | 868 | habo = new QHBox( topFrame ); |
874 | if ( QApplication::desktop()->width() < 320 ) { | 869 | if ( QApplication::desktop()->width() < 320 ) { |
875 | lab = new QLabel (i18n("Show in every cell ") , topFrame ); | 870 | lab = new QLabel (i18n("Show in every cell ") , topFrame ); |
876 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); | 871 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); |
877 | ii++; | 872 | ii++; |
878 | 873 | ||
879 | } else { | 874 | } else { |
880 | new QLabel ( i18n("Show in every cell "), habo ); | 875 | new QLabel ( i18n("Show in every cell "), habo ); |
881 | } | 876 | } |
882 | weeklyRecur = | 877 | weeklyRecur = |
883 | addWidBool(i18n("short month"), | 878 | addWidBool(i18n("short month"), |
884 | &(KOPrefs::instance()->mMonthShowShort),habo); | 879 | &(KOPrefs::instance()->mMonthShowShort),habo); |
885 | weeklyRecur = | 880 | weeklyRecur = |
886 | addWidBool(i18n("icons"), | 881 | addWidBool(i18n("icons"), |
887 | &(KOPrefs::instance()->mMonthShowIcons),habo); | 882 | &(KOPrefs::instance()->mMonthShowIcons),habo); |
888 | 883 | ||
889 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); | 884 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); |
890 | ii++; | 885 | ii++; |
891 | #ifdef DESKTOP_VERSION | 886 | #ifdef DESKTOP_VERSION |
892 | KPrefsDialogWidBool *enableMonthScroll = | 887 | KPrefsDialogWidBool *enableMonthScroll = |
893 | addWidBool(i18n("Enable scrollbars in month view cells"), | 888 | addWidBool(i18n("Enable scrollbars in month view cells"), |
894 | &(KOPrefs::instance()->mEnableMonthScroll),topFrame); | 889 | &(KOPrefs::instance()->mEnableMonthScroll),topFrame); |
895 | topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); | 890 | topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); |
896 | #endif | 891 | #endif |
897 | 892 | ||
898 | dummy = | 893 | dummy = |
899 | addWidBool(i18n("Show Sat/Sun together"), | 894 | addWidBool(i18n("Show Sat/Sun together"), |
900 | &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); | 895 | &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); |
901 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 896 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
902 | 897 | ||
903 | KPrefsDialogWidBool *coloredCategoriesInMonthView = | 898 | KPrefsDialogWidBool *coloredCategoriesInMonthView = |
904 | addWidBool(i18n("Month view uses category colors"), | 899 | addWidBool(i18n("Month view uses category colors"), |
905 | &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); | 900 | &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); |
906 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); | 901 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); |
907 | 902 | ||
908 | dummy = | 903 | dummy = |
909 | addWidBool(i18n("Categorie colors are applied to text"), | 904 | addWidBool(i18n("Categorie colors are applied to text"), |
910 | &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); | 905 | &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); |
911 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 906 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
912 | coloredCategoriesInMonthView = | 907 | coloredCategoriesInMonthView = |
913 | addWidBool(i18n("Month view uses day colors"), | 908 | addWidBool(i18n("Month view uses day colors"), |
914 | &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); | 909 | &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); |
915 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); | 910 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); |
916 | 911 | ||
917 | KPrefsWidColor *holidayColor = | 912 | KPrefsWidColor *holidayColor = |
918 | addWidColor(i18n("Day color odd months"), | 913 | addWidColor(i18n("Day color odd months"), |
919 | &(KOPrefs::instance()->mMonthViewOddColor),topFrame); | 914 | &(KOPrefs::instance()->mMonthViewOddColor),topFrame); |
920 | topLayout->addWidget(holidayColor->label(),ii,0); | 915 | topLayout->addWidget(holidayColor->label(),ii,0); |
921 | topLayout->addWidget(holidayColor->button(),ii++,1); | 916 | topLayout->addWidget(holidayColor->button(),ii++,1); |
922 | 917 | ||
923 | holidayColor = | 918 | holidayColor = |
924 | addWidColor(i18n("Day color even months"), | 919 | addWidColor(i18n("Day color even months"), |
925 | &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); | 920 | &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); |
926 | topLayout->addWidget(holidayColor->label(),ii,0); | 921 | topLayout->addWidget(holidayColor->label(),ii,0); |
927 | topLayout->addWidget(holidayColor->button(),ii++,1); | 922 | topLayout->addWidget(holidayColor->button(),ii++,1); |
928 | 923 | ||
929 | 924 | ||
930 | holidayColor = | 925 | holidayColor = |
931 | addWidColor(i18n("Color for Sundays + category \"Holiday\""), | 926 | addWidColor(i18n("Color for Sundays + category \"Holiday\""), |
932 | &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); | 927 | &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); |
933 | topLayout->addWidget(holidayColor->label(),ii,0); | 928 | topLayout->addWidget(holidayColor->label(),ii,0); |
934 | topLayout->addWidget(holidayColor->button(),ii++,1); | 929 | topLayout->addWidget(holidayColor->button(),ii++,1); |
935 | 930 | ||
936 | // *********************** Todo View | 931 | // *********************** Todo View |
937 | 932 | ||
938 | topFrame = addPage(i18n("Todo View"),0,0); | 933 | topFrame = addPage(i18n("Todo View"),0,0); |
939 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 934 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
940 | 935 | ||
941 | topLayout = new QGridLayout(topFrame,4,1); | 936 | topLayout = new QGridLayout(topFrame,4,1); |
942 | topLayout->setSpacing(spacingHint()); | 937 | topLayout->setSpacing(spacingHint()); |
943 | topLayout->setMargin(marginHint()); | 938 | topLayout->setMargin(marginHint()); |
944 | ii = 0; | 939 | ii = 0; |
945 | 940 | ||
946 | KPrefsDialogWidBool *showCompletedTodo = | 941 | KPrefsDialogWidBool *showCompletedTodo = |
947 | addWidBool(i18n("To-do view shows completed Todos"), | 942 | addWidBool(i18n("To-do view shows completed Todos"), |
948 | &(KOPrefs::instance()->mShowCompletedTodo),topFrame); | 943 | &(KOPrefs::instance()->mShowCompletedTodo),topFrame); |
949 | topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); | 944 | topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); |
950 | dummy = | 945 | dummy = |
951 | addWidBool(i18n("To-do view shows complete as 'xx %'"), | 946 | addWidBool(i18n("To-do view shows complete as 'xx %'"), |
952 | &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); | 947 | &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); |
953 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 948 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
954 | 949 | ||
955 | dummy = | 950 | dummy = |
956 | addWidBool(i18n("Small To-do view uses smaller font"), | 951 | addWidBool(i18n("Small To-do view uses smaller font"), |
957 | &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); | 952 | &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); |
958 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 953 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
959 | 954 | ||
960 | 955 | ||
961 | 956 | ||
962 | dummy = | 957 | dummy = |
963 | addWidBool(i18n("Todo view uses category colors"), | 958 | addWidBool(i18n("Todo view uses category colors"), |
964 | &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); | 959 | &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); |
965 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 960 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
966 | 961 | ||
967 | 962 | ||
968 | QWidget* wid = new QWidget( topFrame ); | 963 | QWidget* wid = new QWidget( topFrame ); |
969 | // Todo due today color | 964 | // Todo due today color |
970 | KPrefsWidColor *todoDueTodayColor = | 965 | KPrefsWidColor *todoDueTodayColor = |
971 | addWidColor(i18n("Todo due today color:"), | 966 | addWidColor(i18n("Todo due today color:"), |
972 | &(KOPrefs::instance()->mTodoDueTodayColor),wid); | 967 | &(KOPrefs::instance()->mTodoDueTodayColor),wid); |
973 | QHBoxLayout *widLayout = new QHBoxLayout(wid); | 968 | QHBoxLayout *widLayout = new QHBoxLayout(wid); |
974 | widLayout->addWidget( todoDueTodayColor->label() ); | 969 | widLayout->addWidget( todoDueTodayColor->label() ); |
975 | widLayout->addWidget( todoDueTodayColor->button() ); | 970 | widLayout->addWidget( todoDueTodayColor->button() ); |
976 | topLayout->addWidget(wid,ii++,0); | 971 | topLayout->addWidget(wid,ii++,0); |
977 | //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); | 972 | //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); |
978 | 973 | ||
979 | // Todo overdue color | 974 | // Todo overdue color |
980 | wid = new QWidget( topFrame ); | 975 | wid = new QWidget( topFrame ); |
981 | widLayout = new QHBoxLayout(wid); | 976 | widLayout = new QHBoxLayout(wid); |
982 | KPrefsWidColor *todoOverdueColor = | 977 | KPrefsWidColor *todoOverdueColor = |
983 | addWidColor(i18n("Todo overdue color:"), | 978 | addWidColor(i18n("Todo overdue color:"), |
984 | &(KOPrefs::instance()->mTodoOverdueColor),wid); | 979 | &(KOPrefs::instance()->mTodoOverdueColor),wid); |
985 | widLayout->addWidget(todoOverdueColor->label()); | 980 | widLayout->addWidget(todoOverdueColor->label()); |
986 | widLayout->addWidget(todoOverdueColor->button()); | 981 | widLayout->addWidget(todoOverdueColor->button()); |
987 | topLayout->addWidget(wid,ii++,0); | 982 | topLayout->addWidget(wid,ii++,0); |
988 | 983 | ||
989 | dummy = | 984 | dummy = |
990 | addWidBool(i18n("Colors are applied to text"), | 985 | addWidBool(i18n("Colors are applied to text"), |
991 | &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); | 986 | &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); |
992 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 987 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
993 | 988 | ||
994 | dummy = | 989 | dummy = |
995 | addWidBool(i18n("Allday Agenda view shows todos"), | 990 | addWidBool(i18n("Allday Agenda view shows todos"), |
996 | &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); | 991 | &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); |
997 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 992 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
998 | 993 | ||
999 | 994 | ||
1000 | 995 | ||
1001 | 996 | ||
1002 | topFrame = addPage(i18n("Alarm"),0,0); | 997 | topFrame = addPage(i18n("Alarm"),0,0); |
1003 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 998 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
1004 | 999 | ||
1005 | topLayout = new QGridLayout(topFrame,2,1); | 1000 | topLayout = new QGridLayout(topFrame,2,1); |
1006 | topLayout->setSpacing(spacingHint()); | 1001 | topLayout->setSpacing(spacingHint()); |
diff --git a/kmicromail/koprefsdialog.h b/kmicromail/koprefsdialog.h index a0416ae..7fa9261 100644 --- a/kmicromail/koprefsdialog.h +++ b/kmicromail/koprefsdialog.h | |||
@@ -1,180 +1,179 @@ | |||
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 | #ifndef _KOPREFSDIALOG_H | 23 | #ifndef _KOPREFSDIALOG_H |
24 | #define _KOPREFSDIALOG_H | 24 | #define _KOPREFSDIALOG_H |
25 | 25 | ||
26 | #include <qframe.h> | 26 | #include <qframe.h> |
27 | #include <qdict.h> | 27 | #include <qdict.h> |
28 | #include <qcolor.h> | 28 | #include <qcolor.h> |
29 | #include <qlistview.h> | 29 | #include <qlistview.h> |
30 | 30 | ||
31 | #include <kdialogbase.h> | 31 | #include <kdialogbase.h> |
32 | 32 | ||
33 | #include <libkdepim/kprefsdialog.h> | 33 | #include <libkdepim/kprefsdialog.h> |
34 | #include <libkdepim/kdateedit.h> | 34 | #include <libkdepim/kdateedit.h> |
35 | #include <kcmconfigs/kdepimconfigwidget.h> | 35 | #include <kcmconfigs/kdepimconfigwidget.h> |
36 | 36 | ||
37 | class KColorButton; | 37 | class KColorButton; |
38 | class QSpinBox; | 38 | class QSpinBox; |
39 | class QSlider; | 39 | class QSlider; |
40 | class KURLRequester; | 40 | class KURLRequester; |
41 | class QComboBox; | 41 | class QComboBox; |
42 | class QLineEdit; | 42 | class QLineEdit; |
43 | class QStringList; | 43 | class QStringList; |
44 | 44 | ||
45 | /** Dialog to change the korganizer configuration. | 45 | /** Dialog to change the korganizer configuration. |
46 | */ | 46 | */ |
47 | class KOPrefsDialog : public KPrefsDialog | 47 | class KOPrefsDialog : public KPrefsDialog |
48 | { | 48 | { |
49 | Q_OBJECT | 49 | Q_OBJECT |
50 | public: | 50 | public: |
51 | /** Initialize dialog and pages */ | 51 | /** Initialize dialog and pages */ |
52 | KOPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false); | 52 | KOPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false); |
53 | ~KOPrefsDialog(); | 53 | ~KOPrefsDialog(); |
54 | 54 | ||
55 | protected: | 55 | protected: |
56 | void usrReadConfig(); | 56 | void usrReadConfig(); |
57 | void usrWriteConfig(); | 57 | void usrWriteConfig(); |
58 | 58 | ||
59 | void setupMainTab(); | 59 | void setupMainTab(); |
60 | void setupGlobalTab(); | 60 | void setupGlobalTab(); |
61 | void setupMailTab(); | 61 | void setupMailTab(); |
62 | void setupFontsTab(); | 62 | void setupFontsTab(); |
63 | private: | 63 | private: |
64 | KDEPIMConfigWidget* kdelibcfg; | ||
65 | QLineEdit *mNameEdit; | 64 | QLineEdit *mNameEdit; |
66 | QLineEdit *mCodecEdit; | 65 | QLineEdit *mCodecEdit; |
67 | QLineEdit *mEmailEdit; | 66 | QLineEdit *mEmailEdit; |
68 | QLabel *mNameLabel; | 67 | QLabel *mNameLabel; |
69 | QLabel *mEmailLabel; | 68 | QLabel *mEmailLabel; |
70 | #if 0 | 69 | #if 0 |
71 | /* | 70 | /* |
72 | public slots: | 71 | public slots: |
73 | void showPrinterTab(); | 72 | void showPrinterTab(); |
74 | 73 | ||
75 | 74 | ||
76 | void updateCategories(); | 75 | void updateCategories(); |
77 | void showSyncPage(); | 76 | void showSyncPage(); |
78 | protected slots: | 77 | protected slots: |
79 | void selectSoundFile(); | 78 | void selectSoundFile(); |
80 | void setCategoryColor(); | 79 | void setCategoryColor(); |
81 | void updateCategoryColor(); | 80 | void updateCategoryColor(); |
82 | void updateTimezoneOffset( int ); | 81 | void updateTimezoneOffset( int ); |
83 | 82 | ||
84 | 83 | ||
85 | void warningExperimental(bool on); | 84 | void warningExperimental(bool on); |
86 | void warningGroupScheduling(); | 85 | void warningGroupScheduling(); |
87 | void warningProjectView(); | 86 | void warningProjectView(); |
88 | 87 | ||
89 | void toggleEmailSettings(bool); | 88 | void toggleEmailSettings(bool); |
90 | 89 | ||
91 | //additional emails | 90 | //additional emails |
92 | void addItem(); | 91 | void addItem(); |
93 | void removeItem(); | 92 | void removeItem(); |
94 | void updateItem(); | 93 | void updateItem(); |
95 | void updateInput(); | 94 | void updateInput(); |
96 | */ | 95 | */ |
97 | protected: | 96 | protected: |
98 | void usrReadConfig(); | 97 | void usrReadConfig(); |
99 | void usrWriteConfig(); | 98 | void usrWriteConfig(); |
100 | 99 | ||
101 | void setupMainTab(); | 100 | void setupMainTab(); |
102 | void setupTimeTab(); | 101 | void setupTimeTab(); |
103 | void setupTimeZoneTab(); | 102 | void setupTimeZoneTab(); |
104 | void setupLocaleTab(); | 103 | void setupLocaleTab(); |
105 | void setupLocaleDateTab(); | 104 | void setupLocaleDateTab(); |
106 | void setupFontsTab(); | 105 | void setupFontsTab(); |
107 | void setupColorsTab(); | 106 | void setupColorsTab(); |
108 | void setupViewsTab(); | 107 | void setupViewsTab(); |
109 | void setupDisplayTab(); | 108 | void setupDisplayTab(); |
110 | void setupPrinterTab(); | 109 | void setupPrinterTab(); |
111 | void setupGroupSchedulingTab(); | 110 | void setupGroupSchedulingTab(); |
112 | void setupGroupAutomationTab(); | 111 | void setupGroupAutomationTab(); |
113 | void setupSyncTab(); | 112 | void setupSyncTab(); |
114 | void setupSyncAlgTab(); | 113 | void setupSyncAlgTab(); |
115 | 114 | ||
116 | void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0); | 115 | void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0); |
117 | 116 | ||
118 | 117 | ||
119 | private: | 118 | private: |
120 | KPrefsWidBool *mEnableGroupScheduling; | 119 | KPrefsWidBool *mEnableGroupScheduling; |
121 | KPrefsWidBool *mEnableProjectView; | 120 | KPrefsWidBool *mEnableProjectView; |
122 | 121 | ||
123 | QFrame *mPrinterTab; | 122 | QFrame *mPrinterTab; |
124 | 123 | ||
125 | QLineEdit *nameEdit; | 124 | QLineEdit *nameEdit; |
126 | QLineEdit *emailEdit; | 125 | QLineEdit *emailEdit; |
127 | 126 | ||
128 | QComboBox *timeCombo; | 127 | QComboBox *timeCombo; |
129 | QComboBox *tzCombo; | 128 | QComboBox *tzCombo; |
130 | 129 | ||
131 | // widgets holding preferences data | 130 | // widgets holding preferences data |
132 | QLineEdit *mNameEdit; | 131 | QLineEdit *mNameEdit; |
133 | QLineEdit *mEmailEdit; | 132 | QLineEdit *mEmailEdit; |
134 | QLabel *mNameLabel; | 133 | QLabel *mNameLabel; |
135 | QLabel *mEmailLabel; | 134 | QLabel *mEmailLabel; |
136 | QLineEdit *mAdditionalEdit; | 135 | QLineEdit *mAdditionalEdit; |
137 | QSpinBox *mAutoSaveIntervalSpin; | 136 | QSpinBox *mAutoSaveIntervalSpin; |
138 | QSpinBox *mPrioSpin; | 137 | QSpinBox *mPrioSpin; |
139 | // QListView *mAMails; | 138 | // QListView *mAMails; |
140 | QLineEdit *aEmailsEdit; | 139 | QLineEdit *aEmailsEdit; |
141 | 140 | ||
142 | QComboBox *mTimeZoneCombo; | 141 | QComboBox *mTimeZoneCombo; |
143 | QStringList tzonenames; | 142 | QStringList tzonenames; |
144 | QSpinBox *mStartTimeSpin; | 143 | QSpinBox *mStartTimeSpin; |
145 | QSpinBox *mDefaultDurationSpin; | 144 | QSpinBox *mDefaultDurationSpin; |
146 | QComboBox *mAlarmTimeCombo; | 145 | QComboBox *mAlarmTimeCombo; |
147 | 146 | ||
148 | QComboBox *mCategoryCombo; | 147 | QComboBox *mCategoryCombo; |
149 | KColorButton *mCategoryButton; | 148 | KColorButton *mCategoryButton; |
150 | QDict<QColor> mCategoryDict; | 149 | QDict<QColor> mCategoryDict; |
151 | 150 | ||
152 | QSlider *mHourSizeSlider; | 151 | QSlider *mHourSizeSlider; |
153 | 152 | ||
154 | QSpinBox *mNextXDaysSpin; | 153 | QSpinBox *mNextXDaysSpin; |
155 | QSpinBox *mWhatsNextSpin; | 154 | QSpinBox *mWhatsNextSpin; |
156 | 155 | ||
157 | QLineEdit * mRemoteIPEdit; | 156 | QLineEdit * mRemoteIPEdit; |
158 | QLineEdit * mRemoteUser; | 157 | QLineEdit * mRemoteUser; |
159 | QLineEdit * mRemotePassWd; | 158 | QLineEdit * mRemotePassWd; |
160 | QLineEdit * mRemoteFile; | 159 | QLineEdit * mRemoteFile; |
161 | QLineEdit * mLocalTempFile; | 160 | QLineEdit * mLocalTempFile; |
162 | QWidget* mSetupSyncAlgTab; | 161 | QWidget* mSetupSyncAlgTab; |
163 | QLineEdit * mUserDateFormatLong; | 162 | QLineEdit * mUserDateFormatLong; |
164 | QLineEdit * mUserDateFormatShort; | 163 | QLineEdit * mUserDateFormatShort; |
165 | 164 | ||
166 | QSpinBox *mTimezoneOffsetSpin; | 165 | QSpinBox *mTimezoneOffsetSpin; |
167 | QSpinBox *mDaylightsavingStart; | 166 | QSpinBox *mDaylightsavingStart; |
168 | QSpinBox *mDaylightsavingEnd; | 167 | QSpinBox *mDaylightsavingEnd; |
169 | KDateEdit* mStartDateSavingEdit; | 168 | KDateEdit* mStartDateSavingEdit; |
170 | KDateEdit* mEndDateSavingEdit; | 169 | KDateEdit* mEndDateSavingEdit; |
171 | QSpinBox * mAlarmPlayBeeps; | 170 | QSpinBox * mAlarmPlayBeeps; |
172 | QSpinBox * mAlarmSuspendTime; | 171 | QSpinBox * mAlarmSuspendTime; |
173 | QSpinBox * mAlarmSuspendCount; | 172 | QSpinBox * mAlarmSuspendCount; |
174 | QSpinBox * mAlarmBeepInterval; | 173 | QSpinBox * mAlarmBeepInterval; |
175 | 174 | ||
176 | QLineEdit * mDefaultAlarmFile; | 175 | QLineEdit * mDefaultAlarmFile; |
177 | #endif | 176 | #endif |
178 | }; | 177 | }; |
179 | 178 | ||
180 | #endif | 179 | #endif |
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index 9a52d1b..e3c5ec3 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp | |||
@@ -1,416 +1,429 @@ | |||
1 | 1 | ||
2 | // CHANGED 2004-08-06 Lutz Rogowski | 2 | // CHANGED 2004-08-06 Lutz Rogowski |
3 | #include <qlabel.h> | 3 | #include <qlabel.h> |
4 | #include <qvbox.h> | 4 | #include <qvbox.h> |
5 | #include <qheader.h> | 5 | #include <qheader.h> |
6 | #include <qtimer.h> | 6 | #include <qtimer.h> |
7 | #include <qlayout.h> | 7 | #include <qlayout.h> |
8 | //#include <kdialog.h> | 8 | //#include <kdialog.h> |
9 | #include <kiconloader.h> | 9 | #include <kiconloader.h> |
10 | #include <kapplication.h> | 10 | #include <kapplication.h> |
11 | 11 | ||
12 | #ifdef DESKTOP_VERSION | 12 | #ifdef DESKTOP_VERSION |
13 | #include <qapplication.h> | 13 | #include <qapplication.h> |
14 | #include <qstatusbar.h> | 14 | #include <qstatusbar.h> |
15 | #include <kabc/stdaddressbook.h> | 15 | #include <kabc/stdaddressbook.h> |
16 | extern QStatusBar* globalSstatusBarMainWindow; | 16 | extern QStatusBar* globalSstatusBarMainWindow; |
17 | #else | 17 | #else |
18 | #include <qpe/qpeapplication.h> | 18 | #include <qpe/qpeapplication.h> |
19 | #include <klocale.h> | 19 | #include <klocale.h> |
20 | #endif | 20 | #endif |
21 | #include "defines.h" | 21 | #include "defines.h" |
22 | #include "koprefs.h" | 22 | #include "koprefs.h" |
23 | #include "mainwindow.h" | 23 | #include "mainwindow.h" |
24 | #include "mailistviewitem.h" | 24 | #include "mailistviewitem.h" |
25 | #include <KDGanttMinimizeSplitter.h> | 25 | #include <KDGanttMinimizeSplitter.h> |
26 | 26 | ||
27 | #include "koprefs.h" | 27 | #include "koprefs.h" |
28 | 28 | ||
29 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | 29 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) |
30 | : QMainWindow( parent, name ) //, flags ) | 30 | : QMainWindow( parent, name ) //, flags ) |
31 | { | 31 | { |
32 | #ifdef DESKTOP_VERSION | 32 | #ifdef DESKTOP_VERSION |
33 | globalSstatusBarMainWindow = statusBar(); | 33 | globalSstatusBarMainWindow = statusBar(); |
34 | #endif | 34 | #endif |
35 | setCaption( i18n( "KOpieMail/Pi" ) ); | 35 | setCaption( i18n( "KOpieMail/Pi" ) ); |
36 | setToolBarsMovable( false ); | 36 | setToolBarsMovable( false ); |
37 | //KABC::StdAddressBook::self(); | 37 | //KABC::StdAddressBook::self(); |
38 | toolBar = new QToolBar( this ); | 38 | toolBar = new QToolBar( this ); |
39 | menuBar = new QPEMenuBar( toolBar ); | 39 | menuBar = new QPEMenuBar( toolBar ); |
40 | mailMenu = new QPopupMenu( menuBar ); | 40 | mailMenu = new QPopupMenu( menuBar ); |
41 | menuBar->insertItem( i18n( "Mail" ), mailMenu ); | 41 | menuBar->insertItem( i18n( "Mail" ), mailMenu ); |
42 | settingsMenu = new QPopupMenu( menuBar ); | 42 | settingsMenu = new QPopupMenu( menuBar ); |
43 | menuBar->insertItem( i18n( "Settings" ), settingsMenu ); | 43 | menuBar->insertItem( i18n( "Settings" ), settingsMenu ); |
44 | 44 | ||
45 | addToolBar( toolBar ); | 45 | addToolBar( toolBar ); |
46 | toolBar->setHorizontalStretchable( true ); | 46 | toolBar->setHorizontalStretchable( true ); |
47 | QAction* getMail = new QAction( i18n( "Get all new mails" ), SmallIcon("enter"), | 47 | QAction* getMail = new QAction( i18n( "Get all new mails" ), SmallIcon("enter"), |
48 | 0, 0, this ); | 48 | 0, 0, this ); |
49 | connect(getMail, SIGNAL( activated() ), | 49 | connect(getMail, SIGNAL( activated() ), |
50 | SLOT( slotGetAllMail() ) ); | 50 | SLOT( slotGetAllMail() ) ); |
51 | getMail->addTo( mailMenu ); | 51 | getMail->addTo( mailMenu ); |
52 | 52 | ||
53 | getMail = new QAction( i18n( "Get new messages" ), SmallIcon("add"), | 53 | getMail = new QAction( i18n( "Get new messages" ), SmallIcon("add"), |
54 | 0, 0, this ); | 54 | 0, 0, this ); |
55 | getMail->addTo( toolBar ); | 55 | getMail->addTo( toolBar ); |
56 | getMail->addTo( mailMenu ); | 56 | getMail->addTo( mailMenu ); |
57 | connect(getMail, SIGNAL( activated() ), | 57 | connect(getMail, SIGNAL( activated() ), |
58 | SLOT( slotGetMail() ) ); | 58 | SLOT( slotGetMail() ) ); |
59 | 59 | ||
60 | composeMail = new QAction( i18n( "Compose new mail" ), SmallIcon("composemail"), | 60 | composeMail = new QAction( i18n( "Compose new mail" ), SmallIcon("composemail"), |
61 | 0, 0, this ); | 61 | 0, 0, this ); |
62 | composeMail->addTo( toolBar ); | 62 | composeMail->addTo( toolBar ); |
63 | composeMail->addTo( mailMenu ); | 63 | composeMail->addTo( mailMenu ); |
64 | 64 | ||
65 | sendQueued = new QAction( i18n( "Send queued mails" ), SmallIcon("sendqueued") , | 65 | sendQueued = new QAction( i18n( "Send queued mails" ), SmallIcon("sendqueued") , |
66 | 0, 0, this ); | 66 | 0, 0, this ); |
67 | sendQueued->addTo( toolBar ); | 67 | sendQueued->addTo( toolBar ); |
68 | sendQueued->addTo( mailMenu ); | 68 | sendQueued->addTo( mailMenu ); |
69 | 69 | ||
70 | /* | 70 | /* |
71 | syncFolders = new QAction( i18n( "Sync mailfolders" ), ICON_SYNC, | 71 | syncFolders = new QAction( i18n( "Sync mailfolders" ), ICON_SYNC, |
72 | 0, 0, this ); | 72 | 0, 0, this ); |
73 | syncFolders->addTo( toolBar ); | 73 | syncFolders->addTo( toolBar ); |
74 | syncFolders->addTo( mailMenu ); | 74 | syncFolders->addTo( mailMenu ); |
75 | */ | 75 | */ |
76 | 76 | ||
77 | showFolders = new QAction( i18n( "Show/Hide folders" ), SmallIcon("showfolders") , | 77 | showFolders = new QAction( i18n( "Show/Hide folders" ), SmallIcon("showfolders") , |
78 | 0, 0, this, 0, true ); | 78 | 0, 0, this, 0, true ); |
79 | showFolders->addTo( toolBar ); | 79 | showFolders->addTo( toolBar ); |
80 | showFolders->addTo( mailMenu ); | 80 | showFolders->addTo( mailMenu ); |
81 | showFolders->setOn( true ); | 81 | showFolders->setOn( true ); |
82 | connect(showFolders, SIGNAL( toggled(bool) ), | 82 | connect(showFolders, SIGNAL( toggled(bool) ), |
83 | SLOT( slotShowFolders(bool) ) ); | 83 | SLOT( slotShowFolders(bool) ) ); |
84 | 84 | ||
85 | /* | 85 | /* |
86 | searchMails = new QAction( i18n( "Search mails" ), SmallIcon("find") ), | 86 | searchMails = new QAction( i18n( "Search mails" ), SmallIcon("find") ), |
87 | 0, 0, this ); | 87 | 0, 0, this ); |
88 | searchMails->kopddTo( toolBar ); | 88 | searchMails->kopddTo( toolBar ); |
89 | searchMails->addTo( mailMenu ); | 89 | searchMails->addTo( mailMenu ); |
90 | */ | 90 | */ |
91 | 91 | ||
92 | deleteMails = new QAction(i18n("Delete Mail"), SmallIcon("trash"), 0, 0, this); | 92 | deleteMails = new QAction(i18n("Delete Mail"), SmallIcon("trash"), 0, 0, this); |
93 | deleteMails->addTo( toolBar ); | 93 | deleteMails->addTo( toolBar ); |
94 | deleteMails->addTo( mailMenu ); | 94 | deleteMails->addTo( mailMenu ); |
95 | connect( deleteMails, SIGNAL( activated() ), | 95 | connect( deleteMails, SIGNAL( activated() ), |
96 | SLOT( slotDeleteAllMail() ) ); | 96 | SLOT( slotDeleteAllMail() ) ); |
97 | 97 | ||
98 | editSettings = new QAction( i18n( "Edit settings" ), SmallIcon("SettingsIcon") , | 98 | editSettings = new QAction( i18n( "Configure OM/Pi..." ), SmallIcon("SettingsIcon") , |
99 | 0, 0, this ); | 99 | 0, 0, this ); |
100 | editSettings->addTo( settingsMenu ); | 100 | editSettings->addTo( settingsMenu ); |
101 | connect( editSettings, SIGNAL( activated() ), | 101 | connect( editSettings, SIGNAL( activated() ), |
102 | SLOT( slotEditSettings() ) ); | 102 | SLOT( slotEditSettings() ) ); |
103 | |||
104 | |||
105 | QAction * editSettings2 = new QAction( i18n( "Global Settings..." ), SmallIcon("SettingsIcon") , | ||
106 | 0, 0, this ); | ||
107 | editSettings2->addTo( settingsMenu ); | ||
108 | connect( editSettings2, SIGNAL( activated() ), | ||
109 | SLOT( slotEditGlobalSettings() ) ); | ||
110 | |||
111 | |||
112 | |||
103 | editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") , | 113 | editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") , |
104 | 0, 0, this ); | 114 | 0, 0, this ); |
105 | editAccounts->addTo( settingsMenu ); | 115 | editAccounts->addTo( settingsMenu ); |
106 | codecMenu = new QPopupMenu( menuBar ); | 116 | codecMenu = new QPopupMenu( menuBar ); |
107 | codecMenu->insertItem( "Western (iso-8859-1)",0,0); | 117 | codecMenu->insertItem( "Western (iso-8859-1)",0,0); |
108 | codecMenu->insertItem( "Cyrillic (iso-8859-5)",1,1); | 118 | codecMenu->insertItem( "Cyrillic (iso-8859-5)",1,1); |
109 | codecMenu->insertItem( "Western (iso-8859-15)",2,2); | 119 | codecMenu->insertItem( "Western (iso-8859-15)",2,2); |
110 | codecMenu->insertItem( "Chinese (big-5)",3,3); | 120 | codecMenu->insertItem( "Chinese (big-5)",3,3); |
111 | codecMenu->insertItem( "Unicode (utf-8)",4,4); | 121 | codecMenu->insertItem( "Unicode (utf-8)",4,4); |
112 | codecMenu->insertItem( "Userdefined ("+KOPrefs::instance()->mSendCodec+")",5,5); | 122 | codecMenu->insertItem( "Userdefined ("+KOPrefs::instance()->mSendCodec+")",5,5); |
113 | //disabled | 123 | //disabled |
114 | //settingsMenu->insertItem( i18n("Codec for new mails"), codecMenu); | 124 | //settingsMenu->insertItem( i18n("Codec for new mails"), codecMenu); |
115 | //setCentralWidget( view ); | 125 | //setCentralWidget( view ); |
116 | 126 | ||
117 | QVBox* wrapperBox = new QVBox( this ); | 127 | QVBox* wrapperBox = new QVBox( this ); |
118 | setCentralWidget( wrapperBox ); | 128 | setCentralWidget( wrapperBox ); |
119 | 129 | ||
120 | // QWidget *view = new QWidget( wrapperBox ); | 130 | // QWidget *view = new QWidget( wrapperBox ); |
121 | KDGanttMinimizeSplitter* splithor = new KDGanttMinimizeSplitter( Qt::Vertical, wrapperBox); | 131 | KDGanttMinimizeSplitter* splithor = new KDGanttMinimizeSplitter( Qt::Vertical, wrapperBox); |
122 | splithor->setMinimizeDirection( KDGanttMinimizeSplitter::Down); | 132 | splithor->setMinimizeDirection( KDGanttMinimizeSplitter::Down); |
123 | KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, splithor); | 133 | KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, splithor); |
124 | split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); | 134 | split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); |
125 | //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); | 135 | //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); |
126 | subLE = 0; | 136 | subLE = 0; |
127 | fromLE = 0; | 137 | fromLE = 0; |
128 | toLE = 0; | 138 | toLE = 0; |
129 | if ( KOPrefs::instance()->mShowInfoSub || KOPrefs::instance()->mShowInfoFrom || KOPrefs::instance()->mShowInfoTo ) { | 139 | if ( KOPrefs::instance()->mShowInfoSub || KOPrefs::instance()->mShowInfoFrom || KOPrefs::instance()->mShowInfoTo ) { |
130 | QWidget* infoBox = new QWidget( splithor ); | 140 | QWidget* infoBox = new QWidget( splithor ); |
131 | QGridLayout *griLay = new QGridLayout( infoBox, 2,2); | 141 | QGridLayout *griLay = new QGridLayout( infoBox, 2,2); |
132 | if ( KOPrefs::instance()->mShowInfoSub ) { | 142 | if ( KOPrefs::instance()->mShowInfoSub ) { |
133 | griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 ); | 143 | griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 ); |
134 | griLay->addWidget( subLE = new QLineEdit( infoBox ),0,1) ; | 144 | griLay->addWidget( subLE = new QLineEdit( infoBox ),0,1) ; |
135 | } | 145 | } |
136 | if ( KOPrefs::instance()->mShowInfoFrom ) { | 146 | if ( KOPrefs::instance()->mShowInfoFrom ) { |
137 | griLay->addWidget( new QLabel ( i18n("Fr:"), infoBox ),1,0 ); | 147 | griLay->addWidget( new QLabel ( i18n("Fr:"), infoBox ),1,0 ); |
138 | griLay->addWidget( fromLE = new QLineEdit( infoBox ),1,1) ; | 148 | griLay->addWidget( fromLE = new QLineEdit( infoBox ),1,1) ; |
139 | } | 149 | } |
140 | if ( KOPrefs::instance()->mShowInfoTo ) { | 150 | if ( KOPrefs::instance()->mShowInfoTo ) { |
141 | griLay->addWidget( new QLabel ( i18n("To:"), infoBox ),2,0 ); | 151 | griLay->addWidget( new QLabel ( i18n("To:"), infoBox ),2,0 ); |
142 | griLay->addWidget( toLE = new QLineEdit( infoBox ),2,1) ; | 152 | griLay->addWidget( toLE = new QLineEdit( infoBox ),2,1) ; |
143 | } | 153 | } |
144 | infoBox->setMaximumHeight( infoBox->sizeHint().height() ); | 154 | infoBox->setMaximumHeight( infoBox->sizeHint().height() ); |
145 | if ( !KOPrefs::instance()->mShowInfoStart ) { | 155 | if ( !KOPrefs::instance()->mShowInfoStart ) { |
146 | QTimer::singleShot( 1,splithor, SLOT ( toggle() ) ); | 156 | QTimer::singleShot( 1,splithor, SLOT ( toggle() ) ); |
147 | } | 157 | } |
148 | } | 158 | } |
149 | 159 | ||
150 | 160 | ||
151 | folderView = new AccountView( split ); | 161 | folderView = new AccountView( split ); |
152 | folderView->header()->hide(); | 162 | folderView->header()->hide(); |
153 | folderView->setRootIsDecorated( false ); | 163 | folderView->setRootIsDecorated( false ); |
154 | folderView->addColumn( i18n( "Mailbox" ) ); | 164 | folderView->addColumn( i18n( "Mailbox" ) ); |
155 | 165 | ||
156 | //layout->addWidget( folderView ); | 166 | //layout->addWidget( folderView ); |
157 | 167 | ||
158 | mailView = new QListView( split ); | 168 | mailView = new QListView( split ); |
159 | mailView->addColumn( i18n( " " ) ); | 169 | mailView->addColumn( i18n( " " ) ); |
160 | mailView->addColumn( i18n( "Subject" ),QListView::Manual ); | 170 | mailView->addColumn( i18n( "Subject" ),QListView::Manual ); |
161 | mailView->addColumn( i18n( "Sender" ),QListView::Manual ); | 171 | mailView->addColumn( i18n( "Sender" ),QListView::Manual ); |
162 | mailView->addColumn( i18n( "Size" ),QListView::Manual); | 172 | mailView->addColumn( i18n( "Size" ),QListView::Manual); |
163 | mailView->addColumn( i18n( "Date" ),QListView::Manual); | 173 | mailView->addColumn( i18n( "Date" ),QListView::Manual); |
164 | if ( KOPrefs::instance()->mShowToField ) | 174 | if ( KOPrefs::instance()->mShowToField ) |
165 | mailView->addColumn( i18n( "To" ),QListView::Manual); | 175 | mailView->addColumn( i18n( "To" ),QListView::Manual); |
166 | mailView->setAllColumnsShowFocus(true); | 176 | mailView->setAllColumnsShowFocus(true); |
167 | //mailView->setSorting(-1); | 177 | //mailView->setSorting(-1); |
168 | mailView->setRootIsDecorated( false ); | 178 | mailView->setRootIsDecorated( false ); |
169 | statusWidget = new StatusWidget( wrapperBox ); | 179 | statusWidget = new StatusWidget( wrapperBox ); |
170 | statusWidget->hide(); | 180 | statusWidget->hide(); |
171 | 181 | ||
172 | //layout->addWidget( mailView ); | 182 | //layout->addWidget( mailView ); |
173 | //layout->setStretchFactor( folderView, 1 ); | 183 | //layout->setStretchFactor( folderView, 1 ); |
174 | //layout->setStretchFactor( mailView, 2 ); | 184 | //layout->setStretchFactor( mailView, 2 ); |
175 | 185 | ||
176 | slotAdjustLayout(); | 186 | slotAdjustLayout(); |
177 | #ifndef DESKTOP_VERSION | 187 | #ifndef DESKTOP_VERSION |
178 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); | 188 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); |
179 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); | 189 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); |
180 | if ( subLE ) | 190 | if ( subLE ) |
181 | QPEApplication::setStylusOperation( subLE ,QPEApplication::RightOnHold); | 191 | QPEApplication::setStylusOperation( subLE ,QPEApplication::RightOnHold); |
182 | if ( fromLE ) | 192 | if ( fromLE ) |
183 | QPEApplication::setStylusOperation( fromLE ,QPEApplication::RightOnHold); | 193 | QPEApplication::setStylusOperation( fromLE ,QPEApplication::RightOnHold); |
184 | if ( toLE ) | 194 | if ( toLE ) |
185 | QPEApplication::setStylusOperation( toLE ,QPEApplication::RightOnHold); | 195 | QPEApplication::setStylusOperation( toLE ,QPEApplication::RightOnHold); |
186 | #endif | 196 | #endif |
187 | connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, | 197 | connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, |
188 | SLOT( mailLeftClicked(QListViewItem*) ) ); | 198 | SLOT( mailLeftClicked(QListViewItem*) ) ); |
189 | connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, | 199 | connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, |
190 | SLOT( mailLeftClicked(QListViewItem*) ) ); | 200 | SLOT( mailLeftClicked(QListViewItem*) ) ); |
191 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, | 201 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, |
192 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); | 202 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); |
193 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), | 203 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), |
194 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); | 204 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); |
195 | 205 | ||
196 | connect( mailView, SIGNAL( currentChanged (QListViewItem* )),this, | 206 | connect( mailView, SIGNAL( currentChanged (QListViewItem* )),this, |
197 | SLOT( setInfoFields(QListViewItem*) ) ); | 207 | SLOT( setInfoFields(QListViewItem*) ) ); |
198 | 208 | ||
199 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); | 209 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); |
200 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); | 210 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); |
201 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); | 211 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); |
202 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); | 212 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); |
203 | //mailView->setMultiSelection ( true ); | 213 | //mailView->setMultiSelection ( true ); |
204 | mailView->setSelectionMode( QListView::Extended ); | 214 | mailView->setSelectionMode( QListView::Extended ); |
205 | QValueList<int> list; | 215 | QValueList<int> list; |
206 | int fw = 100; | 216 | int fw = 100; |
207 | if ( QApplication::desktop()->width() > 320 ) | 217 | if ( QApplication::desktop()->width() > 320 ) |
208 | fw = 50; | 218 | fw = 50; |
209 | list.append( fw ); | 219 | list.append( fw ); |
210 | list.append( 100 ); | 220 | list.append( 100 ); |
211 | split->setSizes( list ); | 221 | split->setSizes( list ); |
212 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); | 222 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); |
213 | mailView->setShowSortIndicator ( true ); | 223 | mailView->setShowSortIndicator ( true ); |
214 | QLabel *spacer = new QLabel( toolBar ); | 224 | QLabel *spacer = new QLabel( toolBar ); |
215 | spacer->setBackgroundMode( QWidget::PaletteButton ); | 225 | spacer->setBackgroundMode( QWidget::PaletteButton ); |
216 | toolBar->setStretchableWidget( spacer ); | 226 | toolBar->setStretchableWidget( spacer ); |
217 | 227 | ||
218 | QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); | 228 | QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); |
219 | connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); | 229 | connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); |
220 | if ( QApplication::desktop()->width() > 320 ) | 230 | if ( QApplication::desktop()->width() > 320 ) |
221 | closeMail->addTo(toolBar); | 231 | closeMail->addTo(toolBar); |
222 | closeMail->addTo(mailMenu); | 232 | closeMail->addTo(mailMenu); |
223 | 233 | ||
224 | 234 | ||
225 | QPopupMenu* helpMenu = new QPopupMenu( menuBar ); | 235 | QPopupMenu* helpMenu = new QPopupMenu( menuBar ); |
226 | menuBar->insertItem( i18n( "Help" ), helpMenu ); | 236 | menuBar->insertItem( i18n( "Help" ), helpMenu ); |
227 | QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this); | 237 | QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this); |
228 | connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); | 238 | connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); |
229 | li->addTo(helpMenu); | 239 | li->addTo(helpMenu); |
230 | li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this); | 240 | li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this); |
231 | connect( li, SIGNAL( activated() ), SLOT( showLicence()) ); | 241 | connect( li, SIGNAL( activated() ), SLOT( showLicence()) ); |
232 | li->addTo(helpMenu); | 242 | li->addTo(helpMenu); |
233 | li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this); | 243 | li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this); |
234 | connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) ); | 244 | connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) ); |
235 | li->addTo(helpMenu); | 245 | li->addTo(helpMenu); |
236 | connect( codecMenu, SIGNAL( activated(int) ), this, SLOT( slotSetCodec( int )) ); | 246 | connect( codecMenu, SIGNAL( activated(int) ), this, SLOT( slotSetCodec( int )) ); |
237 | slotSetCodec( KOPrefs::instance()->mCurrentCodec ); | 247 | slotSetCodec( KOPrefs::instance()->mCurrentCodec ); |
238 | menuBar->setMaximumWidth( menuBar->sizeHint().width()); | 248 | menuBar->setMaximumWidth( menuBar->sizeHint().width()); |
239 | //menuBar->setMaximumSize( menuBar->sizeHint()); | 249 | //menuBar->setMaximumSize( menuBar->sizeHint()); |
240 | #ifdef DESKTOP_VERSION | 250 | #ifdef DESKTOP_VERSION |
241 | resize ( 640, 480 ); | 251 | resize ( 640, 480 ); |
242 | #endif | 252 | #endif |
243 | } | 253 | } |
244 | 254 | ||
245 | MainWindow::~MainWindow() | 255 | MainWindow::~MainWindow() |
246 | { | 256 | { |
247 | } | 257 | } |
248 | 258 | ||
249 | void MainWindow::setInfoFields(QListViewItem* item ) | 259 | void MainWindow::setInfoFields(QListViewItem* item ) |
250 | { | 260 | { |
251 | if ( item == 0) { | 261 | if ( item == 0) { |
252 | if ( subLE ) subLE->setText(""); | 262 | if ( subLE ) subLE->setText(""); |
253 | if ( fromLE ) fromLE->setText(""); | 263 | if ( fromLE ) fromLE->setText(""); |
254 | if ( toLE ) toLE->setText(""); | 264 | if ( toLE ) toLE->setText(""); |
255 | return; | 265 | return; |
256 | } | 266 | } |
257 | RecMailP mail = ((MailListViewItem*)item)->data(); | 267 | RecMailP mail = ((MailListViewItem*)item)->data(); |
258 | if ( subLE ) subLE->setText(mail->getSubject()); | 268 | if ( subLE ) subLE->setText(mail->getSubject()); |
259 | if ( fromLE ) fromLE->setText(mail->getFrom()); | 269 | if ( fromLE ) fromLE->setText(mail->getFrom()); |
260 | if ( toLE ) toLE->setText(mail->To().join(";" )); | 270 | if ( toLE ) toLE->setText(mail->To().join(";" )); |
261 | if ( subLE ) subLE->setCursorPosition(0); | 271 | if ( subLE ) subLE->setCursorPosition(0); |
262 | if ( fromLE ) fromLE->setCursorPosition(0); | 272 | if ( fromLE ) fromLE->setCursorPosition(0); |
263 | if ( toLE ) toLE->setCursorPosition(0); | 273 | if ( toLE ) toLE->setCursorPosition(0); |
264 | 274 | ||
265 | } | 275 | } |
266 | void MainWindow::slotSetCodec( int codec ) | 276 | void MainWindow::slotSetCodec( int codec ) |
267 | { | 277 | { |
268 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, false ); | 278 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, false ); |
269 | //qDebug("codec %d ", codec); | 279 | //qDebug("codec %d ", codec); |
270 | KOPrefs::instance()->mCurrentCodec = codec; | 280 | KOPrefs::instance()->mCurrentCodec = codec; |
271 | KOPrefs::instance()->isDirty = true; | 281 | KOPrefs::instance()->isDirty = true; |
272 | QString name; | 282 | QString name; |
273 | switch ( codec ) { | 283 | switch ( codec ) { |
274 | case 0: | 284 | case 0: |
275 | name = "iso-8859-1"; | 285 | name = "iso-8859-1"; |
276 | break; | 286 | break; |
277 | case 1: | 287 | case 1: |
278 | name = "iso-8859-5"; | 288 | name = "iso-8859-5"; |
279 | break; | 289 | break; |
280 | case 2: | 290 | case 2: |
281 | name = "iso-8859-15"; | 291 | name = "iso-8859-15"; |
282 | break; | 292 | break; |
283 | case 3: | 293 | case 3: |
284 | name = "big-5"; | 294 | name = "big-5"; |
285 | break; | 295 | break; |
286 | case 4: | 296 | case 4: |
287 | name = "utf-8"; | 297 | name = "utf-8"; |
288 | break; | 298 | break; |
289 | case 5: | 299 | case 5: |
290 | name = KOPrefs::instance()->mSendCodec.lower(); | 300 | name = KOPrefs::instance()->mSendCodec.lower(); |
291 | break; | 301 | break; |
292 | } | 302 | } |
293 | KOPrefs::instance()->mCurrentCodeName = name ; | 303 | KOPrefs::instance()->mCurrentCodeName = name ; |
294 | codecMenu->changeItem ( 5, "Userdefined ("+KOPrefs::instance()->mSendCodec+")"); | 304 | codecMenu->changeItem ( 5, "Userdefined ("+KOPrefs::instance()->mSendCodec+")"); |
295 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, true ); | 305 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, true ); |
296 | } | 306 | } |
297 | void MainWindow::showLicence() | 307 | void MainWindow::showLicence() |
298 | { | 308 | { |
299 | KApplication::showLicence(); | 309 | KApplication::showLicence(); |
300 | } | 310 | } |
301 | void MainWindow::showAbout() | 311 | void MainWindow::showAbout() |
302 | { | 312 | { |
303 | QString version; | 313 | QString version; |
304 | #include <../version> | 314 | #include <../version> |
305 | 315 | ||
306 | QString cap = "About KOpieMail/Pi"; | 316 | QString cap = "About KOpieMail/Pi"; |
307 | QString text =i18n("KOpieMail/Platform-independent\n") + | 317 | QString text =i18n("KOpieMail/Platform-independent\n") + |
308 | "(OM/Pi) " + version + " - " | 318 | "(OM/Pi) " + version + " - " |
309 | 319 | ||
310 | #ifdef DESKTOP_VERSION | 320 | #ifdef DESKTOP_VERSION |
311 | "Desktop Edition\n" | 321 | "Desktop Edition\n" |
312 | #else | 322 | #else |
313 | "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n" | 323 | "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n" |
314 | #endif | 324 | #endif |
315 | "www.pi-sync.info\n\n" | 325 | "www.pi-sync.info\n\n" |
316 | 326 | ||
317 | 327 | ||
318 | 328 | ||
319 | "Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.info>\n" | 329 | "Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.info>\n" |
320 | "KOpieMail/Pi is based on Opie Mail\n" | 330 | "KOpieMail/Pi is based on Opie Mail\n" |
321 | "Copyright (c) Rajko Albrecht and the Opie team\n" | 331 | "Copyright (c) Rajko Albrecht and the Opie team\n" |
322 | "KOpieMail/Pi is licensed under the GPL\n" | 332 | "KOpieMail/Pi is licensed under the GPL\n" |
323 | "\n" | 333 | "\n" |
324 | "KOpieMail/Pi uses LibEtPan - a mail stuff library\n" | 334 | "KOpieMail/Pi uses LibEtPan - a mail stuff library\n" |
325 | "Copyright (C) 2001, 2002 - DINH Viet Hoa\n" | 335 | "Copyright (C) 2001, 2002 - DINH Viet Hoa\n" |
326 | "libEtPan has its own licence - see LibEtPan licence\n"; | 336 | "libEtPan has its own licence - see LibEtPan licence\n"; |
327 | 337 | ||
328 | KApplication::showText( cap, text ); | 338 | KApplication::showText( cap, text ); |
329 | } | 339 | } |
330 | void MainWindow::showEtpanLicence() | 340 | void MainWindow::showEtpanLicence() |
331 | { | 341 | { |
332 | KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" ); | 342 | KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" ); |
333 | 343 | ||
334 | } | 344 | } |
335 | void MainWindow::appMessage(const QCString &, const QByteArray &) | 345 | void MainWindow::appMessage(const QCString &, const QByteArray &) |
336 | { | 346 | { |
337 | qDebug("appMessage implemented by subclass"); | 347 | qDebug("appMessage implemented by subclass"); |
338 | } | 348 | } |
339 | 349 | ||
340 | void MainWindow::slotAdjustLayout() { | 350 | void MainWindow::slotAdjustLayout() { |
341 | 351 | ||
342 | /* | 352 | /* |
343 | QWidget *d = QApplication::desktop(); | 353 | QWidget *d = QApplication::desktop(); |
344 | 354 | ||
345 | if ( d->width() < d->height() ) { | 355 | if ( d->width() < d->height() ) { |
346 | layout->setDirection( QBoxLayout::TopToBottom ); | 356 | layout->setDirection( QBoxLayout::TopToBottom ); |
347 | } else { | 357 | } else { |
348 | layout->setDirection( QBoxLayout::LeftToRight ); | 358 | layout->setDirection( QBoxLayout::LeftToRight ); |
349 | } | 359 | } |
350 | */ | 360 | */ |
351 | } | 361 | } |
352 | 362 | ||
353 | void MainWindow::slotAdjustColumns() | 363 | void MainWindow::slotAdjustColumns() |
354 | { | 364 | { |
355 | bool hidden = folderView->isHidden(); | 365 | bool hidden = folderView->isHidden(); |
356 | if ( hidden ) folderView->show(); | 366 | if ( hidden ) folderView->show(); |
357 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); | 367 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); |
358 | if ( hidden ) folderView->hide(); | 368 | if ( hidden ) folderView->hide(); |
359 | 369 | ||
360 | mailView->setColumnWidth( 0, 10 ); | 370 | mailView->setColumnWidth( 0, 10 ); |
361 | mailView->setColumnWidth( 1, 100 ); | 371 | mailView->setColumnWidth( 1, 100 ); |
362 | mailView->setColumnWidth( 2, 100 ); | 372 | mailView->setColumnWidth( 2, 100 ); |
363 | mailView->setColumnWidth( 3, 50 ); | 373 | mailView->setColumnWidth( 3, 50 ); |
364 | mailView->setColumnWidth( 4, 120 ); | 374 | mailView->setColumnWidth( 4, 120 ); |
365 | if ( KOPrefs::instance()->mShowToField ) | 375 | if ( KOPrefs::instance()->mShowToField ) |
366 | mailView->setColumnWidth( 5, 100 ); | 376 | mailView->setColumnWidth( 5, 100 ); |
367 | } | 377 | } |
368 | 378 | ||
369 | void MainWindow::slotEditSettings() | 379 | void MainWindow::slotEditSettings() |
370 | { | 380 | { |
371 | } | 381 | } |
382 | void MainWindow::slotEditGlobalSettings() | ||
383 | { | ||
384 | } | ||
372 | 385 | ||
373 | void MainWindow::slotShowFolders( bool ) | 386 | void MainWindow::slotShowFolders( bool ) |
374 | { | 387 | { |
375 | qDebug("not implemented: "); | 388 | qDebug("not implemented: "); |
376 | } | 389 | } |
377 | 390 | ||
378 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) | 391 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) |
379 | { | 392 | { |
380 | qDebug("not implemented: "); | 393 | qDebug("not implemented: "); |
381 | } | 394 | } |
382 | 395 | ||
383 | void MainWindow::mailLeftClicked(QListViewItem * ) | 396 | void MainWindow::mailLeftClicked(QListViewItem * ) |
384 | { | 397 | { |
385 | qDebug("not implemented: "); | 398 | qDebug("not implemented: "); |
386 | } | 399 | } |
387 | 400 | ||
388 | void MainWindow::displayMail() | 401 | void MainWindow::displayMail() |
389 | { | 402 | { |
390 | qDebug("not implemented: "); | 403 | qDebug("not implemented: "); |
391 | } | 404 | } |
392 | 405 | ||
393 | void MainWindow::slotDeleteMail() | 406 | void MainWindow::slotDeleteMail() |
394 | { | 407 | { |
395 | qDebug("not implemented: "); | 408 | qDebug("not implemented: "); |
396 | } | 409 | } |
397 | 410 | ||
398 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) | 411 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) |
399 | { | 412 | { |
400 | qDebug("not implemented: "); | 413 | qDebug("not implemented: "); |
401 | } | 414 | } |
402 | 415 | ||
403 | void MainWindow::slotSendQueued() | 416 | void MainWindow::slotSendQueued() |
404 | { | 417 | { |
405 | qDebug("not implemented: "); | 418 | qDebug("not implemented: "); |
406 | } | 419 | } |
407 | 420 | ||
408 | void MainWindow::slotEditAccounts() | 421 | void MainWindow::slotEditAccounts() |
409 | { | 422 | { |
410 | qDebug("not implemented: "); | 423 | qDebug("not implemented: "); |
411 | } | 424 | } |
412 | 425 | ||
413 | void MainWindow::slotComposeMail() | 426 | void MainWindow::slotComposeMail() |
414 | { | 427 | { |
415 | qDebug("not implemented: "); | 428 | qDebug("not implemented: "); |
416 | } | 429 | } |
diff --git a/kmicromail/mainwindow.h b/kmicromail/mainwindow.h index ddb3fca..6894039 100644 --- a/kmicromail/mainwindow.h +++ b/kmicromail/mainwindow.h | |||
@@ -1,73 +1,74 @@ | |||
1 | 1 | ||
2 | // CHANGED 2004-08-06 Lutz Rogowski | 2 | // CHANGED 2004-08-06 Lutz Rogowski |
3 | #ifndef MAINWINDOW_H | 3 | #ifndef MAINWINDOW_H |
4 | #define MAINWINDOW_H | 4 | #define MAINWINDOW_H |
5 | 5 | ||
6 | #include <qmainwindow.h> | 6 | #include <qmainwindow.h> |
7 | #include <qlistview.h> | 7 | #include <qlistview.h> |
8 | #include <qaction.h> | 8 | #include <qaction.h> |
9 | #include <qlineedit.h> | 9 | #include <qlineedit.h> |
10 | 10 | ||
11 | #include <qtoolbar.h> | 11 | #include <qtoolbar.h> |
12 | #ifdef DESKTOP_VERSION | 12 | #ifdef DESKTOP_VERSION |
13 | #include <qmenubar.h> | 13 | #include <qmenubar.h> |
14 | #define QPEMenuBar QMenuBar | 14 | #define QPEMenuBar QMenuBar |
15 | #else | 15 | #else |
16 | #include <qpe/qpemenubar.h> | 16 | #include <qpe/qpemenubar.h> |
17 | #endif | 17 | #endif |
18 | 18 | ||
19 | #include "accountview.h" | 19 | #include "accountview.h" |
20 | #include "statuswidget.h" | 20 | #include "statuswidget.h" |
21 | 21 | ||
22 | #include <libmailwrapper/mailtypes.h> | 22 | #include <libmailwrapper/mailtypes.h> |
23 | #include <opie2/osmartpointer.h> | 23 | #include <opie2/osmartpointer.h> |
24 | 24 | ||
25 | class RecMail; | 25 | class RecMail; |
26 | 26 | ||
27 | class MainWindow : public QMainWindow | 27 | class MainWindow : public QMainWindow |
28 | { | 28 | { |
29 | Q_OBJECT | 29 | Q_OBJECT |
30 | 30 | ||
31 | public: | 31 | public: |
32 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); | 32 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); |
33 | virtual ~MainWindow(); | 33 | virtual ~MainWindow(); |
34 | 34 | ||
35 | public slots: | 35 | public slots: |
36 | virtual void slotAdjustColumns(); | 36 | virtual void slotAdjustColumns(); |
37 | virtual void appMessage(const QCString &msg, const QByteArray &data); | 37 | virtual void appMessage(const QCString &msg, const QByteArray &data); |
38 | virtual void slotComposeMail(); | 38 | virtual void slotComposeMail(); |
39 | 39 | ||
40 | protected slots: | 40 | protected slots: |
41 | virtual void setInfoFields(QListViewItem* ); | 41 | virtual void setInfoFields(QListViewItem* ); |
42 | virtual void slotSendQueued(); | 42 | virtual void slotSendQueued(); |
43 | virtual void slotEditAccounts(); | 43 | virtual void slotEditAccounts(); |
44 | virtual void slotShowFolders( bool show ); | 44 | virtual void slotShowFolders( bool show ); |
45 | virtual void refreshMailView(const QValueList<RecMailP>&); | 45 | virtual void refreshMailView(const QValueList<RecMailP>&); |
46 | virtual void displayMail(); | 46 | virtual void displayMail(); |
47 | virtual void slotGetMail() = 0; | 47 | virtual void slotGetMail() = 0; |
48 | virtual void slotGetAllMail() = 0; | 48 | virtual void slotGetAllMail() = 0; |
49 | virtual void slotDeleteMail(); | 49 | virtual void slotDeleteMail(); |
50 | virtual void slotDeleteAllMail() = 0; | 50 | virtual void slotDeleteAllMail() = 0; |
51 | virtual void slotSetCodec(int); | 51 | virtual void slotSetCodec(int); |
52 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); | 52 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); |
53 | virtual void slotAdjustLayout(); | 53 | virtual void slotAdjustLayout(); |
54 | virtual void slotEditSettings(); | 54 | virtual void slotEditSettings(); |
55 | virtual void slotEditGlobalSettings(); | ||
55 | virtual void mailLeftClicked( QListViewItem * ); | 56 | virtual void mailLeftClicked( QListViewItem * ); |
56 | void showLicence(); | 57 | void showLicence(); |
57 | void showAbout(); | 58 | void showAbout(); |
58 | void showEtpanLicence(); | 59 | void showEtpanLicence(); |
59 | 60 | ||
60 | protected: | 61 | protected: |
61 | QToolBar *toolBar; | 62 | QToolBar *toolBar; |
62 | StatusWidget *statusWidget; | 63 | StatusWidget *statusWidget; |
63 | QPEMenuBar *menuBar; | 64 | QPEMenuBar *menuBar; |
64 | QPopupMenu *mailMenu, *settingsMenu, *codecMenu; | 65 | QPopupMenu *mailMenu, *settingsMenu, *codecMenu; |
65 | QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails, | 66 | QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails, |
66 | *editSettings, *editAccounts, *syncFolders; | 67 | *editSettings, *editAccounts, *syncFolders; |
67 | AccountView *folderView; | 68 | AccountView *folderView; |
68 | QListView *mailView; | 69 | QListView *mailView; |
69 | QLineEdit* toLE,*fromLE,*subLE; | 70 | QLineEdit* toLE,*fromLE,*subLE; |
70 | //QBoxLayout *layout; | 71 | //QBoxLayout *layout; |
71 | }; | 72 | }; |
72 | 73 | ||
73 | #endif | 74 | #endif |
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index 4436ad6..8ac3451 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp | |||
@@ -1,676 +1,681 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | 1 | // CHANGED 2004-09-31 Lutz Rogowski |
2 | // CHANGED 2004-08-06 Lutz Rogowski | 2 | // CHANGED 2004-08-06 Lutz Rogowski |
3 | 3 | ||
4 | 4 | ||
5 | #define protected public | 5 | #define protected public |
6 | #include <qwidget.h> | 6 | #include <qwidget.h> |
7 | #undef protected | 7 | #undef protected |
8 | #include "koprefsdialog.h" | 8 | #include "koprefsdialog.h" |
9 | #include <kapplication.h> | 9 | #include <kapplication.h> |
10 | #include <libkdepim/externalapphandler.h> | 10 | #include <libkdepim/externalapphandler.h> |
11 | #include <libkdepim/kpimglobalprefs.h> | 11 | #include <libkdepim/kpimglobalprefs.h> |
12 | #ifdef MINIKDE_KDIALOG_H | 12 | #ifdef MINIKDE_KDIALOG_H |
13 | #undef MINIKDE_KDIALOG_H | 13 | #undef MINIKDE_KDIALOG_H |
14 | #endif | 14 | #endif |
15 | #include "settingsdialog.h" | 15 | #include "settingsdialog.h" |
16 | #include "opiemail.h" | 16 | #include "opiemail.h" |
17 | #include "editaccounts.h" | 17 | #include "editaccounts.h" |
18 | #include "composemail.h" | 18 | #include "composemail.h" |
19 | #include "mailistviewitem.h" | 19 | #include "mailistviewitem.h" |
20 | #include "viewmail.h" | 20 | #include "viewmail.h" |
21 | #include "selectstore.h" | 21 | #include "selectstore.h" |
22 | #include "selectsmtp.h" | 22 | #include "selectsmtp.h" |
23 | #include "accountitem.h" | 23 | #include "accountitem.h" |
24 | #include "accountview.h" | 24 | #include "accountview.h" |
25 | #include "klocale.h" | 25 | #include "klocale.h" |
26 | 26 | ||
27 | #include <qmessagebox.h> | 27 | #include <qmessagebox.h> |
28 | #include <qtimer.h> | 28 | #include <qtimer.h> |
29 | #include <qcursor.h> | 29 | #include <qcursor.h> |
30 | #include <qtextbrowser.h> | 30 | #include <qtextbrowser.h> |
31 | #include <qregexp.h> | 31 | #include <qregexp.h> |
32 | #include <qpe/global.h> | 32 | #include <qpe/global.h> |
33 | 33 | ||
34 | #ifdef DESKTOP_VERSION | 34 | #ifdef DESKTOP_VERSION |
35 | #include <qapplication.h> | 35 | #include <qapplication.h> |
36 | #else | 36 | #else |
37 | #include <qpe/qpeapplication.h> | 37 | #include <qpe/qpeapplication.h> |
38 | #endif | 38 | #endif |
39 | #include <libmailwrapper/smtpwrapper.h> | 39 | #include <libmailwrapper/smtpwrapper.h> |
40 | #include <libmailwrapper/mailtypes.h> | 40 | #include <libmailwrapper/mailtypes.h> |
41 | #include <libmailwrapper/abstractmail.h> | 41 | #include <libmailwrapper/abstractmail.h> |
42 | #include "koprefs.h" | 42 | #include "koprefs.h" |
43 | 43 | ||
44 | //using namespace Opie::Core; | 44 | //using namespace Opie::Core; |
45 | 45 | ||
46 | OpieMail::OpieMail( QWidget *parent, const char *name ) | 46 | OpieMail::OpieMail( QWidget *parent, const char *name ) |
47 | : MainWindow( parent, name) //, WStyle_ContextHelp ) | 47 | : MainWindow( parent, name) //, WStyle_ContextHelp ) |
48 | { | 48 | { |
49 | mCurrentComposer = 0; | 49 | mCurrentComposer = 0; |
50 | settings = new Settings(); | 50 | settings = new Settings(); |
51 | tb = 0; | 51 | tb = 0; |
52 | setIcon(SmallIcon( "kmicromail" ) ); | 52 | setIcon(SmallIcon( "kmicromail" ) ); |
53 | folderView->populate( settings->getAccounts() ); | 53 | folderView->populate( settings->getAccounts() ); |
54 | connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), | 54 | connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), |
55 | this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); | 55 | this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); |
56 | folderView->setFocus(); | 56 | folderView->setFocus(); |
57 | } | 57 | } |
58 | 58 | ||
59 | OpieMail::~OpieMail() | 59 | OpieMail::~OpieMail() |
60 | { | 60 | { |
61 | if (settings) delete settings; | 61 | if (settings) delete settings; |
62 | if ( tb ) | 62 | if ( tb ) |
63 | delete tb; | 63 | delete tb; |
64 | } | 64 | } |
65 | 65 | ||
66 | void OpieMail::appMessage(const QCString &msg, const QByteArray &data) | 66 | void OpieMail::appMessage(const QCString &msg, const QByteArray &data) |
67 | { | 67 | { |
68 | 68 | ||
69 | } | 69 | } |
70 | #include <stdlib.h> | 70 | #include <stdlib.h> |
71 | void OpieMail::message(const QCString &msg, const QByteArray &data) | 71 | void OpieMail::message(const QCString &msg, const QByteArray &data) |
72 | { | 72 | { |
73 | // copied from old mail2 | 73 | // copied from old mail2 |
74 | static int ii = 0; | 74 | static int ii = 0; |
75 | //qDebug("QCOP CALL ############################# %d ", ii); | 75 | //qDebug("QCOP CALL ############################# %d ", ii); |
76 | //QString mess ( msg ); | 76 | //QString mess ( msg ); |
77 | //qDebug("Message = %s ",mess.latin1()); | 77 | //qDebug("Message = %s ",mess.latin1()); |
78 | ++ii; | 78 | ++ii; |
79 | //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this); | 79 | //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this); |
80 | 80 | ||
81 | mPendingEmail = QString::null; | 81 | mPendingEmail = QString::null; |
82 | mPendingName = QString::null; | 82 | mPendingName = QString::null; |
83 | if (msg == "writeMail(QString,QString)") | 83 | if (msg == "writeMail(QString,QString)") |
84 | { | 84 | { |
85 | //qDebug("writeMail(QString,QString) "); | 85 | //qDebug("writeMail(QString,QString) "); |
86 | QDataStream stream(data,IO_ReadOnly); | 86 | QDataStream stream(data,IO_ReadOnly); |
87 | stream >> mPendingName >> mPendingEmail; | 87 | stream >> mPendingName >> mPendingEmail; |
88 | // removing the whitespaces at beginning and end is needed! | 88 | // removing the whitespaces at beginning and end is needed! |
89 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); | 89 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); |
90 | } | 90 | } |
91 | else if (msg == "newMail()") | 91 | else if (msg == "newMail()") |
92 | { | 92 | { |
93 | //qDebug("slotComposeMail() "); | 93 | //qDebug("slotComposeMail() "); |
94 | // we cannot call slotComposeMail(); directly, because may be executing a QCOP call | 94 | // we cannot call slotComposeMail(); directly, because may be executing a QCOP call |
95 | // and a QCOP call does not like a processevents in his execution | 95 | // and a QCOP call does not like a processevents in his execution |
96 | // with the Qtimer we call slotComposeMail() after we reached the main event loop | 96 | // with the Qtimer we call slotComposeMail() after we reached the main event loop |
97 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); | 97 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); |
98 | // slotComposeMail(); | 98 | // slotComposeMail(); |
99 | } | 99 | } |
100 | else if (msg == "newMail(QString)") | 100 | else if (msg == "newMail(QString)") |
101 | { | 101 | { |
102 | //qDebug(" newMail(QString)"); | 102 | //qDebug(" newMail(QString)"); |
103 | QDataStream stream(data,IO_ReadOnly); | 103 | QDataStream stream(data,IO_ReadOnly); |
104 | stream >> mPendingName; | 104 | stream >> mPendingName; |
105 | // the format is | 105 | // the format is |
106 | // NAME <EMAIL>:SUBJECT | 106 | // NAME <EMAIL>:SUBJECT |
107 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); | 107 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); |
108 | } else { | 108 | } else { |
109 | mPendingData = data; | 109 | mPendingData = data; |
110 | mPendingMessage = msg; | 110 | mPendingMessage = msg; |
111 | QTimer::singleShot ( 50, this, SLOT(slotExtAppHandler() ) ); | 111 | QTimer::singleShot ( 50, this, SLOT(slotExtAppHandler() ) ); |
112 | } | 112 | } |
113 | 113 | ||
114 | //qDebug("END OpieMail::message "); | 114 | //qDebug("END OpieMail::message "); |
115 | } | 115 | } |
116 | void OpieMail::slotExtAppHandler() | 116 | void OpieMail::slotExtAppHandler() |
117 | { | 117 | { |
118 | ExternalAppHandler::instance()->appMessage ( mPendingMessage, mPendingData ); | 118 | ExternalAppHandler::instance()->appMessage ( mPendingMessage, mPendingData ); |
119 | } | 119 | } |
120 | void OpieMail::slotwriteMail2(const QString& namemail ) | 120 | void OpieMail::slotwriteMail2(const QString& namemail ) |
121 | { | 121 | { |
122 | //qDebug("OpieMail::slotwriteMail2 "); | 122 | //qDebug("OpieMail::slotwriteMail2 "); |
123 | //qApp->processEvents(); | 123 | //qApp->processEvents(); |
124 | ComposeMail compose( settings, this, 0, true ); | 124 | ComposeMail compose( settings, this, 0, true ); |
125 | if ( !namemail.isEmpty() ) { | 125 | if ( !namemail.isEmpty() ) { |
126 | QString to = namemail; | 126 | QString to = namemail; |
127 | if ( namemail.find( " <") > 1 ) { | 127 | if ( namemail.find( " <") > 1 ) { |
128 | to = "\"" +to.replace( QRegExp( " <"), "\" <") ; | 128 | to = "\"" +to.replace( QRegExp( " <"), "\" <") ; |
129 | } else | 129 | } else |
130 | if ( namemail.find( "<") > 1 ) { | 130 | if ( namemail.find( "<") > 1 ) { |
131 | to = "\"" +to.replace( QRegExp( "<"), "\" <") ; | 131 | to = "\"" +to.replace( QRegExp( "<"), "\" <") ; |
132 | } | 132 | } |
133 | int sub = to.find( ">:"); | 133 | int sub = to.find( ">:"); |
134 | if ( sub > 0 ) { | 134 | if ( sub > 0 ) { |
135 | compose.setTo( to.left(sub+1) ); | 135 | compose.setTo( to.left(sub+1) ); |
136 | compose.setSubject( to.mid(sub+2) ); | 136 | compose.setSubject( to.mid(sub+2) ); |
137 | } else | 137 | } else |
138 | compose.setTo( to ); | 138 | compose.setTo( to ); |
139 | } | 139 | } |
140 | compose.slotAdjustColumns(); | 140 | compose.slotAdjustColumns(); |
141 | #ifndef DESKTOP_VERSION | 141 | #ifndef DESKTOP_VERSION |
142 | compose.showMaximized(); | 142 | compose.showMaximized(); |
143 | #endif | 143 | #endif |
144 | mCurrentComposer = &compose; | 144 | mCurrentComposer = &compose; |
145 | compose.exec(); | 145 | compose.exec(); |
146 | mCurrentComposer = 0; | 146 | mCurrentComposer = 0; |
147 | folderView->refreshOutgoing(); | 147 | folderView->refreshOutgoing(); |
148 | raise(); | 148 | raise(); |
149 | //qDebug("retttich "); | 149 | //qDebug("retttich "); |
150 | } | 150 | } |
151 | void OpieMail::slotwriteMail(const QString&name,const QString&email) | 151 | void OpieMail::slotwriteMail(const QString&name,const QString&email) |
152 | { | 152 | { |
153 | // qDebug("OpieMail::slotwriteMail "); | 153 | // qDebug("OpieMail::slotwriteMail "); |
154 | ComposeMail compose( settings, this, 0, true ); | 154 | ComposeMail compose( settings, this, 0, true ); |
155 | if (!email.isEmpty()) | 155 | if (!email.isEmpty()) |
156 | { | 156 | { |
157 | if (!name.isEmpty()) | 157 | if (!name.isEmpty()) |
158 | { | 158 | { |
159 | compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">"); | 159 | compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">"); |
160 | } | 160 | } |
161 | else | 161 | else |
162 | { | 162 | { |
163 | compose.setTo(email); | 163 | compose.setTo(email); |
164 | } | 164 | } |
165 | } | 165 | } |
166 | compose.slotAdjustColumns(); | 166 | compose.slotAdjustColumns(); |
167 | #ifndef DESKTOP_VERSION | 167 | #ifndef DESKTOP_VERSION |
168 | compose.showMaximized(); | 168 | compose.showMaximized(); |
169 | #endif | 169 | #endif |
170 | 170 | ||
171 | mCurrentComposer = &compose; | 171 | mCurrentComposer = &compose; |
172 | compose.exec(); | 172 | compose.exec(); |
173 | mCurrentComposer = 0; | 173 | mCurrentComposer = 0; |
174 | folderView->refreshOutgoing(); | 174 | folderView->refreshOutgoing(); |
175 | raise(); | 175 | raise(); |
176 | } | 176 | } |
177 | 177 | ||
178 | void OpieMail::slotComposeMail() | 178 | void OpieMail::slotComposeMail() |
179 | { | 179 | { |
180 | if ( mPendingEmail == QString::null && mPendingName == QString::null) | 180 | if ( mPendingEmail == QString::null && mPendingName == QString::null) |
181 | slotwriteMail2( QString () ); | 181 | slotwriteMail2( QString () ); |
182 | else { | 182 | else { |
183 | if ( mPendingEmail == QString::null ) | 183 | if ( mPendingEmail == QString::null ) |
184 | slotwriteMail2( mPendingName ); | 184 | slotwriteMail2( mPendingName ); |
185 | else | 185 | else |
186 | slotwriteMail( mPendingName, mPendingEmail ); | 186 | slotwriteMail( mPendingName, mPendingEmail ); |
187 | } | 187 | } |
188 | //slotwriteMail(0l,0l); | 188 | //slotwriteMail(0l,0l); |
189 | } | 189 | } |
190 | 190 | ||
191 | void OpieMail::slotSendQueued() | 191 | void OpieMail::slotSendQueued() |
192 | { | 192 | { |
193 | SMTPaccount *smtp = 0; | 193 | SMTPaccount *smtp = 0; |
194 | 194 | ||
195 | QList<Account> list = settings->getAccounts(); | 195 | QList<Account> list = settings->getAccounts(); |
196 | QList<SMTPaccount> smtpList; | 196 | QList<SMTPaccount> smtpList; |
197 | smtpList.setAutoDelete(false); | 197 | smtpList.setAutoDelete(false); |
198 | Account *it; | 198 | Account *it; |
199 | for ( it = list.first(); it; it = list.next() ) | 199 | for ( it = list.first(); it; it = list.next() ) |
200 | { | 200 | { |
201 | if ( it->getType() == MAILLIB::A_SMTP ) | 201 | if ( it->getType() == MAILLIB::A_SMTP ) |
202 | { | 202 | { |
203 | smtp = static_cast<SMTPaccount *>(it); | 203 | smtp = static_cast<SMTPaccount *>(it); |
204 | smtpList.append(smtp); | 204 | smtpList.append(smtp); |
205 | } | 205 | } |
206 | } | 206 | } |
207 | if (smtpList.count()==0) | 207 | if (smtpList.count()==0) |
208 | { | 208 | { |
209 | QMessageBox::information(0,i18n("Info"),i18n("Define a smtp\n account first!\n")); | 209 | QMessageBox::information(0,i18n("Info"),i18n("Define a smtp\n account first!\n")); |
210 | return; | 210 | return; |
211 | } | 211 | } |
212 | if ( QMessageBox::warning(this, i18n("Sending all mails"), i18n("Do you really want to\nsend all queued mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No ) | 212 | if ( QMessageBox::warning(this, i18n("Sending all mails"), i18n("Do you really want to\nsend all queued mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No ) |
213 | return; | 213 | return; |
214 | if (smtpList.count()==1) | 214 | if (smtpList.count()==1) |
215 | { | 215 | { |
216 | smtp = smtpList.at(0); | 216 | smtp = smtpList.at(0); |
217 | } | 217 | } |
218 | else | 218 | else |
219 | { | 219 | { |
220 | smtp = 0; | 220 | smtp = 0; |
221 | selectsmtp selsmtp; | 221 | selectsmtp selsmtp; |
222 | selsmtp.setSelectionlist(&smtpList); | 222 | selsmtp.setSelectionlist(&smtpList); |
223 | selsmtp.resize( selsmtp.sizeHint() ); | 223 | selsmtp.resize( selsmtp.sizeHint() ); |
224 | if ( selsmtp.exec() == QDialog::Accepted ) | 224 | if ( selsmtp.exec() == QDialog::Accepted ) |
225 | { | 225 | { |
226 | smtp = selsmtp.selected_smtp(); | 226 | smtp = selsmtp.selected_smtp(); |
227 | } | 227 | } |
228 | } | 228 | } |
229 | if (smtp) | 229 | if (smtp) |
230 | { | 230 | { |
231 | 231 | ||
232 | Global::statusMessage("Sending mails...!"); | 232 | Global::statusMessage("Sending mails...!"); |
233 | SMTPwrapper * wrap = new SMTPwrapper(smtp); | 233 | SMTPwrapper * wrap = new SMTPwrapper(smtp); |
234 | if ( wrap->flushOutbox() ) | 234 | if ( wrap->flushOutbox() ) |
235 | { | 235 | { |
236 | Global::statusMessage("Mails sent!"); | 236 | Global::statusMessage("Mails sent!"); |
237 | } | 237 | } |
238 | delete wrap; | 238 | delete wrap; |
239 | } | 239 | } |
240 | folderView->refreshOutgoing(); | 240 | folderView->refreshOutgoing(); |
241 | } | 241 | } |
242 | 242 | ||
243 | void OpieMail::slotSearchMails() | 243 | void OpieMail::slotSearchMails() |
244 | { | 244 | { |
245 | qDebug("OpieMail::slotSearchMails():not implemented "); | 245 | qDebug("OpieMail::slotSearchMails():not implemented "); |
246 | } | 246 | } |
247 | void OpieMail::slotEditGlobalSettings() | ||
248 | { | ||
249 | KPimPrefsGlobalDialog gc ( this ); | ||
250 | gc.exec(); | ||
251 | } | ||
247 | 252 | ||
248 | void OpieMail::slotEditSettings() | 253 | void OpieMail::slotEditSettings() |
249 | { | 254 | { |
250 | 255 | ||
251 | KOPrefsDialog settingsDialog( this, "koprefs", true ); | 256 | KOPrefsDialog settingsDialog( this, "koprefs", true ); |
252 | #ifndef DESKTOP_VERSION | 257 | #ifndef DESKTOP_VERSION |
253 | settingsDialog.showMaximized(); | 258 | settingsDialog.showMaximized(); |
254 | #endif | 259 | #endif |
255 | settingsDialog.exec(); | 260 | settingsDialog.exec(); |
256 | 261 | ||
257 | slotSetCodec( KOPrefs::instance()->mCurrentCodec ); | 262 | slotSetCodec( KOPrefs::instance()->mCurrentCodec ); |
258 | // KApplication::execDialog(settingsDialog); | 263 | // KApplication::execDialog(settingsDialog); |
259 | } | 264 | } |
260 | 265 | ||
261 | void OpieMail::slotEditAccounts() | 266 | void OpieMail::slotEditAccounts() |
262 | { | 267 | { |
263 | EditAccounts eaDialog( settings, this, 0, true ); | 268 | EditAccounts eaDialog( settings, this, 0, true ); |
264 | eaDialog.slotAdjustColumns(); | 269 | eaDialog.slotAdjustColumns(); |
265 | #ifndef DESKTOP_VERSION | 270 | #ifndef DESKTOP_VERSION |
266 | eaDialog.showMaximized(); | 271 | eaDialog.showMaximized(); |
267 | #endif | 272 | #endif |
268 | eaDialog.exec(); | 273 | eaDialog.exec(); |
269 | if ( settings ) delete settings; | 274 | if ( settings ) delete settings; |
270 | settings = new Settings(); | 275 | settings = new Settings(); |
271 | 276 | ||
272 | folderView->populate( settings->getAccounts() ); | 277 | folderView->populate( settings->getAccounts() ); |
273 | } | 278 | } |
274 | void OpieMail::replyMail() | 279 | void OpieMail::replyMail() |
275 | { | 280 | { |
276 | 281 | ||
277 | QListViewItem*item = mailView->currentItem(); | 282 | QListViewItem*item = mailView->currentItem(); |
278 | if (!item) return; | 283 | if (!item) return; |
279 | RecMailP mail = ((MailListViewItem*)item)->data(); | 284 | RecMailP mail = ((MailListViewItem*)item)->data(); |
280 | RecBodyP body = folderView->fetchBody(mail); | 285 | RecBodyP body = folderView->fetchBody(mail); |
281 | 286 | ||
282 | QString rtext; | 287 | QString rtext; |
283 | rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose | 288 | rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose |
284 | .arg( mail->getFrom()) | 289 | .arg( mail->getFrom()) |
285 | .arg( mail->getDate()); | 290 | .arg( mail->getDate()); |
286 | 291 | ||
287 | QString text = body->Bodytext(); | 292 | QString text = body->Bodytext(); |
288 | QStringList lines = QStringList::split(QRegExp("\\n"), text); | 293 | QStringList lines = QStringList::split(QRegExp("\\n"), text); |
289 | QStringList::Iterator it; | 294 | QStringList::Iterator it; |
290 | for (it = lines.begin(); it != lines.end(); it++) | 295 | for (it = lines.begin(); it != lines.end(); it++) |
291 | { | 296 | { |
292 | rtext += "> " + *it + "\n"; | 297 | rtext += "> " + *it + "\n"; |
293 | } | 298 | } |
294 | rtext += "\n"; | 299 | rtext += "\n"; |
295 | 300 | ||
296 | QString prefix; | 301 | QString prefix; |
297 | if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = ""; | 302 | if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = ""; |
298 | else prefix = "Re: "; // no i18n on purpose | 303 | else prefix = "Re: "; // no i18n on purpose |
299 | 304 | ||
300 | Settings *settings = new Settings(); | 305 | Settings *settings = new Settings(); |
301 | ComposeMail composer( settings ,this, 0, true); | 306 | ComposeMail composer( settings ,this, 0, true); |
302 | if (mail->Replyto().isEmpty()) { | 307 | if (mail->Replyto().isEmpty()) { |
303 | composer.setTo( mail->getFrom()); | 308 | composer.setTo( mail->getFrom()); |
304 | } else { | 309 | } else { |
305 | composer.setTo( mail->Replyto()); | 310 | composer.setTo( mail->Replyto()); |
306 | } | 311 | } |
307 | composer.setSubject( prefix + mail->getSubject()); | 312 | composer.setSubject( prefix + mail->getSubject()); |
308 | composer.setMessage( rtext ); | 313 | composer.setMessage( rtext ); |
309 | composer.setInReplyTo( mail->Msgid()); | 314 | composer.setInReplyTo( mail->Msgid()); |
310 | composer.setCharset( body->getCharset() ); | 315 | composer.setCharset( body->getCharset() ); |
311 | 316 | ||
312 | mCurrentComposer = &composer; | 317 | mCurrentComposer = &composer; |
313 | if ( QDialog::Accepted == KApplication::execDialog( &composer ) ) | 318 | if ( QDialog::Accepted == KApplication::execDialog( &composer ) ) |
314 | { | 319 | { |
315 | mail->Wrapper()->answeredMail(mail); | 320 | mail->Wrapper()->answeredMail(mail); |
316 | } | 321 | } |
317 | mCurrentComposer = 0; | 322 | mCurrentComposer = 0; |
318 | folderView->refreshOutgoing(); | 323 | folderView->refreshOutgoing(); |
319 | delete settings; | 324 | delete settings; |
320 | 325 | ||
321 | } | 326 | } |
322 | void OpieMail::closeViewMail(ViewMail * vm) | 327 | void OpieMail::closeViewMail(ViewMail * vm) |
323 | { | 328 | { |
324 | vm->hide(); | 329 | vm->hide(); |
325 | } | 330 | } |
326 | 331 | ||
327 | void OpieMail::slotDownloadMail( ) | 332 | void OpieMail::slotDownloadMail( ) |
328 | { | 333 | { |
329 | QListViewItem*item = mailView->currentItem(); | 334 | QListViewItem*item = mailView->currentItem(); |
330 | if (!item ) { | 335 | if (!item ) { |
331 | Global::statusMessage("Error: No item slected!"); | 336 | Global::statusMessage("Error: No item slected!"); |
332 | return; | 337 | return; |
333 | } | 338 | } |
334 | RecMailP mail = ((MailListViewItem*)item)->data(); | 339 | RecMailP mail = ((MailListViewItem*)item)->data(); |
335 | Account * acc = mail->Wrapper()->getAccount(); | 340 | Account * acc = mail->Wrapper()->getAccount(); |
336 | if ( !acc ) { | 341 | if ( !acc ) { |
337 | Global::statusMessage("Mail is already stored locally!"); | 342 | Global::statusMessage("Mail is already stored locally!"); |
338 | return; | 343 | return; |
339 | } | 344 | } |
340 | QString lfName = acc->getLocalFolder(); | 345 | QString lfName = acc->getLocalFolder(); |
341 | //qDebug("local folder " + lfName ); | 346 | //qDebug("local folder " + lfName ); |
342 | if ( lfName.isEmpty() ) | 347 | if ( lfName.isEmpty() ) |
343 | lfName = acc->getAccountName(); | 348 | lfName = acc->getAccountName(); |
344 | AbstractMail* targetMail = folderView->allAccounts()[0]->getWrapper(); | 349 | AbstractMail* targetMail = folderView->allAccounts()[0]->getWrapper(); |
345 | //qDebug("target %d %d ",targetMail,mail->Wrapper() ); | 350 | //qDebug("target %d %d ",targetMail,mail->Wrapper() ); |
346 | if ( targetMail == mail->Wrapper() ) { | 351 | if ( targetMail == mail->Wrapper() ) { |
347 | Global::statusMessage("Mail is already locally stored!"); | 352 | Global::statusMessage("Mail is already locally stored!"); |
348 | return; | 353 | return; |
349 | } | 354 | } |
350 | if ( !targetMail->createMbox(lfName)) { | 355 | if ( !targetMail->createMbox(lfName)) { |
351 | Global::statusMessage("Error creating folder!"); | 356 | Global::statusMessage("Error creating folder!"); |
352 | return; | 357 | return; |
353 | } | 358 | } |
354 | Global::statusMessage("Fetching mail...please wait!"); | 359 | Global::statusMessage("Fetching mail...please wait!"); |
355 | qApp->processEvents(); | 360 | qApp->processEvents(); |
356 | encodedString*st = 0; | 361 | encodedString*st = 0; |
357 | st = mail->Wrapper()->fetchRawBody(mail); | 362 | st = mail->Wrapper()->fetchRawBody(mail); |
358 | if ( st ) { | 363 | if ( st ) { |
359 | targetMail->storeMessage(st->Content(),st->Length(),lfName); | 364 | targetMail->storeMessage(st->Content(),st->Length(),lfName); |
360 | Global::statusMessage("Mail stored in "+ lfName); | 365 | Global::statusMessage("Mail stored in "+ lfName); |
361 | delete st; | 366 | delete st; |
362 | } else { | 367 | } else { |
363 | Global::statusMessage("Error: Cannot fetch mail!"); | 368 | Global::statusMessage("Error: Cannot fetch mail!"); |
364 | } | 369 | } |
365 | } | 370 | } |
366 | 371 | ||
367 | 372 | ||
368 | void OpieMail::deleteAndDisplayNextMail(ViewMail * vm) | 373 | void OpieMail::deleteAndDisplayNextMail(ViewMail * vm) |
369 | { | 374 | { |
370 | QListViewItem*item = mailView->currentItem(); | 375 | QListViewItem*item = mailView->currentItem(); |
371 | if (!item ) { | 376 | if (!item ) { |
372 | closeViewMail(vm); | 377 | closeViewMail(vm); |
373 | return; | 378 | return; |
374 | } | 379 | } |
375 | RecMailP mail = ((MailListViewItem*)item)->data(); | 380 | RecMailP mail = ((MailListViewItem*)item)->data(); |
376 | mail->Wrapper()->deleteMail( mail ); | 381 | mail->Wrapper()->deleteMail( mail ); |
377 | item = item->itemBelow(); | 382 | item = item->itemBelow(); |
378 | if (!item ) { | 383 | if (!item ) { |
379 | closeViewMail(vm); | 384 | closeViewMail(vm); |
380 | return; | 385 | return; |
381 | } | 386 | } |
382 | mailView->setCurrentItem(item); | 387 | mailView->setCurrentItem(item); |
383 | mail = ((MailListViewItem*)item)->data(); | 388 | mail = ((MailListViewItem*)item)->data(); |
384 | RecBodyP body = folderView->fetchBody(mail); | 389 | RecBodyP body = folderView->fetchBody(mail); |
385 | vm->setBody( body ); | 390 | vm->setBody( body ); |
386 | vm->setMail( mail ); | 391 | vm->setMail( mail ); |
387 | } | 392 | } |
388 | void OpieMail::displayNextMail(ViewMail * vm) | 393 | void OpieMail::displayNextMail(ViewMail * vm) |
389 | { | 394 | { |
390 | QListViewItem*item = mailView->currentItem(); | 395 | QListViewItem*item = mailView->currentItem(); |
391 | if (!item) return; | 396 | if (!item) return; |
392 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); | 397 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); |
393 | item = item->itemBelow(); | 398 | item = item->itemBelow(); |
394 | if (!item) { | 399 | if (!item) { |
395 | vm->setCaption(i18n("End of List" )); | 400 | vm->setCaption(i18n("End of List" )); |
396 | return; | 401 | return; |
397 | } | 402 | } |
398 | mailView->setCurrentItem(item); | 403 | mailView->setCurrentItem(item); |
399 | RecMailP mail = ((MailListViewItem*)item)->data(); | 404 | RecMailP mail = ((MailListViewItem*)item)->data(); |
400 | RecBodyP body = folderView->fetchBody(mail); | 405 | RecBodyP body = folderView->fetchBody(mail); |
401 | vm->setBody( body ); | 406 | vm->setBody( body ); |
402 | vm->setMail( mail ); | 407 | vm->setMail( mail ); |
403 | } | 408 | } |
404 | void OpieMail::displayMail() | 409 | void OpieMail::displayMail() |
405 | { | 410 | { |
406 | QListViewItem*item = mailView->currentItem(); | 411 | QListViewItem*item = mailView->currentItem(); |
407 | if (!item) return; | 412 | if (!item) return; |
408 | RecMailP mail = ((MailListViewItem*)item)->data(); | 413 | RecMailP mail = ((MailListViewItem*)item)->data(); |
409 | RecBodyP body = folderView->fetchBody(mail); | 414 | RecBodyP body = folderView->fetchBody(mail); |
410 | ViewMail readMail( this,"", Qt::WType_Modal ); | 415 | ViewMail readMail( this,"", Qt::WType_Modal ); |
411 | readMail.setBody( body ); | 416 | readMail.setBody( body ); |
412 | readMail.setMail( mail ); | 417 | readMail.setMail( mail ); |
413 | #ifndef DESKTOP_VERSION | 418 | #ifndef DESKTOP_VERSION |
414 | readMail.showMaximized(); | 419 | readMail.showMaximized(); |
415 | #else | 420 | #else |
416 | readMail.resize( 640, 480); | 421 | readMail.resize( 640, 480); |
417 | #endif | 422 | #endif |
418 | connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) ); | 423 | connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) ); |
419 | connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) ); | 424 | connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) ); |
420 | connect( &readMail,SIGNAL( signalDownloadMail() ), this, SLOT( slotDownloadMail() ) ); | 425 | connect( &readMail,SIGNAL( signalDownloadMail() ), this, SLOT( slotDownloadMail() ) ); |
421 | 426 | ||
422 | readMail.exec(); | 427 | readMail.exec(); |
423 | 428 | ||
424 | if ( readMail.deleted ) | 429 | if ( readMail.deleted ) |
425 | { | 430 | { |
426 | folderView->refreshCurrent(); | 431 | folderView->refreshCurrent(); |
427 | } | 432 | } |
428 | else | 433 | else |
429 | { | 434 | { |
430 | QListViewItem*item = mailView->currentItem(); | 435 | QListViewItem*item = mailView->currentItem(); |
431 | if (item) | 436 | if (item) |
432 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); | 437 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); |
433 | } | 438 | } |
434 | } | 439 | } |
435 | void OpieMail::slotGetAllMail() | 440 | void OpieMail::slotGetAllMail() |
436 | { | 441 | { |
437 | QListViewItem * item = folderView->firstChild(); | 442 | QListViewItem * item = folderView->firstChild(); |
438 | while ( item ){ | 443 | while ( item ){ |
439 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); | 444 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); |
440 | item = item->nextSibling (); | 445 | item = item->nextSibling (); |
441 | } | 446 | } |
442 | } | 447 | } |
443 | void OpieMail::slotGetMail() | 448 | void OpieMail::slotGetMail() |
444 | { | 449 | { |
445 | QListViewItem * item = folderView->currentItem(); | 450 | QListViewItem * item = folderView->currentItem(); |
446 | if ( ! item ) return; | 451 | if ( ! item ) return; |
447 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); | 452 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); |
448 | } | 453 | } |
449 | void OpieMail::slotDeleteMail() | 454 | void OpieMail::slotDeleteMail() |
450 | { | 455 | { |
451 | if (!mailView->currentItem()) return; | 456 | if (!mailView->currentItem()) return; |
452 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); | 457 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); |
453 | if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) | 458 | if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) |
454 | { | 459 | { |
455 | mail->Wrapper()->deleteMail( mail ); | 460 | mail->Wrapper()->deleteMail( mail ); |
456 | folderView->refreshCurrent(); | 461 | folderView->refreshCurrent(); |
457 | } | 462 | } |
458 | } | 463 | } |
459 | void OpieMail::slotDeleteAllMail() | 464 | void OpieMail::slotDeleteAllMail() |
460 | { | 465 | { |
461 | 466 | ||
462 | QValueList<RecMailP> t; | 467 | QValueList<RecMailP> t; |
463 | if ( QMessageBox::warning(this, i18n("Delete All Mails"), i18n("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) | 468 | if ( QMessageBox::warning(this, i18n("Delete All Mails"), i18n("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) |
464 | { | 469 | { |
465 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); | 470 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); |
466 | while ( item ) { | 471 | while ( item ) { |
467 | if ( item->isSelected() ) { | 472 | if ( item->isSelected() ) { |
468 | t.append( item->data() ); | 473 | t.append( item->data() ); |
469 | } | 474 | } |
470 | item = (MailListViewItem*)item->nextSibling(); | 475 | item = (MailListViewItem*)item->nextSibling(); |
471 | } | 476 | } |
472 | } | 477 | } |
473 | else | 478 | else |
474 | return; | 479 | return; |
475 | if ( t.count() == 0 ) | 480 | if ( t.count() == 0 ) |
476 | return; | 481 | return; |
477 | RecMailP mail = t.first(); | 482 | RecMailP mail = t.first(); |
478 | mail->Wrapper()->deleteMailList(t); | 483 | mail->Wrapper()->deleteMailList(t); |
479 | folderView->refreshCurrent(); | 484 | folderView->refreshCurrent(); |
480 | 485 | ||
481 | 486 | ||
482 | } | 487 | } |
483 | void OpieMail::clearSelection() | 488 | void OpieMail::clearSelection() |
484 | { | 489 | { |
485 | mailView->clearSelection(); | 490 | mailView->clearSelection(); |
486 | 491 | ||
487 | } | 492 | } |
488 | 493 | ||
489 | void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) | 494 | void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) |
490 | { | 495 | { |
491 | if (!mailView->currentItem()) return; | 496 | if (!mailView->currentItem()) return; |
492 | MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType(); | 497 | MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType(); |
493 | /* just the RIGHT button - or hold on pda */ | 498 | /* just the RIGHT button - or hold on pda */ |
494 | if (button!=2) {return;} | 499 | if (button!=2) {return;} |
495 | if (!item) return; | 500 | if (!item) return; |
496 | QPopupMenu *m = new QPopupMenu(0); | 501 | QPopupMenu *m = new QPopupMenu(0); |
497 | if (m) | 502 | if (m) |
498 | { | 503 | { |
499 | if (mailtype==MAILLIB::A_NNTP) { | 504 | if (mailtype==MAILLIB::A_NNTP) { |
500 | m->insertItem(i18n("Read this posting"),this,SLOT(displayMail())); | 505 | m->insertItem(i18n("Read this posting"),this,SLOT(displayMail())); |
501 | m->insertItem(i18n("Copy this posting"),this,SLOT(slotMoveCopyMail())); | 506 | m->insertItem(i18n("Copy this posting"),this,SLOT(slotMoveCopyMail())); |
502 | m->insertSeparator(); | 507 | m->insertSeparator(); |
503 | m->insertItem(i18n("Copy all selected postings"),this,SLOT(slotMoveCopyAllMail())); | 508 | m->insertItem(i18n("Copy all selected postings"),this,SLOT(slotMoveCopyAllMail())); |
504 | m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection())); | 509 | m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection())); |
505 | } else { | 510 | } else { |
506 | if (folderView->currentisDraft()) { | 511 | if (folderView->currentisDraft()) { |
507 | m->insertItem(i18n("Edit this mail"),this,SLOT(reEditMail())); | 512 | m->insertItem(i18n("Edit this mail"),this,SLOT(reEditMail())); |
508 | } | 513 | } |
509 | m->insertItem(i18n("Reply to this mail"),this,SLOT(replyMail())); | 514 | m->insertItem(i18n("Reply to this mail"),this,SLOT(replyMail())); |
510 | m->insertItem(i18n("Read this mail"),this,SLOT(displayMail())); | 515 | m->insertItem(i18n("Read this mail"),this,SLOT(displayMail())); |
511 | m->insertSeparator(); | 516 | m->insertSeparator(); |
512 | m->insertItem(i18n("Move/Copy this mail"),this,SLOT(slotMoveCopyMail())); | 517 | m->insertItem(i18n("Move/Copy this mail"),this,SLOT(slotMoveCopyMail())); |
513 | m->insertItem(i18n("Delete this mail"),this,SLOT(slotDeleteMail())); | 518 | m->insertItem(i18n("Delete this mail"),this,SLOT(slotDeleteMail())); |
514 | m->insertSeparator(); | 519 | m->insertSeparator(); |
515 | m->insertItem(i18n("Move/Copy all selected mail"),this,SLOT(slotMoveCopyAllMail())); | 520 | m->insertItem(i18n("Move/Copy all selected mail"),this,SLOT(slotMoveCopyAllMail())); |
516 | m->insertItem(i18n("Delete all selected mails"),this,SLOT(slotDeleteAllMail())); | 521 | m->insertItem(i18n("Delete all selected mails"),this,SLOT(slotDeleteAllMail())); |
517 | m->insertSeparator(); | 522 | m->insertSeparator(); |
518 | m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection())); | 523 | m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection())); |
519 | } | 524 | } |
520 | m->setFocus(); | 525 | m->setFocus(); |
521 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); | 526 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); |
522 | delete m; | 527 | delete m; |
523 | } | 528 | } |
524 | } | 529 | } |
525 | 530 | ||
526 | void OpieMail::slotShowFolders( bool show ) | 531 | void OpieMail::slotShowFolders( bool show ) |
527 | { | 532 | { |
528 | if ( show && folderView->isHidden() ) | 533 | if ( show && folderView->isHidden() ) |
529 | { | 534 | { |
530 | folderView->show(); | 535 | folderView->show(); |
531 | } | 536 | } |
532 | else if ( !show && !folderView->isHidden() ) | 537 | else if ( !show && !folderView->isHidden() ) |
533 | { | 538 | { |
534 | folderView->hide(); | 539 | folderView->hide(); |
535 | } | 540 | } |
536 | } | 541 | } |
537 | 542 | ||
538 | void OpieMail::refreshMailView(const QValueList<RecMailP>&list) | 543 | void OpieMail::refreshMailView(const QValueList<RecMailP>&list) |
539 | { | 544 | { |
540 | MailListViewItem*item = 0; | 545 | MailListViewItem*item = 0; |
541 | mailView->clear(); | 546 | mailView->clear(); |
542 | 547 | ||
543 | QValueList<RecMailP>::ConstIterator it; | 548 | QValueList<RecMailP>::ConstIterator it; |
544 | for (it = list.begin(); it != list.end();++it) | 549 | for (it = list.begin(); it != list.end();++it) |
545 | { | 550 | { |
546 | item = new MailListViewItem(mailView,item); | 551 | item = new MailListViewItem(mailView,item); |
547 | item->storeData((*it)); | 552 | item->storeData((*it)); |
548 | item->showEntry(); | 553 | item->showEntry(); |
549 | } | 554 | } |
550 | mailView->setSorting ( 4, false ); | 555 | mailView->setSorting ( 4, false ); |
551 | } | 556 | } |
552 | 557 | ||
553 | void OpieMail::mailLeftClicked( QListViewItem *item ) | 558 | void OpieMail::mailLeftClicked( QListViewItem *item ) |
554 | { | 559 | { |
555 | mailView->clearSelection(); | 560 | mailView->clearSelection(); |
556 | /* just LEFT button - or tap with stylus on pda */ | 561 | /* just LEFT button - or tap with stylus on pda */ |
557 | //if (button!=1) return; | 562 | //if (button!=1) return; |
558 | if (!item) return; | 563 | if (!item) return; |
559 | if (folderView->currentisDraft()) { | 564 | if (folderView->currentisDraft()) { |
560 | reEditMail(); | 565 | reEditMail(); |
561 | } else { | 566 | } else { |
562 | displayMail(); | 567 | displayMail(); |
563 | } | 568 | } |
564 | } | 569 | } |
565 | 570 | ||
566 | void OpieMail::slotMoveCopyMail() | 571 | void OpieMail::slotMoveCopyMail() |
567 | { | 572 | { |
568 | if (!mailView->currentItem()) return; | 573 | if (!mailView->currentItem()) return; |
569 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); | 574 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); |
570 | AbstractMail*targetMail = 0; | 575 | AbstractMail*targetMail = 0; |
571 | QString targetFolder = ""; | 576 | QString targetFolder = ""; |
572 | Selectstore sels; | 577 | Selectstore sels; |
573 | folderView->setupFolderselect(&sels); | 578 | folderView->setupFolderselect(&sels); |
574 | if (!sels.exec()) return; | 579 | if (!sels.exec()) return; |
575 | targetMail = sels.currentMail(); | 580 | targetMail = sels.currentMail(); |
576 | targetFolder = sels.currentFolder(); | 581 | targetFolder = sels.currentFolder(); |
577 | if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || | 582 | if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || |
578 | targetFolder.isEmpty()) | 583 | targetFolder.isEmpty()) |
579 | { | 584 | { |
580 | return; | 585 | return; |
581 | } | 586 | } |
582 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) | 587 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) |
583 | { | 588 | { |
584 | QMessageBox::critical(0,i18n("Error creating new Folder"), | 589 | QMessageBox::critical(0,i18n("Error creating new Folder"), |
585 | i18n("<center>Error while creating<br>new folder - breaking.</center>")); | 590 | i18n("<center>Error while creating<br>new folder - breaking.</center>")); |
586 | return; | 591 | return; |
587 | } | 592 | } |
588 | sels.hide(); | 593 | sels.hide(); |
589 | qApp->processEvents(); | 594 | qApp->processEvents(); |
590 | // qDebug("hiding sels "); | 595 | // qDebug("hiding sels "); |
591 | mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); | 596 | mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); |
592 | folderView->refreshCurrent(); | 597 | folderView->refreshCurrent(); |
593 | } | 598 | } |
594 | 599 | ||
595 | void OpieMail::slotMoveCopyAllMail() | 600 | void OpieMail::slotMoveCopyAllMail() |
596 | { | 601 | { |
597 | 602 | ||
598 | if (!mailView->currentItem()) return; | 603 | if (!mailView->currentItem()) return; |
599 | QValueList<RecMailP> t; | 604 | QValueList<RecMailP> t; |
600 | // if ( QMessageBox::warning(this, i18n("Move/Copy all selected mails"), i18n("Do you really want to copy/move\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) | 605 | // if ( QMessageBox::warning(this, i18n("Move/Copy all selected mails"), i18n("Do you really want to copy/move\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) |
601 | { | 606 | { |
602 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); | 607 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); |
603 | while ( item ) { | 608 | while ( item ) { |
604 | if ( item->isSelected() ) { | 609 | if ( item->isSelected() ) { |
605 | t.append( item->data() ); | 610 | t.append( item->data() ); |
606 | } | 611 | } |
607 | item = (MailListViewItem*)item->nextSibling(); | 612 | item = (MailListViewItem*)item->nextSibling(); |
608 | } | 613 | } |
609 | } | 614 | } |
610 | // else | 615 | // else |
611 | // return; | 616 | // return; |
612 | if ( t.count() == 0 ) | 617 | if ( t.count() == 0 ) |
613 | return; | 618 | return; |
614 | RecMailP mail = t.first(); | 619 | RecMailP mail = t.first(); |
615 | AbstractMail*targetMail = 0; | 620 | AbstractMail*targetMail = 0; |
616 | QString targetFolder = ""; | 621 | QString targetFolder = ""; |
617 | Selectstore sels; | 622 | Selectstore sels; |
618 | folderView->setupFolderselect(&sels); | 623 | folderView->setupFolderselect(&sels); |
619 | if (!sels.exec()) return; | 624 | if (!sels.exec()) return; |
620 | targetMail = sels.currentMail(); | 625 | targetMail = sels.currentMail(); |
621 | targetFolder = sels.currentFolder(); | 626 | targetFolder = sels.currentFolder(); |
622 | if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || | 627 | if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || |
623 | targetFolder.isEmpty()) | 628 | targetFolder.isEmpty()) |
624 | { | 629 | { |
625 | return; | 630 | return; |
626 | } | 631 | } |
627 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) | 632 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) |
628 | { | 633 | { |
629 | QMessageBox::critical(0,i18n("Error creating new Folder"), | 634 | QMessageBox::critical(0,i18n("Error creating new Folder"), |
630 | i18n("<center>Error while creating<br>new folder - breaking.</center>")); | 635 | i18n("<center>Error while creating<br>new folder - breaking.</center>")); |
631 | return; | 636 | return; |
632 | } | 637 | } |
633 | sels.hide(); | 638 | sels.hide(); |
634 | qApp->processEvents(); | 639 | qApp->processEvents(); |
635 | //qDebug("hiding sels "); | 640 | //qDebug("hiding sels "); |
636 | mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails()); | 641 | mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails()); |
637 | folderView->refreshCurrent(); | 642 | folderView->refreshCurrent(); |
638 | } | 643 | } |
639 | 644 | ||
640 | void OpieMail::reEditMail() | 645 | void OpieMail::reEditMail() |
641 | { | 646 | { |
642 | if (!mailView->currentItem()) return; | 647 | if (!mailView->currentItem()) return; |
643 | 648 | ||
644 | ComposeMail compose( settings, this, 0, true ); | 649 | ComposeMail compose( settings, this, 0, true ); |
645 | compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data()); | 650 | compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data()); |
646 | compose.slotAdjustColumns(); | 651 | compose.slotAdjustColumns(); |
647 | #ifndef DESKTOP_VERSION | 652 | #ifndef DESKTOP_VERSION |
648 | compose.showMaximized(); | 653 | compose.showMaximized(); |
649 | #else | 654 | #else |
650 | compose.resize(640,480); | 655 | compose.resize(640,480); |
651 | #endif | 656 | #endif |
652 | mCurrentComposer = &compose; | 657 | mCurrentComposer = &compose; |
653 | compose.exec(); | 658 | compose.exec(); |
654 | folderView->refreshOutgoing(); | 659 | folderView->refreshOutgoing(); |
655 | mCurrentComposer = 0; | 660 | mCurrentComposer = 0; |
656 | } | 661 | } |
657 | 662 | ||
658 | void OpieMail::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) | 663 | void OpieMail::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) |
659 | { | 664 | { |
660 | 665 | ||
661 | if ( mCurrentComposer ) { | 666 | if ( mCurrentComposer ) { |
662 | mCurrentComposer->insertAttendees(uid,nameList,emailList,uidList); | 667 | mCurrentComposer->insertAttendees(uid,nameList,emailList,uidList); |
663 | } else { | 668 | } else { |
664 | ComposeMail compose( settings, this, 0, true ); | 669 | ComposeMail compose( settings, this, 0, true ); |
665 | compose.slotAdjustColumns(); | 670 | compose.slotAdjustColumns(); |
666 | #ifndef DESKTOP_VERSION | 671 | #ifndef DESKTOP_VERSION |
667 | compose.showMaximized(); | 672 | compose.showMaximized(); |
668 | #endif | 673 | #endif |
669 | mCurrentComposer = &compose; | 674 | mCurrentComposer = &compose; |
670 | mCurrentComposer->insertAttendees(uid,nameList,emailList,uidList); | 675 | mCurrentComposer->insertAttendees(uid,nameList,emailList,uidList); |
671 | compose.exec(); | 676 | compose.exec(); |
672 | mCurrentComposer = 0; | 677 | mCurrentComposer = 0; |
673 | folderView->refreshOutgoing(); | 678 | folderView->refreshOutgoing(); |
674 | raise(); | 679 | raise(); |
675 | } | 680 | } |
676 | } | 681 | } |
diff --git a/kmicromail/opiemail.h b/kmicromail/opiemail.h index 4f75b3f..48c5dda 100644 --- a/kmicromail/opiemail.h +++ b/kmicromail/opiemail.h | |||
@@ -1,66 +1,67 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | 1 | // CHANGED 2004-09-31 Lutz Rogowski |
2 | #ifndef OPIEMAIL_H | 2 | #ifndef OPIEMAIL_H |
3 | #define OPIEMAIL_H | 3 | #define OPIEMAIL_H |
4 | 4 | ||
5 | #include "mainwindow.h" | 5 | #include "mainwindow.h" |
6 | #include <libmailwrapper/settings.h> | 6 | #include <libmailwrapper/settings.h> |
7 | 7 | ||
8 | #include <opie2/osmartpointer.h> | 8 | #include <opie2/osmartpointer.h> |
9 | #include <libmailwrapper/mailtypes.h> | 9 | #include <libmailwrapper/mailtypes.h> |
10 | #include <viewmail.h> | 10 | #include <viewmail.h> |
11 | #include <qstringlist.h> | 11 | #include <qstringlist.h> |
12 | 12 | ||
13 | class ComposeMail; | 13 | class ComposeMail; |
14 | 14 | ||
15 | class OpieMail : public MainWindow | 15 | class OpieMail : public MainWindow |
16 | { | 16 | { |
17 | Q_OBJECT | 17 | Q_OBJECT |
18 | 18 | ||
19 | public: | 19 | public: |
20 | OpieMail( QWidget *parent = 0, const char *name = 0 ); | 20 | OpieMail( QWidget *parent = 0, const char *name = 0 ); |
21 | virtual ~OpieMail(); | 21 | virtual ~OpieMail(); |
22 | static QString appName() { return QString::fromLatin1("kopiemail"); } | 22 | static QString appName() { return QString::fromLatin1("kopiemail"); } |
23 | 23 | ||
24 | public slots: | 24 | public slots: |
25 | virtual void slotwriteMail(const QString&name,const QString&email); | 25 | virtual void slotwriteMail(const QString&name,const QString&email); |
26 | virtual void slotwriteMail2(const QString&nameemail); | 26 | virtual void slotwriteMail2(const QString&nameemail); |
27 | virtual void slotComposeMail(); | 27 | virtual void slotComposeMail(); |
28 | virtual void slotExtAppHandler(); | 28 | virtual void slotExtAppHandler(); |
29 | virtual void appMessage(const QCString &msg, const QByteArray &data); | 29 | virtual void appMessage(const QCString &msg, const QByteArray &data); |
30 | virtual void message(const QCString &msg, const QByteArray &data); | 30 | virtual void message(const QCString &msg, const QByteArray &data); |
31 | void insertAttendees(const QString&, const QStringList& namelist, const QStringList& emaillist, const QStringList& uidlist); | 31 | void insertAttendees(const QString&, const QStringList& namelist, const QStringList& emaillist, const QStringList& uidlist); |
32 | protected slots: | 32 | protected slots: |
33 | virtual void deleteAndDisplayNextMail(ViewMail * vm); | 33 | virtual void deleteAndDisplayNextMail(ViewMail * vm); |
34 | virtual void displayNextMail(ViewMail * vm); | 34 | virtual void displayNextMail(ViewMail * vm); |
35 | virtual void slotSendQueued(); | 35 | virtual void slotSendQueued(); |
36 | virtual void slotSearchMails(); | 36 | virtual void slotSearchMails(); |
37 | virtual void slotEditSettings(); | 37 | virtual void slotEditSettings(); |
38 | virtual void slotEditGlobalSettings(); | ||
38 | virtual void slotEditAccounts(); | 39 | virtual void slotEditAccounts(); |
39 | virtual void displayMail(); | 40 | virtual void displayMail(); |
40 | virtual void replyMail(); | 41 | virtual void replyMail(); |
41 | virtual void slotDeleteMail(); | 42 | virtual void slotDeleteMail(); |
42 | virtual void slotGetMail(); | 43 | virtual void slotGetMail(); |
43 | virtual void slotGetAllMail(); | 44 | virtual void slotGetAllMail(); |
44 | virtual void slotDeleteAllMail(); | 45 | virtual void slotDeleteAllMail(); |
45 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); | 46 | virtual void mailHold(int, QListViewItem *,const QPoint&,int); |
46 | virtual void slotShowFolders( bool show ); | 47 | virtual void slotShowFolders( bool show ); |
47 | virtual void refreshMailView(const QValueList<RecMailP>&); | 48 | virtual void refreshMailView(const QValueList<RecMailP>&); |
48 | virtual void mailLeftClicked( QListViewItem * ); | 49 | virtual void mailLeftClicked( QListViewItem * ); |
49 | virtual void slotMoveCopyMail(); | 50 | virtual void slotMoveCopyMail(); |
50 | virtual void slotMoveCopyAllMail(); | 51 | virtual void slotMoveCopyAllMail(); |
51 | virtual void reEditMail(); | 52 | virtual void reEditMail(); |
52 | void clearSelection(); | 53 | void clearSelection(); |
53 | void slotDownloadMail(); | 54 | void slotDownloadMail(); |
54 | private: | 55 | private: |
55 | ComposeMail* mCurrentComposer; | 56 | ComposeMail* mCurrentComposer; |
56 | void closeViewMail(ViewMail * vm); | 57 | void closeViewMail(ViewMail * vm); |
57 | QString mPendingEmail; | 58 | QString mPendingEmail; |
58 | QString mPendingName; | 59 | QString mPendingName; |
59 | QByteArray mPendingData; | 60 | QByteArray mPendingData; |
60 | QCString mPendingMessage; | 61 | QCString mPendingMessage; |
61 | Settings *settings; | 62 | Settings *settings; |
62 | QTextBrowser * tb; | 63 | QTextBrowser * tb; |
63 | 64 | ||
64 | }; | 65 | }; |
65 | 66 | ||
66 | #endif | 67 | #endif |