author | zautrix <zautrix> | 2005-03-26 17:06:57 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-26 17:06:57 (UTC) |
commit | c692f6870157f428aebf1dfdab4fbb6e88699c31 (patch) (unidiff) | |
tree | 43c45e0aef74c1d1fcc42d22bc1e05c9318159ca | |
parent | 5079ed1883f8e53bc12be971c3c9495f45abf341 (diff) | |
download | kdepimpi-c692f6870157f428aebf1dfdab4fbb6e88699c31.zip kdepimpi-c692f6870157f428aebf1dfdab4fbb6e88699c31.tar.gz kdepimpi-c692f6870157f428aebf1dfdab4fbb6e88699c31.tar.bz2 |
layout fixes
-rw-r--r-- | kmicromail/koprefsdialog.cpp | 4 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 18 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 23 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 1 |
4 files changed, 35 insertions, 11 deletions
diff --git a/kmicromail/koprefsdialog.cpp b/kmicromail/koprefsdialog.cpp index 4af4a8c..40347cc 100644 --- a/kmicromail/koprefsdialog.cpp +++ b/kmicromail/koprefsdialog.cpp | |||
@@ -1,843 +1,847 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #include <kdialog.h> | 23 | #include <kdialog.h> |
24 | #include <qlayout.h> | 24 | #include <qlayout.h> |
25 | #include <qlabel.h> | 25 | #include <qlabel.h> |
26 | #include <qgroupbox.h> | 26 | #include <qgroupbox.h> |
27 | #include <qbuttongroup.h> | 27 | #include <qbuttongroup.h> |
28 | #include <qlineedit.h> | 28 | #include <qlineedit.h> |
29 | #include <qfont.h> | 29 | #include <qfont.h> |
30 | #include <qslider.h> | 30 | #include <qslider.h> |
31 | #include <qfile.h> | 31 | #include <qfile.h> |
32 | #include <qtextstream.h> | 32 | #include <qtextstream.h> |
33 | #include <qcombobox.h> | 33 | #include <qcombobox.h> |
34 | #include <qvbox.h> | 34 | #include <qvbox.h> |
35 | #include <qhbox.h> | 35 | #include <qhbox.h> |
36 | #include <qregexp.h> | 36 | #include <qregexp.h> |
37 | #include <qspinbox.h> | 37 | #include <qspinbox.h> |
38 | #include <qdatetime.h> | 38 | #include <qdatetime.h> |
39 | #include <qcheckbox.h> | 39 | #include <qcheckbox.h> |
40 | #include <qradiobutton.h> | 40 | #include <qradiobutton.h> |
41 | #include <qpushbutton.h> | 41 | #include <qpushbutton.h> |
42 | #include <qstrlist.h> | 42 | #include <qstrlist.h> |
43 | #include <qapplication.h> | 43 | #include <qapplication.h> |
44 | 44 | ||
45 | #include <kcolorbutton.h> | 45 | #include <kcolorbutton.h> |
46 | #include <kdebug.h> | 46 | #include <kdebug.h> |
47 | #include <klocale.h> | 47 | #include <klocale.h> |
48 | #include <kglobal.h> | 48 | #include <kglobal.h> |
49 | #include <kfontdialog.h> | 49 | #include <kfontdialog.h> |
50 | #include <kfiledialog.h> | 50 | #include <kfiledialog.h> |
51 | #include <kmessagebox.h> | 51 | #include <kmessagebox.h> |
52 | #include <kcolordialog.h> | 52 | #include <kcolordialog.h> |
53 | #include <kiconloader.h> | 53 | #include <kiconloader.h> |
54 | #include <kemailsettings.h> | 54 | #include <kemailsettings.h> |
55 | #include <kstandarddirs.h> | 55 | #include <kstandarddirs.h> |
56 | 56 | ||
57 | #include <klineedit.h> | 57 | #include <klineedit.h> |
58 | 58 | ||
59 | 59 | ||
60 | #include "koprefs.h" | 60 | #include "koprefs.h" |
61 | 61 | ||
62 | #include "koprefsdialog.h" | 62 | #include "koprefsdialog.h" |
63 | //#include <kprefswidget.h> | 63 | //#include <kprefswidget.h> |
64 | 64 | ||
65 | 65 | ||
66 | KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : | 66 | KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : |
67 | KPrefsDialog(KOPrefs::instance(),parent,name,true) | 67 | KPrefsDialog(KOPrefs::instance(),parent,name,true) |
68 | { | 68 | { |
69 | 69 | ||
70 | setCaption( i18n("Settings - some need a restart (nr)")); | 70 | setCaption( i18n("Settings - some need a restart (nr)")); |
71 | setupGlobalTab(); | 71 | setupGlobalTab(); |
72 | setupMainTab(); | 72 | setupMainTab(); |
73 | setupMailTab();; | 73 | setupMailTab();; |
74 | setupFontsTab(); | 74 | setupFontsTab(); |
75 | readConfig(); | 75 | readConfig(); |
76 | #ifndef DESKTOP_VERSION | ||
77 | if ( QApplication::desktop()->height() == 480 ) | ||
78 | hideButtons(); | ||
79 | #endif | ||
76 | 80 | ||
77 | #if 0 | 81 | #if 0 |
78 | 82 | ||
79 | setupMainTab(); | 83 | setupMainTab(); |
80 | setupLocaleTab(); | 84 | setupLocaleTab(); |
81 | setupTimeZoneTab(); | 85 | setupTimeZoneTab(); |
82 | setupTimeTab(); | 86 | setupTimeTab(); |
83 | setupLocaleDateTab(); | 87 | setupLocaleDateTab(); |
84 | setupFontsTab(); | 88 | setupFontsTab(); |
85 | setupColorsTab(); | 89 | setupColorsTab(); |
86 | setupViewsTab(); | 90 | setupViewsTab(); |
87 | //setupSyncTab(); | 91 | //setupSyncTab(); |
88 | //setupSyncAlgTab(); | 92 | //setupSyncAlgTab(); |
89 | //setupPrinterTab(); | 93 | //setupPrinterTab(); |
90 | //setupGroupSchedulingTab(); | 94 | //setupGroupSchedulingTab(); |
91 | //setupGroupAutomationTab(); | 95 | //setupGroupAutomationTab(); |
92 | #endif | 96 | #endif |
93 | } | 97 | } |
94 | 98 | ||
95 | #include "kpimglobalprefs.h" | 99 | #include "kpimglobalprefs.h" |
96 | 100 | ||
97 | KOPrefsDialog::~KOPrefsDialog() | 101 | KOPrefsDialog::~KOPrefsDialog() |
98 | { | 102 | { |
99 | } | 103 | } |
100 | void KOPrefsDialog::setupGlobalTab() | 104 | void KOPrefsDialog::setupGlobalTab() |
101 | { | 105 | { |
102 | QFrame *topFrame = addPage(i18n("Global"),0,0); | 106 | QFrame *topFrame = addPage(i18n("Global"),0,0); |
103 | kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); | 107 | kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); |
104 | QVBoxLayout *topLayout = new QVBoxLayout(topFrame); | 108 | QVBoxLayout *topLayout = new QVBoxLayout(topFrame); |
105 | topLayout->addWidget( kdelibcfg ); | 109 | topLayout->addWidget( kdelibcfg ); |
106 | 110 | ||
107 | 111 | ||
108 | } | 112 | } |
109 | void KOPrefsDialog::setupMainTab() | 113 | void KOPrefsDialog::setupMainTab() |
110 | { | 114 | { |
111 | QFrame *topFrame = addPage(i18n("General"),0,0); | 115 | QFrame *topFrame = addPage(i18n("General"),0,0); |
112 | 116 | ||
113 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 117 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
114 | topLayout->setSpacing(spacingHint()); | 118 | topLayout->setSpacing(spacingHint()); |
115 | topLayout->setMargin(marginHint()); | 119 | topLayout->setMargin(marginHint()); |
116 | 120 | ||
117 | 121 | ||
118 | mNameEdit = new QLineEdit(topFrame); | 122 | mNameEdit = new QLineEdit(topFrame); |
119 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); | 123 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); |
120 | topLayout->addWidget(mNameLabel,0,0); | 124 | topLayout->addWidget(mNameLabel,0,0); |
121 | topLayout->addWidget(mNameEdit,0,1); | 125 | topLayout->addWidget(mNameEdit,0,1); |
122 | 126 | ||
123 | mEmailEdit = new QLineEdit(topFrame); | 127 | mEmailEdit = new QLineEdit(topFrame); |
124 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); | 128 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); |
125 | topLayout->addWidget(mEmailLabel,1,0); | 129 | topLayout->addWidget(mEmailLabel,1,0); |
126 | topLayout->addWidget(mEmailEdit,1,1); | 130 | topLayout->addWidget(mEmailEdit,1,1); |
127 | QLabel *lab = new QLabel( i18n("HINT: Separate multiple\neMail addresses by \";\""), topFrame); | 131 | QLabel *lab = new QLabel( i18n("HINT: Separate multiple\neMail addresses by \";\""), topFrame); |
128 | topLayout->addMultiCellWidget(lab,2,2,0,1); | 132 | topLayout->addMultiCellWidget(lab,2,2,0,1); |
129 | KPrefsDialogWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"), | 133 | KPrefsDialogWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"), |
130 | &(KOPrefs::instance()->mUseKapi),topFrame); | 134 | &(KOPrefs::instance()->mUseKapi),topFrame); |
131 | topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1); | 135 | topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1); |
132 | } | 136 | } |
133 | 137 | ||
134 | void KOPrefsDialog::setupMailTab() | 138 | void KOPrefsDialog::setupMailTab() |
135 | { | 139 | { |
136 | QFrame *topFrame = addPage(i18n("Mail"),0,0); | 140 | QFrame *topFrame = addPage(i18n("Mail"),0,0); |
137 | 141 | ||
138 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | 142 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); |
139 | topLayout->setSpacing(spacingHint()); | 143 | topLayout->setSpacing(spacingHint()); |
140 | topLayout->setMargin(marginHint()); | 144 | topLayout->setMargin(marginHint()); |
141 | 145 | ||
142 | KPrefsDialogWidBool* ttt = addWidBool(i18n("View mail as html"), | 146 | KPrefsDialogWidBool* ttt = addWidBool(i18n("View mail as html"), |
143 | &(KOPrefs::instance()->mViewAsHtml),topFrame); | 147 | &(KOPrefs::instance()->mViewAsHtml),topFrame); |
144 | topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1); | 148 | topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1); |
145 | 149 | ||
146 | 150 | ||
147 | ttt = addWidBool(i18n("Send mails later"), | 151 | ttt = addWidBool(i18n("Send mails later"), |
148 | &(KOPrefs::instance()->mSendLater),topFrame); | 152 | &(KOPrefs::instance()->mSendLater),topFrame); |
149 | topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1); | 153 | topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1); |
150 | ttt = addWidBool(i18n("Show \"To\" field in list view"), | 154 | ttt = addWidBool(i18n("Show \"To\" field in list view"), |
151 | &(KOPrefs::instance()->mShowToField),topFrame); | 155 | &(KOPrefs::instance()->mShowToField),topFrame); |
152 | topLayout->addMultiCellWidget(ttt->checkBox(),2,2,0,1); | 156 | topLayout->addMultiCellWidget(ttt->checkBox(),2,2,0,1); |
153 | 157 | ||
154 | int iii =3; | 158 | int iii =3; |
155 | ttt = addWidBool(i18n("Show info fields at startup"), | 159 | ttt = addWidBool(i18n("Show info fields at startup"), |
156 | &(KOPrefs::instance()->mShowInfoStart),topFrame); | 160 | &(KOPrefs::instance()->mShowInfoStart),topFrame); |
157 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); | 161 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); |
158 | ++iii; | 162 | ++iii; |
159 | ttt = addWidBool(i18n("Show \"Subject\" info field"), | 163 | ttt = addWidBool(i18n("Show \"Subject\" info field"), |
160 | &(KOPrefs::instance()->mShowInfoSub),topFrame); | 164 | &(KOPrefs::instance()->mShowInfoSub),topFrame); |
161 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); | 165 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); |
162 | ++iii; | 166 | ++iii; |
163 | ttt = addWidBool(i18n("Show \"From\" info field"), | 167 | ttt = addWidBool(i18n("Show \"From\" info field"), |
164 | &(KOPrefs::instance()->mShowInfoFrom),topFrame); | 168 | &(KOPrefs::instance()->mShowInfoFrom),topFrame); |
165 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); | 169 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); |
166 | ++iii; | 170 | ++iii; |
167 | ttt = addWidBool(i18n("Show \"To\" info field"), | 171 | ttt = addWidBool(i18n("Show \"To\" info field"), |
168 | &(KOPrefs::instance()->mShowInfoTo),topFrame); | 172 | &(KOPrefs::instance()->mShowInfoTo),topFrame); |
169 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); | 173 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); |
170 | ++iii; | 174 | ++iii; |
171 | 175 | ||
172 | /* | 176 | /* |
173 | mCodecEdit = new QLineEdit(topFrame); | 177 | mCodecEdit = new QLineEdit(topFrame); |
174 | topLayout->addMultiCellWidget( new QLabel(mCodecEdit, i18n("User defined codec for new mails:"), topFrame),2,2,0,1); | 178 | topLayout->addMultiCellWidget( new QLabel(mCodecEdit, i18n("User defined codec for new mails:"), topFrame),2,2,0,1); |
175 | topLayout->addMultiCellWidget(mCodecEdit,3,3,0,1); | 179 | topLayout->addMultiCellWidget(mCodecEdit,3,3,0,1); |
176 | topLayout->addMultiCellWidget( new QLabel(0, i18n("Example: iso-8859-15"), topFrame),4,4,0,1); | 180 | topLayout->addMultiCellWidget( new QLabel(0, i18n("Example: iso-8859-15"), topFrame),4,4,0,1); |
177 | */ | 181 | */ |
178 | } | 182 | } |
179 | void KOPrefsDialog::setupFontsTab() | 183 | void KOPrefsDialog::setupFontsTab() |
180 | { | 184 | { |
181 | 185 | ||
182 | QFrame *topFrame = addPage(i18n("Fonts"),0,0); | 186 | QFrame *topFrame = addPage(i18n("Fonts"),0,0); |
183 | // DesktopIcon("fonts",KIcon::SizeMedium)); | 187 | // DesktopIcon("fonts",KIcon::SizeMedium)); |
184 | 188 | ||
185 | QGridLayout *topLayout = new QGridLayout(topFrame,7,3); | 189 | QGridLayout *topLayout = new QGridLayout(topFrame,7,3); |
186 | topLayout->setSpacing(1); | 190 | topLayout->setSpacing(1); |
187 | topLayout->setMargin(3); | 191 | topLayout->setMargin(3); |
188 | KPrefsDialogWidFont * tVFont; | 192 | KPrefsDialogWidFont * tVFont; |
189 | int i = 0; | 193 | int i = 0; |
190 | KPrefsDialogWidFont *timeLabelsFont = | 194 | KPrefsDialogWidFont *timeLabelsFont = |
191 | addWidFont(i18n("OK"),i18n("Application(nr)"), | 195 | addWidFont(i18n("OK"),i18n("Application(nr)"), |
192 | &(KOPrefs::instance()->mAppFont),topFrame); | 196 | &(KOPrefs::instance()->mAppFont),topFrame); |
193 | topLayout->addWidget(timeLabelsFont->label(),i,0); | 197 | topLayout->addWidget(timeLabelsFont->label(),i,0); |
194 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | 198 | topLayout->addWidget(timeLabelsFont->preview(),i,1); |
195 | topLayout->addWidget(timeLabelsFont->button(),i,2); | 199 | topLayout->addWidget(timeLabelsFont->button(),i,2); |
196 | ++i; | 200 | ++i; |
197 | 201 | ||
198 | 202 | ||
199 | timeLabelsFont = | 203 | timeLabelsFont = |
200 | addWidFont(i18n("Dear Mr."),i18n("Compose mail:"), | 204 | addWidFont(i18n("Dear Mr."),i18n("Compose mail:"), |
201 | &(KOPrefs::instance()->mComposeFont),topFrame); | 205 | &(KOPrefs::instance()->mComposeFont),topFrame); |
202 | topLayout->addWidget(timeLabelsFont->label(),i,0); | 206 | topLayout->addWidget(timeLabelsFont->label(),i,0); |
203 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | 207 | topLayout->addWidget(timeLabelsFont->preview(),i,1); |
204 | topLayout->addWidget(timeLabelsFont->button(),i,2); | 208 | topLayout->addWidget(timeLabelsFont->button(),i,2); |
205 | ++i; | 209 | ++i; |
206 | 210 | ||
207 | KPrefsDialogWidFont *timeBarFont = | 211 | KPrefsDialogWidFont *timeBarFont = |
208 | addWidFont(i18n("Hello"),i18n("Read mail:"), | 212 | addWidFont(i18n("Hello"),i18n("Read mail:"), |
209 | &(KOPrefs::instance()->mReadFont),topFrame); | 213 | &(KOPrefs::instance()->mReadFont),topFrame); |
210 | topLayout->addWidget(timeBarFont->label(),i,0); | 214 | topLayout->addWidget(timeBarFont->label(),i,0); |
211 | topLayout->addWidget(timeBarFont->preview(),i,1); | 215 | topLayout->addWidget(timeBarFont->preview(),i,1); |
212 | topLayout->addWidget(timeBarFont->button(),i,2); | 216 | topLayout->addWidget(timeBarFont->button(),i,2); |
213 | ++i; | 217 | ++i; |
214 | 218 | ||
215 | topLayout->setColStretch(1,1); | 219 | topLayout->setColStretch(1,1); |
216 | topLayout->setRowStretch(4,1); | 220 | topLayout->setRowStretch(4,1); |
217 | 221 | ||
218 | } | 222 | } |
219 | void KOPrefsDialog::usrReadConfig() | 223 | void KOPrefsDialog::usrReadConfig() |
220 | { | 224 | { |
221 | 225 | ||
222 | mNameEdit->setText(KOPrefs::instance()->mName); | 226 | mNameEdit->setText(KOPrefs::instance()->mName); |
223 | mEmailEdit->setText(KOPrefs::instance()->mEmail); | 227 | mEmailEdit->setText(KOPrefs::instance()->mEmail); |
224 | //mCodecEdit->setText(KOPrefs::instance()->mSendCodec); | 228 | //mCodecEdit->setText(KOPrefs::instance()->mSendCodec); |
225 | kdelibcfg->readConfig(); | 229 | kdelibcfg->readConfig(); |
226 | } | 230 | } |
227 | void KOPrefsDialog::usrWriteConfig() | 231 | void KOPrefsDialog::usrWriteConfig() |
228 | { | 232 | { |
229 | KOPrefs::instance()->mName = mNameEdit->text(); | 233 | KOPrefs::instance()->mName = mNameEdit->text(); |
230 | KOPrefs::instance()->mEmail = mEmailEdit->text(); | 234 | KOPrefs::instance()->mEmail = mEmailEdit->text(); |
231 | //KOPrefs::instance()->mSendCodec = mCodecEdit->text(); | 235 | //KOPrefs::instance()->mSendCodec = mCodecEdit->text(); |
232 | kdelibcfg->writeConfig(); | 236 | kdelibcfg->writeConfig(); |
233 | 237 | ||
234 | 238 | ||
235 | } | 239 | } |
236 | 240 | ||
237 | #if 0 | 241 | #if 0 |
238 | void KOPrefsDialog::setupLocaleDateTab() | 242 | void KOPrefsDialog::setupLocaleDateTab() |
239 | { | 243 | { |
240 | QFrame *topFrame = addPage(i18n("Date Format"),0,0); | 244 | QFrame *topFrame = addPage(i18n("Date Format"),0,0); |
241 | QGridLayout *topLayout = new QGridLayout(topFrame,3,2); | 245 | QGridLayout *topLayout = new QGridLayout(topFrame,3,2); |
242 | topLayout->setSpacing(spacingHint()); | 246 | topLayout->setSpacing(spacingHint()); |
243 | topLayout->setMargin(marginHint()); | 247 | topLayout->setMargin(marginHint()); |
244 | int iii = 0; | 248 | int iii = 0; |
245 | 249 | ||
246 | 250 | ||
247 | KPrefsWidRadios *syncPrefsGroup = | 251 | KPrefsWidRadios *syncPrefsGroup = |
248 | addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); | 252 | addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); |
249 | QString format; | 253 | QString format; |
250 | if ( QApplication::desktop()->width() < 480 ) | 254 | if ( QApplication::desktop()->width() < 480 ) |
251 | format = "(%d.%m.%Y)"; | 255 | format = "(%d.%m.%Y)"; |
252 | else | 256 | else |
253 | format = "(%d.%m.%Y|%A %d %B %Y)"; | 257 | format = "(%d.%m.%Y|%A %d %B %Y)"; |
254 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); | 258 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); |
255 | if ( QApplication::desktop()->width() < 480 ) | 259 | if ( QApplication::desktop()->width() < 480 ) |
256 | format = "(%m.%d.%Y)"; | 260 | format = "(%m.%d.%Y)"; |
257 | else | 261 | else |
258 | format = "(%m.%d.%Y|%A %B %d %Y)"; | 262 | format = "(%m.%d.%Y|%A %B %d %Y)"; |
259 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); | 263 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); |
260 | if ( QApplication::desktop()->width() < 480 ) | 264 | if ( QApplication::desktop()->width() < 480 ) |
261 | format = "(%Y-%m-%d)"; | 265 | format = "(%Y-%m-%d)"; |
262 | else | 266 | else |
263 | format = "(%Y-%m-%d|%A %Y %B %d)"; | 267 | format = "(%Y-%m-%d|%A %Y %B %d)"; |
264 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); | 268 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); |
265 | syncPrefsGroup->addRadio(i18n("User defined")); | 269 | syncPrefsGroup->addRadio(i18n("User defined")); |
266 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 270 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
267 | ++iii; | 271 | ++iii; |
268 | ++iii; | 272 | ++iii; |
269 | QLabel * lab; | 273 | QLabel * lab; |
270 | mUserDateFormatLong = new QLineEdit(topFrame); | 274 | mUserDateFormatLong = new QLineEdit(topFrame); |
271 | lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); | 275 | lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); |
272 | topLayout->addWidget(lab ,iii,0); | 276 | topLayout->addWidget(lab ,iii,0); |
273 | topLayout->addWidget(mUserDateFormatLong,iii,1); | 277 | topLayout->addWidget(mUserDateFormatLong,iii,1); |
274 | ++iii; | 278 | ++iii; |
275 | mUserDateFormatShort = new QLineEdit(topFrame); | 279 | mUserDateFormatShort = new QLineEdit(topFrame); |
276 | lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); | 280 | lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); |
277 | topLayout->addWidget(lab ,iii,0); | 281 | topLayout->addWidget(lab ,iii,0); |
278 | topLayout->addWidget(mUserDateFormatShort,iii,1); | 282 | topLayout->addWidget(mUserDateFormatShort,iii,1); |
279 | ++iii; | 283 | ++iii; |
280 | lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); | 284 | lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); |
281 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 285 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
282 | ++iii; | 286 | ++iii; |
283 | lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); | 287 | lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); |
284 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 288 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
285 | ++iii; | 289 | ++iii; |
286 | lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); | 290 | lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); |
287 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 291 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
288 | ++iii; | 292 | ++iii; |
289 | 293 | ||
290 | } | 294 | } |
291 | 295 | ||
292 | void KOPrefsDialog::setupLocaleTab() | 296 | void KOPrefsDialog::setupLocaleTab() |
293 | { | 297 | { |
294 | QFrame *topFrame = addPage(i18n("Locale"),0,0); | 298 | QFrame *topFrame = addPage(i18n("Locale"),0,0); |
295 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | 299 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); |
296 | topLayout->setSpacing(spacingHint()); | 300 | topLayout->setSpacing(spacingHint()); |
297 | topLayout->setMargin(marginHint()); | 301 | topLayout->setMargin(marginHint()); |
298 | int iii = 0; | 302 | int iii = 0; |
299 | KPrefsWidRadios *syncPrefsGroup = | 303 | KPrefsWidRadios *syncPrefsGroup = |
300 | addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); | 304 | addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); |
301 | syncPrefsGroup->addRadio(i18n("English")); | 305 | syncPrefsGroup->addRadio(i18n("English")); |
302 | syncPrefsGroup->addRadio(i18n("German")); | 306 | syncPrefsGroup->addRadio(i18n("German")); |
303 | syncPrefsGroup->addRadio(i18n("French")); | 307 | syncPrefsGroup->addRadio(i18n("French")); |
304 | syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); | 308 | syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); |
305 | if ( QApplication::desktop()->width() < 300 ) | 309 | if ( QApplication::desktop()->width() < 300 ) |
306 | ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | 310 | ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); |
307 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 311 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
308 | ++iii; | 312 | ++iii; |
309 | 313 | ||
310 | syncPrefsGroup = | 314 | syncPrefsGroup = |
311 | addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); | 315 | addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); |
312 | if ( QApplication::desktop()->width() > 300 ) | 316 | if ( QApplication::desktop()->width() > 300 ) |
313 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | 317 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); |
314 | syncPrefsGroup->addRadio(i18n("24:00")); | 318 | syncPrefsGroup->addRadio(i18n("24:00")); |
315 | syncPrefsGroup->addRadio(i18n("12:00am")); | 319 | syncPrefsGroup->addRadio(i18n("12:00am")); |
316 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | 320 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); |
317 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 321 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
318 | ++iii; | 322 | ++iii; |
319 | KPrefsDialogWidBool *sb; | 323 | KPrefsDialogWidBool *sb; |
320 | if ( QApplication::desktop()->width() < 300 ) { | 324 | if ( QApplication::desktop()->width() < 300 ) { |
321 | sb = | 325 | sb = |
322 | addWidBool(i18n("Week starts on Sunday"), | 326 | addWidBool(i18n("Week starts on Sunday"), |
323 | &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); | 327 | &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); |
324 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 328 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
325 | ++iii; | 329 | ++iii; |
326 | sb = | 330 | sb = |
327 | addWidBool(i18n("Use short date in (WN/E) view"), | 331 | addWidBool(i18n("Use short date in (WN/E) view"), |
328 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); | 332 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); |
329 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 333 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
330 | } | 334 | } |
331 | else { | 335 | else { |
332 | QWidget * hb = new QWidget( topFrame ); | 336 | QWidget * hb = new QWidget( topFrame ); |
333 | QHBoxLayout *hbLayout = new QHBoxLayout(hb); | 337 | QHBoxLayout *hbLayout = new QHBoxLayout(hb); |
334 | sb = | 338 | sb = |
335 | addWidBool(i18n("Week starts on Sunday"), | 339 | addWidBool(i18n("Week starts on Sunday"), |
336 | &(KOPrefs::instance()->mWeekStartsOnSunday),hb); | 340 | &(KOPrefs::instance()->mWeekStartsOnSunday),hb); |
337 | hbLayout->addWidget(sb->checkBox() ); | 341 | hbLayout->addWidget(sb->checkBox() ); |
338 | sb = | 342 | sb = |
339 | addWidBool(i18n("Use short date in (WN/E) view"), | 343 | addWidBool(i18n("Use short date in (WN/E) view"), |
340 | &(KOPrefs::instance()->mShortDateInViewer),hb); | 344 | &(KOPrefs::instance()->mShortDateInViewer),hb); |
341 | hbLayout->addWidget(sb->checkBox() ); | 345 | hbLayout->addWidget(sb->checkBox() ); |
342 | topLayout->addMultiCellWidget(hb, iii,iii,0,1); | 346 | topLayout->addMultiCellWidget(hb, iii,iii,0,1); |
343 | 347 | ||
344 | } | 348 | } |
345 | //#ifndef DESKTOP_VERSION | 349 | //#ifndef DESKTOP_VERSION |
346 | #if 0 | 350 | #if 0 |
347 | ++iii; | 351 | ++iii; |
348 | sb = | 352 | sb = |
349 | addWidBool(i18n("Quick load/save (w/o Unicode)"), | 353 | addWidBool(i18n("Quick load/save (w/o Unicode)"), |
350 | &(KOPrefs::instance()->mUseQuicksave),topFrame); | 354 | &(KOPrefs::instance()->mUseQuicksave),topFrame); |
351 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 355 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
352 | #endif | 356 | #endif |
353 | } | 357 | } |
354 | void KOPrefsDialog::showSyncPage() | 358 | void KOPrefsDialog::showSyncPage() |
355 | { | 359 | { |
356 | showPage ( 2 ) ; | 360 | showPage ( 2 ) ; |
357 | 361 | ||
358 | } | 362 | } |
359 | void KOPrefsDialog::setupSyncAlgTab() | 363 | void KOPrefsDialog::setupSyncAlgTab() |
360 | { | 364 | { |
361 | #if 0 | 365 | #if 0 |
362 | QLabel * lab; | 366 | QLabel * lab; |
363 | QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); | 367 | QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); |
364 | mSetupSyncAlgTab = topFrame; | 368 | mSetupSyncAlgTab = topFrame; |
365 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 369 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
366 | topLayout->setSpacing(spacingHint()); | 370 | topLayout->setSpacing(spacingHint()); |
367 | topLayout->setMargin(marginHint()); | 371 | topLayout->setMargin(marginHint()); |
368 | int iii = 0; | 372 | int iii = 0; |
369 | 373 | ||
370 | KPrefsDialogWidBool *sb = | 374 | KPrefsDialogWidBool *sb = |
371 | addWidBool(i18n("Ask for preferences before syncing"), | 375 | addWidBool(i18n("Ask for preferences before syncing"), |
372 | &(KOPrefs::instance()->mAskForPreferences),topFrame); | 376 | &(KOPrefs::instance()->mAskForPreferences),topFrame); |
373 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 377 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
374 | 378 | ||
375 | ++iii; | 379 | ++iii; |
376 | 380 | ||
377 | KPrefsWidRadios *syncPrefsGroup = | 381 | KPrefsWidRadios *syncPrefsGroup = |
378 | addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs), | 382 | addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs), |
379 | topFrame); | 383 | topFrame); |
380 | syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); | 384 | syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); |
381 | syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); | 385 | syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); |
382 | syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); | 386 | syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); |
383 | syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); | 387 | syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); |
384 | syncPrefsGroup->addRadio(i18n("Force take local entry always")); | 388 | syncPrefsGroup->addRadio(i18n("Force take local entry always")); |
385 | syncPrefsGroup->addRadio(i18n("Force take remote entry always")); | 389 | syncPrefsGroup->addRadio(i18n("Force take remote entry always")); |
386 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 390 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
387 | ++iii; | 391 | ++iii; |
388 | sb = | 392 | sb = |
389 | addWidBool(i18n("Show summary after syncing"), | 393 | addWidBool(i18n("Show summary after syncing"), |
390 | &(KOPrefs::instance()->mShowSyncSummary),topFrame); | 394 | &(KOPrefs::instance()->mShowSyncSummary),topFrame); |
391 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 395 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
392 | 396 | ||
393 | ++iii; | 397 | ++iii; |
394 | #endif | 398 | #endif |
395 | 399 | ||
396 | 400 | ||
397 | 401 | ||
398 | } | 402 | } |
399 | 403 | ||
400 | 404 | ||
401 | void KOPrefsDialog::setupSyncTab() | 405 | void KOPrefsDialog::setupSyncTab() |
402 | { | 406 | { |
403 | #if 0 | 407 | #if 0 |
404 | QLabel * lab; | 408 | QLabel * lab; |
405 | QFrame *topFrame = addPage(i18n("Sync Network"),0,0); | 409 | QFrame *topFrame = addPage(i18n("Sync Network"),0,0); |
406 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 410 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
407 | topLayout->setSpacing(spacingHint()); | 411 | topLayout->setSpacing(spacingHint()); |
408 | topLayout->setMargin(marginHint()); | 412 | topLayout->setMargin(marginHint()); |
409 | lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); | 413 | lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); |
410 | int iii = 0; | 414 | int iii = 0; |
411 | topLayout->addMultiCellWidget(lab , iii,iii,0,1); | 415 | topLayout->addMultiCellWidget(lab , iii,iii,0,1); |
412 | ++iii; | 416 | ++iii; |
413 | 417 | ||
414 | mRemoteIPEdit = new QLineEdit(topFrame); | 418 | mRemoteIPEdit = new QLineEdit(topFrame); |
415 | lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame); | 419 | lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame); |
416 | topLayout->addWidget(lab ,iii,0); | 420 | topLayout->addWidget(lab ,iii,0); |
417 | topLayout->addWidget(mRemoteIPEdit,iii,1); | 421 | topLayout->addWidget(mRemoteIPEdit,iii,1); |
418 | ++iii; | 422 | ++iii; |
419 | mRemoteUser = new QLineEdit(topFrame); | 423 | mRemoteUser = new QLineEdit(topFrame); |
420 | lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame); | 424 | lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame); |
421 | topLayout->addWidget(lab ,iii,0); | 425 | topLayout->addWidget(lab ,iii,0); |
422 | topLayout->addWidget(mRemoteUser, iii,1); | 426 | topLayout->addWidget(mRemoteUser, iii,1); |
423 | ++iii; | 427 | ++iii; |
424 | 428 | ||
425 | mRemoteFile = new QLineEdit(topFrame); | 429 | mRemoteFile = new QLineEdit(topFrame); |
426 | lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame); | 430 | lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame); |
427 | topLayout->addWidget(lab ,iii,0); | 431 | topLayout->addWidget(lab ,iii,0); |
428 | topLayout->addWidget(mRemoteFile,iii,1); | 432 | topLayout->addWidget(mRemoteFile,iii,1); |
429 | ++iii; | 433 | ++iii; |
430 | 434 | ||
431 | mLocalTempFile = new QLineEdit(topFrame); | 435 | mLocalTempFile = new QLineEdit(topFrame); |
432 | lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame); | 436 | lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame); |
433 | topLayout->addWidget(lab ,iii,0); | 437 | topLayout->addWidget(lab ,iii,0); |
434 | topLayout->addWidget(mLocalTempFile,iii,1); | 438 | topLayout->addWidget(mLocalTempFile,iii,1); |
435 | ++iii; | 439 | ++iii; |
436 | 440 | ||
437 | KPrefsDialogWidBool *wb = | 441 | KPrefsDialogWidBool *wb = |
438 | addWidBool(i18n("Write back synced file"), | 442 | addWidBool(i18n("Write back synced file"), |
439 | &(KOPrefs::instance()->mWriteBackFile),topFrame); | 443 | &(KOPrefs::instance()->mWriteBackFile),topFrame); |
440 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); | 444 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); |
441 | ++iii; | 445 | ++iii; |
442 | wb = | 446 | wb = |
443 | addWidBool(i18n("Write back existing entries only"), | 447 | addWidBool(i18n("Write back existing entries only"), |
444 | &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); | 448 | &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); |
445 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); | 449 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); |
446 | ++iii; | 450 | ++iii; |
447 | 451 | ||
448 | #endif | 452 | #endif |
449 | } | 453 | } |
450 | 454 | ||
451 | void KOPrefsDialog::setupMainTab() | 455 | void KOPrefsDialog::setupMainTab() |
452 | { | 456 | { |
453 | QFrame *topFrame = addPage(i18n("General"),0,0); | 457 | QFrame *topFrame = addPage(i18n("General"),0,0); |
454 | // DesktopIcon("identity",KIcon::SizeMedium)); | 458 | // DesktopIcon("identity",KIcon::SizeMedium)); |
455 | 459 | ||
456 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 460 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
457 | topLayout->setSpacing(spacingHint()); | 461 | topLayout->setSpacing(spacingHint()); |
458 | topLayout->setMargin(marginHint()); | 462 | topLayout->setMargin(marginHint()); |
459 | 463 | ||
460 | // KPrefsDialogWidBool *emailControlCenter = | 464 | // KPrefsDialogWidBool *emailControlCenter = |
461 | // addWidBool(i18n("&Use email settings from Control Center"), | 465 | // addWidBool(i18n("&Use email settings from Control Center"), |
462 | // &(KOPrefs::instance()->mEmailControlCenter),topFrame); | 466 | // &(KOPrefs::instance()->mEmailControlCenter),topFrame); |
463 | // topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); | 467 | // topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); |
464 | // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), | 468 | // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), |
465 | // SLOT(toggleEmailSettings(bool))); | 469 | // SLOT(toggleEmailSettings(bool))); |
466 | 470 | ||
467 | mNameEdit = new QLineEdit(topFrame); | 471 | mNameEdit = new QLineEdit(topFrame); |
468 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); | 472 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); |
469 | topLayout->addWidget(mNameLabel,0,0); | 473 | topLayout->addWidget(mNameLabel,0,0); |
470 | topLayout->addWidget(mNameEdit,0,1); | 474 | topLayout->addWidget(mNameEdit,0,1); |
471 | 475 | ||
472 | mEmailEdit = new QLineEdit(topFrame); | 476 | mEmailEdit = new QLineEdit(topFrame); |
473 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); | 477 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); |
474 | topLayout->addWidget(mEmailLabel,1,0); | 478 | topLayout->addWidget(mEmailLabel,1,0); |
475 | topLayout->addWidget(mEmailEdit,1,1); | 479 | topLayout->addWidget(mEmailEdit,1,1); |
476 | KPrefsDialogWidBool *wb; | 480 | KPrefsDialogWidBool *wb; |
477 | QHBox *dummy; | 481 | QHBox *dummy; |
478 | if ( QApplication::desktop()->width() > 480 ) { | 482 | if ( QApplication::desktop()->width() > 480 ) { |
479 | dummy = new QHBox(topFrame); | 483 | dummy = new QHBox(topFrame); |
480 | } else { | 484 | } else { |
481 | dummy = new QVBox(topFrame); | 485 | dummy = new QVBox(topFrame); |
482 | } | 486 | } |
483 | 487 | ||
484 | topLayout->addMultiCellWidget(dummy, 2,2,0,1); | 488 | topLayout->addMultiCellWidget(dummy, 2,2,0,1); |
485 | addWidBool(i18n("Full menu bar(nr)"), | 489 | addWidBool(i18n("Full menu bar(nr)"), |
486 | &(KOPrefs::instance()->mShowFullMenu),dummy); | 490 | &(KOPrefs::instance()->mShowFullMenu),dummy); |
487 | 491 | ||
488 | 492 | ||
489 | addWidBool(i18n("Mini icons in toolbar(nr)"), | 493 | addWidBool(i18n("Mini icons in toolbar(nr)"), |
490 | &(KOPrefs::instance()->mToolBarMiniIcons),dummy); | 494 | &(KOPrefs::instance()->mToolBarMiniIcons),dummy); |
491 | 495 | ||
492 | 496 | ||
493 | dummy = new QHBox(topFrame); | 497 | dummy = new QHBox(topFrame); |
494 | new QLabel(i18n("Days in What's Next:"),dummy); | 498 | new QLabel(i18n("Days in What's Next:"),dummy); |
495 | mWhatsNextSpin = new QSpinBox(1,14,1,dummy); | 499 | mWhatsNextSpin = new QSpinBox(1,14,1,dummy); |
496 | 500 | ||
497 | topLayout->addMultiCellWidget(dummy,3,3,0,1); | 501 | topLayout->addMultiCellWidget(dummy,3,3,0,1); |
498 | 502 | ||
499 | 503 | ||
500 | 504 | ||
501 | dummy = new QHBox(topFrame); | 505 | dummy = new QHBox(topFrame); |
502 | new QLabel(i18n("Days in Next-X-Days:"),dummy); | 506 | new QLabel(i18n("Days in Next-X-Days:"),dummy); |
503 | mNextXDaysSpin = new QSpinBox(2,14,1,dummy); | 507 | mNextXDaysSpin = new QSpinBox(2,14,1,dummy); |
504 | 508 | ||
505 | topLayout->addMultiCellWidget(dummy,4,4,0,1); | 509 | topLayout->addMultiCellWidget(dummy,4,4,0,1); |
506 | 510 | ||
507 | QHBox *prioBox = new QHBox(topFrame); | 511 | QHBox *prioBox = new QHBox(topFrame); |
508 | // intervalBox->setSpacing(spacingHint()); | 512 | // intervalBox->setSpacing(spacingHint()); |
509 | topLayout->addMultiCellWidget(prioBox,5,5,0,1); | 513 | topLayout->addMultiCellWidget(prioBox,5,5,0,1); |
510 | QString messa = i18n("Show topmost todo prios in What's Next:"); | 514 | QString messa = i18n("Show topmost todo prios in What's Next:"); |
511 | 515 | ||
512 | if ( QApplication::desktop()->width() < 300 ) | 516 | if ( QApplication::desktop()->width() < 300 ) |
513 | messa = i18n("Show topmost todo prios in What's N.:"); | 517 | messa = i18n("Show topmost todo prios in What's N.:"); |
514 | QLabel *prioLabel = new QLabel(messa, prioBox); | 518 | QLabel *prioLabel = new QLabel(messa, prioBox); |
515 | mPrioSpin = new QSpinBox(0,5,1,prioBox); | 519 | mPrioSpin = new QSpinBox(0,5,1,prioBox); |
516 | if ( QApplication::desktop()->width() < 300 ) | 520 | if ( QApplication::desktop()->width() < 300 ) |
517 | mPrioSpin->setFixedWidth( 40 ); | 521 | mPrioSpin->setFixedWidth( 40 ); |
518 | 522 | ||
519 | // KPrefsDialogWidBool *bcc = | 523 | // KPrefsDialogWidBool *bcc = |
520 | // addWidBool(i18n("Send copy to owner when mailing events"), | 524 | // addWidBool(i18n("Send copy to owner when mailing events"), |
521 | // &(KOPrefs::instance()->mBcc),topFrame); | 525 | // &(KOPrefs::instance()->mBcc),topFrame); |
522 | // topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); | 526 | // topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); |
523 | 527 | ||
524 | 528 | ||
525 | // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); | 529 | // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); |
526 | //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); | 530 | //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); |
527 | 531 | ||
528 | // addWidBool(i18n("Enable automatic saving of calendar"), | 532 | // addWidBool(i18n("Enable automatic saving of calendar"), |
529 | // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); | 533 | // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); |
530 | 534 | ||
531 | QHBox *intervalBox = new QHBox(topFrame); | 535 | QHBox *intervalBox = new QHBox(topFrame); |
532 | // intervalBox->setSpacing(spacingHint()); | 536 | // intervalBox->setSpacing(spacingHint()); |
533 | topLayout->addMultiCellWidget(intervalBox,6,6,0,1); | 537 | topLayout->addMultiCellWidget(intervalBox,6,6,0,1); |
534 | QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); | 538 | QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); |
535 | mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); | 539 | mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); |
536 | autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); | 540 | autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); |
537 | /* | 541 | /* |
538 | QHBox * agendasize = new QHBox ( topFrame ); | 542 | QHBox * agendasize = new QHBox ( topFrame ); |
539 | 543 | ||
540 | new QLabel (i18n("AllDayAgenda Height:"), agendasize ); | 544 | new QLabel (i18n("AllDayAgenda Height:"), agendasize ); |
541 | 545 | ||
542 | 546 | ||
543 | mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); | 547 | mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); |
544 | topLayout->addMultiCellWidget(agendasize,7,7,0,1); | 548 | topLayout->addMultiCellWidget(agendasize,7,7,0,1); |
545 | */ | 549 | */ |
546 | KPrefsDialogWidBool *verticalScreen = | 550 | KPrefsDialogWidBool *verticalScreen = |
547 | addWidBool(i18n("Show vertical screen (Needs restart)"), | 551 | addWidBool(i18n("Show vertical screen (Needs restart)"), |
548 | &(KOPrefs::instance()->mVerticalScreen),topFrame); | 552 | &(KOPrefs::instance()->mVerticalScreen),topFrame); |
549 | //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); | 553 | //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); |
550 | topLayout->addMultiCellWidget(verticalScreen->checkBox(),7,7,0,1); | 554 | topLayout->addMultiCellWidget(verticalScreen->checkBox(),7,7,0,1); |
551 | 555 | ||
552 | KPrefsDialogWidBool *ask = | 556 | KPrefsDialogWidBool *ask = |
553 | addWidBool(i18n("Ask for quit when closing KO/Pi"), | 557 | addWidBool(i18n("Ask for quit when closing KO/Pi"), |
554 | &(KOPrefs::instance()->mAskForQuit),topFrame); | 558 | &(KOPrefs::instance()->mAskForQuit),topFrame); |
555 | topLayout->addMultiCellWidget(ask->checkBox(),8,8,0,1); | 559 | topLayout->addMultiCellWidget(ask->checkBox(),8,8,0,1); |
556 | 560 | ||
557 | 561 | ||
558 | /* | 562 | /* |
559 | KPrefsDialogWidBool *confirmCheck = | 563 | KPrefsDialogWidBool *confirmCheck = |
560 | addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), | 564 | addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), |
561 | topFrame); | 565 | topFrame); |
562 | topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); | 566 | topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); |
563 | 567 | ||
564 | 568 | ||
565 | mEnableGroupScheduling = | 569 | mEnableGroupScheduling = |
566 | addWidBool(i18n("Enable group scheduling"), | 570 | addWidBool(i18n("Enable group scheduling"), |
567 | &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); | 571 | &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); |
568 | topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); | 572 | topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); |
569 | connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), | 573 | connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), |
570 | SLOT(warningGroupScheduling())); | 574 | SLOT(warningGroupScheduling())); |
571 | 575 | ||
572 | mEnableProjectView = | 576 | mEnableProjectView = |
573 | addWidBool(i18n("Enable project view"), | 577 | addWidBool(i18n("Enable project view"), |
574 | &(KOPrefs::instance()->mEnableProjectView),topFrame); | 578 | &(KOPrefs::instance()->mEnableProjectView),topFrame); |
575 | topLayout->addWidget(mEnableProjectView->checkBox(),9,0); | 579 | topLayout->addWidget(mEnableProjectView->checkBox(),9,0); |
576 | connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), | 580 | connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), |
577 | SLOT(warningProjectView())); | 581 | SLOT(warningProjectView())); |
578 | 582 | ||
579 | // Can't be disabled anymore | 583 | // Can't be disabled anymore |
580 | mEnableGroupScheduling->checkBox()->hide(); | 584 | mEnableGroupScheduling->checkBox()->hide(); |
581 | 585 | ||
582 | // Disable setting, because this feature now becomes stable | 586 | // Disable setting, because this feature now becomes stable |
583 | mEnableProjectView->checkBox()->hide(); | 587 | mEnableProjectView->checkBox()->hide(); |
584 | 588 | ||
585 | KPrefsWidRadios *defaultFormatGroup = | 589 | KPrefsWidRadios *defaultFormatGroup = |
586 | addWidRadios(i18n("Default Calendar Format"), | 590 | addWidRadios(i18n("Default Calendar Format"), |
587 | &(KOPrefs::instance()->mDefaultFormat),topFrame); | 591 | &(KOPrefs::instance()->mDefaultFormat),topFrame); |
588 | defaultFormatGroup->addRadio(i18n("vCalendar")); | 592 | defaultFormatGroup->addRadio(i18n("vCalendar")); |
589 | defaultFormatGroup->addRadio(i18n("iCalendar")); | 593 | defaultFormatGroup->addRadio(i18n("iCalendar")); |
590 | 594 | ||
591 | topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); | 595 | topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); |
592 | 596 | ||
593 | // Default format unconditionally is iCalendar | 597 | // Default format unconditionally is iCalendar |
594 | defaultFormatGroup->groupBox()->hide(); | 598 | defaultFormatGroup->groupBox()->hide(); |
595 | 599 | ||
596 | KPrefsWidRadios *mailClientGroup = | 600 | KPrefsWidRadios *mailClientGroup = |
597 | addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), | 601 | addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), |
598 | topFrame); | 602 | topFrame); |
599 | mailClientGroup->addRadio(i18n("KMail")); | 603 | mailClientGroup->addRadio(i18n("KMail")); |
600 | mailClientGroup->addRadio(i18n("Sendmail")); | 604 | mailClientGroup->addRadio(i18n("Sendmail")); |
601 | topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); | 605 | topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); |
602 | 606 | ||
603 | KPrefsDialogWidBool *htmlsave = | 607 | KPrefsDialogWidBool *htmlsave = |
604 | addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), | 608 | addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), |
605 | topFrame); | 609 | topFrame); |
606 | topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); | 610 | topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); |
607 | 611 | ||
608 | KPrefsWidRadios *destinationGroup = | 612 | KPrefsWidRadios *destinationGroup = |
609 | addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), | 613 | addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), |
610 | topFrame); | 614 | topFrame); |
611 | destinationGroup->addRadio(i18n("be added to the standard resource")); | 615 | destinationGroup->addRadio(i18n("be added to the standard resource")); |
612 | destinationGroup->addRadio(i18n("be asked which resource to use")); | 616 | destinationGroup->addRadio(i18n("be asked which resource to use")); |
613 | topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); | 617 | topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); |
614 | 618 | ||
615 | topLayout->setRowStretch(14,1); | 619 | topLayout->setRowStretch(14,1); |
616 | */ | 620 | */ |
617 | } | 621 | } |
618 | 622 | ||
619 | 623 | ||
620 | void KOPrefsDialog::setupTimeTab() | 624 | void KOPrefsDialog::setupTimeTab() |
621 | { | 625 | { |
622 | QFrame *topFrame = addPage(i18n("Time"),0,0); | 626 | QFrame *topFrame = addPage(i18n("Time"),0,0); |
623 | // DesktopIcon("clock",KIcon::SizeMedium)); | 627 | // DesktopIcon("clock",KIcon::SizeMedium)); |
624 | 628 | ||
625 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | 629 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); |
626 | topLayout->setSpacing(spacingHint()); | 630 | topLayout->setSpacing(spacingHint()); |
627 | topLayout->setMargin(marginHint()); | 631 | topLayout->setMargin(marginHint()); |
628 | 632 | ||
629 | QHBox *dummy = new QHBox(topFrame); | 633 | QHBox *dummy = new QHBox(topFrame); |
630 | KPrefsWidTime *dayBegins = | 634 | KPrefsWidTime *dayBegins = |
631 | addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), | 635 | addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), |
632 | dummy); | 636 | dummy); |
633 | //topLayout->addWidget(dayBegins->label(),2,0); | 637 | //topLayout->addWidget(dayBegins->label(),2,0); |
634 | 638 | ||
635 | //topLayout->addWidget(dayBegins->spinBox(),2,1); | 639 | //topLayout->addWidget(dayBegins->spinBox(),2,1); |
636 | topLayout->addMultiCellWidget(dummy,0,0,0,1); | 640 | topLayout->addMultiCellWidget(dummy,0,0,0,1); |
637 | 641 | ||
638 | topLayout->addWidget(new QLabel(i18n("Default appointment time:"), | 642 | topLayout->addWidget(new QLabel(i18n("Default appointment time:"), |
639 | topFrame),1,0); | 643 | topFrame),1,0); |
640 | mStartTimeSpin = new QSpinBox(0,23,1,topFrame); | 644 | mStartTimeSpin = new QSpinBox(0,23,1,topFrame); |
641 | mStartTimeSpin->setSuffix(":00"); | 645 | mStartTimeSpin->setSuffix(":00"); |
642 | topLayout->addWidget(mStartTimeSpin,1,1); | 646 | topLayout->addWidget(mStartTimeSpin,1,1); |
643 | 647 | ||
644 | topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), | 648 | topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), |
645 | topFrame),2,0); | 649 | topFrame),2,0); |
646 | mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); | 650 | mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); |
647 | mDefaultDurationSpin->setSuffix(":00"); | 651 | mDefaultDurationSpin->setSuffix(":00"); |
648 | topLayout->addWidget(mDefaultDurationSpin,2,1); | 652 | topLayout->addWidget(mDefaultDurationSpin,2,1); |
649 | 653 | ||
650 | QStringList alarmList; | 654 | QStringList alarmList; |
651 | alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") | 655 | alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") |
652 | << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; | 656 | << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; |
653 | topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), | 657 | topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), |
654 | 3,0); | 658 | 3,0); |
655 | mAlarmTimeCombo = new QComboBox(topFrame); | 659 | mAlarmTimeCombo = new QComboBox(topFrame); |
656 | mAlarmTimeCombo->insertStringList(alarmList); | 660 | mAlarmTimeCombo->insertStringList(alarmList); |
657 | topLayout->addWidget(mAlarmTimeCombo,3,1); | 661 | topLayout->addWidget(mAlarmTimeCombo,3,1); |
658 | 662 | ||
659 | 663 | ||
660 | QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, | 664 | QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, |
661 | i18n("Working Hours"), | 665 | i18n("Working Hours"), |
662 | topFrame); | 666 | topFrame); |
663 | topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); | 667 | topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); |
664 | workingHoursGroup->layout()->setSpacing( 0 ); | 668 | workingHoursGroup->layout()->setSpacing( 0 ); |
665 | workingHoursGroup->layout()->setMargin( 4 ); | 669 | workingHoursGroup->layout()->setMargin( 4 ); |
666 | QHBox *workStartBox = new QHBox(workingHoursGroup); | 670 | QHBox *workStartBox = new QHBox(workingHoursGroup); |
667 | // workStartBox->setMargin( 0 ); | 671 | // workStartBox->setMargin( 0 ); |
668 | addWidTime(i18n("Daily starting hour:"), | 672 | addWidTime(i18n("Daily starting hour:"), |
669 | &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); | 673 | &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); |
670 | 674 | ||
671 | QHBox *workEndBox = new QHBox(workingHoursGroup); | 675 | QHBox *workEndBox = new QHBox(workingHoursGroup); |
672 | //workEndBox->setMargin( 0 ); | 676 | //workEndBox->setMargin( 0 ); |
673 | addWidTime(i18n("Daily ending hour:"), | 677 | addWidTime(i18n("Daily ending hour:"), |
674 | &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); | 678 | &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); |
675 | QVBox *excludeBox = new QVBox(workingHoursGroup); | 679 | QVBox *excludeBox = new QVBox(workingHoursGroup); |
676 | //excludeBox->setMargin( 0 ); | 680 | //excludeBox->setMargin( 0 ); |
677 | addWidBool(i18n("Exclude holidays"), | 681 | addWidBool(i18n("Exclude holidays"), |
678 | &(KOPrefs::instance()->mExcludeHolidays),excludeBox); | 682 | &(KOPrefs::instance()->mExcludeHolidays),excludeBox); |
679 | 683 | ||
680 | addWidBool(i18n("Exclude Saturdays"), | 684 | addWidBool(i18n("Exclude Saturdays"), |
681 | &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); | 685 | &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); |
682 | 686 | ||
683 | // KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), | 687 | // KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), |
684 | // &(KOPrefs::instance()->mMarcusBainsShowSeconds), | 688 | // &(KOPrefs::instance()->mMarcusBainsShowSeconds), |
685 | // topFrame); | 689 | // topFrame); |
686 | // topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); | 690 | // topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); |
687 | 691 | ||
688 | // topLayout->setRowStretch(6,1); | 692 | // topLayout->setRowStretch(6,1); |
689 | } | 693 | } |
690 | 694 | ||
691 | 695 | ||
692 | void KOPrefsDialog::setupViewsTab() | 696 | void KOPrefsDialog::setupViewsTab() |
693 | { | 697 | { |
694 | 698 | ||
695 | QFrame *topFrame = addPage(i18n("Views"),0,0); | 699 | QFrame *topFrame = addPage(i18n("Views"),0,0); |
696 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 700 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
697 | 701 | ||
698 | QGridLayout *topLayout = new QGridLayout(topFrame,6,1); | 702 | QGridLayout *topLayout = new QGridLayout(topFrame,6,1); |
699 | topLayout->setSpacing(spacingHint()); | 703 | topLayout->setSpacing(spacingHint()); |
700 | topLayout->setMargin(marginHint()); | 704 | topLayout->setMargin(marginHint()); |
701 | 705 | ||
702 | // QBoxLayout *dayBeginsLayout = new QHBoxLayout; | 706 | // QBoxLayout *dayBeginsLayout = new QHBoxLayout; |
703 | // topLayout->addLayout(dayBeginsLayout,0,0); | 707 | // topLayout->addLayout(dayBeginsLayout,0,0); |
704 | 708 | ||
705 | // KPrefsWidTime *dayBegins = | 709 | // KPrefsWidTime *dayBegins = |
706 | // addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), | 710 | // addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), |
707 | // topFrame); | 711 | // topFrame); |
708 | // dayBeginsLayout->addWidget(dayBegins->label()); | 712 | // dayBeginsLayout->addWidget(dayBegins->label()); |
709 | // dayBeginsLayout->addStretch(1); | 713 | // dayBeginsLayout->addStretch(1); |
710 | // dayBeginsLayout->addWidget(dayBegins->spinBox()); | 714 | // dayBeginsLayout->addWidget(dayBegins->spinBox()); |
711 | 715 | ||
712 | // QBoxLayout *nextDaysLayout = new QHBoxLayout; | 716 | // QBoxLayout *nextDaysLayout = new QHBoxLayout; |
713 | // topLayout->addLayout(nextDaysLayout,1,0); | 717 | // topLayout->addLayout(nextDaysLayout,1,0); |
714 | // nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); | 718 | // nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); |
715 | // mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); | 719 | // mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); |
716 | // nextDaysLayout->addStretch(1); | 720 | // nextDaysLayout->addStretch(1); |
717 | // nextDaysLayout->addWidget(mNextXDaysSpin); | 721 | // nextDaysLayout->addWidget(mNextXDaysSpin); |
718 | 722 | ||
719 | 723 | ||
720 | int ii = 0; | 724 | int ii = 0; |
721 | KPrefsDialogWidBool *dummy = | 725 | KPrefsDialogWidBool *dummy = |
722 | addWidBool(i18n("Edit item on doubleclick (if not, show)"), | 726 | addWidBool(i18n("Edit item on doubleclick (if not, show)"), |
723 | &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); | 727 | &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); |
724 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 728 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
725 | 729 | ||
726 | dummy = | 730 | dummy = |
727 | addWidBool(i18n("Highlight current day in agenda"), | 731 | addWidBool(i18n("Highlight current day in agenda"), |
728 | &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); | 732 | &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); |
729 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 733 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
730 | 734 | ||
731 | dummy = | 735 | dummy = |
732 | addWidBool(i18n("Use light color for highlight current day"), | 736 | addWidBool(i18n("Use light color for highlight current day"), |
733 | &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); | 737 | &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); |
734 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 738 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
735 | 739 | ||
736 | KPrefsDialogWidBool *dailyRecur = | 740 | KPrefsDialogWidBool *dailyRecur = |
737 | addWidBool(i18n("Show events that recur daily in date nav."), | 741 | addWidBool(i18n("Show events that recur daily in date nav."), |
738 | &(KOPrefs::instance()->mDailyRecur),topFrame); | 742 | &(KOPrefs::instance()->mDailyRecur),topFrame); |
739 | topLayout->addWidget(dailyRecur->checkBox(),ii++,0); | 743 | topLayout->addWidget(dailyRecur->checkBox(),ii++,0); |
740 | 744 | ||
741 | KPrefsDialogWidBool *weeklyRecur = | 745 | KPrefsDialogWidBool *weeklyRecur = |
742 | addWidBool(i18n("Show ev. that recur weekly in date nav."), | 746 | addWidBool(i18n("Show ev. that recur weekly in date nav."), |
743 | &(KOPrefs::instance()->mWeeklyRecur),topFrame); | 747 | &(KOPrefs::instance()->mWeeklyRecur),topFrame); |
744 | topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); | 748 | topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); |
745 | if ( QApplication::desktop()->width() > 640 ) { | 749 | if ( QApplication::desktop()->width() > 640 ) { |
746 | 750 | ||
747 | KPrefsDialogWidBool *enableToolTips = | 751 | KPrefsDialogWidBool *enableToolTips = |
748 | addWidBool(i18n("Enable tooltips displaying summary of ev."), | 752 | addWidBool(i18n("Enable tooltips displaying summary of ev."), |
749 | &(KOPrefs::instance()->mEnableToolTips),topFrame); | 753 | &(KOPrefs::instance()->mEnableToolTips),topFrame); |
750 | topLayout->addWidget(enableToolTips->checkBox(),ii++,0); | 754 | topLayout->addWidget(enableToolTips->checkBox(),ii++,0); |
751 | 755 | ||
752 | } | 756 | } |
753 | KPrefsDialogWidBool *passwdk = | 757 | KPrefsDialogWidBool *passwdk = |
754 | addWidBool(i18n("Show parent To-Do's in What's Next view"), | 758 | addWidBool(i18n("Show parent To-Do's in What's Next view"), |
755 | &(KOPrefs::instance()->mWNViewShowsParents),topFrame); | 759 | &(KOPrefs::instance()->mWNViewShowsParents),topFrame); |
756 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 760 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
757 | 761 | ||
758 | passwdk = | 762 | passwdk = |
759 | addWidBool(i18n("Show location in What's Next view"), | 763 | addWidBool(i18n("Show location in What's Next view"), |
760 | &(KOPrefs::instance()->mWNViewShowLocation),topFrame); | 764 | &(KOPrefs::instance()->mWNViewShowLocation),topFrame); |
761 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 765 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
762 | 766 | ||
763 | passwdk = | 767 | passwdk = |
764 | addWidBool(i18n("Show Sync Events in WN/Agenda view"), | 768 | addWidBool(i18n("Show Sync Events in WN/Agenda view"), |
765 | &(KOPrefs::instance()->mShowSyncEvents),topFrame); | 769 | &(KOPrefs::instance()->mShowSyncEvents),topFrame); |
766 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 770 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
767 | 771 | ||
768 | 772 | ||
769 | KPrefsDialogWidBool *marcusBainsEnabled = | 773 | KPrefsDialogWidBool *marcusBainsEnabled = |
770 | addWidBool(i18n("Show Marcus Bains line"), | 774 | addWidBool(i18n("Show Marcus Bains line"), |
771 | &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); | 775 | &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); |
772 | topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); | 776 | topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); |
773 | 777 | ||
774 | 778 | ||
775 | // topLayout->addWidget(hourSizeGroup,ii++,0); | 779 | // topLayout->addWidget(hourSizeGroup,ii++,0); |
776 | // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); | 780 | // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); |
777 | //topLayout->setRowStretch(11,1); | 781 | //topLayout->setRowStretch(11,1); |
778 | 782 | ||
779 | 783 | ||
780 | 784 | ||
781 | 785 | ||
782 | 786 | ||
783 | 787 | ||
784 | topFrame = addPage(i18n("ViewChange"),0,0); | 788 | topFrame = addPage(i18n("ViewChange"),0,0); |
785 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 789 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
786 | 790 | ||
787 | topLayout = new QGridLayout(topFrame,6,1); | 791 | topLayout = new QGridLayout(topFrame,6,1); |
788 | topLayout->setSpacing(spacingHint()); | 792 | topLayout->setSpacing(spacingHint()); |
789 | topLayout->setMargin(marginHint()); | 793 | topLayout->setMargin(marginHint()); |
790 | ii = 0; | 794 | ii = 0; |
791 | 795 | ||
792 | 796 | ||
793 | dummy = | 797 | dummy = |
794 | addWidBool(i18n("Hold fullscreen on view change"), | 798 | addWidBool(i18n("Hold fullscreen on view change"), |
795 | &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); | 799 | &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); |
796 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 800 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
797 | 801 | ||
798 | dummy = | 802 | dummy = |
799 | addWidBool(i18n("Hold non-fullscreen on view change"), | 803 | addWidBool(i18n("Hold non-fullscreen on view change"), |
800 | &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); | 804 | &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); |
801 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 805 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
802 | 806 | ||
803 | 807 | ||
804 | KPrefsDialogWidBool *fullViewTodo = | 808 | KPrefsDialogWidBool *fullViewTodo = |
805 | addWidBool(i18n("Event list view uses full window"), | 809 | addWidBool(i18n("Event list view uses full window"), |
806 | &(KOPrefs::instance()->mFullViewTodo),topFrame); | 810 | &(KOPrefs::instance()->mFullViewTodo),topFrame); |
807 | topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); | 811 | topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); |
808 | 812 | ||
809 | KPrefsDialogWidBool *fullViewMonth = | 813 | KPrefsDialogWidBool *fullViewMonth = |
810 | addWidBool(i18n("Next days view uses full window"), | 814 | addWidBool(i18n("Next days view uses full window"), |
811 | &(KOPrefs::instance()->mFullViewMonth),topFrame); | 815 | &(KOPrefs::instance()->mFullViewMonth),topFrame); |
812 | topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); | 816 | topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); |
813 | 817 | ||
814 | dummy = | 818 | dummy = |
815 | addWidBool(i18n("Set agenda to DayBeginsAt on change"), | 819 | addWidBool(i18n("Set agenda to DayBeginsAt on change"), |
816 | &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); | 820 | &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); |
817 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 821 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
818 | 822 | ||
819 | dummy = | 823 | dummy = |
820 | addWidBool(i18n("Set agenda to current time on change"), | 824 | addWidBool(i18n("Set agenda to current time on change"), |
821 | &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); | 825 | &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); |
822 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 826 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
823 | 827 | ||
824 | dummy = | 828 | dummy = |
825 | addWidBool(i18n("Listview uses monthly timespan"), | 829 | addWidBool(i18n("Listview uses monthly timespan"), |
826 | &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); | 830 | &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); |
827 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 831 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
828 | dummy = | 832 | dummy = |
829 | addWidBool(i18n("Highlight selection in Time Edit"), | 833 | addWidBool(i18n("Highlight selection in Time Edit"), |
830 | &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); | 834 | &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); |
831 | topLayout->addWidget( dummy->checkBox(), ii++,0); | 835 | topLayout->addWidget( dummy->checkBox(), ii++,0); |
832 | 836 | ||
833 | 837 | ||
834 | 838 | ||
835 | 839 | ||
836 | 840 | ||
837 | topFrame = addPage(i18n("Month View"),0,0); | 841 | topFrame = addPage(i18n("Month View"),0,0); |
838 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 842 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
839 | 843 | ||
840 | topLayout = new QGridLayout(topFrame,5,1); | 844 | topLayout = new QGridLayout(topFrame,5,1); |
841 | topLayout->setSpacing(spacingHint()); | 845 | topLayout->setSpacing(spacingHint()); |
842 | topLayout->setMargin(marginHint()); | 846 | topLayout->setMargin(marginHint()); |
843 | ii = 0; | 847 | ii = 0; |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 92fd59c..3a16fe6 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -2841,1220 +2841,1226 @@ void CalendarView::editEvent( Event *event ) | |||
2841 | if ( event->isReadOnly() ) { | 2841 | if ( event->isReadOnly() ) { |
2842 | showEvent( event ); | 2842 | showEvent( event ); |
2843 | return; | 2843 | return; |
2844 | } | 2844 | } |
2845 | showEventEditor(); | 2845 | showEventEditor(); |
2846 | mEventEditor->editEvent( event , mFlagEditDescription); | 2846 | mEventEditor->editEvent( event , mFlagEditDescription); |
2847 | mEventEditor->exec(); | 2847 | mEventEditor->exec(); |
2848 | setActiveWindow(); | 2848 | setActiveWindow(); |
2849 | 2849 | ||
2850 | } | 2850 | } |
2851 | void CalendarView::editJournal( Journal *jour ) | 2851 | void CalendarView::editJournal( Journal *jour ) |
2852 | { | 2852 | { |
2853 | if ( !jour ) return; | 2853 | if ( !jour ) return; |
2854 | mDialogManager->hideSearchDialog(); | 2854 | mDialogManager->hideSearchDialog(); |
2855 | mViewManager->showJournalView(); | 2855 | mViewManager->showJournalView(); |
2856 | mNavigator->slotDaySelect( jour->dtStart().date() ); | 2856 | mNavigator->slotDaySelect( jour->dtStart().date() ); |
2857 | } | 2857 | } |
2858 | void CalendarView::editTodo( Todo *todo ) | 2858 | void CalendarView::editTodo( Todo *todo ) |
2859 | { | 2859 | { |
2860 | if ( !todo ) return; | 2860 | if ( !todo ) return; |
2861 | 2861 | ||
2862 | if ( todo->isReadOnly() ) { | 2862 | if ( todo->isReadOnly() ) { |
2863 | showTodo( todo ); | 2863 | showTodo( todo ); |
2864 | return; | 2864 | return; |
2865 | } | 2865 | } |
2866 | showTodoEditor(); | 2866 | showTodoEditor(); |
2867 | mTodoEditor->editTodo( todo ,mFlagEditDescription); | 2867 | mTodoEditor->editTodo( todo ,mFlagEditDescription); |
2868 | mTodoEditor->exec(); | 2868 | mTodoEditor->exec(); |
2869 | setActiveWindow(); | 2869 | setActiveWindow(); |
2870 | 2870 | ||
2871 | } | 2871 | } |
2872 | 2872 | ||
2873 | KOEventViewerDialog* CalendarView::getEventViewerDialog() | 2873 | KOEventViewerDialog* CalendarView::getEventViewerDialog() |
2874 | { | 2874 | { |
2875 | if ( !mEventViewerDialog ) { | 2875 | if ( !mEventViewerDialog ) { |
2876 | mEventViewerDialog = new KOEventViewerDialog(0); | 2876 | mEventViewerDialog = new KOEventViewerDialog(0); |
2877 | connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); | 2877 | connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); |
2878 | connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); | 2878 | connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); |
2879 | connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), | 2879 | connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), |
2880 | dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); | 2880 | dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); |
2881 | connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), | 2881 | connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), |
2882 | viewManager(), SLOT( showAgendaView( bool ) ) ); | 2882 | viewManager(), SLOT( showAgendaView( bool ) ) ); |
2883 | connect( mEventViewerDialog, SIGNAL(signalViewerClosed()), | 2883 | connect( mEventViewerDialog, SIGNAL(signalViewerClosed()), |
2884 | this, SLOT( slotViewerClosed() ) ); | 2884 | this, SLOT( slotViewerClosed() ) ); |
2885 | connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ), | 2885 | connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ), |
2886 | this, SLOT( todoChanged(Todo *) ) ); | 2886 | this, SLOT( todoChanged(Todo *) ) ); |
2887 | mEventViewerDialog->resize( 640, 480 ); | 2887 | mEventViewerDialog->resize( 640, 480 ); |
2888 | 2888 | ||
2889 | } | 2889 | } |
2890 | return mEventViewerDialog; | 2890 | return mEventViewerDialog; |
2891 | } | 2891 | } |
2892 | void CalendarView::showEvent(Event *event) | 2892 | void CalendarView::showEvent(Event *event) |
2893 | { | 2893 | { |
2894 | getEventViewerDialog()->setEvent(event); | 2894 | getEventViewerDialog()->setEvent(event); |
2895 | getEventViewerDialog()->showMe(); | 2895 | getEventViewerDialog()->showMe(); |
2896 | } | 2896 | } |
2897 | 2897 | ||
2898 | void CalendarView::showTodo(Todo *event) | 2898 | void CalendarView::showTodo(Todo *event) |
2899 | { | 2899 | { |
2900 | getEventViewerDialog()->setTodo(event); | 2900 | getEventViewerDialog()->setTodo(event); |
2901 | getEventViewerDialog()->showMe(); | 2901 | getEventViewerDialog()->showMe(); |
2902 | } | 2902 | } |
2903 | void CalendarView::showJournal( Journal *jour ) | 2903 | void CalendarView::showJournal( Journal *jour ) |
2904 | { | 2904 | { |
2905 | getEventViewerDialog()->setJournal(jour); | 2905 | getEventViewerDialog()->setJournal(jour); |
2906 | getEventViewerDialog()->showMe(); | 2906 | getEventViewerDialog()->showMe(); |
2907 | 2907 | ||
2908 | } | 2908 | } |
2909 | // void CalendarView::todoModified (Todo *event, int changed) | 2909 | // void CalendarView::todoModified (Todo *event, int changed) |
2910 | // { | 2910 | // { |
2911 | // // if (mDialogList.find (event) != mDialogList.end ()) { | 2911 | // // if (mDialogList.find (event) != mDialogList.end ()) { |
2912 | // // kdDebug() << "Todo modified and open" << endl; | 2912 | // // kdDebug() << "Todo modified and open" << endl; |
2913 | // // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event]; | 2913 | // // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event]; |
2914 | // // temp->modified (changed); | 2914 | // // temp->modified (changed); |
2915 | 2915 | ||
2916 | // // } | 2916 | // // } |
2917 | 2917 | ||
2918 | // mViewManager->updateView(); | 2918 | // mViewManager->updateView(); |
2919 | // } | 2919 | // } |
2920 | 2920 | ||
2921 | void CalendarView::appointment_show() | 2921 | void CalendarView::appointment_show() |
2922 | { | 2922 | { |
2923 | Event *anEvent = 0; | 2923 | Event *anEvent = 0; |
2924 | 2924 | ||
2925 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 2925 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
2926 | 2926 | ||
2927 | if (mViewManager->currentView()->isEventView()) { | 2927 | if (mViewManager->currentView()->isEventView()) { |
2928 | if ( incidence && incidence->type() == "Event" ) { | 2928 | if ( incidence && incidence->type() == "Event" ) { |
2929 | anEvent = static_cast<Event *>(incidence); | 2929 | anEvent = static_cast<Event *>(incidence); |
2930 | } | 2930 | } |
2931 | } | 2931 | } |
2932 | 2932 | ||
2933 | if (!anEvent) { | 2933 | if (!anEvent) { |
2934 | KNotifyClient::beep(); | 2934 | KNotifyClient::beep(); |
2935 | return; | 2935 | return; |
2936 | } | 2936 | } |
2937 | 2937 | ||
2938 | showEvent(anEvent); | 2938 | showEvent(anEvent); |
2939 | } | 2939 | } |
2940 | 2940 | ||
2941 | void CalendarView::appointment_edit() | 2941 | void CalendarView::appointment_edit() |
2942 | { | 2942 | { |
2943 | Event *anEvent = 0; | 2943 | Event *anEvent = 0; |
2944 | 2944 | ||
2945 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 2945 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
2946 | 2946 | ||
2947 | if (mViewManager->currentView()->isEventView()) { | 2947 | if (mViewManager->currentView()->isEventView()) { |
2948 | if ( incidence && incidence->type() == "Event" ) { | 2948 | if ( incidence && incidence->type() == "Event" ) { |
2949 | anEvent = static_cast<Event *>(incidence); | 2949 | anEvent = static_cast<Event *>(incidence); |
2950 | } | 2950 | } |
2951 | } | 2951 | } |
2952 | 2952 | ||
2953 | if (!anEvent) { | 2953 | if (!anEvent) { |
2954 | KNotifyClient::beep(); | 2954 | KNotifyClient::beep(); |
2955 | return; | 2955 | return; |
2956 | } | 2956 | } |
2957 | 2957 | ||
2958 | editEvent(anEvent); | 2958 | editEvent(anEvent); |
2959 | } | 2959 | } |
2960 | 2960 | ||
2961 | void CalendarView::appointment_delete() | 2961 | void CalendarView::appointment_delete() |
2962 | { | 2962 | { |
2963 | Event *anEvent = 0; | 2963 | Event *anEvent = 0; |
2964 | 2964 | ||
2965 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 2965 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
2966 | 2966 | ||
2967 | if (mViewManager->currentView()->isEventView()) { | 2967 | if (mViewManager->currentView()->isEventView()) { |
2968 | if ( incidence && incidence->type() == "Event" ) { | 2968 | if ( incidence && incidence->type() == "Event" ) { |
2969 | anEvent = static_cast<Event *>(incidence); | 2969 | anEvent = static_cast<Event *>(incidence); |
2970 | } | 2970 | } |
2971 | } | 2971 | } |
2972 | 2972 | ||
2973 | if (!anEvent) { | 2973 | if (!anEvent) { |
2974 | KNotifyClient::beep(); | 2974 | KNotifyClient::beep(); |
2975 | return; | 2975 | return; |
2976 | } | 2976 | } |
2977 | 2977 | ||
2978 | deleteEvent(anEvent); | 2978 | deleteEvent(anEvent); |
2979 | } | 2979 | } |
2980 | 2980 | ||
2981 | void CalendarView::todo_resub( Todo * parent, Todo * sub ) | 2981 | void CalendarView::todo_resub( Todo * parent, Todo * sub ) |
2982 | { | 2982 | { |
2983 | if (!sub) return; | 2983 | if (!sub) return; |
2984 | if (!parent) return; | 2984 | if (!parent) return; |
2985 | if ( sub->relatedTo() ) | 2985 | if ( sub->relatedTo() ) |
2986 | sub->relatedTo()->removeRelation(sub); | 2986 | sub->relatedTo()->removeRelation(sub); |
2987 | sub->setRelatedTo(parent); | 2987 | sub->setRelatedTo(parent); |
2988 | sub->setRelatedToUid(parent->uid()); | 2988 | sub->setRelatedToUid(parent->uid()); |
2989 | parent->addRelation(sub); | 2989 | parent->addRelation(sub); |
2990 | sub->updated(); | 2990 | sub->updated(); |
2991 | parent->updated(); | 2991 | parent->updated(); |
2992 | setModified(true); | 2992 | setModified(true); |
2993 | updateView(); | 2993 | updateView(); |
2994 | } | 2994 | } |
2995 | void CalendarView::todo_unsub(Todo *anTodo ) | 2995 | void CalendarView::todo_unsub(Todo *anTodo ) |
2996 | { | 2996 | { |
2997 | // Todo *anTodo = selectedTodo(); | 2997 | // Todo *anTodo = selectedTodo(); |
2998 | if (!anTodo) return; | 2998 | if (!anTodo) return; |
2999 | if (!anTodo->relatedTo()) return; | 2999 | if (!anTodo->relatedTo()) return; |
3000 | anTodo->relatedTo()->removeRelation(anTodo); | 3000 | anTodo->relatedTo()->removeRelation(anTodo); |
3001 | anTodo->setRelatedTo(0); | 3001 | anTodo->setRelatedTo(0); |
3002 | anTodo->updated(); | 3002 | anTodo->updated(); |
3003 | anTodo->setRelatedToUid(""); | 3003 | anTodo->setRelatedToUid(""); |
3004 | setModified(true); | 3004 | setModified(true); |
3005 | updateView(); | 3005 | updateView(); |
3006 | } | 3006 | } |
3007 | 3007 | ||
3008 | void CalendarView::deleteTodo(Todo *todo) | 3008 | void CalendarView::deleteTodo(Todo *todo) |
3009 | { | 3009 | { |
3010 | if (!todo) { | 3010 | if (!todo) { |
3011 | KNotifyClient::beep(); | 3011 | KNotifyClient::beep(); |
3012 | return; | 3012 | return; |
3013 | } | 3013 | } |
3014 | if (KOPrefs::instance()->mConfirm) { | 3014 | if (KOPrefs::instance()->mConfirm) { |
3015 | QString text = todo->summary().left(20); | 3015 | QString text = todo->summary().left(20); |
3016 | if (!todo->relations().isEmpty()) { | 3016 | if (!todo->relations().isEmpty()) { |
3017 | text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!"); | 3017 | text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!"); |
3018 | 3018 | ||
3019 | } | 3019 | } |
3020 | switch (msgItemDelete(text)) { | 3020 | switch (msgItemDelete(text)) { |
3021 | case KMessageBox::Continue: // OK | 3021 | case KMessageBox::Continue: // OK |
3022 | bool deleteT = false; | 3022 | bool deleteT = false; |
3023 | if (!todo->relations().isEmpty()) { | 3023 | if (!todo->relations().isEmpty()) { |
3024 | deleteT = removeCompletedSubTodos( todo ); | 3024 | deleteT = removeCompletedSubTodos( todo ); |
3025 | } | 3025 | } |
3026 | // deleteT == true: todo already deleted in removeCompletedSubTodos | 3026 | // deleteT == true: todo already deleted in removeCompletedSubTodos |
3027 | if ( !deleteT ) { | 3027 | if ( !deleteT ) { |
3028 | checkExternalId( todo ); | 3028 | checkExternalId( todo ); |
3029 | calendar()->deleteTodo(todo); | 3029 | calendar()->deleteTodo(todo); |
3030 | changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); | 3030 | changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); |
3031 | updateView(); | 3031 | updateView(); |
3032 | } | 3032 | } |
3033 | break; | 3033 | break; |
3034 | } // switch | 3034 | } // switch |
3035 | } else { | 3035 | } else { |
3036 | checkExternalId( todo ); | 3036 | checkExternalId( todo ); |
3037 | mCalendar->deleteTodo(todo); | 3037 | mCalendar->deleteTodo(todo); |
3038 | changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); | 3038 | changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); |
3039 | updateView(); | 3039 | updateView(); |
3040 | } | 3040 | } |
3041 | 3041 | ||
3042 | emit updateSearchDialog(); | 3042 | emit updateSearchDialog(); |
3043 | } | 3043 | } |
3044 | void CalendarView::deleteJournal(Journal *jour) | 3044 | void CalendarView::deleteJournal(Journal *jour) |
3045 | { | 3045 | { |
3046 | if (!jour) { | 3046 | if (!jour) { |
3047 | KNotifyClient::beep(); | 3047 | KNotifyClient::beep(); |
3048 | return; | 3048 | return; |
3049 | } | 3049 | } |
3050 | if (KOPrefs::instance()->mConfirm) { | 3050 | if (KOPrefs::instance()->mConfirm) { |
3051 | switch (msgItemDelete( jour->description().left(20))) { | 3051 | switch (msgItemDelete( jour->description().left(20))) { |
3052 | case KMessageBox::Continue: // OK | 3052 | case KMessageBox::Continue: // OK |
3053 | calendar()->deleteJournal(jour); | 3053 | calendar()->deleteJournal(jour); |
3054 | updateView(); | 3054 | updateView(); |
3055 | break; | 3055 | break; |
3056 | } // switch | 3056 | } // switch |
3057 | } else { | 3057 | } else { |
3058 | calendar()->deleteJournal(jour);; | 3058 | calendar()->deleteJournal(jour);; |
3059 | updateView(); | 3059 | updateView(); |
3060 | } | 3060 | } |
3061 | emit updateSearchDialog(); | 3061 | emit updateSearchDialog(); |
3062 | } | 3062 | } |
3063 | 3063 | ||
3064 | void CalendarView::deleteEvent(Event *anEvent) | 3064 | void CalendarView::deleteEvent(Event *anEvent) |
3065 | { | 3065 | { |
3066 | if (!anEvent) { | 3066 | if (!anEvent) { |
3067 | KNotifyClient::beep(); | 3067 | KNotifyClient::beep(); |
3068 | return; | 3068 | return; |
3069 | } | 3069 | } |
3070 | 3070 | ||
3071 | if (anEvent->recurrence()->doesRecur()) { | 3071 | if (anEvent->recurrence()->doesRecur()) { |
3072 | QDate itemDate = mViewManager->currentSelectionDate(); | 3072 | QDate itemDate = mViewManager->currentSelectionDate(); |
3073 | int km; | 3073 | int km; |
3074 | if (!itemDate.isValid()) { | 3074 | if (!itemDate.isValid()) { |
3075 | //kdDebug() << "Date Not Valid" << endl; | 3075 | //kdDebug() << "Date Not Valid" << endl; |
3076 | if (KOPrefs::instance()->mConfirm) { | 3076 | if (KOPrefs::instance()->mConfirm) { |
3077 | km = KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + | 3077 | km = KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + |
3078 | i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), | 3078 | i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), |
3079 | i18n("KO/Pi Confirmation"),i18n("Delete All")); | 3079 | i18n("KO/Pi Confirmation"),i18n("Delete All")); |
3080 | if ( km == KMessageBox::Continue ) | 3080 | if ( km == KMessageBox::Continue ) |
3081 | km = KMessageBox::No; // No = all below | 3081 | km = KMessageBox::No; // No = all below |
3082 | } else | 3082 | } else |
3083 | km = KMessageBox::No; | 3083 | km = KMessageBox::No; |
3084 | } else { | 3084 | } else { |
3085 | km = KMessageBox::warningYesNoCancel(this,anEvent->summary().left(25) + | 3085 | km = KMessageBox::warningYesNoCancel(this,anEvent->summary().left(25) + |
3086 | i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+ | 3086 | i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+ |
3087 | KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"), | 3087 | KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"), |
3088 | i18n("KO/Pi Confirmation"),i18n("Current"), | 3088 | i18n("KO/Pi Confirmation"),i18n("Current"), |
3089 | i18n("All")); | 3089 | i18n("All")); |
3090 | } | 3090 | } |
3091 | switch(km) { | 3091 | switch(km) { |
3092 | 3092 | ||
3093 | case KMessageBox::No: // Continue // all | 3093 | case KMessageBox::No: // Continue // all |
3094 | //qDebug("KMessageBox::No "); | 3094 | //qDebug("KMessageBox::No "); |
3095 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) | 3095 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) |
3096 | schedule(Scheduler::Cancel,anEvent); | 3096 | schedule(Scheduler::Cancel,anEvent); |
3097 | 3097 | ||
3098 | checkExternalId( anEvent); | 3098 | checkExternalId( anEvent); |
3099 | mCalendar->deleteEvent(anEvent); | 3099 | mCalendar->deleteEvent(anEvent); |
3100 | changeEventDisplay(anEvent,KOGlobals::EVENTDELETED); | 3100 | changeEventDisplay(anEvent,KOGlobals::EVENTDELETED); |
3101 | break; | 3101 | break; |
3102 | 3102 | ||
3103 | // Disabled because it does not work | 3103 | // Disabled because it does not work |
3104 | //#if 0 | 3104 | //#if 0 |
3105 | case KMessageBox::Yes: // just this one | 3105 | case KMessageBox::Yes: // just this one |
3106 | //QDate qd = mNavigator->selectedDates().first(); | 3106 | //QDate qd = mNavigator->selectedDates().first(); |
3107 | //if (!qd.isValid()) { | 3107 | //if (!qd.isValid()) { |
3108 | // kdDebug() << "no date selected, or invalid date" << endl; | 3108 | // kdDebug() << "no date selected, or invalid date" << endl; |
3109 | // KNotifyClient::beep(); | 3109 | // KNotifyClient::beep(); |
3110 | // return; | 3110 | // return; |
3111 | //} | 3111 | //} |
3112 | //while (!anEvent->recursOn(qd)) qd = qd.addDays(1); | 3112 | //while (!anEvent->recursOn(qd)) qd = qd.addDays(1); |
3113 | if (itemDate!=QDate(1,1,1) || itemDate.isValid()) { | 3113 | if (itemDate!=QDate(1,1,1) || itemDate.isValid()) { |
3114 | anEvent->addExDate(itemDate); | 3114 | anEvent->addExDate(itemDate); |
3115 | int duration = anEvent->recurrence()->duration(); | 3115 | int duration = anEvent->recurrence()->duration(); |
3116 | if ( duration > 0 ) { | 3116 | if ( duration > 0 ) { |
3117 | anEvent->recurrence()->setDuration( duration - 1 ); | 3117 | anEvent->recurrence()->setDuration( duration - 1 ); |
3118 | } | 3118 | } |
3119 | changeEventDisplay(anEvent, KOGlobals::EVENTEDITED); | 3119 | changeEventDisplay(anEvent, KOGlobals::EVENTEDITED); |
3120 | } | 3120 | } |
3121 | break; | 3121 | break; |
3122 | //#endif | 3122 | //#endif |
3123 | } // switch | 3123 | } // switch |
3124 | } else { | 3124 | } else { |
3125 | if (KOPrefs::instance()->mConfirm) { | 3125 | if (KOPrefs::instance()->mConfirm) { |
3126 | switch (KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + | 3126 | switch (KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + |
3127 | i18n("\nAre you sure you want\nto delete this event?"), | 3127 | i18n("\nAre you sure you want\nto delete this event?"), |
3128 | i18n("KO/Pi Confirmation"),i18n("Delete"))) { | 3128 | i18n("KO/Pi Confirmation"),i18n("Delete"))) { |
3129 | case KMessageBox::Continue: // OK | 3129 | case KMessageBox::Continue: // OK |
3130 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) | 3130 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) |
3131 | schedule(Scheduler::Cancel,anEvent); | 3131 | schedule(Scheduler::Cancel,anEvent); |
3132 | checkExternalId( anEvent); | 3132 | checkExternalId( anEvent); |
3133 | mCalendar->deleteEvent(anEvent); | 3133 | mCalendar->deleteEvent(anEvent); |
3134 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); | 3134 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); |
3135 | break; | 3135 | break; |
3136 | } // switch | 3136 | } // switch |
3137 | } else { | 3137 | } else { |
3138 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) | 3138 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) |
3139 | schedule(Scheduler::Cancel,anEvent); | 3139 | schedule(Scheduler::Cancel,anEvent); |
3140 | checkExternalId( anEvent); | 3140 | checkExternalId( anEvent); |
3141 | mCalendar->deleteEvent(anEvent); | 3141 | mCalendar->deleteEvent(anEvent); |
3142 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); | 3142 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); |
3143 | } | 3143 | } |
3144 | } // if-else | 3144 | } // if-else |
3145 | emit updateSearchDialog(); | 3145 | emit updateSearchDialog(); |
3146 | } | 3146 | } |
3147 | 3147 | ||
3148 | bool CalendarView::deleteEvent(const QString &uid) | 3148 | bool CalendarView::deleteEvent(const QString &uid) |
3149 | { | 3149 | { |
3150 | Event *ev = mCalendar->event(uid); | 3150 | Event *ev = mCalendar->event(uid); |
3151 | if (ev) { | 3151 | if (ev) { |
3152 | deleteEvent(ev); | 3152 | deleteEvent(ev); |
3153 | return true; | 3153 | return true; |
3154 | } else { | 3154 | } else { |
3155 | return false; | 3155 | return false; |
3156 | } | 3156 | } |
3157 | } | 3157 | } |
3158 | 3158 | ||
3159 | /*****************************************************************************/ | 3159 | /*****************************************************************************/ |
3160 | 3160 | ||
3161 | void CalendarView::action_mail() | 3161 | void CalendarView::action_mail() |
3162 | { | 3162 | { |
3163 | #ifndef KORG_NOMAIL | 3163 | #ifndef KORG_NOMAIL |
3164 | KOMailClient mailClient; | 3164 | KOMailClient mailClient; |
3165 | 3165 | ||
3166 | Incidence *incidence = currentSelection(); | 3166 | Incidence *incidence = currentSelection(); |
3167 | 3167 | ||
3168 | if (!incidence) { | 3168 | if (!incidence) { |
3169 | KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); | 3169 | KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); |
3170 | return; | 3170 | return; |
3171 | } | 3171 | } |
3172 | if(incidence->attendeeCount() == 0 ) { | 3172 | if(incidence->attendeeCount() == 0 ) { |
3173 | KMessageBox::sorry(this, | 3173 | KMessageBox::sorry(this, |
3174 | i18n("Can't generate mail:\nNo attendees defined.\n")); | 3174 | i18n("Can't generate mail:\nNo attendees defined.\n")); |
3175 | return; | 3175 | return; |
3176 | } | 3176 | } |
3177 | 3177 | ||
3178 | CalendarLocal cal_tmp; | 3178 | CalendarLocal cal_tmp; |
3179 | Event *event = 0; | 3179 | Event *event = 0; |
3180 | Event *ev = 0; | 3180 | Event *ev = 0; |
3181 | if ( incidence && incidence->type() == "Event" ) { | 3181 | if ( incidence && incidence->type() == "Event" ) { |
3182 | event = static_cast<Event *>(incidence); | 3182 | event = static_cast<Event *>(incidence); |
3183 | ev = new Event(*event); | 3183 | ev = new Event(*event); |
3184 | cal_tmp.addEvent(ev); | 3184 | cal_tmp.addEvent(ev); |
3185 | } | 3185 | } |
3186 | ICalFormat mForm(); | 3186 | ICalFormat mForm(); |
3187 | QString attachment = mForm.toString( &cal_tmp ); | 3187 | QString attachment = mForm.toString( &cal_tmp ); |
3188 | if (ev) delete(ev); | 3188 | if (ev) delete(ev); |
3189 | 3189 | ||
3190 | mailClient.mailAttendees(currentSelection(), attachment); | 3190 | mailClient.mailAttendees(currentSelection(), attachment); |
3191 | 3191 | ||
3192 | #endif | 3192 | #endif |
3193 | 3193 | ||
3194 | #if 0 | 3194 | #if 0 |
3195 | Event *anEvent = 0; | 3195 | Event *anEvent = 0; |
3196 | if (mViewManager->currentView()->isEventView()) { | 3196 | if (mViewManager->currentView()->isEventView()) { |
3197 | anEvent = dynamic_cast<Event *>((mViewManager->currentView()->selectedIncidences()).first()); | 3197 | anEvent = dynamic_cast<Event *>((mViewManager->currentView()->selectedIncidences()).first()); |
3198 | } | 3198 | } |
3199 | 3199 | ||
3200 | if (!anEvent) { | 3200 | if (!anEvent) { |
3201 | KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); | 3201 | KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); |
3202 | return; | 3202 | return; |
3203 | } | 3203 | } |
3204 | if(anEvent->attendeeCount() == 0 ) { | 3204 | if(anEvent->attendeeCount() == 0 ) { |
3205 | KMessageBox::sorry(this, | 3205 | KMessageBox::sorry(this, |
3206 | i18n("Can't generate mail:\nNo attendees defined.\n")); | 3206 | i18n("Can't generate mail:\nNo attendees defined.\n")); |
3207 | return; | 3207 | return; |
3208 | } | 3208 | } |
3209 | 3209 | ||
3210 | mailobject.emailEvent(anEvent); | 3210 | mailobject.emailEvent(anEvent); |
3211 | #endif | 3211 | #endif |
3212 | } | 3212 | } |
3213 | 3213 | ||
3214 | 3214 | ||
3215 | void CalendarView::schedule_publish(Incidence *incidence) | 3215 | void CalendarView::schedule_publish(Incidence *incidence) |
3216 | { | 3216 | { |
3217 | Event *event = 0; | 3217 | Event *event = 0; |
3218 | Todo *todo = 0; | 3218 | Todo *todo = 0; |
3219 | 3219 | ||
3220 | if (incidence == 0) { | 3220 | if (incidence == 0) { |
3221 | incidence = mViewManager->currentView()->selectedIncidences().first(); | 3221 | incidence = mViewManager->currentView()->selectedIncidences().first(); |
3222 | if (incidence == 0) { | 3222 | if (incidence == 0) { |
3223 | incidence = mTodoList->selectedIncidences().first(); | 3223 | incidence = mTodoList->selectedIncidences().first(); |
3224 | } | 3224 | } |
3225 | } | 3225 | } |
3226 | if ( incidence && incidence->type() == "Event" ) { | 3226 | if ( incidence && incidence->type() == "Event" ) { |
3227 | event = static_cast<Event *>(incidence); | 3227 | event = static_cast<Event *>(incidence); |
3228 | } else { | 3228 | } else { |
3229 | if ( incidence && incidence->type() == "Todo" ) { | 3229 | if ( incidence && incidence->type() == "Todo" ) { |
3230 | todo = static_cast<Todo *>(incidence); | 3230 | todo = static_cast<Todo *>(incidence); |
3231 | } | 3231 | } |
3232 | } | 3232 | } |
3233 | 3233 | ||
3234 | if (!event && !todo) { | 3234 | if (!event && !todo) { |
3235 | KMessageBox::sorry(this,i18n("No event selected.")); | 3235 | KMessageBox::sorry(this,i18n("No event selected.")); |
3236 | return; | 3236 | return; |
3237 | } | 3237 | } |
3238 | 3238 | ||
3239 | PublishDialog *publishdlg = new PublishDialog(); | 3239 | PublishDialog *publishdlg = new PublishDialog(); |
3240 | if (incidence->attendeeCount()>0) { | 3240 | if (incidence->attendeeCount()>0) { |
3241 | QPtrList<Attendee> attendees = incidence->attendees(); | 3241 | QPtrList<Attendee> attendees = incidence->attendees(); |
3242 | attendees.first(); | 3242 | attendees.first(); |
3243 | while ( attendees.current()!=0 ) { | 3243 | while ( attendees.current()!=0 ) { |
3244 | publishdlg->addAttendee(attendees.current()); | 3244 | publishdlg->addAttendee(attendees.current()); |
3245 | attendees.next(); | 3245 | attendees.next(); |
3246 | } | 3246 | } |
3247 | } | 3247 | } |
3248 | bool send = true; | 3248 | bool send = true; |
3249 | if ( KOPrefs::instance()->mMailClient == KOPrefs::MailClientSendmail ) { | 3249 | if ( KOPrefs::instance()->mMailClient == KOPrefs::MailClientSendmail ) { |
3250 | if ( publishdlg->exec() != QDialog::Accepted ) | 3250 | if ( publishdlg->exec() != QDialog::Accepted ) |
3251 | send = false; | 3251 | send = false; |
3252 | } | 3252 | } |
3253 | if ( send ) { | 3253 | if ( send ) { |
3254 | OutgoingDialog *dlg = mDialogManager->outgoingDialog(); | 3254 | OutgoingDialog *dlg = mDialogManager->outgoingDialog(); |
3255 | if ( event ) { | 3255 | if ( event ) { |
3256 | Event *ev = new Event(*event); | 3256 | Event *ev = new Event(*event); |
3257 | ev->registerObserver(0); | 3257 | ev->registerObserver(0); |
3258 | ev->clearAttendees(); | 3258 | ev->clearAttendees(); |
3259 | if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { | 3259 | if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { |
3260 | delete(ev); | 3260 | delete(ev); |
3261 | } | 3261 | } |
3262 | } else { | 3262 | } else { |
3263 | if ( todo ) { | 3263 | if ( todo ) { |
3264 | Todo *ev = new Todo(*todo); | 3264 | Todo *ev = new Todo(*todo); |
3265 | ev->registerObserver(0); | 3265 | ev->registerObserver(0); |
3266 | ev->clearAttendees(); | 3266 | ev->clearAttendees(); |
3267 | if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { | 3267 | if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { |
3268 | delete(ev); | 3268 | delete(ev); |
3269 | } | 3269 | } |
3270 | } | 3270 | } |
3271 | } | 3271 | } |
3272 | } | 3272 | } |
3273 | delete publishdlg; | 3273 | delete publishdlg; |
3274 | } | 3274 | } |
3275 | 3275 | ||
3276 | void CalendarView::schedule_request(Incidence *incidence) | 3276 | void CalendarView::schedule_request(Incidence *incidence) |
3277 | { | 3277 | { |
3278 | schedule(Scheduler::Request,incidence); | 3278 | schedule(Scheduler::Request,incidence); |
3279 | } | 3279 | } |
3280 | 3280 | ||
3281 | void CalendarView::schedule_refresh(Incidence *incidence) | 3281 | void CalendarView::schedule_refresh(Incidence *incidence) |
3282 | { | 3282 | { |
3283 | schedule(Scheduler::Refresh,incidence); | 3283 | schedule(Scheduler::Refresh,incidence); |
3284 | } | 3284 | } |
3285 | 3285 | ||
3286 | void CalendarView::schedule_cancel(Incidence *incidence) | 3286 | void CalendarView::schedule_cancel(Incidence *incidence) |
3287 | { | 3287 | { |
3288 | schedule(Scheduler::Cancel,incidence); | 3288 | schedule(Scheduler::Cancel,incidence); |
3289 | } | 3289 | } |
3290 | 3290 | ||
3291 | void CalendarView::schedule_add(Incidence *incidence) | 3291 | void CalendarView::schedule_add(Incidence *incidence) |
3292 | { | 3292 | { |
3293 | schedule(Scheduler::Add,incidence); | 3293 | schedule(Scheduler::Add,incidence); |
3294 | } | 3294 | } |
3295 | 3295 | ||
3296 | void CalendarView::schedule_reply(Incidence *incidence) | 3296 | void CalendarView::schedule_reply(Incidence *incidence) |
3297 | { | 3297 | { |
3298 | schedule(Scheduler::Reply,incidence); | 3298 | schedule(Scheduler::Reply,incidence); |
3299 | } | 3299 | } |
3300 | 3300 | ||
3301 | void CalendarView::schedule_counter(Incidence *incidence) | 3301 | void CalendarView::schedule_counter(Incidence *incidence) |
3302 | { | 3302 | { |
3303 | schedule(Scheduler::Counter,incidence); | 3303 | schedule(Scheduler::Counter,incidence); |
3304 | } | 3304 | } |
3305 | 3305 | ||
3306 | void CalendarView::schedule_declinecounter(Incidence *incidence) | 3306 | void CalendarView::schedule_declinecounter(Incidence *incidence) |
3307 | { | 3307 | { |
3308 | schedule(Scheduler::Declinecounter,incidence); | 3308 | schedule(Scheduler::Declinecounter,incidence); |
3309 | } | 3309 | } |
3310 | 3310 | ||
3311 | void CalendarView::schedule_publish_freebusy(int daysToPublish) | 3311 | void CalendarView::schedule_publish_freebusy(int daysToPublish) |
3312 | { | 3312 | { |
3313 | QDateTime start = QDateTime::currentDateTime(); | 3313 | QDateTime start = QDateTime::currentDateTime(); |
3314 | QDateTime end = start.addDays(daysToPublish); | 3314 | QDateTime end = start.addDays(daysToPublish); |
3315 | 3315 | ||
3316 | FreeBusy *freebusy = new FreeBusy(mCalendar, start, end); | 3316 | FreeBusy *freebusy = new FreeBusy(mCalendar, start, end); |
3317 | freebusy->setOrganizer(KOPrefs::instance()->email()); | 3317 | freebusy->setOrganizer(KOPrefs::instance()->email()); |
3318 | 3318 | ||
3319 | 3319 | ||
3320 | PublishDialog *publishdlg = new PublishDialog(); | 3320 | PublishDialog *publishdlg = new PublishDialog(); |
3321 | if ( publishdlg->exec() == QDialog::Accepted ) { | 3321 | if ( publishdlg->exec() == QDialog::Accepted ) { |
3322 | OutgoingDialog *dlg = mDialogManager->outgoingDialog(); | 3322 | OutgoingDialog *dlg = mDialogManager->outgoingDialog(); |
3323 | if (!dlg->addMessage(freebusy,Scheduler::Publish,publishdlg->addresses())) { | 3323 | if (!dlg->addMessage(freebusy,Scheduler::Publish,publishdlg->addresses())) { |
3324 | delete(freebusy); | 3324 | delete(freebusy); |
3325 | } | 3325 | } |
3326 | } | 3326 | } |
3327 | delete publishdlg; | 3327 | delete publishdlg; |
3328 | } | 3328 | } |
3329 | 3329 | ||
3330 | void CalendarView::schedule(Scheduler::Method method, Incidence *incidence) | 3330 | void CalendarView::schedule(Scheduler::Method method, Incidence *incidence) |
3331 | { | 3331 | { |
3332 | Event *event = 0; | 3332 | Event *event = 0; |
3333 | Todo *todo = 0; | 3333 | Todo *todo = 0; |
3334 | 3334 | ||
3335 | if (incidence == 0) { | 3335 | if (incidence == 0) { |
3336 | incidence = mViewManager->currentView()->selectedIncidences().first(); | 3336 | incidence = mViewManager->currentView()->selectedIncidences().first(); |
3337 | if (incidence == 0) { | 3337 | if (incidence == 0) { |
3338 | incidence = mTodoList->selectedIncidences().first(); | 3338 | incidence = mTodoList->selectedIncidences().first(); |
3339 | } | 3339 | } |
3340 | } | 3340 | } |
3341 | if ( incidence && incidence->type() == "Event" ) { | 3341 | if ( incidence && incidence->type() == "Event" ) { |
3342 | event = static_cast<Event *>(incidence); | 3342 | event = static_cast<Event *>(incidence); |
3343 | } | 3343 | } |
3344 | if ( incidence && incidence->type() == "Todo" ) { | 3344 | if ( incidence && incidence->type() == "Todo" ) { |
3345 | todo = static_cast<Todo *>(incidence); | 3345 | todo = static_cast<Todo *>(incidence); |
3346 | } | 3346 | } |
3347 | 3347 | ||
3348 | if (!event && !todo) { | 3348 | if (!event && !todo) { |
3349 | KMessageBox::sorry(this,i18n("No event selected.")); | 3349 | KMessageBox::sorry(this,i18n("No event selected.")); |
3350 | return; | 3350 | return; |
3351 | } | 3351 | } |
3352 | 3352 | ||
3353 | if( incidence->attendeeCount() == 0 && method != Scheduler::Publish ) { | 3353 | if( incidence->attendeeCount() == 0 && method != Scheduler::Publish ) { |
3354 | KMessageBox::sorry(this,i18n("The event has no attendees.")); | 3354 | KMessageBox::sorry(this,i18n("The event has no attendees.")); |
3355 | return; | 3355 | return; |
3356 | } | 3356 | } |
3357 | 3357 | ||
3358 | Event *ev = 0; | 3358 | Event *ev = 0; |
3359 | if (event) ev = new Event(*event); | 3359 | if (event) ev = new Event(*event); |
3360 | Todo *to = 0; | 3360 | Todo *to = 0; |
3361 | if (todo) to = new Todo(*todo); | 3361 | if (todo) to = new Todo(*todo); |
3362 | 3362 | ||
3363 | if (method == Scheduler::Reply || method == Scheduler::Refresh) { | 3363 | if (method == Scheduler::Reply || method == Scheduler::Refresh) { |
3364 | Attendee *me = incidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); | 3364 | Attendee *me = incidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); |
3365 | if (!me) { | 3365 | if (!me) { |
3366 | KMessageBox::sorry(this,i18n("Could not find your attendee entry.\nPlease check the emails.")); | 3366 | KMessageBox::sorry(this,i18n("Could not find your attendee entry.\nPlease check the emails.")); |
3367 | return; | 3367 | return; |
3368 | } | 3368 | } |
3369 | if (me->status()==Attendee::NeedsAction && me->RSVP() && method==Scheduler::Reply) { | 3369 | if (me->status()==Attendee::NeedsAction && me->RSVP() && method==Scheduler::Reply) { |
3370 | StatusDialog *statdlg = new StatusDialog(this); | 3370 | StatusDialog *statdlg = new StatusDialog(this); |
3371 | if (!statdlg->exec()==QDialog::Accepted) return; | 3371 | if (!statdlg->exec()==QDialog::Accepted) return; |
3372 | me->setStatus( statdlg->status() ); | 3372 | me->setStatus( statdlg->status() ); |
3373 | delete(statdlg); | 3373 | delete(statdlg); |
3374 | } | 3374 | } |
3375 | Attendee *menew = new Attendee(*me); | 3375 | Attendee *menew = new Attendee(*me); |
3376 | if (ev) { | 3376 | if (ev) { |
3377 | ev->clearAttendees(); | 3377 | ev->clearAttendees(); |
3378 | ev->addAttendee(menew,false); | 3378 | ev->addAttendee(menew,false); |
3379 | } else { | 3379 | } else { |
3380 | if (to) { | 3380 | if (to) { |
3381 | todo->clearAttendees(); | 3381 | todo->clearAttendees(); |
3382 | todo->addAttendee(menew,false); | 3382 | todo->addAttendee(menew,false); |
3383 | } | 3383 | } |
3384 | } | 3384 | } |
3385 | } | 3385 | } |
3386 | 3386 | ||
3387 | OutgoingDialog *dlg = mDialogManager->outgoingDialog(); | 3387 | OutgoingDialog *dlg = mDialogManager->outgoingDialog(); |
3388 | if (ev) { | 3388 | if (ev) { |
3389 | if ( !dlg->addMessage(ev,method) ) delete(ev); | 3389 | if ( !dlg->addMessage(ev,method) ) delete(ev); |
3390 | } else { | 3390 | } else { |
3391 | if (to) { | 3391 | if (to) { |
3392 | if ( !dlg->addMessage(to,method) ) delete(to); | 3392 | if ( !dlg->addMessage(to,method) ) delete(to); |
3393 | } | 3393 | } |
3394 | } | 3394 | } |
3395 | } | 3395 | } |
3396 | 3396 | ||
3397 | void CalendarView::openAddressbook() | 3397 | void CalendarView::openAddressbook() |
3398 | { | 3398 | { |
3399 | KRun::runCommand("kaddressbook"); | 3399 | KRun::runCommand("kaddressbook"); |
3400 | } | 3400 | } |
3401 | 3401 | ||
3402 | void CalendarView::setModified(bool modified) | 3402 | void CalendarView::setModified(bool modified) |
3403 | { | 3403 | { |
3404 | if ( modified ) | 3404 | if ( modified ) |
3405 | emit signalmodified(); | 3405 | emit signalmodified(); |
3406 | if (mModified != modified) { | 3406 | if (mModified != modified) { |
3407 | mModified = modified; | 3407 | mModified = modified; |
3408 | emit modifiedChanged(mModified); | 3408 | emit modifiedChanged(mModified); |
3409 | } | 3409 | } |
3410 | } | 3410 | } |
3411 | 3411 | ||
3412 | bool CalendarView::isReadOnly() | 3412 | bool CalendarView::isReadOnly() |
3413 | { | 3413 | { |
3414 | return mReadOnly; | 3414 | return mReadOnly; |
3415 | } | 3415 | } |
3416 | 3416 | ||
3417 | void CalendarView::setReadOnly(bool readOnly) | 3417 | void CalendarView::setReadOnly(bool readOnly) |
3418 | { | 3418 | { |
3419 | if (mReadOnly != readOnly) { | 3419 | if (mReadOnly != readOnly) { |
3420 | mReadOnly = readOnly; | 3420 | mReadOnly = readOnly; |
3421 | emit readOnlyChanged(mReadOnly); | 3421 | emit readOnlyChanged(mReadOnly); |
3422 | } | 3422 | } |
3423 | } | 3423 | } |
3424 | 3424 | ||
3425 | bool CalendarView::isModified() | 3425 | bool CalendarView::isModified() |
3426 | { | 3426 | { |
3427 | return mModified; | 3427 | return mModified; |
3428 | } | 3428 | } |
3429 | 3429 | ||
3430 | void CalendarView::printSetup() | 3430 | void CalendarView::printSetup() |
3431 | { | 3431 | { |
3432 | #ifndef KORG_NOPRINTER | 3432 | #ifndef KORG_NOPRINTER |
3433 | createPrinter(); | 3433 | createPrinter(); |
3434 | 3434 | ||
3435 | mCalPrinter->setupPrinter(); | 3435 | mCalPrinter->setupPrinter(); |
3436 | #endif | 3436 | #endif |
3437 | } | 3437 | } |
3438 | 3438 | ||
3439 | void CalendarView::print() | 3439 | void CalendarView::print() |
3440 | { | 3440 | { |
3441 | #ifndef KORG_NOPRINTER | 3441 | #ifndef KORG_NOPRINTER |
3442 | createPrinter(); | 3442 | createPrinter(); |
3443 | 3443 | ||
3444 | DateList tmpDateList = mNavigator->selectedDates(); | 3444 | DateList tmpDateList = mNavigator->selectedDates(); |
3445 | mCalPrinter->print(CalPrinter::Month, | 3445 | mCalPrinter->print(CalPrinter::Month, |
3446 | tmpDateList.first(), tmpDateList.last()); | 3446 | tmpDateList.first(), tmpDateList.last()); |
3447 | #endif | 3447 | #endif |
3448 | } | 3448 | } |
3449 | 3449 | ||
3450 | void CalendarView::printPreview() | 3450 | void CalendarView::printPreview() |
3451 | { | 3451 | { |
3452 | #ifndef KORG_NOPRINTER | 3452 | #ifndef KORG_NOPRINTER |
3453 | kdDebug() << "CalendarView::printPreview()" << endl; | 3453 | kdDebug() << "CalendarView::printPreview()" << endl; |
3454 | 3454 | ||
3455 | createPrinter(); | 3455 | createPrinter(); |
3456 | 3456 | ||
3457 | DateList tmpDateList = mNavigator->selectedDates(); | 3457 | DateList tmpDateList = mNavigator->selectedDates(); |
3458 | 3458 | ||
3459 | mViewManager->currentView()->printPreview(mCalPrinter,tmpDateList.first(), | 3459 | mViewManager->currentView()->printPreview(mCalPrinter,tmpDateList.first(), |
3460 | tmpDateList.last()); | 3460 | tmpDateList.last()); |
3461 | #endif | 3461 | #endif |
3462 | } | 3462 | } |
3463 | 3463 | ||
3464 | void CalendarView::exportICalendar() | 3464 | void CalendarView::exportICalendar() |
3465 | { | 3465 | { |
3466 | QString filename = KFileDialog::getSaveFileName("icalout.ics",i18n("*.ics|ICalendars"),this); | 3466 | QString filename = KFileDialog::getSaveFileName("icalout.ics",i18n("*.ics|ICalendars"),this); |
3467 | 3467 | ||
3468 | // Force correct extension | 3468 | // Force correct extension |
3469 | if (filename.right(4) != ".ics") filename += ".ics"; | 3469 | if (filename.right(4) != ".ics") filename += ".ics"; |
3470 | 3470 | ||
3471 | FileStorage storage( mCalendar, filename, new ICalFormat() ); | 3471 | FileStorage storage( mCalendar, filename, new ICalFormat() ); |
3472 | storage.save(); | 3472 | storage.save(); |
3473 | } | 3473 | } |
3474 | 3474 | ||
3475 | bool CalendarView::exportVCalendar( QString filename ) | 3475 | bool CalendarView::exportVCalendar( QString filename ) |
3476 | { | 3476 | { |
3477 | if (mCalendar->journals().count() > 0) { | 3477 | if (mCalendar->journals().count() > 0) { |
3478 | int result = KMessageBox::warningContinueCancel(this, | 3478 | int result = KMessageBox::warningContinueCancel(this, |
3479 | i18n("The journal entries can not be\nexported to a vCalendar file."), | 3479 | i18n("The journal entries can not be\nexported to a vCalendar file."), |
3480 | i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"), | 3480 | i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"), |
3481 | true); | 3481 | true); |
3482 | if (result != KMessageBox::Continue) return false; | 3482 | if (result != KMessageBox::Continue) return false; |
3483 | } | 3483 | } |
3484 | 3484 | ||
3485 | //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this); | 3485 | //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this); |
3486 | 3486 | ||
3487 | // Force correct extension | 3487 | // Force correct extension |
3488 | if (filename.right(4) != ".vcs") filename += ".vcs"; | 3488 | if (filename.right(4) != ".vcs") filename += ".vcs"; |
3489 | 3489 | ||
3490 | FileStorage storage( mCalendar, filename, new VCalFormat ); | 3490 | FileStorage storage( mCalendar, filename, new VCalFormat ); |
3491 | return storage.save(); | 3491 | return storage.save(); |
3492 | 3492 | ||
3493 | } | 3493 | } |
3494 | 3494 | ||
3495 | void CalendarView::eventUpdated(Incidence *) | 3495 | void CalendarView::eventUpdated(Incidence *) |
3496 | { | 3496 | { |
3497 | setModified(); | 3497 | setModified(); |
3498 | // Don't call updateView here. The code, which has caused the update of the | 3498 | // Don't call updateView here. The code, which has caused the update of the |
3499 | // event is responsible for updating the view. | 3499 | // event is responsible for updating the view. |
3500 | // updateView(); | 3500 | // updateView(); |
3501 | } | 3501 | } |
3502 | 3502 | ||
3503 | void CalendarView::adaptNavigationUnits() | 3503 | void CalendarView::adaptNavigationUnits() |
3504 | { | 3504 | { |
3505 | if (mViewManager->currentView()->isEventView()) { | 3505 | if (mViewManager->currentView()->isEventView()) { |
3506 | int days = mViewManager->currentView()->currentDateCount(); | 3506 | int days = mViewManager->currentView()->currentDateCount(); |
3507 | if (days == 1) { | 3507 | if (days == 1) { |
3508 | emit changeNavStringPrev(i18n("&Previous Day")); | 3508 | emit changeNavStringPrev(i18n("&Previous Day")); |
3509 | emit changeNavStringNext(i18n("&Next Day")); | 3509 | emit changeNavStringNext(i18n("&Next Day")); |
3510 | } else { | 3510 | } else { |
3511 | emit changeNavStringPrev(i18n("&Previous Week")); | 3511 | emit changeNavStringPrev(i18n("&Previous Week")); |
3512 | emit changeNavStringNext(i18n("&Next Week")); | 3512 | emit changeNavStringNext(i18n("&Next Week")); |
3513 | } | 3513 | } |
3514 | } | 3514 | } |
3515 | } | 3515 | } |
3516 | 3516 | ||
3517 | void CalendarView::processMainViewSelection( Incidence *incidence ) | 3517 | void CalendarView::processMainViewSelection( Incidence *incidence ) |
3518 | { | 3518 | { |
3519 | if ( incidence ) mTodoList->clearSelection(); | 3519 | if ( incidence ) mTodoList->clearSelection(); |
3520 | processIncidenceSelection( incidence ); | 3520 | processIncidenceSelection( incidence ); |
3521 | } | 3521 | } |
3522 | 3522 | ||
3523 | void CalendarView::processTodoListSelection( Incidence *incidence ) | 3523 | void CalendarView::processTodoListSelection( Incidence *incidence ) |
3524 | { | 3524 | { |
3525 | if ( incidence && mViewManager->currentView() ) { | 3525 | if ( incidence && mViewManager->currentView() ) { |
3526 | mViewManager->currentView()->clearSelection(); | 3526 | mViewManager->currentView()->clearSelection(); |
3527 | } | 3527 | } |
3528 | processIncidenceSelection( incidence ); | 3528 | processIncidenceSelection( incidence ); |
3529 | } | 3529 | } |
3530 | 3530 | ||
3531 | void CalendarView::processIncidenceSelection( Incidence *incidence ) | 3531 | void CalendarView::processIncidenceSelection( Incidence *incidence ) |
3532 | { | 3532 | { |
3533 | if ( incidence == mSelectedIncidence ) return; | 3533 | if ( incidence == mSelectedIncidence ) return; |
3534 | 3534 | ||
3535 | mSelectedIncidence = incidence; | 3535 | mSelectedIncidence = incidence; |
3536 | 3536 | ||
3537 | emit incidenceSelected( mSelectedIncidence ); | 3537 | emit incidenceSelected( mSelectedIncidence ); |
3538 | 3538 | ||
3539 | if ( incidence && incidence->type() == "Event" ) { | 3539 | if ( incidence && incidence->type() == "Event" ) { |
3540 | Event *event = static_cast<Event *>( incidence ); | 3540 | Event *event = static_cast<Event *>( incidence ); |
3541 | if ( event->organizer() == KOPrefs::instance()->email() ) { | 3541 | if ( event->organizer() == KOPrefs::instance()->email() ) { |
3542 | emit organizerEventsSelected( true ); | 3542 | emit organizerEventsSelected( true ); |
3543 | } else { | 3543 | } else { |
3544 | emit organizerEventsSelected(false); | 3544 | emit organizerEventsSelected(false); |
3545 | } | 3545 | } |
3546 | if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, | 3546 | if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, |
3547 | KOPrefs::instance()->email() ) ) { | 3547 | KOPrefs::instance()->email() ) ) { |
3548 | emit groupEventsSelected( true ); | 3548 | emit groupEventsSelected( true ); |
3549 | } else { | 3549 | } else { |
3550 | emit groupEventsSelected(false); | 3550 | emit groupEventsSelected(false); |
3551 | } | 3551 | } |
3552 | return; | 3552 | return; |
3553 | } else { | 3553 | } else { |
3554 | if ( incidence && incidence->type() == "Todo" ) { | 3554 | if ( incidence && incidence->type() == "Todo" ) { |
3555 | emit todoSelected( true ); | 3555 | emit todoSelected( true ); |
3556 | Todo *event = static_cast<Todo *>( incidence ); | 3556 | Todo *event = static_cast<Todo *>( incidence ); |
3557 | if ( event->organizer() == KOPrefs::instance()->email() ) { | 3557 | if ( event->organizer() == KOPrefs::instance()->email() ) { |
3558 | emit organizerEventsSelected( true ); | 3558 | emit organizerEventsSelected( true ); |
3559 | } else { | 3559 | } else { |
3560 | emit organizerEventsSelected(false); | 3560 | emit organizerEventsSelected(false); |
3561 | } | 3561 | } |
3562 | if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, | 3562 | if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, |
3563 | KOPrefs::instance()->email() ) ) { | 3563 | KOPrefs::instance()->email() ) ) { |
3564 | emit groupEventsSelected( true ); | 3564 | emit groupEventsSelected( true ); |
3565 | } else { | 3565 | } else { |
3566 | emit groupEventsSelected(false); | 3566 | emit groupEventsSelected(false); |
3567 | } | 3567 | } |
3568 | return; | 3568 | return; |
3569 | } else { | 3569 | } else { |
3570 | emit todoSelected( false ); | 3570 | emit todoSelected( false ); |
3571 | emit organizerEventsSelected(false); | 3571 | emit organizerEventsSelected(false); |
3572 | emit groupEventsSelected(false); | 3572 | emit groupEventsSelected(false); |
3573 | } | 3573 | } |
3574 | return; | 3574 | return; |
3575 | } | 3575 | } |
3576 | 3576 | ||
3577 | /* if ( incidence && incidence->type() == "Todo" ) { | 3577 | /* if ( incidence && incidence->type() == "Todo" ) { |
3578 | emit todoSelected( true ); | 3578 | emit todoSelected( true ); |
3579 | } else { | 3579 | } else { |
3580 | emit todoSelected( false ); | 3580 | emit todoSelected( false ); |
3581 | }*/ | 3581 | }*/ |
3582 | } | 3582 | } |
3583 | 3583 | ||
3584 | 3584 | ||
3585 | void CalendarView::checkClipboard() | 3585 | void CalendarView::checkClipboard() |
3586 | { | 3586 | { |
3587 | #ifndef KORG_NODND | 3587 | #ifndef KORG_NODND |
3588 | if (ICalDrag::canDecode(QApplication::clipboard()->data())) { | 3588 | if (ICalDrag::canDecode(QApplication::clipboard()->data())) { |
3589 | emit pasteEnabled(true); | 3589 | emit pasteEnabled(true); |
3590 | } else { | 3590 | } else { |
3591 | emit pasteEnabled(false); | 3591 | emit pasteEnabled(false); |
3592 | } | 3592 | } |
3593 | #endif | 3593 | #endif |
3594 | } | 3594 | } |
3595 | 3595 | ||
3596 | void CalendarView::showDates(const DateList &selectedDates) | 3596 | void CalendarView::showDates(const DateList &selectedDates) |
3597 | { | 3597 | { |
3598 | // kdDebug() << "CalendarView::selectDates()" << endl; | 3598 | // kdDebug() << "CalendarView::selectDates()" << endl; |
3599 | 3599 | ||
3600 | 3600 | ||
3601 | if ( !mBlockShowDates ) { | 3601 | if ( !mBlockShowDates ) { |
3602 | if ( mViewManager->currentView() ) { | 3602 | if ( mViewManager->currentView() ) { |
3603 | updateView( selectedDates.first(), selectedDates.last() ); | 3603 | updateView( selectedDates.first(), selectedDates.last() ); |
3604 | } else { | 3604 | } else { |
3605 | mViewManager->showAgendaView(); | 3605 | mViewManager->showAgendaView(); |
3606 | } | 3606 | } |
3607 | } | 3607 | } |
3608 | 3608 | ||
3609 | QDate date = selectedDates.first(); | ||
3610 | if ( ! date.isValid() ) { | ||
3611 | topLevelWidget()->setCaption(""); | ||
3612 | return; | ||
3613 | } | ||
3614 | |||
3609 | QString selDates; | 3615 | QString selDates; |
3610 | selDates = KGlobal::locale()->formatDate( selectedDates.first(), true); | 3616 | selDates = KGlobal::locale()->formatDate( date, true); |
3611 | if (selectedDates.first() < selectedDates.last() ) | 3617 | if (selectedDates.first() < selectedDates.last() ) |
3612 | selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true); | 3618 | selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true); |
3613 | else { | 3619 | else { |
3614 | QString addString; | 3620 | QString addString; |
3615 | if ( selectedDates.first() == QDateTime::currentDateTime().date() ) | 3621 | if ( date == QDateTime::currentDateTime().date() ) |
3616 | addString = i18n("Today"); | 3622 | addString = i18n("Today"); |
3617 | else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) | 3623 | else if ( date == QDateTime::currentDateTime().date().addDays(1) ) |
3618 | addString = i18n("Tomorrow"); | 3624 | addString = i18n("Tomorrow"); |
3619 | else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) | 3625 | else if ( date == QDateTime::currentDateTime().date().addDays(-1) ) |
3620 | addString = i18n("Yesterday"); | 3626 | addString = i18n("Yesterday"); |
3621 | else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) | 3627 | else if ( date == QDateTime::currentDateTime().date().addDays(-2) ) |
3622 | addString = i18n("Day before yesterday"); | 3628 | addString = i18n("Day before yesterday"); |
3623 | else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) | 3629 | else if ( date == QDateTime::currentDateTime().date().addDays(2) ) |
3624 | addString = i18n("Day after tomorrow"); | 3630 | addString = i18n("Day after tomorrow"); |
3625 | if ( !addString.isEmpty() ) { | 3631 | if ( !addString.isEmpty() ) { |
3626 | topLevelWidget()->setCaption( addString+", " + selDates ); | 3632 | topLevelWidget()->setCaption( addString+", " + selDates ); |
3627 | return; | 3633 | return; |
3628 | } | 3634 | } |
3629 | } | 3635 | } |
3630 | topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); | 3636 | topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); |
3631 | 3637 | ||
3632 | } | 3638 | } |
3633 | 3639 | ||
3634 | QPtrList<CalFilter> CalendarView::filters() | 3640 | QPtrList<CalFilter> CalendarView::filters() |
3635 | { | 3641 | { |
3636 | return mFilters; | 3642 | return mFilters; |
3637 | 3643 | ||
3638 | } | 3644 | } |
3639 | void CalendarView::editFilters() | 3645 | void CalendarView::editFilters() |
3640 | { | 3646 | { |
3641 | // kdDebug() << "CalendarView::editFilters()" << endl; | 3647 | // kdDebug() << "CalendarView::editFilters()" << endl; |
3642 | 3648 | ||
3643 | CalFilter *filter = mFilters.first(); | 3649 | CalFilter *filter = mFilters.first(); |
3644 | while(filter) { | 3650 | while(filter) { |
3645 | kdDebug() << " Filter: " << filter->name() << endl; | 3651 | kdDebug() << " Filter: " << filter->name() << endl; |
3646 | filter = mFilters.next(); | 3652 | filter = mFilters.next(); |
3647 | } | 3653 | } |
3648 | 3654 | ||
3649 | mDialogManager->showFilterEditDialog(&mFilters); | 3655 | mDialogManager->showFilterEditDialog(&mFilters); |
3650 | } | 3656 | } |
3651 | void CalendarView::toggleFilter() | 3657 | void CalendarView::toggleFilter() |
3652 | { | 3658 | { |
3653 | showFilter(! mFilterView->isVisible()); | 3659 | showFilter(! mFilterView->isVisible()); |
3654 | } | 3660 | } |
3655 | 3661 | ||
3656 | KOFilterView *CalendarView::filterView() | 3662 | KOFilterView *CalendarView::filterView() |
3657 | { | 3663 | { |
3658 | return mFilterView; | 3664 | return mFilterView; |
3659 | } | 3665 | } |
3660 | void CalendarView::selectFilter( int fil ) | 3666 | void CalendarView::selectFilter( int fil ) |
3661 | { | 3667 | { |
3662 | mFilterView->setSelectedFilter( fil ); | 3668 | mFilterView->setSelectedFilter( fil ); |
3663 | } | 3669 | } |
3664 | void CalendarView::showFilter(bool visible) | 3670 | void CalendarView::showFilter(bool visible) |
3665 | { | 3671 | { |
3666 | if (visible) mFilterView->show(); | 3672 | if (visible) mFilterView->show(); |
3667 | else mFilterView->hide(); | 3673 | else mFilterView->hide(); |
3668 | } | 3674 | } |
3669 | void CalendarView::toggleFilerEnabled( ) | 3675 | void CalendarView::toggleFilerEnabled( ) |
3670 | { | 3676 | { |
3671 | mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() ); | 3677 | mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() ); |
3672 | if ( !mFilterView->filtersEnabled() ) | 3678 | if ( !mFilterView->filtersEnabled() ) |
3673 | topLevelWidget()->setCaption( i18n("Filter disabled ") ); | 3679 | topLevelWidget()->setCaption( i18n("Filter disabled ") ); |
3674 | 3680 | ||
3675 | } | 3681 | } |
3676 | void CalendarView::updateFilter() | 3682 | void CalendarView::updateFilter() |
3677 | { | 3683 | { |
3678 | CalFilter *filter = mFilterView->selectedFilter(); | 3684 | CalFilter *filter = mFilterView->selectedFilter(); |
3679 | if (filter) { | 3685 | if (filter) { |
3680 | QString mess; | 3686 | QString mess; |
3681 | if (mFilterView->filtersEnabled()) { | 3687 | if (mFilterView->filtersEnabled()) { |
3682 | mess = i18n("Filter selected: ")+filter->name(); | 3688 | mess = i18n("Filter selected: ")+filter->name(); |
3683 | filter->setEnabled(true); | 3689 | filter->setEnabled(true); |
3684 | } | 3690 | } |
3685 | else filter->setEnabled(false); | 3691 | else filter->setEnabled(false); |
3686 | mCalendar->setFilter(filter); | 3692 | mCalendar->setFilter(filter); |
3687 | updateView(); | 3693 | updateView(); |
3688 | if ( !mess.isEmpty() ) | 3694 | if ( !mess.isEmpty() ) |
3689 | topLevelWidget()->setCaption( mess ); | 3695 | topLevelWidget()->setCaption( mess ); |
3690 | 3696 | ||
3691 | } | 3697 | } |
3692 | } | 3698 | } |
3693 | 3699 | ||
3694 | void CalendarView::filterEdited() | 3700 | void CalendarView::filterEdited() |
3695 | { | 3701 | { |
3696 | mFilterView->updateFilters(); | 3702 | mFilterView->updateFilters(); |
3697 | updateFilter(); | 3703 | updateFilter(); |
3698 | writeSettings(); | 3704 | writeSettings(); |
3699 | } | 3705 | } |
3700 | 3706 | ||
3701 | 3707 | ||
3702 | void CalendarView::takeOverEvent() | 3708 | void CalendarView::takeOverEvent() |
3703 | { | 3709 | { |
3704 | Incidence *incidence = currentSelection(); | 3710 | Incidence *incidence = currentSelection(); |
3705 | 3711 | ||
3706 | if (!incidence) return; | 3712 | if (!incidence) return; |
3707 | 3713 | ||
3708 | incidence->setOrganizer(KOPrefs::instance()->email()); | 3714 | incidence->setOrganizer(KOPrefs::instance()->email()); |
3709 | incidence->recreate(); | 3715 | incidence->recreate(); |
3710 | incidence->setReadOnly(false); | 3716 | incidence->setReadOnly(false); |
3711 | 3717 | ||
3712 | updateView(); | 3718 | updateView(); |
3713 | } | 3719 | } |
3714 | 3720 | ||
3715 | void CalendarView::takeOverCalendar() | 3721 | void CalendarView::takeOverCalendar() |
3716 | { | 3722 | { |
3717 | // TODO: Create Calendar::allIncidences() function and use it here | 3723 | // TODO: Create Calendar::allIncidences() function and use it here |
3718 | 3724 | ||
3719 | QPtrList<Event> events = mCalendar->events(); | 3725 | QPtrList<Event> events = mCalendar->events(); |
3720 | for(uint i=0; i<events.count(); ++i) { | 3726 | for(uint i=0; i<events.count(); ++i) { |
3721 | events.at(i)->setOrganizer(KOPrefs::instance()->email()); | 3727 | events.at(i)->setOrganizer(KOPrefs::instance()->email()); |
3722 | events.at(i)->recreate(); | 3728 | events.at(i)->recreate(); |
3723 | events.at(i)->setReadOnly(false); | 3729 | events.at(i)->setReadOnly(false); |
3724 | } | 3730 | } |
3725 | 3731 | ||
3726 | QPtrList<Todo> todos = mCalendar->todos(); | 3732 | QPtrList<Todo> todos = mCalendar->todos(); |
3727 | for(uint i=0; i<todos.count(); ++i) { | 3733 | for(uint i=0; i<todos.count(); ++i) { |
3728 | todos.at(i)->setOrganizer(KOPrefs::instance()->email()); | 3734 | todos.at(i)->setOrganizer(KOPrefs::instance()->email()); |
3729 | todos.at(i)->recreate(); | 3735 | todos.at(i)->recreate(); |
3730 | todos.at(i)->setReadOnly(false); | 3736 | todos.at(i)->setReadOnly(false); |
3731 | } | 3737 | } |
3732 | 3738 | ||
3733 | QPtrList<Journal> journals = mCalendar->journals(); | 3739 | QPtrList<Journal> journals = mCalendar->journals(); |
3734 | for(uint i=0; i<journals.count(); ++i) { | 3740 | for(uint i=0; i<journals.count(); ++i) { |
3735 | journals.at(i)->setOrganizer(KOPrefs::instance()->email()); | 3741 | journals.at(i)->setOrganizer(KOPrefs::instance()->email()); |
3736 | journals.at(i)->recreate(); | 3742 | journals.at(i)->recreate(); |
3737 | journals.at(i)->setReadOnly(false); | 3743 | journals.at(i)->setReadOnly(false); |
3738 | } | 3744 | } |
3739 | 3745 | ||
3740 | updateView(); | 3746 | updateView(); |
3741 | } | 3747 | } |
3742 | 3748 | ||
3743 | void CalendarView::showIntro() | 3749 | void CalendarView::showIntro() |
3744 | { | 3750 | { |
3745 | kdDebug() << "To be implemented." << endl; | 3751 | kdDebug() << "To be implemented." << endl; |
3746 | } | 3752 | } |
3747 | 3753 | ||
3748 | QWidgetStack *CalendarView::viewStack() | 3754 | QWidgetStack *CalendarView::viewStack() |
3749 | { | 3755 | { |
3750 | return mRightFrame; | 3756 | return mRightFrame; |
3751 | } | 3757 | } |
3752 | 3758 | ||
3753 | QWidget *CalendarView::leftFrame() | 3759 | QWidget *CalendarView::leftFrame() |
3754 | { | 3760 | { |
3755 | return ( QWidget *)mLeftFrame; | 3761 | return ( QWidget *)mLeftFrame; |
3756 | } | 3762 | } |
3757 | 3763 | ||
3758 | DateNavigator *CalendarView::dateNavigator() | 3764 | DateNavigator *CalendarView::dateNavigator() |
3759 | { | 3765 | { |
3760 | return mNavigator; | 3766 | return mNavigator; |
3761 | } | 3767 | } |
3762 | 3768 | ||
3763 | KDateNavigator* CalendarView::dateNavigatorWidget() | 3769 | KDateNavigator* CalendarView::dateNavigatorWidget() |
3764 | { | 3770 | { |
3765 | return mDateNavigator->navigatorView(); | 3771 | return mDateNavigator->navigatorView(); |
3766 | } | 3772 | } |
3767 | void CalendarView::toggleDateNavigatorWidget() | 3773 | void CalendarView::toggleDateNavigatorWidget() |
3768 | { | 3774 | { |
3769 | KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ; | 3775 | KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ; |
3770 | 3776 | ||
3771 | if (!KOPrefs::instance()->mShowDateNavigator ) | 3777 | if (!KOPrefs::instance()->mShowDateNavigator ) |
3772 | mDateNavigator->hide(); | 3778 | mDateNavigator->hide(); |
3773 | else | 3779 | else |
3774 | mDateNavigator->show(); | 3780 | mDateNavigator->show(); |
3775 | } | 3781 | } |
3776 | void CalendarView::addView(KOrg::BaseView *view) | 3782 | void CalendarView::addView(KOrg::BaseView *view) |
3777 | { | 3783 | { |
3778 | mViewManager->addView(view); | 3784 | mViewManager->addView(view); |
3779 | } | 3785 | } |
3780 | 3786 | ||
3781 | void CalendarView::showView(KOrg::BaseView *view) | 3787 | void CalendarView::showView(KOrg::BaseView *view) |
3782 | { | 3788 | { |
3783 | mViewManager->showView(view, mLeftFrame->isVisible()); | 3789 | mViewManager->showView(view, mLeftFrame->isVisible()); |
3784 | } | 3790 | } |
3785 | 3791 | ||
3786 | Incidence *CalendarView::currentSelection() | 3792 | Incidence *CalendarView::currentSelection() |
3787 | { | 3793 | { |
3788 | return mViewManager->currentSelection(); | 3794 | return mViewManager->currentSelection(); |
3789 | } | 3795 | } |
3790 | void CalendarView::toggleAllDaySize() | 3796 | void CalendarView::toggleAllDaySize() |
3791 | { | 3797 | { |
3792 | /* | 3798 | /* |
3793 | if ( KOPrefs::instance()->mAllDaySize > 47 ) | 3799 | if ( KOPrefs::instance()->mAllDaySize > 47 ) |
3794 | KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2; | 3800 | KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2; |
3795 | else | 3801 | else |
3796 | KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2; | 3802 | KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2; |
3797 | */ | 3803 | */ |
3798 | viewManager()->agendaView()->toggleAllDay(); | 3804 | viewManager()->agendaView()->toggleAllDay(); |
3799 | } | 3805 | } |
3800 | void CalendarView::toggleExpand() | 3806 | void CalendarView::toggleExpand() |
3801 | { | 3807 | { |
3802 | // if ( mLeftFrame->isHidden() ) { | 3808 | // if ( mLeftFrame->isHidden() ) { |
3803 | // mLeftFrame->show(); | 3809 | // mLeftFrame->show(); |
3804 | // emit calendarViewExpanded( false ); | 3810 | // emit calendarViewExpanded( false ); |
3805 | // } else { | 3811 | // } else { |
3806 | // mLeftFrame->hide(); | 3812 | // mLeftFrame->hide(); |
3807 | // emit calendarViewExpanded( true ); | 3813 | // emit calendarViewExpanded( true ); |
3808 | // } | 3814 | // } |
3809 | //qDebug(" CalendarView::toggleExpand()"); | 3815 | //qDebug(" CalendarView::toggleExpand()"); |
3810 | globalFlagBlockAgenda = 1; | 3816 | globalFlagBlockAgenda = 1; |
3811 | emit calendarViewExpanded( !mLeftFrame->isHidden() ); | 3817 | emit calendarViewExpanded( !mLeftFrame->isHidden() ); |
3812 | globalFlagBlockAgenda = 5; | 3818 | globalFlagBlockAgenda = 5; |
3813 | mViewManager->raiseCurrentView( !mLeftFrame->isHidden() ); | 3819 | mViewManager->raiseCurrentView( !mLeftFrame->isHidden() ); |
3814 | //mViewManager->showView( 0, true ); | 3820 | //mViewManager->showView( 0, true ); |
3815 | } | 3821 | } |
3816 | 3822 | ||
3817 | void CalendarView::calendarModified( bool modified, Calendar * ) | 3823 | void CalendarView::calendarModified( bool modified, Calendar * ) |
3818 | { | 3824 | { |
3819 | setModified( modified ); | 3825 | setModified( modified ); |
3820 | } | 3826 | } |
3821 | 3827 | ||
3822 | Todo *CalendarView::selectedTodo() | 3828 | Todo *CalendarView::selectedTodo() |
3823 | { | 3829 | { |
3824 | Incidence *incidence = currentSelection(); | 3830 | Incidence *incidence = currentSelection(); |
3825 | if ( incidence && incidence->type() == "Todo" ) { | 3831 | if ( incidence && incidence->type() == "Todo" ) { |
3826 | return static_cast<Todo *>( incidence ); | 3832 | return static_cast<Todo *>( incidence ); |
3827 | } | 3833 | } |
3828 | 3834 | ||
3829 | incidence = mTodoList->selectedIncidences().first(); | 3835 | incidence = mTodoList->selectedIncidences().first(); |
3830 | if ( incidence && incidence->type() == "Todo" ) { | 3836 | if ( incidence && incidence->type() == "Todo" ) { |
3831 | return static_cast<Todo *>( incidence ); | 3837 | return static_cast<Todo *>( incidence ); |
3832 | } | 3838 | } |
3833 | 3839 | ||
3834 | return 0; | 3840 | return 0; |
3835 | } | 3841 | } |
3836 | 3842 | ||
3837 | void CalendarView::dialogClosing(Incidence *in) | 3843 | void CalendarView::dialogClosing(Incidence *in) |
3838 | { | 3844 | { |
3839 | // mDialogList.remove(in); | 3845 | // mDialogList.remove(in); |
3840 | } | 3846 | } |
3841 | 3847 | ||
3842 | void CalendarView::showIncidence() | 3848 | void CalendarView::showIncidence() |
3843 | { | 3849 | { |
3844 | mViewerCallerIsSearchDialog = false; | 3850 | mViewerCallerIsSearchDialog = false; |
3845 | Incidence *incidence = currentSelection(); | 3851 | Incidence *incidence = currentSelection(); |
3846 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 3852 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
3847 | if ( incidence ) { | 3853 | if ( incidence ) { |
3848 | ShowIncidenceVisitor v; | 3854 | ShowIncidenceVisitor v; |
3849 | v.act( incidence, this ); | 3855 | v.act( incidence, this ); |
3850 | } | 3856 | } |
3851 | } | 3857 | } |
3852 | void CalendarView::editIncidenceDescription() | 3858 | void CalendarView::editIncidenceDescription() |
3853 | { | 3859 | { |
3854 | mFlagEditDescription = true; | 3860 | mFlagEditDescription = true; |
3855 | editIncidence(); | 3861 | editIncidence(); |
3856 | mFlagEditDescription = false; | 3862 | mFlagEditDescription = false; |
3857 | } | 3863 | } |
3858 | void CalendarView::editIncidence() | 3864 | void CalendarView::editIncidence() |
3859 | { | 3865 | { |
3860 | // qDebug("editIncidence() "); | 3866 | // qDebug("editIncidence() "); |
3861 | Incidence *incidence = currentSelection(); | 3867 | Incidence *incidence = currentSelection(); |
3862 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 3868 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
3863 | if ( incidence ) { | 3869 | if ( incidence ) { |
3864 | EditIncidenceVisitor v; | 3870 | EditIncidenceVisitor v; |
3865 | v.act( incidence, this ); | 3871 | v.act( incidence, this ); |
3866 | } | 3872 | } |
3867 | } | 3873 | } |
3868 | 3874 | ||
3869 | void CalendarView::deleteIncidence() | 3875 | void CalendarView::deleteIncidence() |
3870 | { | 3876 | { |
3871 | Incidence *incidence = currentSelection(); | 3877 | Incidence *incidence = currentSelection(); |
3872 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 3878 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
3873 | if ( incidence ) { | 3879 | if ( incidence ) { |
3874 | deleteIncidence(incidence); | 3880 | deleteIncidence(incidence); |
3875 | } | 3881 | } |
3876 | } | 3882 | } |
3877 | 3883 | ||
3878 | void CalendarView::showIncidence(Incidence *incidence) | 3884 | void CalendarView::showIncidence(Incidence *incidence) |
3879 | { | 3885 | { |
3880 | mViewerCallerIsSearchDialog = false; | 3886 | mViewerCallerIsSearchDialog = false; |
3881 | //qDebug("%x %x ",sender (), mDialogManager->getSearchDialog() ); | 3887 | //qDebug("%x %x ",sender (), mDialogManager->getSearchDialog() ); |
3882 | if ( sender() && mDialogManager->getSearchDialog() ) { | 3888 | if ( sender() && mDialogManager->getSearchDialog() ) { |
3883 | if ( sender () == mDialogManager->getSearchDialog()->listview() ) { | 3889 | if ( sender () == mDialogManager->getSearchDialog()->listview() ) { |
3884 | mViewerCallerIsSearchDialog = true; | 3890 | mViewerCallerIsSearchDialog = true; |
3885 | } | 3891 | } |
3886 | } | 3892 | } |
3887 | if ( incidence ) { | 3893 | if ( incidence ) { |
3888 | ShowIncidenceVisitor v; | 3894 | ShowIncidenceVisitor v; |
3889 | v.act( incidence, this ); | 3895 | v.act( incidence, this ); |
3890 | } | 3896 | } |
3891 | } | 3897 | } |
3892 | 3898 | ||
3893 | void CalendarView::editIncidence(Incidence *incidence) | 3899 | void CalendarView::editIncidence(Incidence *incidence) |
3894 | { | 3900 | { |
3895 | if ( incidence ) { | 3901 | if ( incidence ) { |
3896 | 3902 | ||
3897 | EditIncidenceVisitor v; | 3903 | EditIncidenceVisitor v; |
3898 | v.act( incidence, this ); | 3904 | v.act( incidence, this ); |
3899 | 3905 | ||
3900 | } | 3906 | } |
3901 | } | 3907 | } |
3902 | 3908 | ||
3903 | void CalendarView::deleteIncidence(Incidence *incidence) | 3909 | void CalendarView::deleteIncidence(Incidence *incidence) |
3904 | { | 3910 | { |
3905 | //qDebug(" CalendarView::deleteIncidence "); | 3911 | //qDebug(" CalendarView::deleteIncidence "); |
3906 | if ( incidence ) { | 3912 | if ( incidence ) { |
3907 | DeleteIncidenceVisitor v; | 3913 | DeleteIncidenceVisitor v; |
3908 | v.act( incidence, this ); | 3914 | v.act( incidence, this ); |
3909 | } | 3915 | } |
3910 | } | 3916 | } |
3911 | 3917 | ||
3912 | 3918 | ||
3913 | void CalendarView::lookForOutgoingMessages() | 3919 | void CalendarView::lookForOutgoingMessages() |
3914 | { | 3920 | { |
3915 | OutgoingDialog *ogd = mDialogManager->outgoingDialog(); | 3921 | OutgoingDialog *ogd = mDialogManager->outgoingDialog(); |
3916 | ogd->loadMessages(); | 3922 | ogd->loadMessages(); |
3917 | } | 3923 | } |
3918 | 3924 | ||
3919 | void CalendarView::lookForIncomingMessages() | 3925 | void CalendarView::lookForIncomingMessages() |
3920 | { | 3926 | { |
3921 | IncomingDialog *icd = mDialogManager->incomingDialog(); | 3927 | IncomingDialog *icd = mDialogManager->incomingDialog(); |
3922 | icd->retrieve(); | 3928 | icd->retrieve(); |
3923 | } | 3929 | } |
3924 | 3930 | ||
3925 | bool CalendarView::removeCompletedSubTodos( Todo* t ) | 3931 | bool CalendarView::removeCompletedSubTodos( Todo* t ) |
3926 | { | 3932 | { |
3927 | bool deleteTodo = true; | 3933 | bool deleteTodo = true; |
3928 | QPtrList<Incidence> subTodos; | 3934 | QPtrList<Incidence> subTodos; |
3929 | Incidence *aTodo; | 3935 | Incidence *aTodo; |
3930 | subTodos = t->relations(); | 3936 | subTodos = t->relations(); |
3931 | for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { | 3937 | for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { |
3932 | if (! removeCompletedSubTodos( (Todo*) aTodo )) | 3938 | if (! removeCompletedSubTodos( (Todo*) aTodo )) |
3933 | deleteTodo = false; | 3939 | deleteTodo = false; |
3934 | } | 3940 | } |
3935 | if ( deleteTodo ) { | 3941 | if ( deleteTodo ) { |
3936 | if ( t->isCompleted() && !t->doesRecur()) { | 3942 | if ( t->isCompleted() && !t->doesRecur()) { |
3937 | checkExternalId( t ); | 3943 | checkExternalId( t ); |
3938 | mCalendar->deleteTodo( t ); | 3944 | mCalendar->deleteTodo( t ); |
3939 | changeTodoDisplay( t,KOGlobals::EVENTDELETED ); | 3945 | changeTodoDisplay( t,KOGlobals::EVENTDELETED ); |
3940 | } | 3946 | } |
3941 | else | 3947 | else |
3942 | deleteTodo = false; | 3948 | deleteTodo = false; |
3943 | } | 3949 | } |
3944 | return deleteTodo; | 3950 | return deleteTodo; |
3945 | 3951 | ||
3946 | } | 3952 | } |
3947 | void CalendarView::purgeCompleted() | 3953 | void CalendarView::purgeCompleted() |
3948 | { | 3954 | { |
3949 | int result = KMessageBox::warningContinueCancel(this, | 3955 | int result = KMessageBox::warningContinueCancel(this, |
3950 | i18n("Delete all\ncompleted To-Dos?"),i18n("Purge To-Dos"),i18n("Purge")); | 3956 | i18n("Delete all\ncompleted To-Dos?"),i18n("Purge To-Dos"),i18n("Purge")); |
3951 | 3957 | ||
3952 | if (result == KMessageBox::Continue) { | 3958 | if (result == KMessageBox::Continue) { |
3953 | 3959 | ||
3954 | QPtrList<Todo> todoCal; | 3960 | QPtrList<Todo> todoCal; |
3955 | QPtrList<Todo> rootTodos; | 3961 | QPtrList<Todo> rootTodos; |
3956 | //QPtrList<Incidence> rel; | 3962 | //QPtrList<Incidence> rel; |
3957 | Todo *aTodo;//, *rTodo; | 3963 | Todo *aTodo;//, *rTodo; |
3958 | Incidence *rIncidence; | 3964 | Incidence *rIncidence; |
3959 | bool childDelete = false; | 3965 | bool childDelete = false; |
3960 | bool deletedOne = true; | 3966 | bool deletedOne = true; |
3961 | todoCal = calendar()->todos(); | 3967 | todoCal = calendar()->todos(); |
3962 | for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { | 3968 | for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { |
3963 | if ( !aTodo->relatedTo() ) | 3969 | if ( !aTodo->relatedTo() ) |
3964 | rootTodos.append( aTodo ); | 3970 | rootTodos.append( aTodo ); |
3965 | } | 3971 | } |
3966 | for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { | 3972 | for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { |
3967 | removeCompletedSubTodos( aTodo ); | 3973 | removeCompletedSubTodos( aTodo ); |
3968 | } | 3974 | } |
3969 | 3975 | ||
3970 | updateView(); | 3976 | updateView(); |
3971 | } | 3977 | } |
3972 | } | 3978 | } |
3973 | 3979 | ||
3974 | void CalendarView::slotCalendarChanged() | 3980 | void CalendarView::slotCalendarChanged() |
3975 | { | 3981 | { |
3976 | ; | 3982 | ; |
3977 | } | 3983 | } |
3978 | 3984 | ||
3979 | void CalendarView::keyPressEvent ( QKeyEvent *e) | 3985 | void CalendarView::keyPressEvent ( QKeyEvent *e) |
3980 | { | 3986 | { |
3981 | //qDebug(" alendarView::keyPressEvent "); | 3987 | //qDebug(" alendarView::keyPressEvent "); |
3982 | e->ignore(); | 3988 | e->ignore(); |
3983 | } | 3989 | } |
3984 | 3990 | ||
3985 | 3991 | ||
3986 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) | 3992 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) |
3987 | { | 3993 | { |
3988 | // mSyncManager = manager; | 3994 | // mSyncManager = manager; |
3989 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { | 3995 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { |
3990 | qDebug("KO: SyncKDE request detected!"); | 3996 | qDebug("KO: SyncKDE request detected!"); |
3991 | } | 3997 | } |
3992 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); | 3998 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); |
3993 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); | 3999 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); |
3994 | return syncCalendar( filename, mode ); | 4000 | return syncCalendar( filename, mode ); |
3995 | } | 4001 | } |
3996 | bool CalendarView::syncExternal(KSyncManager* manager, QString resource) | 4002 | bool CalendarView::syncExternal(KSyncManager* manager, QString resource) |
3997 | { | 4003 | { |
3998 | //mSyncManager = manager; | 4004 | //mSyncManager = manager; |
3999 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); | 4005 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); |
4000 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); | 4006 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); |
4001 | if ( resource == "sharp" ) | 4007 | if ( resource == "sharp" ) |
4002 | syncExternal( 0 ); | 4008 | syncExternal( 0 ); |
4003 | if ( resource == "phone" ) | 4009 | if ( resource == "phone" ) |
4004 | syncExternal( 1 ); | 4010 | syncExternal( 1 ); |
4005 | // pending setmodified | 4011 | // pending setmodified |
4006 | return true; | 4012 | return true; |
4007 | } | 4013 | } |
4008 | void CalendarView::setSyncManager(KSyncManager* manager) | 4014 | void CalendarView::setSyncManager(KSyncManager* manager) |
4009 | { | 4015 | { |
4010 | mSyncManager = manager; | 4016 | mSyncManager = manager; |
4011 | } | 4017 | } |
4012 | 4018 | ||
4013 | void CalendarView::removeSyncInfo( QString syncProfile) | 4019 | void CalendarView::removeSyncInfo( QString syncProfile) |
4014 | { | 4020 | { |
4015 | qDebug("KO: removeSyncInfo for profile %s ", syncProfile.latin1()); | 4021 | qDebug("KO: removeSyncInfo for profile %s ", syncProfile.latin1()); |
4016 | mCalendar->removeSyncInfo( syncProfile ); | 4022 | mCalendar->removeSyncInfo( syncProfile ); |
4017 | 4023 | ||
4018 | } | 4024 | } |
4019 | 4025 | ||
4020 | void CalendarView::undo_delete() | 4026 | void CalendarView::undo_delete() |
4021 | { | 4027 | { |
4022 | //qDebug("undo_delete() "); | 4028 | //qDebug("undo_delete() "); |
4023 | Incidence* undo = mCalendar->undoIncidence(); | 4029 | Incidence* undo = mCalendar->undoIncidence(); |
4024 | if ( !undo ) { | 4030 | if ( !undo ) { |
4025 | KMessageBox::sorry(this,i18n("There is nothing to undo!"), | 4031 | KMessageBox::sorry(this,i18n("There is nothing to undo!"), |
4026 | i18n("KO/Pi")); | 4032 | i18n("KO/Pi")); |
4027 | return; | 4033 | return; |
4028 | } | 4034 | } |
4029 | if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,undo->summary().left(25) + | 4035 | if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,undo->summary().left(25) + |
4030 | i18n("\nAre you sure you want\nto restore this?"), | 4036 | i18n("\nAre you sure you want\nto restore this?"), |
4031 | i18n("KO/Pi Confirmation"),i18n("Restore"))) { | 4037 | i18n("KO/Pi Confirmation"),i18n("Restore"))) { |
4032 | mCalendar->undoDeleteIncidence(); | 4038 | mCalendar->undoDeleteIncidence(); |
4033 | updateView(); | 4039 | updateView(); |
4034 | } | 4040 | } |
4035 | } | 4041 | } |
4036 | 4042 | ||
4037 | void CalendarView::slotViewerClosed() | 4043 | void CalendarView::slotViewerClosed() |
4038 | { | 4044 | { |
4039 | QTimer::singleShot( 50, this, SLOT ( resetFocus() ) ); | 4045 | QTimer::singleShot( 50, this, SLOT ( resetFocus() ) ); |
4040 | } | 4046 | } |
4041 | 4047 | ||
4042 | void CalendarView::resetFocus() | 4048 | void CalendarView::resetFocus() |
4043 | { | 4049 | { |
4044 | if ( mViewerCallerIsSearchDialog ) { | 4050 | if ( mViewerCallerIsSearchDialog ) { |
4045 | if ( mDialogManager->getSearchDialog()->isVisible() ){ | 4051 | if ( mDialogManager->getSearchDialog()->isVisible() ){ |
4046 | mDialogManager->getSearchDialog()->raise(); | 4052 | mDialogManager->getSearchDialog()->raise(); |
4047 | mDialogManager->getSearchDialog()->setActiveWindow(); | 4053 | mDialogManager->getSearchDialog()->setActiveWindow(); |
4048 | mDialogManager->getSearchDialog()->listview()->resetFocus(); | 4054 | mDialogManager->getSearchDialog()->listview()->resetFocus(); |
4049 | } else | 4055 | } else |
4050 | mViewerCallerIsSearchDialog = false; | 4056 | mViewerCallerIsSearchDialog = false; |
4051 | } | 4057 | } |
4052 | if ( !mViewerCallerIsSearchDialog ) { | 4058 | if ( !mViewerCallerIsSearchDialog ) { |
4053 | //mViewManager->currentView()->setFocus(); | 4059 | //mViewManager->currentView()->setFocus(); |
4054 | //qDebug("sssssssssssssssset focus "); | 4060 | //qDebug("sssssssssssssssset focus "); |
4055 | topLevelWidget()->raise(); | 4061 | topLevelWidget()->raise(); |
4056 | setActiveWindow(); | 4062 | setActiveWindow(); |
4057 | //setFocus(); | 4063 | //setFocus(); |
4058 | } | 4064 | } |
4059 | mViewerCallerIsSearchDialog = false; | 4065 | mViewerCallerIsSearchDialog = false; |
4060 | } | 4066 | } |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 7faf675..7d5cf72 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -1,912 +1,912 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | 2 | ||
3 | #include <qaction.h> | 3 | #include <qaction.h> |
4 | #include <qpopupmenu.h> | 4 | #include <qpopupmenu.h> |
5 | #include <qpainter.h> | 5 | #include <qpainter.h> |
6 | #include <qwhatsthis.h> | 6 | #include <qwhatsthis.h> |
7 | #include <qpushbutton.h> | 7 | #include <qpushbutton.h> |
8 | #include <qmessagebox.h> | 8 | #include <qmessagebox.h> |
9 | #include <qlineedit.h> | 9 | #include <qlineedit.h> |
10 | #include <qtextcodec.h> | 10 | #include <qtextcodec.h> |
11 | #include <qfile.h> | 11 | #include <qfile.h> |
12 | #include <qdir.h> | 12 | #include <qdir.h> |
13 | #include <qapp.h> | 13 | #include <qapp.h> |
14 | #include <qfileinfo.h> | 14 | #include <qfileinfo.h> |
15 | #include <qlabel.h> | 15 | #include <qlabel.h> |
16 | #include <qspinbox.h> | 16 | #include <qspinbox.h> |
17 | #include <qcheckbox.h> | 17 | #include <qcheckbox.h> |
18 | #include <qmap.h> | 18 | #include <qmap.h> |
19 | #include <qwmatrix.h> | 19 | #include <qwmatrix.h> |
20 | #include <qtextbrowser.h> | 20 | #include <qtextbrowser.h> |
21 | #include <qtextstream.h> | 21 | #include <qtextstream.h> |
22 | #ifndef DESKTOP_VERSION | 22 | #ifndef DESKTOP_VERSION |
23 | #include <qpe/global.h> | 23 | #include <qpe/global.h> |
24 | #include <qpe/qpemenubar.h> | 24 | #include <qpe/qpemenubar.h> |
25 | #include <qpe/qpetoolbar.h> | 25 | #include <qpe/qpetoolbar.h> |
26 | #include <qpe/resource.h> | 26 | #include <qpe/resource.h> |
27 | #include <qpe/qpeapplication.h> | 27 | #include <qpe/qpeapplication.h> |
28 | #include <qtopia/alarmserver.h> | 28 | #include <qtopia/alarmserver.h> |
29 | #include <qtopia/qcopenvelope_qws.h> | 29 | #include <qtopia/qcopenvelope_qws.h> |
30 | #include <unistd.h> // for sleep | 30 | #include <unistd.h> // for sleep |
31 | #else | 31 | #else |
32 | #include <qmenubar.h> | 32 | #include <qmenubar.h> |
33 | #include <qtoolbar.h> | 33 | #include <qtoolbar.h> |
34 | #include <qapplication.h> | 34 | #include <qapplication.h> |
35 | //#include <resource.h> | 35 | //#include <resource.h> |
36 | 36 | ||
37 | #endif | 37 | #endif |
38 | #include <libkcal/calendarlocal.h> | 38 | #include <libkcal/calendarlocal.h> |
39 | #include <libkcal/todo.h> | 39 | #include <libkcal/todo.h> |
40 | #include <libkcal/phoneformat.h> | 40 | #include <libkcal/phoneformat.h> |
41 | #include <libkdepim/ksyncprofile.h> | 41 | #include <libkdepim/ksyncprofile.h> |
42 | #include <libkdepim/phoneaccess.h> | 42 | #include <libkdepim/phoneaccess.h> |
43 | #include <libkcal/kincidenceformatter.h> | 43 | #include <libkcal/kincidenceformatter.h> |
44 | #include <libkdepim/kpimglobalprefs.h> | 44 | #include <libkdepim/kpimglobalprefs.h> |
45 | 45 | ||
46 | #include "calendarview.h" | 46 | #include "calendarview.h" |
47 | #include "koviewmanager.h" | 47 | #include "koviewmanager.h" |
48 | #include "datenavigator.h" | 48 | #include "datenavigator.h" |
49 | #include "koagendaview.h" | 49 | #include "koagendaview.h" |
50 | #include "koagenda.h" | 50 | #include "koagenda.h" |
51 | #include "kodialogmanager.h" | 51 | #include "kodialogmanager.h" |
52 | #include "kdialogbase.h" | 52 | #include "kdialogbase.h" |
53 | #include "kapplication.h" | 53 | #include "kapplication.h" |
54 | #include "kofilterview.h" | 54 | #include "kofilterview.h" |
55 | #include "kstandarddirs.h" | 55 | #include "kstandarddirs.h" |
56 | #include "koprefs.h" | 56 | #include "koprefs.h" |
57 | #include "kfiledialog.h" | 57 | #include "kfiledialog.h" |
58 | #include "koglobals.h" | 58 | #include "koglobals.h" |
59 | #include "kglobal.h" | 59 | #include "kglobal.h" |
60 | #include "klocale.h" | 60 | #include "klocale.h" |
61 | #include "kconfig.h" | 61 | #include "kconfig.h" |
62 | #include "simplealarmclient.h" | 62 | #include "simplealarmclient.h" |
63 | #include "externalapphandler.h" | 63 | #include "externalapphandler.h" |
64 | 64 | ||
65 | using namespace KCal; | 65 | using namespace KCal; |
66 | #ifndef _WIN32_ | 66 | #ifndef _WIN32_ |
67 | #include <unistd.h> | 67 | #include <unistd.h> |
68 | #else | 68 | #else |
69 | #ifdef _OL_IMPORT_ | 69 | #ifdef _OL_IMPORT_ |
70 | #include "koimportoldialog.h" | 70 | #include "koimportoldialog.h" |
71 | #endif | 71 | #endif |
72 | #endif | 72 | #endif |
73 | #include "mainwindow.h" | 73 | #include "mainwindow.h" |
74 | 74 | ||
75 | 75 | ||
76 | class KOex2phonePrefs : public QDialog | 76 | class KOex2phonePrefs : public QDialog |
77 | { | 77 | { |
78 | public: | 78 | public: |
79 | KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : | 79 | KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : |
80 | QDialog( parent, name, true ) | 80 | QDialog( parent, name, true ) |
81 | { | 81 | { |
82 | setCaption( i18n("Export to phone options") ); | 82 | setCaption( i18n("Export to phone options") ); |
83 | QVBoxLayout* lay = new QVBoxLayout( this ); | 83 | QVBoxLayout* lay = new QVBoxLayout( this ); |
84 | lay->setSpacing( 3 ); | 84 | lay->setSpacing( 3 ); |
85 | lay->setMargin( 3 ); | 85 | lay->setMargin( 3 ); |
86 | QLabel *lab; | 86 | QLabel *lab; |
87 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); | 87 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); |
88 | lab->setAlignment (AlignHCenter ); | 88 | lab->setAlignment (AlignHCenter ); |
89 | QHBox* temphb; | 89 | QHBox* temphb; |
90 | temphb = new QHBox( this ); | 90 | temphb = new QHBox( this ); |
91 | new QLabel( i18n("I/O device: "), temphb ); | 91 | new QLabel( i18n("I/O device: "), temphb ); |
92 | mPhoneDevice = new QLineEdit( temphb); | 92 | mPhoneDevice = new QLineEdit( temphb); |
93 | lay->addWidget( temphb ); | 93 | lay->addWidget( temphb ); |
94 | temphb = new QHBox( this ); | 94 | temphb = new QHBox( this ); |
95 | new QLabel( i18n("Connection: "), temphb ); | 95 | new QLabel( i18n("Connection: "), temphb ); |
96 | mPhoneConnection = new QLineEdit( temphb); | 96 | mPhoneConnection = new QLineEdit( temphb); |
97 | lay->addWidget( temphb ); | 97 | lay->addWidget( temphb ); |
98 | temphb = new QHBox( this ); | 98 | temphb = new QHBox( this ); |
99 | new QLabel( i18n("Model(opt.): "), temphb ); | 99 | new QLabel( i18n("Model(opt.): "), temphb ); |
100 | mPhoneModel = new QLineEdit( temphb); | 100 | mPhoneModel = new QLineEdit( temphb); |
101 | lay->addWidget( temphb ); | 101 | lay->addWidget( temphb ); |
102 | mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); | 102 | mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); |
103 | mWriteBackFuture->setChecked( true ); | 103 | mWriteBackFuture->setChecked( true ); |
104 | lay->addWidget( mWriteBackFuture ); | 104 | lay->addWidget( mWriteBackFuture ); |
105 | temphb = new QHBox( this ); | 105 | temphb = new QHBox( this ); |
106 | new QLabel( i18n("Max. weeks in future: ") , temphb ); | 106 | new QLabel( i18n("Max. weeks in future: ") , temphb ); |
107 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); | 107 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); |
108 | mWriteBackFutureWeeks->setValue( 8 ); | 108 | mWriteBackFutureWeeks->setValue( 8 ); |
109 | lay->addWidget( temphb ); | 109 | lay->addWidget( temphb ); |
110 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); | 110 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); |
111 | lab->setAlignment (AlignHCenter ); | 111 | lab->setAlignment (AlignHCenter ); |
112 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); | 112 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); |
113 | lay->addWidget( ok ); | 113 | lay->addWidget( ok ); |
114 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 114 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
115 | lay->addWidget( cancel ); | 115 | lay->addWidget( cancel ); |
116 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 116 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
117 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 117 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
118 | resize( 220, 240 ); | 118 | resize( 220, 240 ); |
119 | qApp->processEvents(); | 119 | qApp->processEvents(); |
120 | int dw = QApplication::desktop()->width(); | 120 | int dw = QApplication::desktop()->width(); |
121 | int dh = QApplication::desktop()->height(); | 121 | int dh = QApplication::desktop()->height(); |
122 | move( (dw-width())/2, (dh - height() )/2 ); | 122 | move( (dw-width())/2, (dh - height() )/2 ); |
123 | } | 123 | } |
124 | 124 | ||
125 | public: | 125 | public: |
126 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; | 126 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; |
127 | QCheckBox* mWriteBackFuture; | 127 | QCheckBox* mWriteBackFuture; |
128 | QSpinBox* mWriteBackFutureWeeks; | 128 | QSpinBox* mWriteBackFutureWeeks; |
129 | }; | 129 | }; |
130 | 130 | ||
131 | int globalFlagBlockStartup; | 131 | int globalFlagBlockStartup; |
132 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | 132 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : |
133 | QMainWindow( parent, name ) | 133 | QMainWindow( parent, name ) |
134 | { | 134 | { |
135 | 135 | ||
136 | mClosed = false; | 136 | mClosed = false; |
137 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; | 137 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; |
138 | QString confFile = locateLocal("config","korganizerrc"); | 138 | QString confFile = locateLocal("config","korganizerrc"); |
139 | QFileInfo finf ( confFile ); | 139 | QFileInfo finf ( confFile ); |
140 | bool showWarning = !finf.exists(); | 140 | bool showWarning = !finf.exists(); |
141 | setIcon(SmallIcon( "ko24" ) ); | 141 | setIcon(SmallIcon( "ko24" ) ); |
142 | mBlockAtStartup = true; | 142 | mBlockAtStartup = true; |
143 | mFlagKeyPressed = false; | 143 | mFlagKeyPressed = false; |
144 | setCaption("KOrganizer/Pi"); | 144 | setCaption("KO/Pi"); |
145 | KOPrefs *p = KOPrefs::instance(); | 145 | KOPrefs *p = KOPrefs::instance(); |
146 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 146 | KPimGlobalPrefs::instance()->setGlobalConfig(); |
147 | if ( p->mHourSize > 22 ) | 147 | if ( p->mHourSize > 22 ) |
148 | p->mHourSize = 22; | 148 | p->mHourSize = 22; |
149 | QMainWindow::ToolBarDock tbd; | 149 | QMainWindow::ToolBarDock tbd; |
150 | if ( p->mToolBarHor ) { | 150 | if ( p->mToolBarHor ) { |
151 | if ( p->mToolBarUp ) | 151 | if ( p->mToolBarUp ) |
152 | tbd = Bottom; | 152 | tbd = Bottom; |
153 | else | 153 | else |
154 | tbd = Top; | 154 | tbd = Top; |
155 | } | 155 | } |
156 | else { | 156 | else { |
157 | if ( p->mToolBarUp ) | 157 | if ( p->mToolBarUp ) |
158 | tbd = Right; | 158 | tbd = Right; |
159 | else | 159 | else |
160 | tbd = Left; | 160 | tbd = Left; |
161 | } | 161 | } |
162 | if ( KOPrefs::instance()->mUseAppColors ) | 162 | if ( KOPrefs::instance()->mUseAppColors ) |
163 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 163 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
164 | globalFlagBlockStartup = 1; | 164 | globalFlagBlockStartup = 1; |
165 | iconToolBar = new QPEToolBar( this ); | 165 | iconToolBar = new QPEToolBar( this ); |
166 | addToolBar (iconToolBar , tbd ); | 166 | addToolBar (iconToolBar , tbd ); |
167 | mCalendarModifiedFlag = false; | 167 | mCalendarModifiedFlag = false; |
168 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); | 168 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); |
169 | splash->setAlignment ( AlignCenter ); | 169 | splash->setAlignment ( AlignCenter ); |
170 | setCentralWidget( splash ); | 170 | setCentralWidget( splash ); |
171 | #ifndef DESKTOP_VERSION | 171 | #ifndef DESKTOP_VERSION |
172 | showMaximized(); | 172 | showMaximized(); |
173 | #endif | 173 | #endif |
174 | 174 | ||
175 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); | 175 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); |
176 | setDefaultPreferences(); | 176 | setDefaultPreferences(); |
177 | mCalendar = new CalendarLocal(); | 177 | mCalendar = new CalendarLocal(); |
178 | mView = new CalendarView( mCalendar, this,"mCalendar " ); | 178 | mView = new CalendarView( mCalendar, this,"mCalendar " ); |
179 | mView->hide(); | 179 | mView->hide(); |
180 | //mView->resize(splash->size() ); | 180 | //mView->resize(splash->size() ); |
181 | initActions(); | 181 | initActions(); |
182 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); | 182 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); |
183 | mSyncManager->setBlockSave(false); | 183 | mSyncManager->setBlockSave(false); |
184 | mView->setSyncManager(mSyncManager); | 184 | mView->setSyncManager(mSyncManager); |
185 | #ifndef DESKTOP_VERSION | 185 | #ifndef DESKTOP_VERSION |
186 | iconToolBar->show(); | 186 | iconToolBar->show(); |
187 | qApp->processEvents(); | 187 | qApp->processEvents(); |
188 | #endif | 188 | #endif |
189 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); | 189 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); |
190 | int vh = height() ; | 190 | int vh = height() ; |
191 | int vw = width(); | 191 | int vw = width(); |
192 | //qDebug("Toolbar hei %d ",iconToolBar->height() ); | 192 | //qDebug("Toolbar hei %d ",iconToolBar->height() ); |
193 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { | 193 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { |
194 | vh -= iconToolBar->height(); | 194 | vh -= iconToolBar->height(); |
195 | } else { | 195 | } else { |
196 | vw -= iconToolBar->height(); | 196 | vw -= iconToolBar->height(); |
197 | } | 197 | } |
198 | //mView->setMaximumSize( splash->size() ); | 198 | //mView->setMaximumSize( splash->size() ); |
199 | //mView->resize( splash->size() ); | 199 | //mView->resize( splash->size() ); |
200 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 200 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
201 | mView->readSettings(); | 201 | mView->readSettings(); |
202 | bool newFile = false; | 202 | bool newFile = false; |
203 | if( !QFile::exists( defaultFileName() ) ) { | 203 | if( !QFile::exists( defaultFileName() ) ) { |
204 | QFileInfo finfo ( defaultFileName() ); | 204 | QFileInfo finfo ( defaultFileName() ); |
205 | QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); | 205 | QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); |
206 | qDebug("oldfile %s ", oldFile.latin1()); | 206 | qDebug("oldfile %s ", oldFile.latin1()); |
207 | QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; | 207 | QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; |
208 | finfo.setFile( oldFile ); | 208 | finfo.setFile( oldFile ); |
209 | if (finfo.exists() ) { | 209 | if (finfo.exists() ) { |
210 | KMessageBox::information( this, message); | 210 | KMessageBox::information( this, message); |
211 | mView->openCalendar( oldFile ); | 211 | mView->openCalendar( oldFile ); |
212 | qApp->processEvents(); | 212 | qApp->processEvents(); |
213 | } else { | 213 | } else { |
214 | oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); | 214 | oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); |
215 | finfo.setFile( oldFile ); | 215 | finfo.setFile( oldFile ); |
216 | if (finfo.exists() ) { | 216 | if (finfo.exists() ) { |
217 | KMessageBox::information( this, message); | 217 | KMessageBox::information( this, message); |
218 | mView->openCalendar( oldFile ); | 218 | mView->openCalendar( oldFile ); |
219 | qApp->processEvents(); | 219 | qApp->processEvents(); |
220 | } | 220 | } |
221 | } | 221 | } |
222 | mView->saveCalendar( defaultFileName() ); | 222 | mView->saveCalendar( defaultFileName() ); |
223 | newFile = true; | 223 | newFile = true; |
224 | } | 224 | } |
225 | 225 | ||
226 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 226 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
227 | mView->openCalendar( defaultFileName() ); | 227 | mView->openCalendar( defaultFileName() ); |
228 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 228 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
229 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); | 229 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); |
230 | 230 | ||
231 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { | 231 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { |
232 | KOPrefs::instance()->setAllDefaults(); | 232 | KOPrefs::instance()->setAllDefaults(); |
233 | int count = mView->addCategories(); | 233 | int count = mView->addCategories(); |
234 | } | 234 | } |
235 | processIncidenceSelection( 0 ); | 235 | processIncidenceSelection( 0 ); |
236 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), | 236 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), |
237 | SLOT( processIncidenceSelection( Incidence * ) ) ); | 237 | SLOT( processIncidenceSelection( Incidence * ) ) ); |
238 | connect( mView, SIGNAL( modifiedChanged( bool ) ), | 238 | connect( mView, SIGNAL( modifiedChanged( bool ) ), |
239 | SLOT( slotModifiedChanged( bool ) ) ); | 239 | SLOT( slotModifiedChanged( bool ) ) ); |
240 | 240 | ||
241 | 241 | ||
242 | connect( mView, SIGNAL( tempDisableBR(bool) ), | 242 | connect( mView, SIGNAL( tempDisableBR(bool) ), |
243 | SLOT( disableBR(bool) ) ); | 243 | SLOT( disableBR(bool) ) ); |
244 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); | 244 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); |
245 | mView->setModified( false ); | 245 | mView->setModified( false ); |
246 | mBlockAtStartup = false; | 246 | mBlockAtStartup = false; |
247 | mView->setModified( false ); | 247 | mView->setModified( false ); |
248 | setCentralWidget( mView ); | 248 | setCentralWidget( mView ); |
249 | globalFlagBlockStartup = 0; | 249 | globalFlagBlockStartup = 0; |
250 | mView->show(); | 250 | mView->show(); |
251 | delete splash; | 251 | delete splash; |
252 | if ( newFile ) | 252 | if ( newFile ) |
253 | mView->updateConfig(); | 253 | mView->updateConfig(); |
254 | // qApp->processEvents(); | 254 | // qApp->processEvents(); |
255 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 255 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
256 | //fillSyncMenu(); | 256 | //fillSyncMenu(); |
257 | 257 | ||
258 | 258 | ||
259 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); | 259 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); |
260 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); | 260 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); |
261 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); | 261 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); |
262 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); | 262 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); |
263 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); | 263 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); |
264 | mSyncManager->setDefaultFileName( sentSyncFile()); | 264 | mSyncManager->setDefaultFileName( sentSyncFile()); |
265 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); | 265 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); |
266 | mSyncManager->fillSyncMenu(); | 266 | mSyncManager->fillSyncMenu(); |
267 | 267 | ||
268 | 268 | ||
269 | 269 | ||
270 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); | 270 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); |
271 | if ( showWarning ) { | 271 | if ( showWarning ) { |
272 | KMessageBox::information( this, | 272 | KMessageBox::information( this, |
273 | "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); | 273 | "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); |
274 | qApp->processEvents(); | 274 | qApp->processEvents(); |
275 | mView->dialogManager()->showSyncOptions(); | 275 | mView->dialogManager()->showSyncOptions(); |
276 | } | 276 | } |
277 | 277 | ||
278 | //US listen for result adressed from Ka/Pi | 278 | //US listen for result adressed from Ka/Pi |
279 | #ifndef DESKTOP_VERSION | 279 | #ifndef DESKTOP_VERSION |
280 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 280 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
281 | #endif | 281 | #endif |
282 | #ifndef DESKTOP_VERSION | 282 | #ifndef DESKTOP_VERSION |
283 | infrared = 0; | 283 | infrared = 0; |
284 | #endif | 284 | #endif |
285 | updateWeek( mView->startDate() ); | 285 | updateWeek( mView->startDate() ); |
286 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), | 286 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), |
287 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); | 287 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); |
288 | mBRdisabled = false; | 288 | mBRdisabled = false; |
289 | //toggleBeamReceive(); | 289 | //toggleBeamReceive(); |
290 | } | 290 | } |
291 | MainWindow::~MainWindow() | 291 | MainWindow::~MainWindow() |
292 | { | 292 | { |
293 | //qDebug("MainWindow::~MainWindow() "); | 293 | //qDebug("MainWindow::~MainWindow() "); |
294 | //save toolbar location | 294 | //save toolbar location |
295 | delete mCalendar; | 295 | delete mCalendar; |
296 | delete mSyncManager; | 296 | delete mSyncManager; |
297 | #ifndef DESKTOP_VERSION | 297 | #ifndef DESKTOP_VERSION |
298 | if ( infrared ) | 298 | if ( infrared ) |
299 | delete infrared; | 299 | delete infrared; |
300 | #endif | 300 | #endif |
301 | 301 | ||
302 | 302 | ||
303 | } | 303 | } |
304 | 304 | ||
305 | void MainWindow::disableBR(bool b) | 305 | void MainWindow::disableBR(bool b) |
306 | { | 306 | { |
307 | #ifndef DESKTOP_VERSION | 307 | #ifndef DESKTOP_VERSION |
308 | if ( b ) { | 308 | if ( b ) { |
309 | if ( infrared ) { | 309 | if ( infrared ) { |
310 | toggleBeamReceive(); | 310 | toggleBeamReceive(); |
311 | mBRdisabled = true; | 311 | mBRdisabled = true; |
312 | } | 312 | } |
313 | mBRdisabled = true; | 313 | mBRdisabled = true; |
314 | } else { | 314 | } else { |
315 | if ( mBRdisabled ) { | 315 | if ( mBRdisabled ) { |
316 | mBRdisabled = false; | 316 | mBRdisabled = false; |
317 | //makes no sense,because other cal ap is probably running | 317 | //makes no sense,because other cal ap is probably running |
318 | // toggleBeamReceive(); | 318 | // toggleBeamReceive(); |
319 | } | 319 | } |
320 | } | 320 | } |
321 | #endif | 321 | #endif |
322 | 322 | ||
323 | } | 323 | } |
324 | bool MainWindow::beamReceiveEnabled() | 324 | bool MainWindow::beamReceiveEnabled() |
325 | { | 325 | { |
326 | #ifndef DESKTOP_VERSION | 326 | #ifndef DESKTOP_VERSION |
327 | return ( infrared != 0 ); | 327 | return ( infrared != 0 ); |
328 | #endif | 328 | #endif |
329 | return false; | 329 | return false; |
330 | } | 330 | } |
331 | 331 | ||
332 | void MainWindow::toggleBeamReceive() | 332 | void MainWindow::toggleBeamReceive() |
333 | { | 333 | { |
334 | if ( mBRdisabled ) | 334 | if ( mBRdisabled ) |
335 | return; | 335 | return; |
336 | #ifndef DESKTOP_VERSION | 336 | #ifndef DESKTOP_VERSION |
337 | if ( infrared ) { | 337 | if ( infrared ) { |
338 | qDebug("disable BeamReceive "); | 338 | qDebug("disable BeamReceive "); |
339 | delete infrared; | 339 | delete infrared; |
340 | infrared = 0; | 340 | infrared = 0; |
341 | brAction->setOn(false); | 341 | brAction->setOn(false); |
342 | return; | 342 | return; |
343 | } | 343 | } |
344 | qDebug("enable BeamReceive "); | 344 | qDebug("enable BeamReceive "); |
345 | brAction->setOn(true); | 345 | brAction->setOn(true); |
346 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; | 346 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; |
347 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); | 347 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); |
348 | #endif | 348 | #endif |
349 | } | 349 | } |
350 | void MainWindow::showMaximized () | 350 | void MainWindow::showMaximized () |
351 | { | 351 | { |
352 | #ifndef DESKTOP_VERSION | 352 | #ifndef DESKTOP_VERSION |
353 | if ( ! globalFlagBlockStartup ) | 353 | if ( ! globalFlagBlockStartup ) |
354 | if ( mClosed ) | 354 | if ( mClosed ) |
355 | mView->goToday(); | 355 | mView->goToday(); |
356 | #endif | 356 | #endif |
357 | QWidget::showMaximized () ; | 357 | QWidget::showMaximized () ; |
358 | mClosed = false; | 358 | mClosed = false; |
359 | } | 359 | } |
360 | void MainWindow::closeEvent( QCloseEvent* ce ) | 360 | void MainWindow::closeEvent( QCloseEvent* ce ) |
361 | { | 361 | { |
362 | 362 | ||
363 | 363 | ||
364 | 364 | ||
365 | if ( ! KOPrefs::instance()->mAskForQuit ) { | 365 | if ( ! KOPrefs::instance()->mAskForQuit ) { |
366 | saveOnClose(); | 366 | saveOnClose(); |
367 | mClosed = true; | 367 | mClosed = true; |
368 | ce->accept(); | 368 | ce->accept(); |
369 | return; | 369 | return; |
370 | 370 | ||
371 | } | 371 | } |
372 | 372 | ||
373 | switch( QMessageBox::information( this, "KO/Pi", | 373 | switch( QMessageBox::information( this, "KO/Pi", |
374 | i18n("Do you really want\nto close KO/Pi?"), | 374 | i18n("Do you really want\nto close KO/Pi?"), |
375 | i18n("Close"), i18n("No"), | 375 | i18n("Close"), i18n("No"), |
376 | 0, 0 ) ) { | 376 | 0, 0 ) ) { |
377 | case 0: | 377 | case 0: |
378 | saveOnClose(); | 378 | saveOnClose(); |
379 | mClosed = true; | 379 | mClosed = true; |
380 | ce->accept(); | 380 | ce->accept(); |
381 | break; | 381 | break; |
382 | case 1: | 382 | case 1: |
383 | ce->ignore(); | 383 | ce->ignore(); |
384 | break; | 384 | break; |
385 | case 2: | 385 | case 2: |
386 | 386 | ||
387 | default: | 387 | default: |
388 | break; | 388 | break; |
389 | } | 389 | } |
390 | 390 | ||
391 | 391 | ||
392 | } | 392 | } |
393 | 393 | ||
394 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | 394 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) |
395 | { | 395 | { |
396 | QDataStream stream( data, IO_ReadOnly ); | 396 | QDataStream stream( data, IO_ReadOnly ); |
397 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); | 397 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); |
398 | //QString datamess; | 398 | //QString datamess; |
399 | //qDebug("message "); | 399 | //qDebug("message "); |
400 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); | 400 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); |
401 | 401 | ||
402 | if ( cmsg == "setDocument(QString)" ) { | 402 | if ( cmsg == "setDocument(QString)" ) { |
403 | QDataStream stream( data, IO_ReadOnly ); | 403 | QDataStream stream( data, IO_ReadOnly ); |
404 | QString fileName; | 404 | QString fileName; |
405 | stream >> fileName; | 405 | stream >> fileName; |
406 | //qDebug("filename %s ", fileName.latin1()); | 406 | //qDebug("filename %s ", fileName.latin1()); |
407 | showMaximized(); | 407 | showMaximized(); |
408 | raise(); | 408 | raise(); |
409 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; | 409 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; |
410 | mSyncManager->slotSyncMenu( 1002 ); | 410 | mSyncManager->slotSyncMenu( 1002 ); |
411 | return; | 411 | return; |
412 | } | 412 | } |
413 | 413 | ||
414 | if ( cmsg == "-writeFile" ) { | 414 | if ( cmsg == "-writeFile" ) { |
415 | // I made from the "-writeFile" an "-writeAlarm" | 415 | // I made from the "-writeFile" an "-writeAlarm" |
416 | mView->viewManager()->showWhatsNextView(); | 416 | mView->viewManager()->showWhatsNextView(); |
417 | mCalendar->checkAlarmForIncidence( 0, true); | 417 | mCalendar->checkAlarmForIncidence( 0, true); |
418 | showMaximized(); | 418 | showMaximized(); |
419 | raise(); | 419 | raise(); |
420 | return; | 420 | return; |
421 | 421 | ||
422 | } | 422 | } |
423 | if ( cmsg == "-writeFileSilent" ) { | 423 | if ( cmsg == "-writeFileSilent" ) { |
424 | // I made from the "-writeFile" an "-writeAlarm" | 424 | // I made from the "-writeFile" an "-writeAlarm" |
425 | // mView->viewManager()->showWhatsNextView(); | 425 | // mView->viewManager()->showWhatsNextView(); |
426 | mCalendar->checkAlarmForIncidence( 0, true); | 426 | mCalendar->checkAlarmForIncidence( 0, true); |
427 | //showMaximized(); | 427 | //showMaximized(); |
428 | //raise(); | 428 | //raise(); |
429 | hide(); | 429 | hide(); |
430 | return; | 430 | return; |
431 | } | 431 | } |
432 | if ( cmsg == "-newCountdown" ) { | 432 | if ( cmsg == "-newCountdown" ) { |
433 | qDebug("newCountdown "); | 433 | qDebug("newCountdown "); |
434 | 434 | ||
435 | } | 435 | } |
436 | QString msg ; | 436 | QString msg ; |
437 | QString allmsg = cmsg; | 437 | QString allmsg = cmsg; |
438 | while ( allmsg.length() > 0 ) { | 438 | while ( allmsg.length() > 0 ) { |
439 | int nextC = allmsg.find( "-", 1 ); | 439 | int nextC = allmsg.find( "-", 1 ); |
440 | if ( nextC == -1 ) { | 440 | if ( nextC == -1 ) { |
441 | msg = allmsg; | 441 | msg = allmsg; |
442 | allmsg = ""; | 442 | allmsg = ""; |
443 | } else{ | 443 | } else{ |
444 | msg = allmsg.left( nextC ); | 444 | msg = allmsg.left( nextC ); |
445 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); | 445 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); |
446 | } | 446 | } |
447 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); | 447 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); |
448 | if ( msg == "-newEvent" ) { | 448 | if ( msg == "-newEvent" ) { |
449 | mView->newEvent(); | 449 | mView->newEvent(); |
450 | } | 450 | } |
451 | if ( msg == "-newTodo" ) { | 451 | if ( msg == "-newTodo" ) { |
452 | mView->newTodo(); | 452 | mView->newTodo(); |
453 | 453 | ||
454 | } | 454 | } |
455 | if ( msg == "-showWN" ) { | 455 | if ( msg == "-showWN" ) { |
456 | mView->viewManager()->showWhatsNextView(); | 456 | mView->viewManager()->showWhatsNextView(); |
457 | } | 457 | } |
458 | if ( msg == "-showTodo" ) { | 458 | if ( msg == "-showTodo" ) { |
459 | mView->viewManager()->showTodoView(); | 459 | mView->viewManager()->showTodoView(); |
460 | } | 460 | } |
461 | if ( msg == "-showList" ) { | 461 | if ( msg == "-showList" ) { |
462 | mView->viewManager()->showListView(); | 462 | mView->viewManager()->showListView(); |
463 | } | 463 | } |
464 | else if ( msg == "-showDay" ) { | 464 | else if ( msg == "-showDay" ) { |
465 | mView->viewManager()->showDayView(); | 465 | mView->viewManager()->showDayView(); |
466 | } | 466 | } |
467 | else if ( msg == "-showWWeek" ) { | 467 | else if ( msg == "-showWWeek" ) { |
468 | mView->viewManager()->showWorkWeekView(); | 468 | mView->viewManager()->showWorkWeekView(); |
469 | } | 469 | } |
470 | else if ( msg == "-ringSync" ) { | 470 | else if ( msg == "-ringSync" ) { |
471 | mSyncManager->multiSync( false ); | 471 | mSyncManager->multiSync( false ); |
472 | } | 472 | } |
473 | else if ( msg == "-showWeek" ) { | 473 | else if ( msg == "-showWeek" ) { |
474 | mView->viewManager()->showWeekView(); | 474 | mView->viewManager()->showWeekView(); |
475 | } | 475 | } |
476 | else if ( msg == "-showTodo" ) { | 476 | else if ( msg == "-showTodo" ) { |
477 | mView->viewManager()->showTodoView(); | 477 | mView->viewManager()->showTodoView(); |
478 | } | 478 | } |
479 | else if ( msg == "-showJournal" ) { | 479 | else if ( msg == "-showJournal" ) { |
480 | mView->dateNavigator()->selectDates( 1 ); | 480 | mView->dateNavigator()->selectDates( 1 ); |
481 | mView->dateNavigator()->selectToday(); | 481 | mView->dateNavigator()->selectToday(); |
482 | mView->viewManager()->showJournalView(); | 482 | mView->viewManager()->showJournalView(); |
483 | } | 483 | } |
484 | else if ( msg == "-showKO" ) { | 484 | else if ( msg == "-showKO" ) { |
485 | mView->viewManager()->showNextXView(); | 485 | mView->viewManager()->showNextXView(); |
486 | } | 486 | } |
487 | else if ( msg == "-showWNext" || msg == "nextView()" ) { | 487 | else if ( msg == "-showWNext" || msg == "nextView()" ) { |
488 | mView->viewManager()->showWhatsNextView(); | 488 | mView->viewManager()->showWhatsNextView(); |
489 | } | 489 | } |
490 | else if ( msg == "-showNextXView" ) { | 490 | else if ( msg == "-showNextXView" ) { |
491 | mView->viewManager()->showNextXView(); | 491 | mView->viewManager()->showNextXView(); |
492 | } | 492 | } |
493 | 493 | ||
494 | 494 | ||
495 | } | 495 | } |
496 | 496 | ||
497 | showMaximized(); | 497 | showMaximized(); |
498 | raise(); | 498 | raise(); |
499 | } | 499 | } |
500 | 500 | ||
501 | QPixmap MainWindow::loadPixmap( QString name ) | 501 | QPixmap MainWindow::loadPixmap( QString name ) |
502 | { | 502 | { |
503 | return SmallIcon( name ); | 503 | return SmallIcon( name ); |
504 | 504 | ||
505 | } | 505 | } |
506 | void MainWindow::initActions() | 506 | void MainWindow::initActions() |
507 | { | 507 | { |
508 | //KOPrefs::instance()->mShowFullMenu | 508 | //KOPrefs::instance()->mShowFullMenu |
509 | iconToolBar->clear(); | 509 | iconToolBar->clear(); |
510 | KOPrefs *p = KOPrefs::instance(); | 510 | KOPrefs *p = KOPrefs::instance(); |
511 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 511 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
512 | 512 | ||
513 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 513 | QPopupMenu *viewMenu = new QPopupMenu( this ); |
514 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 514 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
515 | QPopupMenu *importMenu = new QPopupMenu( this ); | 515 | QPopupMenu *importMenu = new QPopupMenu( this ); |
516 | QPopupMenu *importMenu_X = new QPopupMenu( this ); | 516 | QPopupMenu *importMenu_X = new QPopupMenu( this ); |
517 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); | 517 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); |
518 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); | 518 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); |
519 | selectFilterMenu = new QPopupMenu( this ); | 519 | selectFilterMenu = new QPopupMenu( this ); |
520 | selectFilterMenu->setCheckable( true ); | 520 | selectFilterMenu->setCheckable( true ); |
521 | syncMenu = new QPopupMenu( this ); | 521 | syncMenu = new QPopupMenu( this ); |
522 | configureAgendaMenu = new QPopupMenu( this ); | 522 | configureAgendaMenu = new QPopupMenu( this ); |
523 | configureToolBarMenu = new QPopupMenu( this ); | 523 | configureToolBarMenu = new QPopupMenu( this ); |
524 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 524 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
525 | QIconSet icon; | 525 | QIconSet icon; |
526 | int pixWid = 22, pixHei = 22; | 526 | int pixWid = 22, pixHei = 22; |
527 | QString pathString = ""; | 527 | QString pathString = ""; |
528 | if ( !p->mToolBarMiniIcons ) { | 528 | if ( !p->mToolBarMiniIcons ) { |
529 | if ( QApplication::desktop()->width() < 480 ) { | 529 | if ( QApplication::desktop()->width() < 480 ) { |
530 | pathString += "icons16/"; | 530 | pathString += "icons16/"; |
531 | pixWid = 18; pixHei = 16; | 531 | pixWid = 18; pixHei = 16; |
532 | } | 532 | } |
533 | } else { | 533 | } else { |
534 | pathString += "iconsmini/"; | 534 | pathString += "iconsmini/"; |
535 | pixWid = 18; pixHei = 16; | 535 | pixWid = 18; pixHei = 16; |
536 | } | 536 | } |
537 | if ( KOPrefs::instance()->mShowFullMenu ) { | 537 | if ( KOPrefs::instance()->mShowFullMenu ) { |
538 | QMenuBar *menuBar1; | 538 | QMenuBar *menuBar1; |
539 | menuBar1 = menuBar(); | 539 | menuBar1 = menuBar(); |
540 | menuBar1->insertItem( i18n("File"), importMenu ); | 540 | menuBar1->insertItem( i18n("File"), importMenu ); |
541 | menuBar1->insertItem( i18n("View"), viewMenu ); | 541 | menuBar1->insertItem( i18n("View"), viewMenu ); |
542 | menuBar1->insertItem( i18n("Actions"), actionMenu ); | 542 | menuBar1->insertItem( i18n("Actions"), actionMenu ); |
543 | #ifdef DESKTOP_VERSION | 543 | #ifdef DESKTOP_VERSION |
544 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); | 544 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); |
545 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 545 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
546 | #else | 546 | #else |
547 | menuBar1->insertItem( i18n("Sync"), syncMenu ); | 547 | menuBar1->insertItem( i18n("Sync"), syncMenu ); |
548 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); | 548 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); |
549 | #endif | 549 | #endif |
550 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 550 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
551 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); | 551 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); |
552 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 552 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
553 | } else { | 553 | } else { |
554 | QPEMenuBar *menuBar1; | 554 | QPEMenuBar *menuBar1; |
555 | menuBar1 = new QPEMenuBar( iconToolBar ); | 555 | menuBar1 = new QPEMenuBar( iconToolBar ); |
556 | QPopupMenu *menuBar = new QPopupMenu( this ); | 556 | QPopupMenu *menuBar = new QPopupMenu( this ); |
557 | icon = loadPixmap( pathString + "z_menu" ); | 557 | icon = loadPixmap( pathString + "z_menu" ); |
558 | menuBar1->insertItem( icon.pixmap(), menuBar); | 558 | menuBar1->insertItem( icon.pixmap(), menuBar); |
559 | //menuBar1->insertItem( i18n("ME"), menuBar); | 559 | //menuBar1->insertItem( i18n("ME"), menuBar); |
560 | menuBar->insertItem( i18n("File"), importMenu ); | 560 | menuBar->insertItem( i18n("File"), importMenu ); |
561 | menuBar->insertItem( i18n("View"), viewMenu ); | 561 | menuBar->insertItem( i18n("View"), viewMenu ); |
562 | menuBar->insertItem( i18n("Actions"), actionMenu ); | 562 | menuBar->insertItem( i18n("Actions"), actionMenu ); |
563 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); | 563 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); |
564 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 564 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
565 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 565 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
566 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); | 566 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); |
567 | menuBar->insertItem( i18n("Help"), helpMenu ); | 567 | menuBar->insertItem( i18n("Help"), helpMenu ); |
568 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); | 568 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); |
569 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); | 569 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); |
570 | } | 570 | } |
571 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 571 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
572 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); | 572 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); |
573 | mWeekBgColor = iconToolBar->backgroundColor(); | 573 | mWeekBgColor = iconToolBar->backgroundColor(); |
574 | mWeekPixmap.resize( pixWid , pixHei ); | 574 | mWeekPixmap.resize( pixWid , pixHei ); |
575 | mWeekPixmap.fill( mWeekBgColor ); | 575 | mWeekPixmap.fill( mWeekBgColor ); |
576 | icon = mWeekPixmap; | 576 | icon = mWeekPixmap; |
577 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); | 577 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); |
578 | if ( p-> mShowIconWeekNum ) | 578 | if ( p-> mShowIconWeekNum ) |
579 | mWeekAction->addTo( iconToolBar ); | 579 | mWeekAction->addTo( iconToolBar ); |
580 | mWeekFont = font(); | 580 | mWeekFont = font(); |
581 | 581 | ||
582 | int fontPoint = mWeekFont.pointSize(); | 582 | int fontPoint = mWeekFont.pointSize(); |
583 | QFontMetrics f( mWeekFont ); | 583 | QFontMetrics f( mWeekFont ); |
584 | int fontWid = f.width( "30" ); | 584 | int fontWid = f.width( "30" ); |
585 | while ( fontWid > pixWid ) { | 585 | while ( fontWid > pixWid ) { |
586 | --fontPoint; | 586 | --fontPoint; |
587 | mWeekFont.setPointSize( fontPoint ); | 587 | mWeekFont.setPointSize( fontPoint ); |
588 | QFontMetrics f( mWeekFont ); | 588 | QFontMetrics f( mWeekFont ); |
589 | fontWid = f.width( "30" ); | 589 | fontWid = f.width( "30" ); |
590 | qDebug("dec-- "); | 590 | qDebug("dec-- "); |
591 | } | 591 | } |
592 | 592 | ||
593 | connect( mWeekAction, SIGNAL( activated() ), | 593 | connect( mWeekAction, SIGNAL( activated() ), |
594 | this, SLOT( weekAction() ) ); | 594 | this, SLOT( weekAction() ) ); |
595 | 595 | ||
596 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); | 596 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); |
597 | 597 | ||
598 | //#endif | 598 | //#endif |
599 | // ****************** | 599 | // ****************** |
600 | QAction *action; | 600 | QAction *action; |
601 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); | 601 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); |
602 | configureToolBarMenu->setCheckable( true ); | 602 | configureToolBarMenu->setCheckable( true ); |
603 | 603 | ||
604 | 604 | ||
605 | configureAgendaMenu->setCheckable( true ); | 605 | configureAgendaMenu->setCheckable( true ); |
606 | int iii ; | 606 | int iii ; |
607 | for ( iii = 1;iii<= 10 ;++iii ){ | 607 | for ( iii = 1;iii<= 10 ;++iii ){ |
608 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); | 608 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); |
609 | } | 609 | } |
610 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 610 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
611 | 611 | ||
612 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), | 612 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), |
613 | this, SLOT( showConfigureAgenda( ) ) ); | 613 | this, SLOT( showConfigureAgenda( ) ) ); |
614 | 614 | ||
615 | icon = loadPixmap( pathString + "configure" ); | 615 | icon = loadPixmap( pathString + "configure" ); |
616 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); | 616 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); |
617 | action->addTo( actionMenu ); | 617 | action->addTo( actionMenu ); |
618 | connect( action, SIGNAL( activated() ), | 618 | connect( action, SIGNAL( activated() ), |
619 | mView, SLOT( edit_options() ) ); | 619 | mView, SLOT( edit_options() ) ); |
620 | actionMenu->insertSeparator(); | 620 | actionMenu->insertSeparator(); |
621 | 621 | ||
622 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); | 622 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); |
623 | action->addTo( actionMenu ); | 623 | action->addTo( actionMenu ); |
624 | connect( action, SIGNAL( activated() ), | 624 | connect( action, SIGNAL( activated() ), |
625 | mView, SLOT( undo_delete() ) ); | 625 | mView, SLOT( undo_delete() ) ); |
626 | actionMenu->insertSeparator(); | 626 | actionMenu->insertSeparator(); |
627 | 627 | ||
628 | icon = loadPixmap( pathString + "newevent" ); | 628 | icon = loadPixmap( pathString + "newevent" ); |
629 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 629 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
630 | configureToolBarMenu->insertSeparator(); | 630 | configureToolBarMenu->insertSeparator(); |
631 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); | 631 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); |
632 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 632 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
633 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 633 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); |
634 | ne_action->addTo( actionMenu ); | 634 | ne_action->addTo( actionMenu ); |
635 | connect( ne_action, SIGNAL( activated() ), | 635 | connect( ne_action, SIGNAL( activated() ), |
636 | mView, SLOT( newEvent() ) ); | 636 | mView, SLOT( newEvent() ) ); |
637 | icon = loadPixmap( pathString + "newtodo" ); | 637 | icon = loadPixmap( pathString + "newtodo" ); |
638 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 638 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); |
639 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | 639 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); |
640 | nt_action->addTo( actionMenu ); | 640 | nt_action->addTo( actionMenu ); |
641 | connect( nt_action, SIGNAL( activated() ), | 641 | connect( nt_action, SIGNAL( activated() ), |
642 | mView, SLOT( newTodo() ) ); | 642 | mView, SLOT( newTodo() ) ); |
643 | 643 | ||
644 | icon = loadPixmap( pathString + "today" ); | 644 | icon = loadPixmap( pathString + "today" ); |
645 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | 645 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); |
646 | today_action->addTo( viewMenu ); | 646 | today_action->addTo( viewMenu ); |
647 | connect( today_action, SIGNAL( activated() ), | 647 | connect( today_action, SIGNAL( activated() ), |
648 | mView, SLOT( goToday() ) ); | 648 | mView, SLOT( goToday() ) ); |
649 | viewMenu->insertSeparator(); | 649 | viewMenu->insertSeparator(); |
650 | 650 | ||
651 | icon = loadPixmap( pathString + "navi" ); | 651 | icon = loadPixmap( pathString + "navi" ); |
652 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 652 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
653 | action->addTo( viewMenu ); | 653 | action->addTo( viewMenu ); |
654 | connect( action, SIGNAL( activated() ), | 654 | connect( action, SIGNAL( activated() ), |
655 | mView, SLOT( toggleDateNavigatorWidget() ) ); | 655 | mView, SLOT( toggleDateNavigatorWidget() ) ); |
656 | mToggleNav = action ; | 656 | mToggleNav = action ; |
657 | icon = loadPixmap( pathString + "filter" ); | 657 | icon = loadPixmap( pathString + "filter" ); |
658 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); | 658 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); |
659 | action->addTo( viewMenu ); | 659 | action->addTo( viewMenu ); |
660 | connect( action, SIGNAL( activated() ), | 660 | connect( action, SIGNAL( activated() ), |
661 | mView, SLOT( toggleFilter() ) ); | 661 | mView, SLOT( toggleFilter() ) ); |
662 | mToggleFilter = action; | 662 | mToggleFilter = action; |
663 | icon = loadPixmap( pathString + "allday" ); | 663 | icon = loadPixmap( pathString + "allday" ); |
664 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); | 664 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); |
665 | action->addTo( viewMenu ); | 665 | action->addTo( viewMenu ); |
666 | connect( action, SIGNAL( activated() ), | 666 | connect( action, SIGNAL( activated() ), |
667 | mView, SLOT( toggleAllDaySize() ) ); | 667 | mView, SLOT( toggleAllDaySize() ) ); |
668 | mToggleAllday = action; | 668 | mToggleAllday = action; |
669 | 669 | ||
670 | 670 | ||
671 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 671 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
672 | mToggleNav, SLOT( setEnabled ( bool ) ) ); | 672 | mToggleNav, SLOT( setEnabled ( bool ) ) ); |
673 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 673 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
674 | mToggleFilter, SLOT( setEnabled ( bool ) ) ); | 674 | mToggleFilter, SLOT( setEnabled ( bool ) ) ); |
675 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 675 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
676 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); | 676 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); |
677 | 677 | ||
678 | viewMenu->insertSeparator(); | 678 | viewMenu->insertSeparator(); |
679 | icon = loadPixmap( pathString + "picker" ); | 679 | icon = loadPixmap( pathString + "picker" ); |
680 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); | 680 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); |
681 | action->addTo( viewMenu ); | 681 | action->addTo( viewMenu ); |
682 | connect( action, SIGNAL( activated() ), | 682 | connect( action, SIGNAL( activated() ), |
683 | mView, SLOT( showDatePicker() ) ); | 683 | mView, SLOT( showDatePicker() ) ); |
684 | action->addTo( iconToolBar ); | 684 | action->addTo( iconToolBar ); |
685 | viewMenu->insertSeparator(); | 685 | viewMenu->insertSeparator(); |
686 | icon = loadPixmap( pathString + "list" ); | 686 | icon = loadPixmap( pathString + "list" ); |
687 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); | 687 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); |
688 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); | 688 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); |
689 | showlist_action->addTo( viewMenu ); | 689 | showlist_action->addTo( viewMenu ); |
690 | connect( showlist_action, SIGNAL( activated() ), | 690 | connect( showlist_action, SIGNAL( activated() ), |
691 | mView->viewManager(), SLOT( showListView() ) ); | 691 | mView->viewManager(), SLOT( showListView() ) ); |
692 | 692 | ||
693 | 693 | ||
694 | icon = loadPixmap( pathString + "day" ); | 694 | icon = loadPixmap( pathString + "day" ); |
695 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); | 695 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); |
696 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); | 696 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); |
697 | day1_action->addTo( viewMenu ); | 697 | day1_action->addTo( viewMenu ); |
698 | // action->addTo( toolBar ); | 698 | // action->addTo( toolBar ); |
699 | connect( day1_action, SIGNAL( activated() ), | 699 | connect( day1_action, SIGNAL( activated() ), |
700 | mView->viewManager(), SLOT( showDayView() ) ); | 700 | mView->viewManager(), SLOT( showDayView() ) ); |
701 | 701 | ||
702 | icon = loadPixmap( pathString + "workweek" ); | 702 | icon = loadPixmap( pathString + "workweek" ); |
703 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); | 703 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); |
704 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); | 704 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); |
705 | day5_action->addTo( viewMenu ); | 705 | day5_action->addTo( viewMenu ); |
706 | connect( day5_action, SIGNAL( activated() ), | 706 | connect( day5_action, SIGNAL( activated() ), |
707 | mView->viewManager(), SLOT( showWorkWeekView() ) ); | 707 | mView->viewManager(), SLOT( showWorkWeekView() ) ); |
708 | 708 | ||
709 | icon = loadPixmap( pathString + "week" ); | 709 | icon = loadPixmap( pathString + "week" ); |
710 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); | 710 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); |
711 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); | 711 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); |
712 | day7_action->addTo( viewMenu ); | 712 | day7_action->addTo( viewMenu ); |
713 | connect( day7_action, SIGNAL( activated() ), | 713 | connect( day7_action, SIGNAL( activated() ), |
714 | mView->viewManager(), SLOT( showWeekView() ) ); | 714 | mView->viewManager(), SLOT( showWeekView() ) ); |
715 | 715 | ||
716 | icon = loadPixmap( pathString + "workweek2" ); | 716 | icon = loadPixmap( pathString + "workweek2" ); |
717 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); | 717 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); |
718 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); | 718 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); |
719 | day6_action->addTo( viewMenu ); | 719 | day6_action->addTo( viewMenu ); |
720 | connect( day6_action, SIGNAL( activated() ), | 720 | connect( day6_action, SIGNAL( activated() ), |
721 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); | 721 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); |
722 | 722 | ||
723 | icon = loadPixmap( pathString + "month" ); | 723 | icon = loadPixmap( pathString + "month" ); |
724 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); | 724 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); |
725 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); | 725 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); |
726 | month_action->addTo( viewMenu ); | 726 | month_action->addTo( viewMenu ); |
727 | connect( month_action, SIGNAL( activated() ), | 727 | connect( month_action, SIGNAL( activated() ), |
728 | mView->viewManager(), SLOT( showMonthView() ) ); | 728 | mView->viewManager(), SLOT( showMonthView() ) ); |
729 | 729 | ||
730 | icon = loadPixmap( pathString + "todo" ); | 730 | icon = loadPixmap( pathString + "todo" ); |
731 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); | 731 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); |
732 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); | 732 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); |
733 | todoview_action->addTo( viewMenu ); | 733 | todoview_action->addTo( viewMenu ); |
734 | connect( todoview_action, SIGNAL( activated() ), | 734 | connect( todoview_action, SIGNAL( activated() ), |
735 | mView->viewManager(), SLOT( showTodoView() ) ); | 735 | mView->viewManager(), SLOT( showTodoView() ) ); |
736 | 736 | ||
737 | icon = loadPixmap( pathString + "journal" ); | 737 | icon = loadPixmap( pathString + "journal" ); |
738 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); | 738 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); |
739 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); | 739 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); |
740 | viewjournal_action->addTo( viewMenu ); | 740 | viewjournal_action->addTo( viewMenu ); |
741 | connect( viewjournal_action, SIGNAL( activated() ), | 741 | connect( viewjournal_action, SIGNAL( activated() ), |
742 | mView->viewManager(), SLOT( showJournalView() ) ); | 742 | mView->viewManager(), SLOT( showJournalView() ) ); |
743 | 743 | ||
744 | icon = loadPixmap( pathString + "xdays" ); | 744 | icon = loadPixmap( pathString + "xdays" ); |
745 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); | 745 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); |
746 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); | 746 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); |
747 | xdays_action->addTo( viewMenu ); | 747 | xdays_action->addTo( viewMenu ); |
748 | connect( xdays_action, SIGNAL( activated() ), | 748 | connect( xdays_action, SIGNAL( activated() ), |
749 | mView->viewManager(), SLOT( showNextXView() ) ); | 749 | mView->viewManager(), SLOT( showNextXView() ) ); |
750 | 750 | ||
751 | icon = loadPixmap( pathString + "whatsnext" ); | 751 | icon = loadPixmap( pathString + "whatsnext" ); |
752 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); | 752 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); |
753 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); | 753 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); |
754 | whatsnext_action->addTo( viewMenu ); | 754 | whatsnext_action->addTo( viewMenu ); |
755 | connect( whatsnext_action, SIGNAL( activated() ), | 755 | connect( whatsnext_action, SIGNAL( activated() ), |
756 | mView->viewManager(), SLOT( showWhatsNextView() ) ); | 756 | mView->viewManager(), SLOT( showWhatsNextView() ) ); |
757 | 757 | ||
758 | #if 0 | 758 | #if 0 |
759 | action = new QAction( "view_timespan", "Time Span", 0, this ); | 759 | action = new QAction( "view_timespan", "Time Span", 0, this ); |
760 | action->addTo( viewMenu ); | 760 | action->addTo( viewMenu ); |
761 | connect( action, SIGNAL( activated() ), | 761 | connect( action, SIGNAL( activated() ), |
762 | mView->viewManager(), SLOT( showTimeSpanView() ) ); | 762 | mView->viewManager(), SLOT( showTimeSpanView() ) ); |
763 | #endif | 763 | #endif |
764 | 764 | ||
765 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, | 765 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, |
766 | this ); | 766 | this ); |
767 | mNewSubTodoAction->addTo( actionMenu ); | 767 | mNewSubTodoAction->addTo( actionMenu ); |
768 | connect( mNewSubTodoAction, SIGNAL( activated() ), | 768 | connect( mNewSubTodoAction, SIGNAL( activated() ), |
769 | mView, SLOT( newSubTodo() ) ); | 769 | mView, SLOT( newSubTodo() ) ); |
770 | 770 | ||
771 | actionMenu->insertSeparator(); | 771 | actionMenu->insertSeparator(); |
772 | 772 | ||
773 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); | 773 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); |
774 | mShowAction->addTo( actionMenu ); | 774 | mShowAction->addTo( actionMenu ); |
775 | connect( mShowAction, SIGNAL( activated() ), | 775 | connect( mShowAction, SIGNAL( activated() ), |
776 | mView, SLOT( showIncidence() ) ); | 776 | mView, SLOT( showIncidence() ) ); |
777 | 777 | ||
778 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | 778 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); |
779 | mEditAction->addTo( actionMenu ); | 779 | mEditAction->addTo( actionMenu ); |
780 | connect( mEditAction, SIGNAL( activated() ), | 780 | connect( mEditAction, SIGNAL( activated() ), |
781 | mView, SLOT( editIncidence() ) ); | 781 | mView, SLOT( editIncidence() ) ); |
782 | 782 | ||
783 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | 783 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); |
784 | mDeleteAction->addTo( actionMenu ); | 784 | mDeleteAction->addTo( actionMenu ); |
785 | connect( mDeleteAction, SIGNAL( activated() ), | 785 | connect( mDeleteAction, SIGNAL( activated() ), |
786 | mView, SLOT( deleteIncidence() ) ); | 786 | mView, SLOT( deleteIncidence() ) ); |
787 | 787 | ||
788 | 788 | ||
789 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); | 789 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); |
790 | mCloneAction->addTo( actionMenu ); | 790 | mCloneAction->addTo( actionMenu ); |
791 | connect( mCloneAction, SIGNAL( activated() ), | 791 | connect( mCloneAction, SIGNAL( activated() ), |
792 | mView, SLOT( cloneIncidence() ) ); | 792 | mView, SLOT( cloneIncidence() ) ); |
793 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); | 793 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); |
794 | mMoveAction->addTo( actionMenu ); | 794 | mMoveAction->addTo( actionMenu ); |
795 | connect( mMoveAction, SIGNAL( activated() ), | 795 | connect( mMoveAction, SIGNAL( activated() ), |
796 | mView, SLOT( moveIncidence() ) ); | 796 | mView, SLOT( moveIncidence() ) ); |
797 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); | 797 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); |
798 | mBeamAction->addTo( actionMenu ); | 798 | mBeamAction->addTo( actionMenu ); |
799 | connect( mBeamAction, SIGNAL( activated() ), | 799 | connect( mBeamAction, SIGNAL( activated() ), |
800 | mView, SLOT( beamIncidence() ) ); | 800 | mView, SLOT( beamIncidence() ) ); |
801 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); | 801 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); |
802 | mCancelAction->addTo( actionMenu ); | 802 | mCancelAction->addTo( actionMenu ); |
803 | connect( mCancelAction, SIGNAL( activated() ), | 803 | connect( mCancelAction, SIGNAL( activated() ), |
804 | mView, SLOT( toggleCancelIncidence() ) ); | 804 | mView, SLOT( toggleCancelIncidence() ) ); |
805 | 805 | ||
806 | actionMenu->insertSeparator(); | 806 | actionMenu->insertSeparator(); |
807 | 807 | ||
808 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, | 808 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, |
809 | this ); | 809 | this ); |
810 | action->addTo( actionMenu ); | 810 | action->addTo( actionMenu ); |
811 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); | 811 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); |
812 | 812 | ||
813 | icon = loadPixmap( pathString + "search" ); | 813 | icon = loadPixmap( pathString + "search" ); |
814 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 814 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); |
815 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); | 815 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); |
816 | search_action->addTo( actionMenu ); | 816 | search_action->addTo( actionMenu ); |
817 | connect( search_action, SIGNAL( activated() ), | 817 | connect( search_action, SIGNAL( activated() ), |
818 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | 818 | mView->dialogManager(), SLOT( showSearchDialog() ) ); |
819 | 819 | ||
820 | 820 | ||
821 | 821 | ||
822 | if ( KOPrefs::instance()->mShowFullMenu ) { | 822 | if ( KOPrefs::instance()->mShowFullMenu ) { |
823 | actionMenu->insertSeparator(); | 823 | actionMenu->insertSeparator(); |
824 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); | 824 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); |
825 | 825 | ||
826 | } | 826 | } |
827 | // actionMenu->insertSeparator(); | 827 | // actionMenu->insertSeparator(); |
828 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, | 828 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, |
829 | this ); | 829 | this ); |
830 | action->addTo( importMenu_X ); | 830 | action->addTo( importMenu_X ); |
831 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); | 831 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); |
832 | action = new QAction( "import_quick", i18n("Import last file"), 0, | 832 | action = new QAction( "import_quick", i18n("Import last file"), 0, |
833 | this ); | 833 | this ); |
834 | action->addTo( importMenu_X ); | 834 | action->addTo( importMenu_X ); |
835 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); | 835 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); |
836 | importMenu_X->insertSeparator(); | 836 | importMenu_X->insertSeparator(); |
837 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, | 837 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, |
838 | this ); | 838 | this ); |
839 | action->addTo( importMenu_X ); | 839 | action->addTo( importMenu_X ); |
840 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); | 840 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); |
841 | //#ifndef DESKTOP_VERSION | 841 | //#ifndef DESKTOP_VERSION |
842 | importMenu_X->insertSeparator(); | 842 | importMenu_X->insertSeparator(); |
843 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, | 843 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, |
844 | this ); | 844 | this ); |
845 | action->addTo( importMenu_X ); | 845 | action->addTo( importMenu_X ); |
846 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); | 846 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); |
847 | //#else | 847 | //#else |
848 | #ifdef _OL_IMPORT_ | 848 | #ifdef _OL_IMPORT_ |
849 | importMenu_X->insertSeparator(); | 849 | importMenu_X->insertSeparator(); |
850 | action = new QAction( "import_ol", i18n("Import from OL"), 0, | 850 | action = new QAction( "import_ol", i18n("Import from OL"), 0, |
851 | this ); | 851 | this ); |
852 | action->addTo( importMenu_X ); | 852 | action->addTo( importMenu_X ); |
853 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); | 853 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); |
854 | #endif | 854 | #endif |
855 | //#endif | 855 | //#endif |
856 | 856 | ||
857 | //importMenu->insertSeparator(); | 857 | //importMenu->insertSeparator(); |
858 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, | 858 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, |
859 | this ); | 859 | this ); |
860 | action->addTo( importMenu ); | 860 | action->addTo( importMenu ); |
861 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); | 861 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); |
862 | 862 | ||
863 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, | 863 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, |
864 | this ); | 864 | this ); |
865 | action->addTo( importMenu ); | 865 | action->addTo( importMenu ); |
866 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); | 866 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); |
867 | importMenu->insertSeparator(); | 867 | importMenu->insertSeparator(); |
868 | importMenu->insertItem( i18n("Import"), importMenu_X ); | 868 | importMenu->insertItem( i18n("Import"), importMenu_X ); |
869 | //importMenu->insertSeparator(); | 869 | //importMenu->insertSeparator(); |
870 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, | 870 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, |
871 | this ); | 871 | this ); |
872 | action->addTo( exportMenu_X ); | 872 | action->addTo( exportMenu_X ); |
873 | connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); | 873 | connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); |
874 | 874 | ||
875 | 875 | ||
876 | //LR | 876 | //LR |
877 | QPopupMenu *ex2phone = new QPopupMenu( this ); | 877 | QPopupMenu *ex2phone = new QPopupMenu( this ); |
878 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 878 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
879 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 879 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
880 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); | 880 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); |
881 | exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); | 881 | exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); |
882 | 882 | ||
883 | importMenu->insertItem( i18n("Export"), exportMenu_X ); | 883 | importMenu->insertItem( i18n("Export"), exportMenu_X ); |
884 | #ifndef DESKTOP_VERSION | 884 | #ifndef DESKTOP_VERSION |
885 | //importMenu->insertSeparator(); | 885 | //importMenu->insertSeparator(); |
886 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, | 886 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, |
887 | this ); | 887 | this ); |
888 | brAction->addTo( beamMenu_X ); | 888 | brAction->addTo( beamMenu_X ); |
889 | brAction->setToggleAction (true ) ; | 889 | brAction->setToggleAction (true ) ; |
890 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); | 890 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); |
891 | 891 | ||
892 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, | 892 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, |
893 | this ); | 893 | this ); |
894 | action->addTo( beamMenu_X ); | 894 | action->addTo( beamMenu_X ); |
895 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); | 895 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); |
896 | 896 | ||
897 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, | 897 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, |
898 | this ); | 898 | this ); |
899 | action->addTo( beamMenu_X ); | 899 | action->addTo( beamMenu_X ); |
900 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); | 900 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); |
901 | importMenu->insertItem( i18n("Beam"), beamMenu_X ); | 901 | importMenu->insertItem( i18n("Beam"), beamMenu_X ); |
902 | #else | 902 | #else |
903 | //importMenu->insertSeparator(); | 903 | //importMenu->insertSeparator(); |
904 | icon = loadPixmap( pathString + "print" ); | 904 | icon = loadPixmap( pathString + "print" ); |
905 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); | 905 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); |
906 | action->addTo( beamMenu_X ); | 906 | action->addTo( beamMenu_X ); |
907 | connect( action, SIGNAL( activated() ), | 907 | connect( action, SIGNAL( activated() ), |
908 | this, SLOT( printCal() ) ); | 908 | this, SLOT( printCal() ) ); |
909 | 909 | ||
910 | icon = loadPixmap( pathString + "print" ); | 910 | icon = loadPixmap( pathString + "print" ); |
911 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); | 911 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); |
912 | action->addTo( beamMenu_X ); | 912 | action->addTo( beamMenu_X ); |
@@ -1087,1027 +1087,1040 @@ void MainWindow::initActions() | |||
1087 | if (p-> mShowIconBack) | 1087 | if (p-> mShowIconBack) |
1088 | configureToolBarMenu->setItemChecked( 210, true ); | 1088 | configureToolBarMenu->setItemChecked( 210, true ); |
1089 | if (p-> mShowIconToday) | 1089 | if (p-> mShowIconToday) |
1090 | configureToolBarMenu->setItemChecked( 130, true ); | 1090 | configureToolBarMenu->setItemChecked( 130, true ); |
1091 | if (p-> mShowIconForward) | 1091 | if (p-> mShowIconForward) |
1092 | configureToolBarMenu->setItemChecked( 220, true ); | 1092 | configureToolBarMenu->setItemChecked( 220, true ); |
1093 | if (p-> mShowIconForwardFast) | 1093 | if (p-> mShowIconForwardFast) |
1094 | configureToolBarMenu->setItemChecked( 230, true ); | 1094 | configureToolBarMenu->setItemChecked( 230, true ); |
1095 | if (p-> mShowIconNextDays) | 1095 | if (p-> mShowIconNextDays) |
1096 | configureToolBarMenu->setItemChecked( 100, true ); | 1096 | configureToolBarMenu->setItemChecked( 100, true ); |
1097 | if (p-> mShowIconNext) | 1097 | if (p-> mShowIconNext) |
1098 | configureToolBarMenu->setItemChecked( 110, true ); | 1098 | configureToolBarMenu->setItemChecked( 110, true ); |
1099 | if (p-> mShowIconJournal) | 1099 | if (p-> mShowIconJournal) |
1100 | configureToolBarMenu->setItemChecked( 90, true ); | 1100 | configureToolBarMenu->setItemChecked( 90, true ); |
1101 | if (p-> mShowIconWhatsThis) | 1101 | if (p-> mShowIconWhatsThis) |
1102 | configureToolBarMenu->setItemChecked( 300, true ); | 1102 | configureToolBarMenu->setItemChecked( 300, true ); |
1103 | if (p-> mShowIconWeekNum) | 1103 | if (p-> mShowIconWeekNum) |
1104 | configureToolBarMenu->setItemChecked( 400, true ); | 1104 | configureToolBarMenu->setItemChecked( 400, true ); |
1105 | QLabel* dummy = new QLabel( iconToolBar ); | 1105 | QLabel* dummy = new QLabel( iconToolBar ); |
1106 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); | 1106 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); |
1107 | if (!p-> mShowIconStretch) | 1107 | if (!p-> mShowIconStretch) |
1108 | iconToolBar->setStretchableWidget ( dummy ) ; | 1108 | iconToolBar->setStretchableWidget ( dummy ) ; |
1109 | else | 1109 | else |
1110 | configureToolBarMenu->setItemChecked( 5, true ); | 1110 | configureToolBarMenu->setItemChecked( 5, true ); |
1111 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); | 1111 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); |
1112 | configureAgenda( p->mHourSize ); | 1112 | configureAgenda( p->mHourSize ); |
1113 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); | 1113 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); |
1114 | } | 1114 | } |
1115 | 1115 | ||
1116 | void MainWindow::exportToPhone( int mode ) | 1116 | void MainWindow::exportToPhone( int mode ) |
1117 | { | 1117 | { |
1118 | 1118 | ||
1119 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 1119 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
1120 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 1120 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
1121 | KOex2phonePrefs ex2phone; | 1121 | KOex2phonePrefs ex2phone; |
1122 | 1122 | ||
1123 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); | 1123 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); |
1124 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); | 1124 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); |
1125 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1125 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1126 | if ( mode == 1 ) | 1126 | if ( mode == 1 ) |
1127 | ex2phone.setCaption(i18n("Export complete calendar")); | 1127 | ex2phone.setCaption(i18n("Export complete calendar")); |
1128 | if ( mode == 2 ) | 1128 | if ( mode == 2 ) |
1129 | ex2phone.setCaption(i18n("Export filtered calendar")); | 1129 | ex2phone.setCaption(i18n("Export filtered calendar")); |
1130 | 1130 | ||
1131 | if ( !ex2phone.exec() ) { | 1131 | if ( !ex2phone.exec() ) { |
1132 | return; | 1132 | return; |
1133 | } | 1133 | } |
1134 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); | 1134 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); |
1135 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); | 1135 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); |
1136 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); | 1136 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); |
1137 | 1137 | ||
1138 | int inFuture = 0; | 1138 | int inFuture = 0; |
1139 | if ( ex2phone.mWriteBackFuture->isChecked() ) | 1139 | if ( ex2phone.mWriteBackFuture->isChecked() ) |
1140 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); | 1140 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); |
1141 | QPtrList<Incidence> delSel; | 1141 | QPtrList<Incidence> delSel; |
1142 | if ( mode == 1 ) | 1142 | if ( mode == 1 ) |
1143 | delSel = mCalendar->rawIncidences(); | 1143 | delSel = mCalendar->rawIncidences(); |
1144 | if ( mode == 2 ) | 1144 | if ( mode == 2 ) |
1145 | delSel = mCalendar->incidences(); | 1145 | delSel = mCalendar->incidences(); |
1146 | CalendarLocal* cal = new CalendarLocal(); | 1146 | CalendarLocal* cal = new CalendarLocal(); |
1147 | cal->setLocalTime(); | 1147 | cal->setLocalTime(); |
1148 | Incidence *incidence = delSel.first(); | 1148 | Incidence *incidence = delSel.first(); |
1149 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); | 1149 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); |
1150 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); | 1150 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); |
1151 | while ( incidence ) { | 1151 | while ( incidence ) { |
1152 | if ( incidence->type() != "Journal" ) { | 1152 | if ( incidence->type() != "Journal" ) { |
1153 | bool add = true; | 1153 | bool add = true; |
1154 | if ( inFuture ) { | 1154 | if ( inFuture ) { |
1155 | QDateTime dt; | 1155 | QDateTime dt; |
1156 | if ( incidence->type() == "Todo" ) { | 1156 | if ( incidence->type() == "Todo" ) { |
1157 | Todo * t = (Todo*)incidence; | 1157 | Todo * t = (Todo*)incidence; |
1158 | if ( t->hasDueDate() ) | 1158 | if ( t->hasDueDate() ) |
1159 | dt = t->dtDue(); | 1159 | dt = t->dtDue(); |
1160 | else | 1160 | else |
1161 | dt = cur.addSecs( 62 ); | 1161 | dt = cur.addSecs( 62 ); |
1162 | } | 1162 | } |
1163 | else { | 1163 | else { |
1164 | bool ok; | 1164 | bool ok; |
1165 | dt = incidence->getNextOccurence( cur, &ok ); | 1165 | dt = incidence->getNextOccurence( cur, &ok ); |
1166 | if ( !ok ) | 1166 | if ( !ok ) |
1167 | dt = cur.addSecs( -62 ); | 1167 | dt = cur.addSecs( -62 ); |
1168 | } | 1168 | } |
1169 | if ( dt < cur || dt > end ) { | 1169 | if ( dt < cur || dt > end ) { |
1170 | add = false; | 1170 | add = false; |
1171 | } | 1171 | } |
1172 | } | 1172 | } |
1173 | if ( add ) { | 1173 | if ( add ) { |
1174 | Incidence *in = incidence->clone(); | 1174 | Incidence *in = incidence->clone(); |
1175 | cal->addIncidence( in ); | 1175 | cal->addIncidence( in ); |
1176 | } | 1176 | } |
1177 | } | 1177 | } |
1178 | incidence = delSel.next(); | 1178 | incidence = delSel.next(); |
1179 | } | 1179 | } |
1180 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, | 1180 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, |
1181 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, | 1181 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, |
1182 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1182 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1183 | 1183 | ||
1184 | setCaption( i18n("Writing to phone...")); | 1184 | setCaption( i18n("Writing to phone...")); |
1185 | if ( PhoneFormat::writeToPhone( cal ) ) | 1185 | if ( PhoneFormat::writeToPhone( cal ) ) |
1186 | setCaption( i18n("Export to phone successful!")); | 1186 | setCaption( i18n("Export to phone successful!")); |
1187 | else | 1187 | else |
1188 | setCaption( i18n("Error exporting to phone!")); | 1188 | setCaption( i18n("Error exporting to phone!")); |
1189 | delete cal; | 1189 | delete cal; |
1190 | } | 1190 | } |
1191 | 1191 | ||
1192 | 1192 | ||
1193 | void MainWindow::setDefaultPreferences() | 1193 | void MainWindow::setDefaultPreferences() |
1194 | { | 1194 | { |
1195 | KOPrefs *p = KOPrefs::instance(); | 1195 | KOPrefs *p = KOPrefs::instance(); |
1196 | 1196 | ||
1197 | p->mCompactDialogs = true; | 1197 | p->mCompactDialogs = true; |
1198 | p->mConfirm = true; | 1198 | p->mConfirm = true; |
1199 | // p->mEnableQuickTodo = false; | 1199 | // p->mEnableQuickTodo = false; |
1200 | 1200 | ||
1201 | } | 1201 | } |
1202 | 1202 | ||
1203 | QString MainWindow::resourcePath() | 1203 | QString MainWindow::resourcePath() |
1204 | { | 1204 | { |
1205 | return KGlobal::iconLoader()->iconPath(); | 1205 | return KGlobal::iconLoader()->iconPath(); |
1206 | } | 1206 | } |
1207 | 1207 | ||
1208 | void MainWindow::displayText( QString text ,QString cap ) | 1208 | void MainWindow::displayText( QString text ,QString cap ) |
1209 | { | 1209 | { |
1210 | QDialog dia( this, "name", true ); ; | 1210 | QDialog dia( this, "name", true ); ; |
1211 | dia.setCaption( cap ); | 1211 | dia.setCaption( cap ); |
1212 | QVBoxLayout* lay = new QVBoxLayout( &dia ); | 1212 | QVBoxLayout* lay = new QVBoxLayout( &dia ); |
1213 | lay->setSpacing( 3 ); | 1213 | lay->setSpacing( 3 ); |
1214 | lay->setMargin( 3 ); | 1214 | lay->setMargin( 3 ); |
1215 | QTextBrowser tb ( &dia ); | 1215 | QTextBrowser tb ( &dia ); |
1216 | lay->addWidget( &tb ); | 1216 | lay->addWidget( &tb ); |
1217 | tb.setText( text ); | 1217 | tb.setText( text ); |
1218 | #ifdef DESKTOP_VERSION | 1218 | #ifdef DESKTOP_VERSION |
1219 | dia.resize( 640, 480); | 1219 | dia.resize( 640, 480); |
1220 | #else | 1220 | #else |
1221 | dia.showMaximized(); | 1221 | dia.showMaximized(); |
1222 | #endif | 1222 | #endif |
1223 | dia.exec(); | 1223 | dia.exec(); |
1224 | } | 1224 | } |
1225 | 1225 | ||
1226 | void MainWindow::features() | 1226 | void MainWindow::features() |
1227 | { | 1227 | { |
1228 | 1228 | ||
1229 | KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); | 1229 | KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); |
1230 | } | 1230 | } |
1231 | 1231 | ||
1232 | void MainWindow::usertrans() | 1232 | void MainWindow::usertrans() |
1233 | { | 1233 | { |
1234 | 1234 | ||
1235 | KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); | 1235 | KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); |
1236 | } | 1236 | } |
1237 | 1237 | ||
1238 | void MainWindow::kdesynchowto() | 1238 | void MainWindow::kdesynchowto() |
1239 | { | 1239 | { |
1240 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); | 1240 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); |
1241 | } | 1241 | } |
1242 | void MainWindow::multisynchowto() | 1242 | void MainWindow::multisynchowto() |
1243 | { | 1243 | { |
1244 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); | 1244 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); |
1245 | } | 1245 | } |
1246 | void MainWindow::synchowto() | 1246 | void MainWindow::synchowto() |
1247 | { | 1247 | { |
1248 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); | 1248 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); |
1249 | } | 1249 | } |
1250 | void MainWindow::faq() | 1250 | void MainWindow::faq() |
1251 | { | 1251 | { |
1252 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); | 1252 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); |
1253 | 1253 | ||
1254 | } | 1254 | } |
1255 | void MainWindow::whatsNew() | 1255 | void MainWindow::whatsNew() |
1256 | { | 1256 | { |
1257 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); | 1257 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); |
1258 | 1258 | ||
1259 | } | 1259 | } |
1260 | void MainWindow::licence() | 1260 | void MainWindow::licence() |
1261 | { | 1261 | { |
1262 | KApplication::showLicence(); | 1262 | KApplication::showLicence(); |
1263 | 1263 | ||
1264 | } | 1264 | } |
1265 | void MainWindow::about() | 1265 | void MainWindow::about() |
1266 | { | 1266 | { |
1267 | QString version; | 1267 | QString version; |
1268 | #include <../version> | 1268 | #include <../version> |
1269 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), | 1269 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), |
1270 | i18n("KOrganizer/Platform-independent\n") + | 1270 | i18n("KOrganizer/Platform-independent\n") + |
1271 | "(KO/Pi) " + version + " - " + | 1271 | "(KO/Pi) " + version + " - " + |
1272 | 1272 | ||
1273 | #ifdef DESKTOP_VERSION | 1273 | #ifdef DESKTOP_VERSION |
1274 | i18n("Desktop Edition\n") + | 1274 | i18n("Desktop Edition\n") + |
1275 | #else | 1275 | #else |
1276 | i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + | 1276 | i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + |
1277 | #endif | 1277 | #endif |
1278 | i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); | 1278 | i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); |
1279 | } | 1279 | } |
1280 | void MainWindow::keyBindings() | 1280 | void MainWindow::keyBindings() |
1281 | { | 1281 | { |
1282 | QString cap = i18n("KO/Pi Keys + Colors"); | 1282 | QString cap = i18n("KO/Pi Keys + Colors"); |
1283 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + | 1283 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + |
1284 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ | 1284 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ |
1285 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + | 1285 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + |
1286 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ | 1286 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ |
1287 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ | 1287 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ |
1288 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ | 1288 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ |
1289 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ | 1289 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ |
1290 | i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ | 1290 | i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ |
1291 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ | 1291 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ |
1292 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ | 1292 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ |
1293 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ | 1293 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ |
1294 | i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ | 1294 | i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ |
1295 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ | 1295 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ |
1296 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ | 1296 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ |
1297 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ | 1297 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ |
1298 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ | 1298 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ |
1299 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ | 1299 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ |
1300 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ | 1300 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ |
1301 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ | 1301 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ |
1302 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ | 1302 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ |
1303 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ | 1303 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ |
1304 | i18n("<p><h3>In agenda view:</h3></p>\n") + | 1304 | i18n("<p><h3>In agenda view:</h3></p>\n") + |
1305 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ | 1305 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ |
1306 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ | 1306 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ |
1307 | i18n("<p><h3>In todo view:</h3></p>\n") + | 1307 | i18n("<p><h3>In todo view:</h3></p>\n") + |
1308 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ | 1308 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ |
1309 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ | 1309 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ |
1310 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ | 1310 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ |
1311 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ | 1311 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ |
1312 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1312 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1313 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ | 1313 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ |
1314 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ | 1314 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ |
1315 | i18n("<p><h3>In list view:</h3></p>\n") + | 1315 | i18n("<p><h3>In list view:</h3></p>\n") + |
1316 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1316 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1317 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ | 1317 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ |
1318 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ | 1318 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ |
1319 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ | 1319 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ |
1320 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ | 1320 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ |
1321 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ | 1321 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ |
1322 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + | 1322 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + |
1323 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ | 1323 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ |
1324 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ | 1324 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ |
1325 | i18n("<p><b>E</b>: Edit item</p>\n") + | 1325 | i18n("<p><b>E</b>: Edit item</p>\n") + |
1326 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + | 1326 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + |
1327 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + | 1327 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + |
1328 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ | 1328 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ |
1329 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ | 1329 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ |
1330 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ | 1330 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ |
1331 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ | 1331 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ |
1332 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ | 1332 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ |
1333 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + | 1333 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + |
1334 | i18n("<p><b>White</b>: Item readonly</p>\n"); | 1334 | i18n("<p><b>White</b>: Item readonly</p>\n"); |
1335 | displayText( text, cap); | 1335 | displayText( text, cap); |
1336 | } | 1336 | } |
1337 | void MainWindow::aboutAutoSaving() | 1337 | void MainWindow::aboutAutoSaving() |
1338 | { | 1338 | { |
1339 | QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"); | 1339 | QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"); |
1340 | 1340 | ||
1341 | KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); | 1341 | KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); |
1342 | 1342 | ||
1343 | } | 1343 | } |
1344 | void MainWindow::aboutKnownBugs() | 1344 | void MainWindow::aboutKnownBugs() |
1345 | { | 1345 | { |
1346 | QMessageBox* msg; | 1346 | QMessageBox* msg; |
1347 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), | 1347 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), |
1348 | i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ | 1348 | i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ |
1349 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ | 1349 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ |
1350 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + | 1350 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + |
1351 | i18n("\nor report them in the bugtracker on\n") + | 1351 | i18n("\nor report them in the bugtracker on\n") + |
1352 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), | 1352 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), |
1353 | QMessageBox::NoIcon, | 1353 | QMessageBox::NoIcon, |
1354 | QMessageBox::Ok, | 1354 | QMessageBox::Ok, |
1355 | QMessageBox::NoButton, | 1355 | QMessageBox::NoButton, |
1356 | QMessageBox::NoButton); | 1356 | QMessageBox::NoButton); |
1357 | msg->exec(); | 1357 | msg->exec(); |
1358 | delete msg; | 1358 | delete msg; |
1359 | 1359 | ||
1360 | } | 1360 | } |
1361 | 1361 | ||
1362 | QString MainWindow::defaultFileName() | 1362 | QString MainWindow::defaultFileName() |
1363 | { | 1363 | { |
1364 | return locateLocal( "data", "korganizer/mycalendar.ics" ); | 1364 | return locateLocal( "data", "korganizer/mycalendar.ics" ); |
1365 | } | 1365 | } |
1366 | QString MainWindow::syncFileName() | 1366 | QString MainWindow::syncFileName() |
1367 | { | 1367 | { |
1368 | #ifdef DESKTOP_VERSION | 1368 | #ifdef DESKTOP_VERSION |
1369 | return locateLocal( "tmp", "synccalendar.ics" ); | 1369 | return locateLocal( "tmp", "synccalendar.ics" ); |
1370 | #else | 1370 | #else |
1371 | return QString( "/tmp/synccalendar.ics" ); | 1371 | return QString( "/tmp/synccalendar.ics" ); |
1372 | #endif | 1372 | #endif |
1373 | } | 1373 | } |
1374 | void MainWindow::updateWeek(QDate seda) | 1374 | void MainWindow::updateWeek(QDate seda) |
1375 | { | 1375 | { |
1376 | int weekNum = 0; | 1376 | int weekNum = 0; |
1377 | QDate d = QDate ( seda.year(), 1,1); | 1377 | QDate d = QDate ( seda.year(), 1,1); |
1378 | seda = seda.addDays( 1-seda.dayOfWeek() );//we are on monday | 1378 | seda = seda.addDays( 1-seda.dayOfWeek() );//we are on monday |
1379 | if ( seda.addDays(6).year() != seda.year() ) { | 1379 | if ( seda.addDays(6).year() != seda.year() ) { |
1380 | if ( seda.year() != d.year() ) { | 1380 | if ( seda.year() != d.year() ) { |
1381 | if ( d.dayOfWeek() > 4 ) | 1381 | if ( d.dayOfWeek() > 4 ) |
1382 | d = QDate ( seda.year(), 1,1); | 1382 | d = QDate ( seda.year(), 1,1); |
1383 | else | 1383 | else |
1384 | weekNum = 1; | 1384 | weekNum = 1; |
1385 | } else { | 1385 | } else { |
1386 | QDate dd( seda.year()+1, 1,1); | 1386 | QDate dd( seda.year()+1, 1,1); |
1387 | if ( dd.dayOfWeek() <= 4 ) | 1387 | if ( dd.dayOfWeek() <= 4 ) |
1388 | weekNum = 1; | 1388 | weekNum = 1; |
1389 | } | 1389 | } |
1390 | } | 1390 | } |
1391 | if ( weekNum == 0 ){ | 1391 | if ( weekNum == 0 ){ |
1392 | int dow = d.dayOfWeek(); | 1392 | int dow = d.dayOfWeek(); |
1393 | if ( dow <= 4 ) | 1393 | if ( dow <= 4 ) |
1394 | d = d.addDays( 1-dow ); | 1394 | d = d.addDays( 1-dow ); |
1395 | else // 5,6,7 | 1395 | else // 5,6,7 |
1396 | d = d.addDays( 8-dow ); | 1396 | d = d.addDays( 8-dow ); |
1397 | // we have the first week of the year.we are on monday | 1397 | // we have the first week of the year.we are on monday |
1398 | weekNum = d.daysTo( seda ) / 7 +1; | 1398 | weekNum = d.daysTo( seda ) / 7 +1; |
1399 | } | 1399 | } |
1400 | 1400 | ||
1401 | mWeekPixmap.fill( mWeekBgColor ); | 1401 | mWeekPixmap.fill( mWeekBgColor ); |
1402 | QPainter p ( &mWeekPixmap ); | 1402 | QPainter p ( &mWeekPixmap ); |
1403 | p.setFont( mWeekFont ); | 1403 | p.setFont( mWeekFont ); |
1404 | p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); | 1404 | p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); |
1405 | p.end(); | 1405 | p.end(); |
1406 | QIconSet icon3 ( mWeekPixmap ); | 1406 | QIconSet icon3 ( mWeekPixmap ); |
1407 | mWeekAction->setIconSet ( icon3 ); | 1407 | mWeekAction->setIconSet ( icon3 ); |
1408 | 1408 | ||
1409 | } | 1409 | } |
1410 | void MainWindow::updateWeekNum(const DateList &selectedDates) | 1410 | void MainWindow::updateWeekNum(const DateList &selectedDates) |
1411 | { | 1411 | { |
1412 | updateWeek( selectedDates.first() ); | 1412 | updateWeek( selectedDates.first() ); |
1413 | } | 1413 | } |
1414 | void MainWindow::processIncidenceSelection( Incidence *incidence ) | 1414 | void MainWindow::processIncidenceSelection( Incidence *incidence ) |
1415 | { | 1415 | { |
1416 | 1416 | ||
1417 | if ( !incidence ) { | 1417 | if ( !incidence ) { |
1418 | enableIncidenceActions( false ); | 1418 | enableIncidenceActions( false ); |
1419 | 1419 | ||
1420 | mNewSubTodoAction->setEnabled( false ); | 1420 | mNewSubTodoAction->setEnabled( false ); |
1421 | setCaptionToDates(); | 1421 | setCaptionToDates(); |
1422 | return; | 1422 | return; |
1423 | 1423 | ||
1424 | } | 1424 | } |
1425 | 1425 | ||
1426 | //KGlobal::locale()->formatDateTime(nextA, true); | 1426 | //KGlobal::locale()->formatDateTime(nextA, true); |
1427 | QString startString = ""; | 1427 | QString startString = ""; |
1428 | if ( incidence->type() != "Todo" ) { | 1428 | if ( incidence->type() != "Todo" ) { |
1429 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { | 1429 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { |
1430 | if ( incidence->doesFloat() ) { | 1430 | if ( incidence->doesFloat() ) { |
1431 | startString += ": "+incidence->dtStartDateStr( true ); | 1431 | startString += ": "+incidence->dtStartDateStr( true ); |
1432 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); | 1432 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); |
1433 | 1433 | ||
1434 | } else { | 1434 | } else { |
1435 | startString = ": "+incidence->dtStartStr(true); | 1435 | startString = ": "+incidence->dtStartStr(true); |
1436 | startString += " --- "+((Event*)incidence)->dtEndStr(true); | 1436 | startString += " --- "+((Event*)incidence)->dtEndStr(true); |
1437 | 1437 | ||
1438 | } | 1438 | } |
1439 | 1439 | ||
1440 | } else { | 1440 | } else { |
1441 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) | 1441 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) |
1442 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ | 1442 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ |
1443 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); | 1443 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); |
1444 | if ( incidence->categories().contains( i18n("Birthday") ) || incidence->categories().contains( i18n("Anniversary") ) ) { | 1444 | if ( incidence->categories().contains( i18n("Birthday") ) || incidence->categories().contains( i18n("Anniversary") ) ) { |
1445 | bool ok; | 1445 | bool ok; |
1446 | QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); | 1446 | QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); |
1447 | if ( ok ) { | 1447 | if ( ok ) { |
1448 | int years = noc.date().year() - incidence->dtStart().date().year(); | 1448 | int years = noc.date().year() - incidence->dtStart().date().year(); |
1449 | startString += i18n(" (%1 y.)"). arg( years ); | 1449 | startString += i18n(" (%1 y.)"). arg( years ); |
1450 | } | 1450 | } |
1451 | } | 1451 | } |
1452 | else | 1452 | else |
1453 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); | 1453 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); |
1454 | } | 1454 | } |
1455 | 1455 | ||
1456 | } | 1456 | } |
1457 | else | 1457 | else |
1458 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); | 1458 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); |
1459 | if ( !incidence->location().isEmpty() ) | 1459 | if ( !incidence->location().isEmpty() ) |
1460 | startString += " (" +incidence->location()+")"; | 1460 | startString += " (" +incidence->location()+")"; |
1461 | setCaption( incidence->summary()+startString); | 1461 | setCaption( incidence->summary()+startString); |
1462 | 1462 | ||
1463 | enableIncidenceActions( true ); | 1463 | enableIncidenceActions( true ); |
1464 | 1464 | ||
1465 | if ( incidence->type() == "Event" ) { | 1465 | if ( incidence->type() == "Event" ) { |
1466 | mShowAction->setText( i18n("Show Event...") ); | 1466 | mShowAction->setText( i18n("Show Event...") ); |
1467 | mEditAction->setText( i18n("Edit Event...") ); | 1467 | mEditAction->setText( i18n("Edit Event...") ); |
1468 | mDeleteAction->setText( i18n("Delete Event...") ); | 1468 | mDeleteAction->setText( i18n("Delete Event...") ); |
1469 | 1469 | ||
1470 | mNewSubTodoAction->setEnabled( false ); | 1470 | mNewSubTodoAction->setEnabled( false ); |
1471 | } else if ( incidence->type() == "Todo" ) { | 1471 | } else if ( incidence->type() == "Todo" ) { |
1472 | mShowAction->setText( i18n("Show Todo...") ); | 1472 | mShowAction->setText( i18n("Show Todo...") ); |
1473 | mEditAction->setText( i18n("Edit Todo...") ); | 1473 | mEditAction->setText( i18n("Edit Todo...") ); |
1474 | mDeleteAction->setText( i18n("Delete Todo...") ); | 1474 | mDeleteAction->setText( i18n("Delete Todo...") ); |
1475 | 1475 | ||
1476 | mNewSubTodoAction->setEnabled( true ); | 1476 | mNewSubTodoAction->setEnabled( true ); |
1477 | } else { | 1477 | } else { |
1478 | mShowAction->setText( i18n("Show...") ); | 1478 | mShowAction->setText( i18n("Show...") ); |
1479 | mShowAction->setText( i18n("Edit...") ); | 1479 | mShowAction->setText( i18n("Edit...") ); |
1480 | mShowAction->setText( i18n("Delete...") ); | 1480 | mShowAction->setText( i18n("Delete...") ); |
1481 | 1481 | ||
1482 | mNewSubTodoAction->setEnabled( false ); | 1482 | mNewSubTodoAction->setEnabled( false ); |
1483 | } | 1483 | } |
1484 | } | 1484 | } |
1485 | 1485 | ||
1486 | void MainWindow::enableIncidenceActions( bool enabled ) | 1486 | void MainWindow::enableIncidenceActions( bool enabled ) |
1487 | { | 1487 | { |
1488 | mShowAction->setEnabled( enabled ); | 1488 | mShowAction->setEnabled( enabled ); |
1489 | mEditAction->setEnabled( enabled ); | 1489 | mEditAction->setEnabled( enabled ); |
1490 | mDeleteAction->setEnabled( enabled ); | 1490 | mDeleteAction->setEnabled( enabled ); |
1491 | 1491 | ||
1492 | mCloneAction->setEnabled( enabled ); | 1492 | mCloneAction->setEnabled( enabled ); |
1493 | mMoveAction->setEnabled( enabled ); | 1493 | mMoveAction->setEnabled( enabled ); |
1494 | mBeamAction->setEnabled( enabled ); | 1494 | mBeamAction->setEnabled( enabled ); |
1495 | mCancelAction->setEnabled( enabled ); | 1495 | mCancelAction->setEnabled( enabled ); |
1496 | } | 1496 | } |
1497 | 1497 | ||
1498 | void MainWindow::importOL() | 1498 | void MainWindow::importOL() |
1499 | { | 1499 | { |
1500 | #ifdef _OL_IMPORT_ | 1500 | #ifdef _OL_IMPORT_ |
1501 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); | 1501 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); |
1502 | id->exec(); | 1502 | id->exec(); |
1503 | delete id; | 1503 | delete id; |
1504 | mView->updateView(); | 1504 | mView->updateView(); |
1505 | #endif | 1505 | #endif |
1506 | } | 1506 | } |
1507 | void MainWindow::importBday() | 1507 | void MainWindow::importBday() |
1508 | { | 1508 | { |
1509 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1509 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1510 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), | 1510 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), |
1511 | i18n("Import!"), i18n("Cancel"), 0, | 1511 | i18n("Import!"), i18n("Cancel"), 0, |
1512 | 0, 1 ); | 1512 | 0, 1 ); |
1513 | if ( result == 0 ) { | 1513 | if ( result == 0 ) { |
1514 | mView->importBday(); | 1514 | mView->importBday(); |
1515 | 1515 | ||
1516 | } | 1516 | } |
1517 | 1517 | ||
1518 | 1518 | ||
1519 | } | 1519 | } |
1520 | void MainWindow::importQtopia() | 1520 | void MainWindow::importQtopia() |
1521 | { | 1521 | { |
1522 | //#ifndef DESKTOP_VERSION | 1522 | //#ifndef DESKTOP_VERSION |
1523 | QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); | 1523 | QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); |
1524 | #ifdef DESKTOP_VERSION | 1524 | #ifdef DESKTOP_VERSION |
1525 | mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); | 1525 | mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); |
1526 | #endif | 1526 | #endif |
1527 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, | 1527 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, |
1528 | i18n("Import!"), i18n("Cancel"), 0, | 1528 | i18n("Import!"), i18n("Cancel"), 0, |
1529 | 0, 1 ); | 1529 | 0, 1 ); |
1530 | if ( result == 0 ) { | 1530 | if ( result == 0 ) { |
1531 | #ifndef DESKTOP_VERSION | 1531 | #ifndef DESKTOP_VERSION |
1532 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); | 1532 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); |
1533 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); | 1533 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); |
1534 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; | 1534 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; |
1535 | #else | 1535 | #else |
1536 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; | 1536 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; |
1537 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; | 1537 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; |
1538 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; | 1538 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; |
1539 | #endif | 1539 | #endif |
1540 | mView->importQtopia( categories, datebook, todolist ); | 1540 | mView->importQtopia( categories, datebook, todolist ); |
1541 | } | 1541 | } |
1542 | #if 0 | 1542 | #if 0 |
1543 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1543 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1544 | i18n("Not supported \non desktop!\n"), | 1544 | i18n("Not supported \non desktop!\n"), |
1545 | i18n("Ok"), i18n("Cancel"), 0, | 1545 | i18n("Ok"), i18n("Cancel"), 0, |
1546 | 0, 1 ); | 1546 | 0, 1 ); |
1547 | 1547 | ||
1548 | #endif | 1548 | #endif |
1549 | } | 1549 | } |
1550 | 1550 | ||
1551 | void MainWindow::saveOnClose() | 1551 | void MainWindow::saveOnClose() |
1552 | { | 1552 | { |
1553 | KOPrefs *p = KOPrefs::instance(); | 1553 | KOPrefs *p = KOPrefs::instance(); |
1554 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); | 1554 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); |
1555 | p->mToolBarUp = iconToolBar->x() > width()/2 || | 1555 | p->mToolBarUp = iconToolBar->x() > width()/2 || |
1556 | iconToolBar->y() > height()/2; | 1556 | iconToolBar->y() > height()/2; |
1557 | mView->writeSettings(); | 1557 | mView->writeSettings(); |
1558 | if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) | 1558 | if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) |
1559 | save(); | 1559 | save(); |
1560 | } | 1560 | } |
1561 | void MainWindow::slotModifiedChanged( bool changed ) | 1561 | void MainWindow::slotModifiedChanged( bool changed ) |
1562 | { | 1562 | { |
1563 | if ( mBlockAtStartup ) | 1563 | if ( mBlockAtStartup ) |
1564 | return; | 1564 | return; |
1565 | 1565 | ||
1566 | int msec; | 1566 | int msec; |
1567 | // we store the changes after 1 minute, | 1567 | // we store the changes after 1 minute, |
1568 | // and for safety reasons after 10 minutes again | 1568 | // and for safety reasons after 10 minutes again |
1569 | if ( !mSyncManager->blockSave() ) | 1569 | if ( !mSyncManager->blockSave() ) |
1570 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; | 1570 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; |
1571 | else | 1571 | else |
1572 | msec = 1000 * 600; | 1572 | msec = 1000 * 600; |
1573 | mSaveTimer.start( msec, true ); // 1 minute | 1573 | mSaveTimer.start( msec, true ); // 1 minute |
1574 | qDebug("KO: Saving File in %d secs!", msec/1000); | 1574 | qDebug("KO: Saving File in %d secs!", msec/1000); |
1575 | mCalendarModifiedFlag = true; | 1575 | mCalendarModifiedFlag = true; |
1576 | } | 1576 | } |
1577 | void MainWindow::saveStopTimer() | 1577 | void MainWindow::saveStopTimer() |
1578 | { | 1578 | { |
1579 | mSaveTimer.stop(); | 1579 | mSaveTimer.stop(); |
1580 | if (mSaveTimer.isActive() ) | 1580 | if (mSaveTimer.isActive() ) |
1581 | qDebug("ti active "); | 1581 | qDebug("ti active "); |
1582 | else | 1582 | else |
1583 | qDebug("KO: Save timer stopped"); | 1583 | qDebug("KO: Save timer stopped"); |
1584 | } | 1584 | } |
1585 | void MainWindow::save() | 1585 | void MainWindow::save() |
1586 | { | 1586 | { |
1587 | if ( !mCalendarModifiedFlag ) { | 1587 | if ( !mCalendarModifiedFlag ) { |
1588 | qDebug("KO: Calendar not modified. Nothing saved."); | 1588 | qDebug("KO: Calendar not modified. Nothing saved."); |
1589 | return; | 1589 | return; |
1590 | } | 1590 | } |
1591 | if ( mSyncManager->blockSave() ) | 1591 | if ( mSyncManager->blockSave() ) |
1592 | return; | 1592 | return; |
1593 | mSyncManager->setBlockSave(true); | 1593 | mSyncManager->setBlockSave(true); |
1594 | if ( mView->checkFileVersion( defaultFileName()) ) { | 1594 | if ( mView->checkFileVersion( defaultFileName()) ) { |
1595 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 1595 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
1596 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); | 1596 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); |
1597 | qDebug("KO: Start saving data to file!"); | 1597 | qDebug("KO: Start saving data to file!"); |
1598 | mView->saveCalendar( defaultFileName() ); | 1598 | mView->saveCalendar( defaultFileName() ); |
1599 | mCalendarModifiedFlag = false; | 1599 | mCalendarModifiedFlag = false; |
1600 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 1600 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
1601 | qDebug("KO: Needed %d ms for saving.",msNeeded ); | 1601 | qDebug("KO: Needed %d ms for saving.",msNeeded ); |
1602 | QString savemes; | 1602 | QString savemes; |
1603 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); | 1603 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); |
1604 | setCaption(savemes); | 1604 | setCaption(savemes); |
1605 | } else | 1605 | } else |
1606 | setCaption(i18n("Saving cancelled!")); | 1606 | setCaption(i18n("Saving cancelled!")); |
1607 | mSyncManager->setBlockSave( false ); | 1607 | mSyncManager->setBlockSave( false ); |
1608 | } | 1608 | } |
1609 | 1609 | ||
1610 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) | 1610 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) |
1611 | { | 1611 | { |
1612 | if ( !e->isAutoRepeat() ) { | 1612 | if ( !e->isAutoRepeat() ) { |
1613 | mFlagKeyPressed = false; | 1613 | mFlagKeyPressed = false; |
1614 | } | 1614 | } |
1615 | } | 1615 | } |
1616 | void MainWindow::keyPressEvent ( QKeyEvent * e ) | 1616 | void MainWindow::keyPressEvent ( QKeyEvent * e ) |
1617 | { | 1617 | { |
1618 | qApp->processEvents(); | 1618 | qApp->processEvents(); |
1619 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { | 1619 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { |
1620 | e->ignore(); | 1620 | e->ignore(); |
1621 | // qDebug(" ignore %d",e->isAutoRepeat() ); | 1621 | // qDebug(" ignore %d",e->isAutoRepeat() ); |
1622 | return; | 1622 | return; |
1623 | } | 1623 | } |
1624 | if (! e->isAutoRepeat() ) | 1624 | if (! e->isAutoRepeat() ) |
1625 | mFlagKeyPressed = true; | 1625 | mFlagKeyPressed = true; |
1626 | KOPrefs *p = KOPrefs::instance(); | 1626 | KOPrefs *p = KOPrefs::instance(); |
1627 | bool showSelectedDates = false; | 1627 | bool showSelectedDates = false; |
1628 | int size; | 1628 | int size; |
1629 | int pro = 0; | 1629 | int pro = 0; |
1630 | //qDebug("MainWindow::keyPressEvent "); | 1630 | //qDebug("MainWindow::keyPressEvent "); |
1631 | switch ( e->key() ) { | 1631 | switch ( e->key() ) { |
1632 | case Qt::Key_Right: | 1632 | case Qt::Key_Right: |
1633 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) | 1633 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
1634 | mView->goNextMonth(); | 1634 | mView->goNextMonth(); |
1635 | else | 1635 | else |
1636 | mView->goNext(); | 1636 | mView->goNext(); |
1637 | showSelectedDates = true; | 1637 | showSelectedDates = true; |
1638 | break; | 1638 | break; |
1639 | case Qt::Key_Left: | 1639 | case Qt::Key_Left: |
1640 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1640 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1641 | mView->goPreviousMonth(); | 1641 | mView->goPreviousMonth(); |
1642 | else | 1642 | else |
1643 | mView->goPrevious(); | 1643 | mView->goPrevious(); |
1644 | showSelectedDates = true; | 1644 | showSelectedDates = true; |
1645 | break; | 1645 | break; |
1646 | case Qt::Key_Down: | 1646 | case Qt::Key_Down: |
1647 | mView->viewManager()->agendaView()->scrollOneHourDown(); | 1647 | mView->viewManager()->agendaView()->scrollOneHourDown(); |
1648 | break; | 1648 | break; |
1649 | case Qt::Key_Up: | 1649 | case Qt::Key_Up: |
1650 | mView->viewManager()->agendaView()->scrollOneHourUp(); | 1650 | mView->viewManager()->agendaView()->scrollOneHourUp(); |
1651 | break; | 1651 | break; |
1652 | case Qt::Key_K: | 1652 | case Qt::Key_K: |
1653 | mView->viewManager()->showMonthViewWeek(); | 1653 | mView->viewManager()->showMonthViewWeek(); |
1654 | break; | 1654 | break; |
1655 | case Qt::Key_I: | 1655 | case Qt::Key_I: |
1656 | mView->showIncidence(); | 1656 | mView->showIncidence(); |
1657 | break; | 1657 | break; |
1658 | case Qt::Key_Delete: | 1658 | case Qt::Key_Delete: |
1659 | case Qt::Key_Backspace: | 1659 | case Qt::Key_Backspace: |
1660 | mView->deleteIncidence(); | 1660 | mView->deleteIncidence(); |
1661 | break; | 1661 | break; |
1662 | case Qt::Key_D: | 1662 | case Qt::Key_D: |
1663 | mView->viewManager()->showDayView(); | 1663 | mView->viewManager()->showDayView(); |
1664 | showSelectedDates = true; | 1664 | showSelectedDates = true; |
1665 | break; | 1665 | break; |
1666 | case Qt::Key_O: | 1666 | case Qt::Key_O: |
1667 | mView->toggleFilerEnabled( ); | 1667 | mView->toggleFilerEnabled( ); |
1668 | break; | 1668 | break; |
1669 | case Qt::Key_0: | 1669 | case Qt::Key_0: |
1670 | case Qt::Key_1: | 1670 | case Qt::Key_1: |
1671 | case Qt::Key_2: | 1671 | case Qt::Key_2: |
1672 | case Qt::Key_3: | 1672 | case Qt::Key_3: |
1673 | case Qt::Key_4: | 1673 | case Qt::Key_4: |
1674 | case Qt::Key_5: | 1674 | case Qt::Key_5: |
1675 | case Qt::Key_6: | 1675 | case Qt::Key_6: |
1676 | case Qt::Key_7: | 1676 | case Qt::Key_7: |
1677 | case Qt::Key_8: | 1677 | case Qt::Key_8: |
1678 | case Qt::Key_9: | 1678 | case Qt::Key_9: |
1679 | pro = e->key()-48; | 1679 | pro = e->key()-48; |
1680 | if ( pro == 0 ) | 1680 | if ( pro == 0 ) |
1681 | pro = 10; | 1681 | pro = 10; |
1682 | if ( e->state() == Qt::ControlButton) | 1682 | if ( e->state() == Qt::ControlButton) |
1683 | pro += 10; | 1683 | pro += 10; |
1684 | break; | 1684 | break; |
1685 | case Qt::Key_M: | 1685 | case Qt::Key_M: |
1686 | mView->viewManager()->showMonthView(); | 1686 | mView->viewManager()->showMonthView(); |
1687 | showSelectedDates = true; | 1687 | showSelectedDates = true; |
1688 | break; | 1688 | break; |
1689 | case Qt::Key_Insert: | 1689 | case Qt::Key_Insert: |
1690 | mView->newEvent(); | 1690 | mView->newEvent(); |
1691 | break; | 1691 | break; |
1692 | case Qt::Key_S : | 1692 | case Qt::Key_S : |
1693 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) | 1693 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
1694 | mView->newSubTodo(); | 1694 | mView->newSubTodo(); |
1695 | else | 1695 | else |
1696 | mView->dialogManager()->showSearchDialog(); | 1696 | mView->dialogManager()->showSearchDialog(); |
1697 | break; | 1697 | break; |
1698 | case Qt::Key_Y : | 1698 | case Qt::Key_Y : |
1699 | case Qt::Key_Z : | 1699 | case Qt::Key_Z : |
1700 | mView->viewManager()->showWorkWeekView(); | 1700 | mView->viewManager()->showWorkWeekView(); |
1701 | showSelectedDates = true; | 1701 | showSelectedDates = true; |
1702 | break; | 1702 | break; |
1703 | case Qt::Key_U : | 1703 | case Qt::Key_U : |
1704 | mView->viewManager()->showWeekView(); | 1704 | mView->viewManager()->showWeekView(); |
1705 | showSelectedDates = true; | 1705 | showSelectedDates = true; |
1706 | break; | 1706 | break; |
1707 | case Qt::Key_H : | 1707 | case Qt::Key_H : |
1708 | keyBindings(); | 1708 | keyBindings(); |
1709 | break; | 1709 | break; |
1710 | case Qt::Key_W: | 1710 | case Qt::Key_W: |
1711 | mView->viewManager()->showWhatsNextView(); | 1711 | mView->viewManager()->showWhatsNextView(); |
1712 | break; | 1712 | break; |
1713 | case Qt::Key_L: | 1713 | case Qt::Key_L: |
1714 | mView->viewManager()->showListView(); | 1714 | mView->viewManager()->showListView(); |
1715 | break; | 1715 | break; |
1716 | case Qt::Key_N: | 1716 | case Qt::Key_N: |
1717 | mView->viewManager()->showNextXView(); | 1717 | mView->viewManager()->showNextXView(); |
1718 | showSelectedDates = true; | 1718 | showSelectedDates = true; |
1719 | break; | 1719 | break; |
1720 | case Qt::Key_V: | 1720 | case Qt::Key_V: |
1721 | mView->viewManager()->showTodoView(); | 1721 | mView->viewManager()->showTodoView(); |
1722 | break; | 1722 | break; |
1723 | case Qt::Key_C: | 1723 | case Qt::Key_C: |
1724 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); | 1724 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); |
1725 | break; | 1725 | break; |
1726 | case Qt::Key_P: | 1726 | case Qt::Key_P: |
1727 | mView->showDatePicker( ); | 1727 | mView->showDatePicker( ); |
1728 | break; | 1728 | break; |
1729 | case Qt::Key_F: | 1729 | case Qt::Key_F: |
1730 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1730 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1731 | mView->editFilters(); | 1731 | mView->editFilters(); |
1732 | else | 1732 | else |
1733 | mView->toggleFilter(); | 1733 | mView->toggleFilter(); |
1734 | break; | 1734 | break; |
1735 | case Qt::Key_X: | 1735 | case Qt::Key_X: |
1736 | mView->toggleDateNavigatorWidget(); | 1736 | mView->toggleDateNavigatorWidget(); |
1737 | break; | 1737 | break; |
1738 | case Qt::Key_Space: | 1738 | case Qt::Key_Space: |
1739 | mView->toggleExpand(); | 1739 | mView->toggleExpand(); |
1740 | break; | 1740 | break; |
1741 | case Qt::Key_A: | 1741 | case Qt::Key_A: |
1742 | mView->toggleAllDaySize(); | 1742 | mView->toggleAllDaySize(); |
1743 | break; | 1743 | break; |
1744 | case Qt::Key_T: | 1744 | case Qt::Key_T: |
1745 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1745 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1746 | mView->newTodo(); | 1746 | mView->newTodo(); |
1747 | else { | 1747 | else { |
1748 | mView->goToday(); | 1748 | mView->goToday(); |
1749 | showSelectedDates = true; | 1749 | showSelectedDates = true; |
1750 | } | 1750 | } |
1751 | break; | 1751 | break; |
1752 | case Qt::Key_J: | 1752 | case Qt::Key_J: |
1753 | mView->viewManager()->showJournalView(); | 1753 | mView->viewManager()->showJournalView(); |
1754 | break; | 1754 | break; |
1755 | case Qt::Key_B: | 1755 | case Qt::Key_B: |
1756 | mView->editIncidenceDescription();; | 1756 | mView->editIncidenceDescription();; |
1757 | break; | 1757 | break; |
1758 | // case Qt::Key_Return: | 1758 | // case Qt::Key_Return: |
1759 | case Qt::Key_E: | 1759 | case Qt::Key_E: |
1760 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1760 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1761 | mView->newEvent(); | 1761 | mView->newEvent(); |
1762 | else | 1762 | else |
1763 | mView->editIncidence(); | 1763 | mView->editIncidence(); |
1764 | break; | 1764 | break; |
1765 | case Qt::Key_Plus: | 1765 | case Qt::Key_Plus: |
1766 | size = p->mHourSize +2; | 1766 | size = p->mHourSize +2; |
1767 | if ( size <= 22 ) | 1767 | if ( size <= 22 ) |
1768 | configureAgenda( size ); | 1768 | configureAgenda( size ); |
1769 | break; | 1769 | break; |
1770 | case Qt::Key_Minus: | 1770 | case Qt::Key_Minus: |
1771 | size = p->mHourSize - 2; | 1771 | size = p->mHourSize - 2; |
1772 | if ( size >= 4 ) | 1772 | if ( size >= 4 ) |
1773 | configureAgenda( size ); | 1773 | configureAgenda( size ); |
1774 | break; | 1774 | break; |
1775 | 1775 | ||
1776 | 1776 | ||
1777 | default: | 1777 | default: |
1778 | e->ignore(); | 1778 | e->ignore(); |
1779 | } | 1779 | } |
1780 | if ( pro > 0 ) { | 1780 | if ( pro > 0 ) { |
1781 | mView->selectFilter( pro-1 ); | 1781 | mView->selectFilter( pro-1 ); |
1782 | } | 1782 | } |
1783 | if ( showSelectedDates ) { | 1783 | if ( showSelectedDates ) { |
1784 | ;// setCaptionToDates(); | 1784 | ;// setCaptionToDates(); |
1785 | } | 1785 | } |
1786 | 1786 | ||
1787 | } | 1787 | } |
1788 | 1788 | ||
1789 | void MainWindow::fillFilterMenu() | 1789 | void MainWindow::fillFilterMenu() |
1790 | { | 1790 | { |
1791 | selectFilterMenu->clear(); | 1791 | selectFilterMenu->clear(); |
1792 | bool disable = false; | 1792 | bool disable = false; |
1793 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); | 1793 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); |
1794 | selectFilterMenu->insertSeparator(); | 1794 | selectFilterMenu->insertSeparator(); |
1795 | if ( mView->filterView()->filtersEnabled() ) { | 1795 | if ( mView->filterView()->filtersEnabled() ) { |
1796 | selectFilterMenu->insertItem(i18n ( "Turn filter off" ), 1 ); | 1796 | selectFilterMenu->insertItem(i18n ( "Turn filter off" ), 1 ); |
1797 | } | 1797 | } |
1798 | else { | 1798 | else { |
1799 | selectFilterMenu->insertItem(i18n ( "Turn filter on" ), 1 ); | 1799 | selectFilterMenu->insertItem(i18n ( "Turn filter on" ), 1 ); |
1800 | disable = true; | 1800 | disable = true; |
1801 | } | 1801 | } |
1802 | selectFilterMenu->insertSeparator(); | 1802 | selectFilterMenu->insertSeparator(); |
1803 | QPtrList<CalFilter> fili = mView->filters(); | 1803 | QPtrList<CalFilter> fili = mView->filters(); |
1804 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 1804 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
1805 | CalFilter *filter = fili.first(); | 1805 | CalFilter *filter = fili.first(); |
1806 | int iii = 2; | 1806 | int iii = 2; |
1807 | while(filter) { | 1807 | while(filter) { |
1808 | selectFilterMenu->insertItem( filter->name(), iii ); | 1808 | selectFilterMenu->insertItem( filter->name(), iii ); |
1809 | if ( filter == curfilter) | 1809 | if ( filter == curfilter) |
1810 | selectFilterMenu->setItemChecked( iii, true ); | 1810 | selectFilterMenu->setItemChecked( iii, true ); |
1811 | if ( disable ) | 1811 | if ( disable ) |
1812 | selectFilterMenu->setItemEnabled( iii, false ); | 1812 | selectFilterMenu->setItemEnabled( iii, false ); |
1813 | filter = fili.next(); | 1813 | filter = fili.next(); |
1814 | ++iii; | 1814 | ++iii; |
1815 | } | 1815 | } |
1816 | } | 1816 | } |
1817 | void MainWindow::selectFilter( int fil ) | 1817 | void MainWindow::selectFilter( int fil ) |
1818 | { | 1818 | { |
1819 | if ( fil == 0 ) { | 1819 | if ( fil == 0 ) { |
1820 | mView->editFilters( ); | 1820 | mView->editFilters( ); |
1821 | } else if ( fil == 1 ){ | 1821 | } else if ( fil == 1 ){ |
1822 | mView->toggleFilerEnabled( ); | 1822 | mView->toggleFilerEnabled( ); |
1823 | } else { | 1823 | } else { |
1824 | mView->selectFilter( fil-2 ); | 1824 | mView->selectFilter( fil-2 ); |
1825 | } | 1825 | } |
1826 | } | 1826 | } |
1827 | void MainWindow::configureToolBar( int item ) | 1827 | void MainWindow::configureToolBar( int item ) |
1828 | { | 1828 | { |
1829 | 1829 | ||
1830 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); | 1830 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); |
1831 | KOPrefs *p = KOPrefs::instance(); | 1831 | KOPrefs *p = KOPrefs::instance(); |
1832 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); | 1832 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); |
1833 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); | 1833 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); |
1834 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); | 1834 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); |
1835 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); | 1835 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); |
1836 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); | 1836 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); |
1837 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); | 1837 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); |
1838 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); | 1838 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); |
1839 | p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); | 1839 | p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); |
1840 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); | 1840 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); |
1841 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); | 1841 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); |
1842 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); | 1842 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); |
1843 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); | 1843 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); |
1844 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); | 1844 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); |
1845 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); | 1845 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); |
1846 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); | 1846 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); |
1847 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); | 1847 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); |
1848 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); | 1848 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); |
1849 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); | 1849 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); |
1850 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); | 1850 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); |
1851 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); | 1851 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); |
1852 | p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); | 1852 | p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); |
1853 | // initActions(); | 1853 | // initActions(); |
1854 | } | 1854 | } |
1855 | 1855 | void MainWindow::setCaption ( const QString & c ) | |
1856 | { | ||
1857 | QString cap = c; | ||
1858 | cap.replace( QRegExp("\n"), " " ); | ||
1859 | cap = cap.stripWhiteSpace(); | ||
1860 | if ( cap.isEmpty() ) | ||
1861 | cap = "KO/Pi"; | ||
1862 | QWidget::setCaption( cap ); | ||
1863 | } | ||
1856 | void MainWindow::setCaptionToDates() | 1864 | void MainWindow::setCaptionToDates() |
1857 | { | 1865 | { |
1858 | QString selDates; | 1866 | QString selDates; |
1859 | selDates = KGlobal::locale()->formatDate(mView->startDate(), true); | 1867 | QDate date = mView->startDate(); |
1868 | if ( ! date.isValid() ) { | ||
1869 | setCaption(""); | ||
1870 | return; | ||
1871 | } | ||
1872 | selDates = KGlobal::locale()->formatDate( date, true); | ||
1860 | if (mView->startDate() < mView->endDate() ) | 1873 | if (mView->startDate() < mView->endDate() ) |
1861 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); | 1874 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); |
1862 | else { | 1875 | else { |
1863 | QString addString; | 1876 | QString addString; |
1864 | if ( mView->startDate() == QDateTime::currentDateTime().date() ) | 1877 | if ( date == QDateTime::currentDateTime().date() ) |
1865 | addString = i18n("Today"); | 1878 | addString = i18n("Today"); |
1866 | else if ( mView->startDate() == QDateTime::currentDateTime().date().addDays(1) ) | 1879 | else if ( date == QDateTime::currentDateTime().date().addDays(1) ) |
1867 | addString = i18n("Tomorrow"); | 1880 | addString = i18n("Tomorrow"); |
1868 | if ( !addString.isEmpty() ) | 1881 | if ( !addString.isEmpty() ) |
1869 | selDates = addString+", "+selDates ; | 1882 | selDates = addString+", "+selDates ; |
1870 | } | 1883 | } |
1871 | setCaption( i18n("Dates: ") + selDates ); | 1884 | setCaption( i18n("Dates: ") + selDates ); |
1872 | 1885 | ||
1873 | } | 1886 | } |
1874 | void MainWindow::showConfigureAgenda( ) | 1887 | void MainWindow::showConfigureAgenda( ) |
1875 | { | 1888 | { |
1876 | int iii; | 1889 | int iii; |
1877 | for ( iii = 1;iii<= 10 ;++iii ){ | 1890 | for ( iii = 1;iii<= 10 ;++iii ){ |
1878 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); | 1891 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); |
1879 | } | 1892 | } |
1880 | configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); | 1893 | configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); |
1881 | } | 1894 | } |
1882 | void MainWindow::configureAgenda( int item ) | 1895 | void MainWindow::configureAgenda( int item ) |
1883 | { | 1896 | { |
1884 | if ( KOPrefs::instance()->mHourSize == item ) | 1897 | if ( KOPrefs::instance()->mHourSize == item ) |
1885 | return; | 1898 | return; |
1886 | KOPrefs::instance()->mHourSize=item; | 1899 | KOPrefs::instance()->mHourSize=item; |
1887 | mView->viewManager()->agendaView()->updateConfig(); | 1900 | mView->viewManager()->agendaView()->updateConfig(); |
1888 | } | 1901 | } |
1889 | 1902 | ||
1890 | void MainWindow::saveCalendar() | 1903 | void MainWindow::saveCalendar() |
1891 | { | 1904 | { |
1892 | QString fn = KOPrefs::instance()->mLastSaveFile; | 1905 | QString fn = KOPrefs::instance()->mLastSaveFile; |
1893 | fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this ); | 1906 | fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this ); |
1894 | 1907 | ||
1895 | if ( fn == "" ) | 1908 | if ( fn == "" ) |
1896 | return; | 1909 | return; |
1897 | QFileInfo info; | 1910 | QFileInfo info; |
1898 | info.setFile( fn ); | 1911 | info.setFile( fn ); |
1899 | QString mes; | 1912 | QString mes; |
1900 | bool createbup = true; | 1913 | bool createbup = true; |
1901 | if ( info. exists() ) { | 1914 | if ( info. exists() ) { |
1902 | mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ; | 1915 | mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ; |
1903 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, | 1916 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, |
1904 | i18n("Overwrite!"), i18n("Cancel"), 0, | 1917 | i18n("Overwrite!"), i18n("Cancel"), 0, |
1905 | 0, 1 ); | 1918 | 0, 1 ); |
1906 | if ( result != 0 ) { | 1919 | if ( result != 0 ) { |
1907 | createbup = false; | 1920 | createbup = false; |
1908 | } | 1921 | } |
1909 | } | 1922 | } |
1910 | if ( createbup ) { | 1923 | if ( createbup ) { |
1911 | mView->saveCalendar( fn ); | 1924 | mView->saveCalendar( fn ); |
1912 | mes = i18n("KO/Pi:Saved %1").arg(fn); | 1925 | mes = i18n("KO/Pi:Saved %1").arg(fn); |
1913 | KOPrefs::instance()->mLastSaveFile = fn; | 1926 | KOPrefs::instance()->mLastSaveFile = fn; |
1914 | setCaption(mes); | 1927 | setCaption(mes); |
1915 | } | 1928 | } |
1916 | } | 1929 | } |
1917 | void MainWindow::loadCalendar() | 1930 | void MainWindow::loadCalendar() |
1918 | { | 1931 | { |
1919 | 1932 | ||
1920 | QString fn = KOPrefs::instance()->mLastLoadFile; | 1933 | QString fn = KOPrefs::instance()->mLastLoadFile; |
1921 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); | 1934 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); |
1922 | 1935 | ||
1923 | if ( fn == "" ) | 1936 | if ( fn == "" ) |
1924 | return; | 1937 | return; |
1925 | QFileInfo info; | 1938 | QFileInfo info; |
1926 | info.setFile( fn ); | 1939 | info.setFile( fn ); |
1927 | QString mess; | 1940 | QString mess; |
1928 | bool loadbup = true; | 1941 | bool loadbup = true; |
1929 | if ( info. exists() ) { | 1942 | if ( info. exists() ) { |
1930 | mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); | 1943 | mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); |
1931 | int result = QMessageBox::warning( this, "KO/Pi: Warning!", | 1944 | int result = QMessageBox::warning( this, "KO/Pi: Warning!", |
1932 | mess, | 1945 | mess, |
1933 | i18n("Load!"), i18n("Cancel"), 0, | 1946 | i18n("Load!"), i18n("Cancel"), 0, |
1934 | 0, 1 ); | 1947 | 0, 1 ); |
1935 | if ( result != 0 ) { | 1948 | if ( result != 0 ) { |
1936 | loadbup = false; | 1949 | loadbup = false; |
1937 | } | 1950 | } |
1938 | } else { | 1951 | } else { |
1939 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1952 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1940 | i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, | 1953 | i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, |
1941 | 0, 1 ); | 1954 | 0, 1 ); |
1942 | 1955 | ||
1943 | return; | 1956 | return; |
1944 | } | 1957 | } |
1945 | if ( loadbup ) { | 1958 | if ( loadbup ) { |
1946 | mView->openCalendar( fn ); | 1959 | mView->openCalendar( fn ); |
1947 | KOPrefs::instance()->mLastLoadFile = fn; | 1960 | KOPrefs::instance()->mLastLoadFile = fn; |
1948 | mess = i18n("KO/Pi:Loaded %1").arg(fn) ; | 1961 | mess = i18n("KO/Pi:Loaded %1").arg(fn) ; |
1949 | setCaption(mess); | 1962 | setCaption(mess); |
1950 | } | 1963 | } |
1951 | 1964 | ||
1952 | } | 1965 | } |
1953 | void MainWindow::quickImportIcal() | 1966 | void MainWindow::quickImportIcal() |
1954 | { | 1967 | { |
1955 | importFile( KOPrefs::instance()->mLastImportFile, false ); | 1968 | importFile( KOPrefs::instance()->mLastImportFile, false ); |
1956 | } | 1969 | } |
1957 | void MainWindow::importFile( QString fn, bool quick ) | 1970 | void MainWindow::importFile( QString fn, bool quick ) |
1958 | { | 1971 | { |
1959 | QFileInfo info; | 1972 | QFileInfo info; |
1960 | info.setFile( fn ); | 1973 | info.setFile( fn ); |
1961 | QString mess; | 1974 | QString mess; |
1962 | bool loadbup = true; | 1975 | bool loadbup = true; |
1963 | if ( !info. exists() ) { | 1976 | if ( !info. exists() ) { |
1964 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); | 1977 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); |
1965 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1978 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1966 | mess ); | 1979 | mess ); |
1967 | return; | 1980 | return; |
1968 | } | 1981 | } |
1969 | int result = 0; | 1982 | int result = 0; |
1970 | if ( !quick ) { | 1983 | if ( !quick ) { |
1971 | mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); | 1984 | mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); |
1972 | result = QMessageBox::warning( this, "KO/Pi: Warning!", | 1985 | result = QMessageBox::warning( this, "KO/Pi: Warning!", |
1973 | mess, | 1986 | mess, |
1974 | "Import", "Cancel", 0, | 1987 | "Import", "Cancel", 0, |
1975 | 0, 1 ); | 1988 | 0, 1 ); |
1976 | } | 1989 | } |
1977 | if ( result == 0 ) { | 1990 | if ( result == 0 ) { |
1978 | if ( mView->openCalendar( fn, true )) { | 1991 | if ( mView->openCalendar( fn, true )) { |
1979 | KOPrefs::instance()->mLastImportFile = fn; | 1992 | KOPrefs::instance()->mLastImportFile = fn; |
1980 | setCaption(i18n("Imported file successfully")); | 1993 | setCaption(i18n("Imported file successfully")); |
1981 | } else { | 1994 | } else { |
1982 | setCaption(i18n("Error importing file")); | 1995 | setCaption(i18n("Error importing file")); |
1983 | } | 1996 | } |
1984 | } | 1997 | } |
1985 | } | 1998 | } |
1986 | 1999 | ||
1987 | void MainWindow::importIcal() | 2000 | void MainWindow::importIcal() |
1988 | { | 2001 | { |
1989 | 2002 | ||
1990 | QString fn =KOPrefs::instance()->mLastImportFile; | 2003 | QString fn =KOPrefs::instance()->mLastImportFile; |
1991 | 2004 | ||
1992 | fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); | 2005 | fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); |
1993 | if ( fn == "" ) | 2006 | if ( fn == "" ) |
1994 | return; | 2007 | return; |
1995 | importFile( fn, true ); | 2008 | importFile( fn, true ); |
1996 | 2009 | ||
1997 | } | 2010 | } |
1998 | 2011 | ||
1999 | void MainWindow::exportVCalendar() | 2012 | void MainWindow::exportVCalendar() |
2000 | { | 2013 | { |
2001 | QString fn = KOPrefs::instance()->mLastVcalFile; | 2014 | QString fn = KOPrefs::instance()->mLastVcalFile; |
2002 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); | 2015 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); |
2003 | if ( fn == "" ) | 2016 | if ( fn == "" ) |
2004 | return; | 2017 | return; |
2005 | QFileInfo info; | 2018 | QFileInfo info; |
2006 | info.setFile( fn ); | 2019 | info.setFile( fn ); |
2007 | QString mes; | 2020 | QString mes; |
2008 | bool createbup = true; | 2021 | bool createbup = true; |
2009 | if ( info. exists() ) { | 2022 | if ( info. exists() ) { |
2010 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); | 2023 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); |
2011 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, | 2024 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, |
2012 | i18n("Overwrite!"), i18n("Cancel"), 0, | 2025 | i18n("Overwrite!"), i18n("Cancel"), 0, |
2013 | 0, 1 ); | 2026 | 0, 1 ); |
2014 | if ( result != 0 ) { | 2027 | if ( result != 0 ) { |
2015 | createbup = false; | 2028 | createbup = false; |
2016 | } | 2029 | } |
2017 | } | 2030 | } |
2018 | if ( createbup ) { | 2031 | if ( createbup ) { |
2019 | if ( mView->exportVCalendar( fn ) ) { | 2032 | if ( mView->exportVCalendar( fn ) ) { |
2020 | KOPrefs::instance()->mLastVcalFile = fn; | 2033 | KOPrefs::instance()->mLastVcalFile = fn; |
2021 | if ( fn.length() > 20 ) | 2034 | if ( fn.length() > 20 ) |
2022 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; | 2035 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; |
2023 | else | 2036 | else |
2024 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); | 2037 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); |
2025 | setCaption(mes); | 2038 | setCaption(mes); |
2026 | } | 2039 | } |
2027 | } | 2040 | } |
2028 | 2041 | ||
2029 | } | 2042 | } |
2030 | QString MainWindow::sentSyncFile() | 2043 | QString MainWindow::sentSyncFile() |
2031 | { | 2044 | { |
2032 | #ifdef DESKTOP_VERSION | 2045 | #ifdef DESKTOP_VERSION |
2033 | return locateLocal( "tmp", "copysynccal.ics" ); | 2046 | return locateLocal( "tmp", "copysynccal.ics" ); |
2034 | #else | 2047 | #else |
2035 | return QString( "/tmp/copysynccal.ics" ); | 2048 | return QString( "/tmp/copysynccal.ics" ); |
2036 | #endif | 2049 | #endif |
2037 | } | 2050 | } |
2038 | 2051 | ||
2039 | void MainWindow::syncFileRequest() | 2052 | void MainWindow::syncFileRequest() |
2040 | { | 2053 | { |
2041 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 2054 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
2042 | mSyncManager->slotSyncMenu( 999 ); | 2055 | mSyncManager->slotSyncMenu( 999 ); |
2043 | } | 2056 | } |
2044 | 2057 | ||
2045 | setCaption(i18n("Saving Data to temp file ..." )); | 2058 | setCaption(i18n("Saving Data to temp file ..." )); |
2046 | mView->saveCalendar( sentSyncFile() ); | 2059 | mView->saveCalendar( sentSyncFile() ); |
2047 | setCaption(i18n("Data saved to temp file!" )); | 2060 | setCaption(i18n("Data saved to temp file!" )); |
2048 | 2061 | ||
2049 | } | 2062 | } |
2050 | void MainWindow::getFile( bool success ) | 2063 | void MainWindow::getFile( bool success ) |
2051 | { | 2064 | { |
2052 | if ( ! success ) { | 2065 | if ( ! success ) { |
2053 | setCaption( i18n("Error receiving file. Nothing changed!") ); | 2066 | setCaption( i18n("Error receiving file. Nothing changed!") ); |
2054 | return; | 2067 | return; |
2055 | } | 2068 | } |
2056 | mView->openCalendar( sentSyncFile() ); | 2069 | mView->openCalendar( sentSyncFile() ); |
2057 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 2070 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
2058 | mSyncManager->slotSyncMenu( 999 ); | 2071 | mSyncManager->slotSyncMenu( 999 ); |
2059 | } | 2072 | } |
2060 | setCaption( i18n("Pi-Sync successful!") ); | 2073 | setCaption( i18n("Pi-Sync successful!") ); |
2061 | } | 2074 | } |
2062 | 2075 | ||
2063 | void MainWindow::printSel( ) | 2076 | void MainWindow::printSel( ) |
2064 | { | 2077 | { |
2065 | mView->viewManager()->agendaView()->agenda()->printSelection(); | 2078 | mView->viewManager()->agendaView()->agenda()->printSelection(); |
2066 | } | 2079 | } |
2067 | 2080 | ||
2068 | void MainWindow::printCal() | 2081 | void MainWindow::printCal() |
2069 | { | 2082 | { |
2070 | mView->print();//mCp->showDialog(); | 2083 | mView->print();//mCp->showDialog(); |
2071 | } | 2084 | } |
2072 | 2085 | ||
2073 | 2086 | ||
2074 | #include "libkdepim/kdatepicker.h" | 2087 | #include "libkdepim/kdatepicker.h" |
2075 | #include <kdatetbl.h> | 2088 | #include <kdatetbl.h> |
2076 | void MainWindow::weekAction() | 2089 | void MainWindow::weekAction() |
2077 | { | 2090 | { |
2078 | int month; | 2091 | int month; |
2079 | KPopupFrame* popup = new KPopupFrame(this); | 2092 | KPopupFrame* popup = new KPopupFrame(this); |
2080 | KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup); | 2093 | KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup); |
2081 | // ----- | 2094 | // ----- |
2082 | picker->resize(picker->sizeHint()); | 2095 | picker->resize(picker->sizeHint()); |
2083 | popup->setMainWidget(picker); | 2096 | popup->setMainWidget(picker); |
2084 | picker->setFocus(); | 2097 | picker->setFocus(); |
2085 | connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); | 2098 | connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); |
2086 | int x = 0; | 2099 | int x = 0; |
2087 | int y = iconToolBar->height(); | 2100 | int y = iconToolBar->height(); |
2088 | int dX = 0; | 2101 | int dX = 0; |
2089 | int dY = 0; | 2102 | int dY = 0; |
2090 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { | 2103 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { |
2091 | if ( iconToolBar->y() > height()/2 ) { | 2104 | if ( iconToolBar->y() > height()/2 ) { |
2092 | dY = picker->sizeHint().height()+8; | 2105 | dY = picker->sizeHint().height()+8; |
2093 | y = 0; | 2106 | y = 0; |
2094 | } | 2107 | } |
2095 | } else { | 2108 | } else { |
2096 | if ( iconToolBar->x() > width()/2 ) { // right side | 2109 | if ( iconToolBar->x() > width()/2 ) { // right side |
2097 | x=0; | 2110 | x=0; |
2098 | dX= picker->sizeHint().width()+8; | 2111 | dX= picker->sizeHint().width()+8; |
2099 | y = 0; | 2112 | y = 0; |
2100 | } else { | 2113 | } else { |
2101 | x= iconToolBar->width(); | 2114 | x= iconToolBar->width(); |
2102 | y = 0; | 2115 | y = 0; |
2103 | } | 2116 | } |
2104 | } | 2117 | } |
2105 | //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); | 2118 | //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); |
2106 | if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)))) | 2119 | if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)))) |
2107 | { | 2120 | { |
2108 | month = picker->getResult(); | 2121 | month = picker->getResult(); |
2109 | emit selectWeek ( month ); | 2122 | emit selectWeek ( month ); |
2110 | //qDebug("weekSelected %d ", month); | 2123 | //qDebug("weekSelected %d ", month); |
2111 | } | 2124 | } |
2112 | delete popup; | 2125 | delete popup; |
2113 | } | 2126 | } |
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 5808700..7604529 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -1,159 +1,160 @@ | |||
1 | #ifndef KORGE_MAINWINDOW_H | 1 | #ifndef KORGE_MAINWINDOW_H |
2 | #define KORGE_MAINWINDOW_H | 2 | #define KORGE_MAINWINDOW_H |
3 | 3 | ||
4 | #include <qmainwindow.h> | 4 | #include <qmainwindow.h> |
5 | #include <qtimer.h> | 5 | #include <qtimer.h> |
6 | #include <qdict.h> | 6 | #include <qdict.h> |
7 | #include <qfile.h> | 7 | #include <qfile.h> |
8 | #include <qmenubar.h> | 8 | #include <qmenubar.h> |
9 | #include <qtextstream.h> | 9 | #include <qtextstream.h> |
10 | #include <qregexp.h> | 10 | #include <qregexp.h> |
11 | 11 | ||
12 | #include <libkcal/incidence.h> | 12 | #include <libkcal/incidence.h> |
13 | #include "simplealarmclient.h" | 13 | #include "simplealarmclient.h" |
14 | #include <ksyncmanager.h> | 14 | #include <ksyncmanager.h> |
15 | #ifndef DESKTOP_VERSION | 15 | #ifndef DESKTOP_VERSION |
16 | #include <qcopchannel_qws.h> | 16 | #include <qcopchannel_qws.h> |
17 | #endif | 17 | #endif |
18 | class QAction; | 18 | class QAction; |
19 | class CalendarView; | 19 | class CalendarView; |
20 | class KSyncProfile; | 20 | class KSyncProfile; |
21 | #ifdef DESKTOP_VERSION | 21 | #ifdef DESKTOP_VERSION |
22 | 22 | ||
23 | #define QPEToolBar QToolBar | 23 | #define QPEToolBar QToolBar |
24 | #define QPEMenuBar QMenuBar | 24 | #define QPEMenuBar QMenuBar |
25 | #endif | 25 | #endif |
26 | class QPEToolBar; | 26 | class QPEToolBar; |
27 | 27 | ||
28 | 28 | ||
29 | namespace KCal { | 29 | namespace KCal { |
30 | class CalendarLocal; | 30 | class CalendarLocal; |
31 | } | 31 | } |
32 | 32 | ||
33 | class KOMenuBar : public QMenuBar | 33 | class KOMenuBar : public QMenuBar |
34 | { | 34 | { |
35 | public: | 35 | public: |
36 | KOMenuBar( QWidget *parent=0 ): QMenuBar (parent ) {;} | 36 | KOMenuBar( QWidget *parent=0 ): QMenuBar (parent ) {;} |
37 | QSize sizeHint () const{ qDebug("sizejint ");return QSize ( 40,25 );} | 37 | QSize sizeHint () const{ qDebug("sizejint ");return QSize ( 40,25 );} |
38 | }; | 38 | }; |
39 | 39 | ||
40 | using namespace KCal; | 40 | using namespace KCal; |
41 | 41 | ||
42 | class MainWindow : public QMainWindow | 42 | class MainWindow : public QMainWindow |
43 | { | 43 | { |
44 | Q_OBJECT | 44 | Q_OBJECT |
45 | public: | 45 | public: |
46 | MainWindow( QWidget *parent = 0, const char *name = 0, QString command = ""); | 46 | MainWindow( QWidget *parent = 0, const char *name = 0, QString command = ""); |
47 | ~MainWindow(); | 47 | ~MainWindow(); |
48 | bool beamReceiveEnabled(); | 48 | bool beamReceiveEnabled(); |
49 | static QString defaultFileName(); | 49 | static QString defaultFileName(); |
50 | static QString syncFileName(); | 50 | static QString syncFileName(); |
51 | static QString resourcePath(); | 51 | static QString resourcePath(); |
52 | public slots: | 52 | public slots: |
53 | void setCaption ( const QString & ); | ||
53 | void updateWeekNum(const KCal::DateList &); | 54 | void updateWeekNum(const KCal::DateList &); |
54 | void updateWeek(QDate); | 55 | void updateWeek(QDate); |
55 | virtual void showMaximized (); | 56 | virtual void showMaximized (); |
56 | void configureAgenda( int ); | 57 | void configureAgenda( int ); |
57 | void recieve( const QCString& msg, const QByteArray& data ); | 58 | void recieve( const QCString& msg, const QByteArray& data ); |
58 | protected slots: | 59 | protected slots: |
59 | void setCaptionToDates(); | 60 | void setCaptionToDates(); |
60 | void weekAction(); | 61 | void weekAction(); |
61 | void about(); | 62 | void about(); |
62 | void licence(); | 63 | void licence(); |
63 | void faq(); | 64 | void faq(); |
64 | void usertrans(); | 65 | void usertrans(); |
65 | void features(); | 66 | void features(); |
66 | void synchowto(); | 67 | void synchowto(); |
67 | void kdesynchowto(); | 68 | void kdesynchowto(); |
68 | void multisynchowto(); | 69 | void multisynchowto(); |
69 | void whatsNew(); | 70 | void whatsNew(); |
70 | void keyBindings(); | 71 | void keyBindings(); |
71 | void aboutAutoSaving();; | 72 | void aboutAutoSaving();; |
72 | void aboutKnownBugs(); | 73 | void aboutKnownBugs(); |
73 | 74 | ||
74 | void processIncidenceSelection( Incidence * ); | 75 | void processIncidenceSelection( Incidence * ); |
75 | 76 | ||
76 | void importQtopia(); | 77 | void importQtopia(); |
77 | void importBday(); | 78 | void importBday(); |
78 | void importOL(); | 79 | void importOL(); |
79 | void importIcal(); | 80 | void importIcal(); |
80 | void importFile( QString, bool ); | 81 | void importFile( QString, bool ); |
81 | void quickImportIcal(); | 82 | void quickImportIcal(); |
82 | 83 | ||
83 | void slotModifiedChanged( bool ); | 84 | void slotModifiedChanged( bool ); |
84 | 85 | ||
85 | void save(); | 86 | void save(); |
86 | void saveStopTimer(); | 87 | void saveStopTimer(); |
87 | void configureToolBar( int ); | 88 | void configureToolBar( int ); |
88 | void printSel(); | 89 | void printSel(); |
89 | void printCal(); | 90 | void printCal(); |
90 | void saveCalendar(); | 91 | void saveCalendar(); |
91 | void loadCalendar(); | 92 | void loadCalendar(); |
92 | void exportVCalendar(); | 93 | void exportVCalendar(); |
93 | void fillFilterMenu(); | 94 | void fillFilterMenu(); |
94 | void selectFilter( int ); | 95 | void selectFilter( int ); |
95 | void exportToPhone( int ); | 96 | void exportToPhone( int ); |
96 | void toggleBeamReceive(); | 97 | void toggleBeamReceive(); |
97 | void disableBR(bool); | 98 | void disableBR(bool); |
98 | signals: | 99 | signals: |
99 | void selectWeek ( int ); | 100 | void selectWeek ( int ); |
100 | private slots: | 101 | private slots: |
101 | void showConfigureAgenda(); | 102 | void showConfigureAgenda(); |
102 | void getFile( bool ); | 103 | void getFile( bool ); |
103 | void syncFileRequest(); | 104 | void syncFileRequest(); |
104 | 105 | ||
105 | protected: | 106 | protected: |
106 | QString sentSyncFile(); | 107 | QString sentSyncFile(); |
107 | void displayText( QString, QString); | 108 | void displayText( QString, QString); |
108 | void enableIncidenceActions( bool ); | 109 | void enableIncidenceActions( bool ); |
109 | 110 | ||
110 | private: | 111 | private: |
111 | bool mBRdisabled; | 112 | bool mBRdisabled; |
112 | #ifndef DESKTOP_VERSION | 113 | #ifndef DESKTOP_VERSION |
113 | QCopChannel* infrared; | 114 | QCopChannel* infrared; |
114 | #endif | 115 | #endif |
115 | QAction* brAction; | 116 | QAction* brAction; |
116 | KSyncManager* mSyncManager; | 117 | KSyncManager* mSyncManager; |
117 | bool mClosed; | 118 | bool mClosed; |
118 | void saveOnClose(); | 119 | void saveOnClose(); |
119 | bool mFlagKeyPressed; | 120 | bool mFlagKeyPressed; |
120 | bool mBlockAtStartup; | 121 | bool mBlockAtStartup; |
121 | QPEToolBar *iconToolBar; | 122 | QPEToolBar *iconToolBar; |
122 | void initActions(); | 123 | void initActions(); |
123 | void setDefaultPreferences(); | 124 | void setDefaultPreferences(); |
124 | void keyPressEvent ( QKeyEvent * ) ; | 125 | void keyPressEvent ( QKeyEvent * ) ; |
125 | void keyReleaseEvent ( QKeyEvent * ) ; | 126 | void keyReleaseEvent ( QKeyEvent * ) ; |
126 | QPopupMenu *configureToolBarMenu; | 127 | QPopupMenu *configureToolBarMenu; |
127 | QPopupMenu *selectFilterMenu; | 128 | QPopupMenu *selectFilterMenu; |
128 | QPopupMenu *configureAgendaMenu, *syncMenu; | 129 | QPopupMenu *configureAgendaMenu, *syncMenu; |
129 | CalendarLocal *mCalendar; | 130 | CalendarLocal *mCalendar; |
130 | CalendarView *mView; | 131 | CalendarView *mView; |
131 | QAction *mNewSubTodoAction; | 132 | QAction *mNewSubTodoAction; |
132 | QAction *mWeekAction; | 133 | QAction *mWeekAction; |
133 | QFont mWeekFont; | 134 | QFont mWeekFont; |
134 | QPixmap mWeekPixmap; | 135 | QPixmap mWeekPixmap; |
135 | QColor mWeekBgColor; | 136 | QColor mWeekBgColor; |
136 | 137 | ||
137 | QAction *mShowAction; | 138 | QAction *mShowAction; |
138 | QAction *mEditAction; | 139 | QAction *mEditAction; |
139 | QAction *mDeleteAction; | 140 | QAction *mDeleteAction; |
140 | QAction *mCloneAction; | 141 | QAction *mCloneAction; |
141 | QAction *mMoveAction; | 142 | QAction *mMoveAction; |
142 | QAction *mBeamAction; | 143 | QAction *mBeamAction; |
143 | QAction *mCancelAction; | 144 | QAction *mCancelAction; |
144 | 145 | ||
145 | QAction *mToggleNav; | 146 | QAction *mToggleNav; |
146 | QAction *mToggleFilter; | 147 | QAction *mToggleFilter; |
147 | QAction *mToggleAllday; | 148 | QAction *mToggleAllday; |
148 | 149 | ||
149 | 150 | ||
150 | void closeEvent( QCloseEvent* ce ); | 151 | void closeEvent( QCloseEvent* ce ); |
151 | SimpleAlarmClient mAlarmClient; | 152 | SimpleAlarmClient mAlarmClient; |
152 | QTimer mSaveTimer; | 153 | QTimer mSaveTimer; |
153 | //bool mBlockSaveFlag; | 154 | //bool mBlockSaveFlag; |
154 | bool mCalendarModifiedFlag; | 155 | bool mCalendarModifiedFlag; |
155 | QPixmap loadPixmap( QString ); | 156 | QPixmap loadPixmap( QString ); |
156 | }; | 157 | }; |
157 | 158 | ||
158 | 159 | ||
159 | #endif | 160 | #endif |