-rw-r--r-- | korganizer/koagendaview.cpp | 8 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 6 | ||||
-rw-r--r-- | korganizer/koviewmanager.h | 2 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 53 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 24 |
5 files changed, 52 insertions, 41 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 05216a7..f54f7bc 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -1,619 +1,619 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qhbox.h> | 24 | #include <qhbox.h> |
25 | #include <qvbox.h> | 25 | #include <qvbox.h> |
26 | #include <qlabel.h> | 26 | #include <qlabel.h> |
27 | #include <qframe.h> | 27 | #include <qframe.h> |
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #ifndef KORG_NOSPLITTER | 29 | #ifndef KORG_NOSPLITTER |
30 | #include <qsplitter.h> | 30 | #include <qsplitter.h> |
31 | #endif | 31 | #endif |
32 | #include <qfont.h> | 32 | #include <qfont.h> |
33 | #include <qfontmetrics.h> | 33 | #include <qfontmetrics.h> |
34 | #include <qpopupmenu.h> | 34 | #include <qpopupmenu.h> |
35 | #include <qtooltip.h> | 35 | #include <qtooltip.h> |
36 | #include <qpainter.h> | 36 | #include <qpainter.h> |
37 | #include <qpushbutton.h> | 37 | #include <qpushbutton.h> |
38 | #include <qapplication.h> | 38 | #include <qapplication.h> |
39 | 39 | ||
40 | #include <kapplication.h> | 40 | #include <kapplication.h> |
41 | #include <KDGanttMinimizeSplitter.h> | 41 | #include <KDGanttMinimizeSplitter.h> |
42 | #include <kdebug.h> | 42 | #include <kdebug.h> |
43 | #include <kstandarddirs.h> | 43 | #include <kstandarddirs.h> |
44 | #include <kiconloader.h> | 44 | #include <kiconloader.h> |
45 | #include <klocale.h> | 45 | #include <klocale.h> |
46 | #include <kconfig.h> | 46 | #include <kconfig.h> |
47 | #include <kglobal.h> | 47 | #include <kglobal.h> |
48 | #include "calendarview.h" | 48 | #include "calendarview.h" |
49 | #include "koviewmanager.h" | 49 | #include "koviewmanager.h" |
50 | 50 | ||
51 | #include <libkcal/calendar.h> | 51 | #include <libkcal/calendar.h> |
52 | #include <libkcal/icaldrag.h> | 52 | #include <libkcal/icaldrag.h> |
53 | #include <libkcal/dndfactory.h> | 53 | #include <libkcal/dndfactory.h> |
54 | 54 | ||
55 | #include <kcalendarsystem.h> | 55 | #include <kcalendarsystem.h> |
56 | 56 | ||
57 | #include "koglobals.h" | 57 | #include "koglobals.h" |
58 | #ifndef KORG_NOPLUGINS | 58 | #ifndef KORG_NOPLUGINS |
59 | #include "kocore.h" | 59 | #include "kocore.h" |
60 | #endif | 60 | #endif |
61 | #include "koprefs.h" | 61 | #include "koprefs.h" |
62 | #include "koagenda.h" | 62 | #include "koagenda.h" |
63 | #include "koagendaitem.h" | 63 | #include "koagendaitem.h" |
64 | #ifndef KORG_NOPRINTER | 64 | #ifndef KORG_NOPRINTER |
65 | #include "calprinter.h" | 65 | #include "calprinter.h" |
66 | #endif | 66 | #endif |
67 | 67 | ||
68 | #include "koagendaview.h" | 68 | #include "koagendaview.h" |
69 | //#include "koagendaview.moc" | 69 | //#include "koagendaview.moc" |
70 | 70 | ||
71 | //extern bool globalFlagBlockPainting; | 71 | //extern bool globalFlagBlockPainting; |
72 | extern int globalFlagBlockAgenda; | 72 | extern int globalFlagBlockAgenda; |
73 | extern int globalFlagBlockStartup; | 73 | extern int globalFlagBlockStartup; |
74 | extern int globalFlagBlockAgendaItemPaint; | 74 | extern int globalFlagBlockAgendaItemPaint; |
75 | extern int globalFlagBlockAgendaItemUpdate; | 75 | extern int globalFlagBlockAgendaItemUpdate; |
76 | extern int globalFlagBlockLabel; | 76 | extern int globalFlagBlockLabel; |
77 | using namespace KOrg; | 77 | using namespace KOrg; |
78 | 78 | ||
79 | TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : | 79 | TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : |
80 | QScrollView(parent,name,f) | 80 | QScrollView(parent,name,f) |
81 | { | 81 | { |
82 | mRows = rows; | 82 | mRows = rows; |
83 | 83 | ||
84 | setMinimumHeight( 20 ); | 84 | setMinimumHeight( 20 ); |
85 | mCellHeight = KOPrefs::instance()->mHourSize*4; | 85 | mCellHeight = KOPrefs::instance()->mHourSize*4; |
86 | 86 | ||
87 | enableClipper(true); | 87 | enableClipper(true); |
88 | 88 | ||
89 | setHScrollBarMode(AlwaysOff); | 89 | setHScrollBarMode(AlwaysOff); |
90 | setVScrollBarMode(AlwaysOff); | 90 | setVScrollBarMode(AlwaysOff); |
91 | 91 | ||
92 | resizeContents(50,mRows * mCellHeight); | 92 | resizeContents(50,mRows * mCellHeight); |
93 | 93 | ||
94 | viewport()->setBackgroundMode( PaletteBackground ); | 94 | viewport()->setBackgroundMode( PaletteBackground ); |
95 | } | 95 | } |
96 | 96 | ||
97 | void TimeLabels::setCellHeight(int height) | 97 | void TimeLabels::setCellHeight(int height) |
98 | { | 98 | { |
99 | mCellHeight = height; | 99 | mCellHeight = height; |
100 | } | 100 | } |
101 | 101 | ||
102 | /* | 102 | /* |
103 | Optimization so that only the "dirty" portion of the scroll view | 103 | Optimization so that only the "dirty" portion of the scroll view |
104 | is redrawn. Unfortunately, this is not called by default paintEvent() method. | 104 | is redrawn. Unfortunately, this is not called by default paintEvent() method. |
105 | */ | 105 | */ |
106 | void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) | 106 | void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) |
107 | { | 107 | { |
108 | 108 | ||
109 | // if ( globalFlagBlockAgenda ) | 109 | // if ( globalFlagBlockAgenda ) |
110 | // return; | 110 | // return; |
111 | // bug: the parameters cx, cy, cw, ch are the areas that need to be | 111 | // bug: the parameters cx, cy, cw, ch are the areas that need to be |
112 | // redrawn, not the area of the widget. unfortunately, this | 112 | // redrawn, not the area of the widget. unfortunately, this |
113 | // code assumes the latter... | 113 | // code assumes the latter... |
114 | 114 | ||
115 | // now, for a workaround... | 115 | // now, for a workaround... |
116 | // these two assignments fix the weird redraw bug | 116 | // these two assignments fix the weird redraw bug |
117 | cx = contentsX() + 2; | 117 | cx = contentsX() + 2; |
118 | cw = contentsWidth() - 2; | 118 | cw = contentsWidth() - 2; |
119 | // end of workaround | 119 | // end of workaround |
120 | 120 | ||
121 | int cell = ((int)(cy/mCellHeight)); | 121 | int cell = ((int)(cy/mCellHeight)); |
122 | int y = cell * mCellHeight; | 122 | int y = cell * mCellHeight; |
123 | QFontMetrics fm = fontMetrics(); | 123 | QFontMetrics fm = fontMetrics(); |
124 | QString hour; | 124 | QString hour; |
125 | QString suffix; | 125 | QString suffix; |
126 | QString fullTime; | 126 | QString fullTime; |
127 | int tW = fm.width("24:00i"); | 127 | int tW = fm.width("24:00i"); |
128 | 128 | ||
129 | while (y < cy + ch) { | 129 | while (y < cy + ch) { |
130 | p->drawLine(cx,y,cx+tW,y); | 130 | p->drawLine(cx,y,cx+tW,y); |
131 | hour.setNum(cell); | 131 | hour.setNum(cell); |
132 | suffix = "am"; | 132 | suffix = "am"; |
133 | 133 | ||
134 | // handle 24h and am/pm time formats | 134 | // handle 24h and am/pm time formats |
135 | if (KGlobal::locale()->use12Clock()) { | 135 | if (KGlobal::locale()->use12Clock()) { |
136 | if (cell > 11) suffix = "pm"; | 136 | if (cell > 11) suffix = "pm"; |
137 | if (cell == 0) hour.setNum(12); | 137 | if (cell == 0) hour.setNum(12); |
138 | if (cell > 12) hour.setNum(cell - 12); | 138 | if (cell > 12) hour.setNum(cell - 12); |
139 | } else { | 139 | } else { |
140 | suffix = ":00"; | 140 | suffix = ":00"; |
141 | } | 141 | } |
142 | 142 | ||
143 | // create string in format of "XX:XX" or "XXpm/am" | 143 | // create string in format of "XX:XX" or "XXpm/am" |
144 | fullTime = hour + suffix; | 144 | fullTime = hour + suffix; |
145 | 145 | ||
146 | // center and draw the time label | 146 | // center and draw the time label |
147 | int timeWidth = fm.width(fullTime+"i"); | 147 | int timeWidth = fm.width(fullTime+"i"); |
148 | int offset = this->width() - timeWidth; | 148 | int offset = this->width() - timeWidth; |
149 | int borderWidth = 5; | 149 | int borderWidth = 5; |
150 | int timeHeight = fm.height(); | 150 | int timeHeight = fm.height(); |
151 | timeHeight = timeHeight + 2 - ( timeHeight / 4 ); | 151 | timeHeight = timeHeight + 2 - ( timeHeight / 4 ); |
152 | p->drawText(cx -borderWidth + offset, y+ timeHeight, fullTime); | 152 | p->drawText(cx -borderWidth + offset, y+ timeHeight, fullTime); |
153 | 153 | ||
154 | // increment indices | 154 | // increment indices |
155 | y += mCellHeight; | 155 | y += mCellHeight; |
156 | cell++; | 156 | cell++; |
157 | } | 157 | } |
158 | } | 158 | } |
159 | 159 | ||
160 | /** | 160 | /** |
161 | Calculates the minimum width. | 161 | Calculates the minimum width. |
162 | */ | 162 | */ |
163 | int TimeLabels::minimumWidth() const | 163 | int TimeLabels::minimumWidth() const |
164 | { | 164 | { |
165 | QFontMetrics fm = fontMetrics(); | 165 | QFontMetrics fm = fontMetrics(); |
166 | 166 | ||
167 | //TODO: calculate this value | 167 | //TODO: calculate this value |
168 | int borderWidth = 4; | 168 | int borderWidth = 4; |
169 | 169 | ||
170 | // the maximum width possible | 170 | // the maximum width possible |
171 | int width = fm.width("88:88x") + borderWidth; | 171 | int width = fm.width("88:88x") + borderWidth; |
172 | 172 | ||
173 | return width; | 173 | return width; |
174 | } | 174 | } |
175 | 175 | ||
176 | /** updates widget's internal state */ | 176 | /** updates widget's internal state */ |
177 | void TimeLabels::updateConfig() | 177 | void TimeLabels::updateConfig() |
178 | { | 178 | { |
179 | // set the font | 179 | // set the font |
180 | // config->setGroup("Fonts"); | 180 | // config->setGroup("Fonts"); |
181 | // QFont font = config->readFontEntry("TimeBar Font"); | 181 | // QFont font = config->readFontEntry("TimeBar Font"); |
182 | setFont(KOPrefs::instance()->mTimeBarFont); | 182 | setFont(KOPrefs::instance()->mTimeBarFont); |
183 | 183 | ||
184 | // update geometry restrictions based on new settings | 184 | // update geometry restrictions based on new settings |
185 | setFixedWidth(minimumWidth()); | 185 | setFixedWidth(minimumWidth()); |
186 | 186 | ||
187 | // update HourSize | 187 | // update HourSize |
188 | mCellHeight = KOPrefs::instance()->mHourSize*4; | 188 | mCellHeight = KOPrefs::instance()->mHourSize*4; |
189 | resizeContents(50,mRows * mCellHeight); | 189 | resizeContents(50,mRows * mCellHeight); |
190 | } | 190 | } |
191 | 191 | ||
192 | /** update time label positions */ | 192 | /** update time label positions */ |
193 | void TimeLabels::positionChanged() | 193 | void TimeLabels::positionChanged() |
194 | { | 194 | { |
195 | int adjustment = mAgenda->contentsY(); | 195 | int adjustment = mAgenda->contentsY(); |
196 | setContentsPos(0, adjustment); | 196 | setContentsPos(0, adjustment); |
197 | } | 197 | } |
198 | 198 | ||
199 | /** */ | 199 | /** */ |
200 | void TimeLabels::setAgenda(KOAgenda* agenda) | 200 | void TimeLabels::setAgenda(KOAgenda* agenda) |
201 | { | 201 | { |
202 | mAgenda = agenda; | 202 | mAgenda = agenda; |
203 | } | 203 | } |
204 | 204 | ||
205 | void TimeLabels::contentsMousePressEvent ( QMouseEvent * e) | 205 | void TimeLabels::contentsMousePressEvent ( QMouseEvent * e) |
206 | { | 206 | { |
207 | mMouseDownY = e->pos().y(); | 207 | mMouseDownY = e->pos().y(); |
208 | mOrgCap = topLevelWidget()->caption(); | 208 | mOrgCap = topLevelWidget()->caption(); |
209 | } | 209 | } |
210 | 210 | ||
211 | void TimeLabels::contentsMouseMoveEvent ( QMouseEvent * e ) | 211 | void TimeLabels::contentsMouseMoveEvent ( QMouseEvent * e ) |
212 | { | 212 | { |
213 | int diff = mMouseDownY - e->pos().y(); | 213 | int diff = mMouseDownY - e->pos().y(); |
214 | if ( diff < 10 && diff > -10 ) | 214 | if ( diff < 10 && diff > -10 ) |
215 | return; | 215 | return; |
216 | int tSize = KOPrefs::instance()->mHourSize + (diff/10) ; | 216 | int tSize = KOPrefs::instance()->mHourSize + (diff/10) ; |
217 | if ( tSize < 4 ) | 217 | if ( tSize < 4 ) |
218 | tSize = 4; | 218 | tSize = 4; |
219 | if ( tSize > 18 ) | 219 | if ( tSize > 22 ) |
220 | tSize = 18; | 220 | tSize = 22; |
221 | tSize = (tSize-2)/2; | 221 | tSize = (tSize-2)/2; |
222 | topLevelWidget()->setCaption(i18n("New Agendasize: %1").arg(tSize)); | 222 | topLevelWidget()->setCaption(i18n("New Agendasize: %1").arg(tSize)); |
223 | 223 | ||
224 | } | 224 | } |
225 | void TimeLabels::contentsMouseReleaseEvent ( QMouseEvent * e ) | 225 | void TimeLabels::contentsMouseReleaseEvent ( QMouseEvent * e ) |
226 | { | 226 | { |
227 | topLevelWidget()->setCaption( mOrgCap ); | 227 | topLevelWidget()->setCaption( mOrgCap ); |
228 | int diff = mMouseDownY - e->pos().y(); | 228 | int diff = mMouseDownY - e->pos().y(); |
229 | if ( diff < 10 && diff > -10 ) | 229 | if ( diff < 10 && diff > -10 ) |
230 | return; | 230 | return; |
231 | int tSize = KOPrefs::instance()->mHourSize + (diff/10); | 231 | int tSize = KOPrefs::instance()->mHourSize + (diff/10); |
232 | if ( tSize < 4 ) | 232 | if ( tSize < 4 ) |
233 | tSize = 4; | 233 | tSize = 4; |
234 | if ( tSize > 18 ) | 234 | if ( tSize > 22 ) |
235 | tSize = 18; | 235 | tSize = 22; |
236 | tSize = (tSize/2)*2; | 236 | tSize = (tSize/2)*2; |
237 | if ( tSize == KOPrefs::instance()->mHourSize ) | 237 | if ( tSize == KOPrefs::instance()->mHourSize ) |
238 | return; | 238 | return; |
239 | KOPrefs::instance()->mHourSize = tSize; | 239 | KOPrefs::instance()->mHourSize = tSize; |
240 | emit scaleChanged(); | 240 | emit scaleChanged(); |
241 | } | 241 | } |
242 | 242 | ||
243 | /** This is called in response to repaint() */ | 243 | /** This is called in response to repaint() */ |
244 | void TimeLabels::paintEvent(QPaintEvent*) | 244 | void TimeLabels::paintEvent(QPaintEvent*) |
245 | { | 245 | { |
246 | 246 | ||
247 | // kdDebug() << "paintevent..." << endl; | 247 | // kdDebug() << "paintevent..." << endl; |
248 | // this is another hack! | 248 | // this is another hack! |
249 | // QPainter painter(this); | 249 | // QPainter painter(this); |
250 | //QString c | 250 | //QString c |
251 | repaintContents(contentsX(), contentsY(), visibleWidth(), visibleHeight()); | 251 | repaintContents(contentsX(), contentsY(), visibleWidth(), visibleHeight()); |
252 | } | 252 | } |
253 | 253 | ||
254 | //////////////////////////////////////////////////////////////////////////// | 254 | //////////////////////////////////////////////////////////////////////////// |
255 | 255 | ||
256 | EventIndicator::EventIndicator(Location loc,QWidget *parent,const char *name) | 256 | EventIndicator::EventIndicator(Location loc,QWidget *parent,const char *name) |
257 | : QFrame(parent,name) | 257 | : QFrame(parent,name) |
258 | { | 258 | { |
259 | mColumns = 1; | 259 | mColumns = 1; |
260 | mTopBox = 0; | 260 | mTopBox = 0; |
261 | mLocation = loc; | 261 | mLocation = loc; |
262 | mTopLayout = 0; | 262 | mTopLayout = 0; |
263 | mPaintWidget = 0; | 263 | mPaintWidget = 0; |
264 | mXOffset = 0; | 264 | mXOffset = 0; |
265 | if (mLocation == Top) mPixmap = SmallIcon("1uparrow"); | 265 | if (mLocation == Top) mPixmap = SmallIcon("1uparrow"); |
266 | else mPixmap = SmallIcon("1downarrow"); | 266 | else mPixmap = SmallIcon("1downarrow"); |
267 | mEnabled.resize(mColumns); | 267 | mEnabled.resize(mColumns); |
268 | if (mLocation == Top) | 268 | if (mLocation == Top) |
269 | setMaximumHeight(0); | 269 | setMaximumHeight(0); |
270 | else | 270 | else |
271 | setMinimumHeight(mPixmap.height()); | 271 | setMinimumHeight(mPixmap.height()); |
272 | } | 272 | } |
273 | 273 | ||
274 | EventIndicator::~EventIndicator() | 274 | EventIndicator::~EventIndicator() |
275 | { | 275 | { |
276 | } | 276 | } |
277 | 277 | ||
278 | void EventIndicator::drawContents(QPainter *p) | 278 | void EventIndicator::drawContents(QPainter *p) |
279 | { | 279 | { |
280 | 280 | ||
281 | // kdDebug() << "======== top: " << contentsRect().top() << " bottom " << // contentsRect().bottom() << " left " << contentsRect().left() << " right " << contentsRect().right() << endl; | 281 | // kdDebug() << "======== top: " << contentsRect().top() << " bottom " << // contentsRect().bottom() << " left " << contentsRect().left() << " right " << contentsRect().right() << endl; |
282 | KDGanttSplitterHandle* han = 0; | 282 | KDGanttSplitterHandle* han = 0; |
283 | if ( mPaintWidget ) | 283 | if ( mPaintWidget ) |
284 | han = mPaintWidget->firstHandle(); | 284 | han = mPaintWidget->firstHandle(); |
285 | if ( ! han ) { | 285 | if ( ! han ) { |
286 | int i; | 286 | int i; |
287 | for(i=0;i<mColumns;++i) { | 287 | for(i=0;i<mColumns;++i) { |
288 | if (mEnabled[i]) { | 288 | if (mEnabled[i]) { |
289 | int cellWidth = contentsRect().right()/mColumns; | 289 | int cellWidth = contentsRect().right()/mColumns; |
290 | int xOffset = KOGlobals::self()->reverseLayout() ? | 290 | int xOffset = KOGlobals::self()->reverseLayout() ? |
291 | (mColumns - 1 - i)*cellWidth + cellWidth/2 -mPixmap.width()/2 : | 291 | (mColumns - 1 - i)*cellWidth + cellWidth/2 -mPixmap.width()/2 : |
292 | i*cellWidth + cellWidth/2 -mPixmap.width()/2; | 292 | i*cellWidth + cellWidth/2 -mPixmap.width()/2; |
293 | p->drawPixmap(QPoint(xOffset,0),mPixmap); | 293 | p->drawPixmap(QPoint(xOffset,0),mPixmap); |
294 | } | 294 | } |
295 | } | 295 | } |
296 | } else { | 296 | } else { |
297 | han->repaint(); | 297 | han->repaint(); |
298 | //mPaintWidget->setBackgroundColor( red ); | 298 | //mPaintWidget->setBackgroundColor( red ); |
299 | 299 | ||
300 | QPainter pa( han ); | 300 | QPainter pa( han ); |
301 | int i; | 301 | int i; |
302 | bool setColor = false; | 302 | bool setColor = false; |
303 | for(i=0;i<mColumns;++i) { | 303 | for(i=0;i<mColumns;++i) { |
304 | if (mEnabled[i]) { | 304 | if (mEnabled[i]) { |
305 | setColor = true; | 305 | setColor = true; |
306 | 306 | ||
307 | int cellWidth = contentsRect().right()/mColumns; | 307 | int cellWidth = contentsRect().right()/mColumns; |
308 | int xOffset = KOGlobals::self()->reverseLayout() ? | 308 | int xOffset = KOGlobals::self()->reverseLayout() ? |
309 | (mColumns - 1 - i)*cellWidth + cellWidth/2 -mPixmap.width()/2 : | 309 | (mColumns - 1 - i)*cellWidth + cellWidth/2 -mPixmap.width()/2 : |
310 | i*cellWidth + cellWidth/2 -mPixmap.width()/2; | 310 | i*cellWidth + cellWidth/2 -mPixmap.width()/2; |
311 | pa.drawPixmap(QPoint(mXOffset + xOffset,0),mPixmap); | 311 | pa.drawPixmap(QPoint(mXOffset + xOffset,0),mPixmap); |
312 | //qDebug("222draw pix %d ",xOffset ); | 312 | //qDebug("222draw pix %d ",xOffset ); |
313 | 313 | ||
314 | } | 314 | } |
315 | 315 | ||
316 | } | 316 | } |
317 | pa.end(); | 317 | pa.end(); |
318 | 318 | ||
319 | } | 319 | } |
320 | } | 320 | } |
321 | 321 | ||
322 | void EventIndicator::setXOffset( int x ) | 322 | void EventIndicator::setXOffset( int x ) |
323 | { | 323 | { |
324 | mXOffset = x; | 324 | mXOffset = x; |
325 | } | 325 | } |
326 | void EventIndicator::setPaintWidget( KDGanttMinimizeSplitter * w ) | 326 | void EventIndicator::setPaintWidget( KDGanttMinimizeSplitter * w ) |
327 | { | 327 | { |
328 | mPaintWidget = w; | 328 | mPaintWidget = w; |
329 | } | 329 | } |
330 | void EventIndicator::changeColumns(int columns) | 330 | void EventIndicator::changeColumns(int columns) |
331 | { | 331 | { |
332 | mColumns = columns; | 332 | mColumns = columns; |
333 | mEnabled.resize(mColumns); | 333 | mEnabled.resize(mColumns); |
334 | 334 | ||
335 | update(); | 335 | update(); |
336 | } | 336 | } |
337 | 337 | ||
338 | void EventIndicator::enableColumn(int column, bool enable) | 338 | void EventIndicator::enableColumn(int column, bool enable) |
339 | { | 339 | { |
340 | mEnabled[column] = enable; | 340 | mEnabled[column] = enable; |
341 | } | 341 | } |
342 | 342 | ||
343 | 343 | ||
344 | //////////////////////////////////////////////////////////////////////////// | 344 | //////////////////////////////////////////////////////////////////////////// |
345 | //////////////////////////////////////////////////////////////////////////// | 345 | //////////////////////////////////////////////////////////////////////////// |
346 | //////////////////////////////////////////////////////////////////////////// | 346 | //////////////////////////////////////////////////////////////////////////// |
347 | 347 | ||
348 | KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : | 348 | KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : |
349 | KOEventView (cal,parent,name) | 349 | KOEventView (cal,parent,name) |
350 | { | 350 | { |
351 | mBlockUpdating = true; | 351 | mBlockUpdating = true; |
352 | mStartHour = 8; | 352 | mStartHour = 8; |
353 | mSelectedDates.append(QDate::currentDate()); | 353 | mSelectedDates.append(QDate::currentDate()); |
354 | 354 | ||
355 | mLayoutDayLabels = 0; | 355 | mLayoutDayLabels = 0; |
356 | mDayLabelsFrame = 0; | 356 | mDayLabelsFrame = 0; |
357 | mDayLabels = 0; | 357 | mDayLabels = 0; |
358 | bool isRTL = KOGlobals::self()->reverseLayout(); | 358 | bool isRTL = KOGlobals::self()->reverseLayout(); |
359 | 359 | ||
360 | if ( KOPrefs::instance()->mVerticalScreen ) { | 360 | if ( KOPrefs::instance()->mVerticalScreen ) { |
361 | mExpandedPixmap = SmallIcon( "1downarrow" ); | 361 | mExpandedPixmap = SmallIcon( "1downarrow" ); |
362 | mNotExpandedPixmap = SmallIcon( "1uparrow" ); | 362 | mNotExpandedPixmap = SmallIcon( "1uparrow" ); |
363 | } else { | 363 | } else { |
364 | mExpandedPixmap = SmallIcon( isRTL ? "1leftarrow" : "1rightarrow" ); | 364 | mExpandedPixmap = SmallIcon( isRTL ? "1leftarrow" : "1rightarrow" ); |
365 | mNotExpandedPixmap = SmallIcon( isRTL ? "1rightarrow" : "1leftarrow" ); | 365 | mNotExpandedPixmap = SmallIcon( isRTL ? "1rightarrow" : "1leftarrow" ); |
366 | } | 366 | } |
367 | 367 | ||
368 | QBoxLayout *topLayout = new QVBoxLayout(this); | 368 | QBoxLayout *topLayout = new QVBoxLayout(this); |
369 | 369 | ||
370 | // Create day name labels for agenda columns | 370 | // Create day name labels for agenda columns |
371 | mDayLabelsFrame = new QHBox(this); | 371 | mDayLabelsFrame = new QHBox(this); |
372 | topLayout->addWidget(mDayLabelsFrame); | 372 | topLayout->addWidget(mDayLabelsFrame); |
373 | mDayLabels = new QFrame (mDayLabelsFrame); | 373 | mDayLabels = new QFrame (mDayLabelsFrame); |
374 | mLayoutDayLabels = new QHBoxLayout(mDayLabels); | 374 | mLayoutDayLabels = new QHBoxLayout(mDayLabels); |
375 | // Create agenda splitter | 375 | // Create agenda splitter |
376 | #ifndef KORG_NOSPLITTER | 376 | #ifndef KORG_NOSPLITTER |
377 | mSplitterAgenda = new QSplitter(Vertical,this); | 377 | mSplitterAgenda = new QSplitter(Vertical,this); |
378 | topLayout->addWidget(mSplitterAgenda); | 378 | topLayout->addWidget(mSplitterAgenda); |
379 | mSplitterAgenda->setOpaqueResize(); | 379 | mSplitterAgenda->setOpaqueResize(); |
380 | 380 | ||
381 | mAllDayFrame = new QHBox(mSplitterAgenda); | 381 | mAllDayFrame = new QHBox(mSplitterAgenda); |
382 | 382 | ||
383 | QWidget *agendaFrame = new QWidget(mSplitterAgenda); | 383 | QWidget *agendaFrame = new QWidget(mSplitterAgenda); |
384 | #else | 384 | #else |
385 | #if 0 | 385 | #if 0 |
386 | QWidget *mainBox = new QWidget( this ); | 386 | QWidget *mainBox = new QWidget( this ); |
387 | topLayout->addWidget( mainBox ); | 387 | topLayout->addWidget( mainBox ); |
388 | QBoxLayout *mainLayout = new QVBoxLayout(mainBox); | 388 | QBoxLayout *mainLayout = new QVBoxLayout(mainBox); |
389 | mAllDayFrame = new QHBox(mainBox); | 389 | mAllDayFrame = new QHBox(mainBox); |
390 | mainLayout->addWidget(mAllDayFrame); | 390 | mainLayout->addWidget(mAllDayFrame); |
391 | mainLayout->setStretchFactor( mAllDayFrame, 0 ); | 391 | mainLayout->setStretchFactor( mAllDayFrame, 0 ); |
392 | mAllDayFrame->setFocusPolicy(NoFocus); | 392 | mAllDayFrame->setFocusPolicy(NoFocus); |
393 | QWidget *agendaFrame = new QWidget(mainBox); | 393 | QWidget *agendaFrame = new QWidget(mainBox); |
394 | mainLayout->addWidget(agendaFrame); | 394 | mainLayout->addWidget(agendaFrame); |
395 | mainLayout->setStretchFactor( agendaFrame, 10 ); | 395 | mainLayout->setStretchFactor( agendaFrame, 10 ); |
396 | 396 | ||
397 | agendaFrame->setFocusPolicy(NoFocus); | 397 | agendaFrame->setFocusPolicy(NoFocus); |
398 | #endif | 398 | #endif |
399 | mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this); | 399 | mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this); |
400 | mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); | 400 | mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); |
401 | topLayout->addWidget( mSplitterAgenda ); | 401 | topLayout->addWidget( mSplitterAgenda ); |
402 | mAllDayFrame = new QHBox(mSplitterAgenda); | 402 | mAllDayFrame = new QHBox(mSplitterAgenda); |
403 | mAllDayFrame->setFocusPolicy(NoFocus); | 403 | mAllDayFrame->setFocusPolicy(NoFocus); |
404 | QWidget *agendaFrame = new QWidget(mSplitterAgenda); | 404 | QWidget *agendaFrame = new QWidget(mSplitterAgenda); |
405 | agendaFrame->setFocusPolicy(NoFocus); | 405 | agendaFrame->setFocusPolicy(NoFocus); |
406 | 406 | ||
407 | #endif | 407 | #endif |
408 | 408 | ||
409 | // Create all-day agenda widget | 409 | // Create all-day agenda widget |
410 | mDummyAllDayLeft = new QVBox( mAllDayFrame ); | 410 | mDummyAllDayLeft = new QVBox( mAllDayFrame ); |
411 | 411 | ||
412 | mExpandButton = new QPushButton(mDummyAllDayLeft); | 412 | mExpandButton = new QPushButton(mDummyAllDayLeft); |
413 | mExpandButton->setPixmap( mNotExpandedPixmap ); | 413 | mExpandButton->setPixmap( mNotExpandedPixmap ); |
414 | int widebut = mExpandButton->sizeHint().width(); | 414 | int widebut = mExpandButton->sizeHint().width(); |
415 | if ( QApplication::desktop()->width() < 480 ) | 415 | if ( QApplication::desktop()->width() < 480 ) |
416 | widebut = widebut*2; | 416 | widebut = widebut*2; |
417 | else | 417 | else |
418 | widebut = (widebut*3) / 2; | 418 | widebut = (widebut*3) / 2; |
419 | //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, | 419 | //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, |
420 | // QSizePolicy::Fixed ) ); | 420 | // QSizePolicy::Fixed ) ); |
421 | mExpandButton->setFixedSize( widebut, widebut); | 421 | mExpandButton->setFixedSize( widebut, widebut); |
422 | connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) ); | 422 | connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) ); |
423 | mExpandButton->setFocusPolicy(NoFocus); | 423 | mExpandButton->setFocusPolicy(NoFocus); |
424 | mAllDayAgenda = new KOAgenda(1,mAllDayFrame); | 424 | mAllDayAgenda = new KOAgenda(1,mAllDayFrame); |
425 | mAllDayAgenda->setFocusPolicy(NoFocus); | 425 | mAllDayAgenda->setFocusPolicy(NoFocus); |
426 | QWidget *dummyAllDayRight = new QWidget(mAllDayFrame); | 426 | QWidget *dummyAllDayRight = new QWidget(mAllDayFrame); |
427 | 427 | ||
428 | // Create event context menu for all day agenda | 428 | // Create event context menu for all day agenda |
429 | mAllDayAgendaPopup = eventPopup(); | 429 | mAllDayAgendaPopup = eventPopup(); |
430 | connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), | 430 | connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), |
431 | mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *))); | 431 | mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *))); |
432 | 432 | ||
433 | // Create agenda frame | 433 | // Create agenda frame |
434 | QGridLayout *agendaLayout = new QGridLayout(agendaFrame,3,3); | 434 | QGridLayout *agendaLayout = new QGridLayout(agendaFrame,3,3); |
435 | // QHBox *agendaFrame = new QHBox(splitterAgenda); | 435 | // QHBox *agendaFrame = new QHBox(splitterAgenda); |
436 | 436 | ||
437 | // create event indicator bars | 437 | // create event indicator bars |
438 | mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame); | 438 | mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame); |
439 | agendaLayout->addWidget(mEventIndicatorTop,0,1); | 439 | agendaLayout->addWidget(mEventIndicatorTop,0,1); |
440 | mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); | 440 | mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); |
441 | mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom, | 441 | mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom, |
442 | agendaFrame); | 442 | agendaFrame); |
443 | agendaLayout->addWidget(mEventIndicatorBottom,2,1); | 443 | agendaLayout->addWidget(mEventIndicatorBottom,2,1); |
444 | QWidget *dummyAgendaRight = new QWidget(agendaFrame); | 444 | QWidget *dummyAgendaRight = new QWidget(agendaFrame); |
445 | agendaLayout->addWidget(dummyAgendaRight,0,2); | 445 | agendaLayout->addWidget(dummyAgendaRight,0,2); |
446 | 446 | ||
447 | // Create time labels | 447 | // Create time labels |
448 | mTimeLabels = new TimeLabels(24,agendaFrame); | 448 | mTimeLabels = new TimeLabels(24,agendaFrame); |
449 | agendaLayout->addWidget(mTimeLabels,1,0); | 449 | agendaLayout->addWidget(mTimeLabels,1,0); |
450 | connect(mTimeLabels,SIGNAL( scaleChanged()), | 450 | connect(mTimeLabels,SIGNAL( scaleChanged()), |
451 | this,SLOT(updateConfig())); | 451 | this,SLOT(updateConfig())); |
452 | 452 | ||
453 | // Create agenda | 453 | // Create agenda |
454 | mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); | 454 | mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); |
455 | agendaLayout->addMultiCellWidget(mAgenda,1,1,1,2); | 455 | agendaLayout->addMultiCellWidget(mAgenda,1,1,1,2); |
456 | agendaLayout->setColStretch(1,1); | 456 | agendaLayout->setColStretch(1,1); |
457 | mAgenda->setFocusPolicy(NoFocus); | 457 | mAgenda->setFocusPolicy(NoFocus); |
458 | // Create event context menu for agenda | 458 | // Create event context menu for agenda |
459 | mAgendaPopup = eventPopup(); | 459 | mAgendaPopup = eventPopup(); |
460 | 460 | ||
461 | mAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")), | 461 | mAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")), |
462 | i18n("Toggle Alarm"),mAgenda, | 462 | i18n("Toggle Alarm"),mAgenda, |
463 | SLOT(popupAlarm()),true); | 463 | SLOT(popupAlarm()),true); |
464 | 464 | ||
465 | 465 | ||
466 | connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), | 466 | connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), |
467 | mAgendaPopup,SLOT(showIncidencePopup(Incidence *))); | 467 | mAgendaPopup,SLOT(showIncidencePopup(Incidence *))); |
468 | 468 | ||
469 | // make connections between dependent widgets | 469 | // make connections between dependent widgets |
470 | mTimeLabels->setAgenda(mAgenda); | 470 | mTimeLabels->setAgenda(mAgenda); |
471 | 471 | ||
472 | // Update widgets to reflect user preferences | 472 | // Update widgets to reflect user preferences |
473 | // updateConfig(); | 473 | // updateConfig(); |
474 | 474 | ||
475 | // createDayLabels(); | 475 | // createDayLabels(); |
476 | 476 | ||
477 | // these blank widgets make the All Day Event box line up with the agenda | 477 | // these blank widgets make the All Day Event box line up with the agenda |
478 | dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); | 478 | dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); |
479 | dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); | 479 | dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); |
480 | mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); | 480 | mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); |
481 | 481 | ||
482 | // Scrolling | 482 | // Scrolling |
483 | connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)), | 483 | connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)), |
484 | mTimeLabels, SLOT(positionChanged())); | 484 | mTimeLabels, SLOT(positionChanged())); |
485 | connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)), | 485 | connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)), |
486 | SLOT(setContentsPos(int))); | 486 | SLOT(setContentsPos(int))); |
487 | 487 | ||
488 | // Create/Show/Edit/Delete Event | 488 | // Create/Show/Edit/Delete Event |
489 | connect(mAgenda,SIGNAL(newEventSignal(int,int)), | 489 | connect(mAgenda,SIGNAL(newEventSignal(int,int)), |
490 | SLOT(newEvent(int,int))); | 490 | SLOT(newEvent(int,int))); |
491 | connect(mAgenda,SIGNAL(newEventSignal(int,int,int,int)), | 491 | connect(mAgenda,SIGNAL(newEventSignal(int,int,int,int)), |
492 | SLOT(newEvent(int,int,int,int))); | 492 | SLOT(newEvent(int,int,int,int))); |
493 | connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int)), | 493 | connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int)), |
494 | SLOT(newEventAllDay(int,int))); | 494 | SLOT(newEventAllDay(int,int))); |
495 | connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int,int,int)), | 495 | connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int,int,int)), |
496 | SLOT(newEventAllDay(int,int))); | 496 | SLOT(newEventAllDay(int,int))); |
497 | connect(mAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), | 497 | connect(mAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), |
498 | SLOT(newTimeSpanSelected(int,int,int,int))); | 498 | SLOT(newTimeSpanSelected(int,int,int,int))); |
499 | connect(mAllDayAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), | 499 | connect(mAllDayAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), |
500 | SLOT(newTimeSpanSelectedAllDay(int,int,int,int))); | 500 | SLOT(newTimeSpanSelectedAllDay(int,int,int,int))); |
501 | connect(mAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); | 501 | connect(mAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); |
502 | connect(mAllDayAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); | 502 | connect(mAllDayAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); |
503 | 503 | ||
504 | connect(mAgenda,SIGNAL(editIncidenceSignal(Incidence *)), | 504 | connect(mAgenda,SIGNAL(editIncidenceSignal(Incidence *)), |
505 | SIGNAL(editIncidenceSignal(Incidence *))); | 505 | SIGNAL(editIncidenceSignal(Incidence *))); |
506 | connect(mAllDayAgenda,SIGNAL(editIncidenceSignal(Incidence *)), | 506 | connect(mAllDayAgenda,SIGNAL(editIncidenceSignal(Incidence *)), |
507 | SIGNAL(editIncidenceSignal(Incidence *))); | 507 | SIGNAL(editIncidenceSignal(Incidence *))); |
508 | connect(mAgenda,SIGNAL(showIncidenceSignal(Incidence *)), | 508 | connect(mAgenda,SIGNAL(showIncidenceSignal(Incidence *)), |
509 | SIGNAL(showIncidenceSignal(Incidence *))); | 509 | SIGNAL(showIncidenceSignal(Incidence *))); |
510 | connect(mAllDayAgenda,SIGNAL(showIncidenceSignal(Incidence *)), | 510 | connect(mAllDayAgenda,SIGNAL(showIncidenceSignal(Incidence *)), |
511 | SIGNAL(showIncidenceSignal(Incidence *))); | 511 | SIGNAL(showIncidenceSignal(Incidence *))); |
512 | connect(mAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), | 512 | connect(mAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), |
513 | SIGNAL(deleteIncidenceSignal(Incidence *))); | 513 | SIGNAL(deleteIncidenceSignal(Incidence *))); |
514 | connect(mAllDayAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), | 514 | connect(mAllDayAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), |
515 | SIGNAL(deleteIncidenceSignal(Incidence *))); | 515 | SIGNAL(deleteIncidenceSignal(Incidence *))); |
516 | 516 | ||
517 | connect(mAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), | 517 | connect(mAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), |
518 | SLOT(updateEventDates(KOAgendaItem *, int ))); | 518 | SLOT(updateEventDates(KOAgendaItem *, int ))); |
519 | connect(mAllDayAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), | 519 | connect(mAllDayAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), |
520 | SLOT(updateEventDates(KOAgendaItem *, int))); | 520 | SLOT(updateEventDates(KOAgendaItem *, int))); |
521 | 521 | ||
522 | // event indicator update | 522 | // event indicator update |
523 | connect(mAgenda,SIGNAL(lowerYChanged(int)), | 523 | connect(mAgenda,SIGNAL(lowerYChanged(int)), |
524 | SLOT(updateEventIndicatorTop(int))); | 524 | SLOT(updateEventIndicatorTop(int))); |
525 | connect(mAgenda,SIGNAL(upperYChanged(int)), | 525 | connect(mAgenda,SIGNAL(upperYChanged(int)), |
526 | SLOT(updateEventIndicatorBottom(int))); | 526 | SLOT(updateEventIndicatorBottom(int))); |
527 | // drag signals | 527 | // drag signals |
528 | /* | 528 | /* |
529 | connect(mAgenda,SIGNAL(startDragSignal(Event *)), | 529 | connect(mAgenda,SIGNAL(startDragSignal(Event *)), |
530 | SLOT(startDrag(Event *))); | 530 | SLOT(startDrag(Event *))); |
531 | connect(mAllDayAgenda,SIGNAL(startDragSignal(Event *)), | 531 | connect(mAllDayAgenda,SIGNAL(startDragSignal(Event *)), |
532 | SLOT(startDrag(Event *))); | 532 | SLOT(startDrag(Event *))); |
533 | */ | 533 | */ |
534 | // synchronize selections | 534 | // synchronize selections |
535 | connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), | 535 | connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), |
536 | mAllDayAgenda, SLOT( deselectItem() ) ); | 536 | mAllDayAgenda, SLOT( deselectItem() ) ); |
537 | connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), | 537 | connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), |
538 | mAgenda, SLOT( deselectItem() ) ); | 538 | mAgenda, SLOT( deselectItem() ) ); |
539 | connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), | 539 | connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), |
540 | SIGNAL( incidenceSelected( Incidence * ) ) ); | 540 | SIGNAL( incidenceSelected( Incidence * ) ) ); |
541 | connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), | 541 | connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), |
542 | SIGNAL( incidenceSelected( Incidence * ) ) ); | 542 | SIGNAL( incidenceSelected( Incidence * ) ) ); |
543 | connect( mAgenda, SIGNAL( resizedSignal() ), | 543 | connect( mAgenda, SIGNAL( resizedSignal() ), |
544 | SLOT( updateConfig( ) ) ); | 544 | SLOT( updateConfig( ) ) ); |
545 | connect( mAgenda, SIGNAL( addToCalSignal(Incidence *, Incidence *) ), | 545 | connect( mAgenda, SIGNAL( addToCalSignal(Incidence *, Incidence *) ), |
546 | SLOT( addToCalSlot(Incidence *, Incidence * ) ) ); | 546 | SLOT( addToCalSlot(Incidence *, Incidence * ) ) ); |
547 | connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ), | 547 | connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ), |
548 | SLOT( addToCalSlot(Incidence * , Incidence *) ) ); | 548 | SLOT( addToCalSlot(Incidence * , Incidence *) ) ); |
549 | // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); | 549 | // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); |
550 | //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); | 550 | //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); |
551 | 551 | ||
552 | 552 | ||
553 | } | 553 | } |
554 | 554 | ||
555 | void KOAgendaView::toggleAllDay() | 555 | void KOAgendaView::toggleAllDay() |
556 | { | 556 | { |
557 | if ( mSplitterAgenda->firstHandle() ) | 557 | if ( mSplitterAgenda->firstHandle() ) |
558 | mSplitterAgenda->firstHandle()->toggle(); | 558 | mSplitterAgenda->firstHandle()->toggle(); |
559 | } | 559 | } |
560 | void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld ) | 560 | void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld ) |
561 | { | 561 | { |
562 | calendar()->addIncidence( inc ); | 562 | calendar()->addIncidence( inc ); |
563 | 563 | ||
564 | if ( incOld ) { | 564 | if ( incOld ) { |
565 | if ( incOld->type() == "Todo" ) | 565 | if ( incOld->type() == "Todo" ) |
566 | emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED ); | 566 | emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED ); |
567 | else | 567 | else |
568 | emit incidenceChanged(incOld, KOGlobals::EVENTEDITED); | 568 | emit incidenceChanged(incOld, KOGlobals::EVENTEDITED); |
569 | } | 569 | } |
570 | 570 | ||
571 | } | 571 | } |
572 | 572 | ||
573 | KOAgendaView::~KOAgendaView() | 573 | KOAgendaView::~KOAgendaView() |
574 | { | 574 | { |
575 | delete mAgendaPopup; | 575 | delete mAgendaPopup; |
576 | delete mAllDayAgendaPopup; | 576 | delete mAllDayAgendaPopup; |
577 | delete KOAgendaItem::paintPix(); | 577 | delete KOAgendaItem::paintPix(); |
578 | delete KOAgendaItem::paintPixSel(); | 578 | delete KOAgendaItem::paintPixSel(); |
579 | } | 579 | } |
580 | void KOAgendaView::resizeEvent( QResizeEvent* e ) | 580 | void KOAgendaView::resizeEvent( QResizeEvent* e ) |
581 | { | 581 | { |
582 | //qDebug("KOAgendaView::resizeEvent( QResizeEvent* e ) %d ", e->size().width()); | 582 | //qDebug("KOAgendaView::resizeEvent( QResizeEvent* e ) %d ", e->size().width()); |
583 | bool uc = false; | 583 | bool uc = false; |
584 | int ow = e->oldSize().width(); | 584 | int ow = e->oldSize().width(); |
585 | int oh = e->oldSize().height(); | 585 | int oh = e->oldSize().height(); |
586 | int w = e->size().width(); | 586 | int w = e->size().width(); |
587 | int h = e->size().height(); | 587 | int h = e->size().height(); |
588 | if ( (ow > oh && w< h ) || (ow < oh && w > h ) ) { | 588 | if ( (ow > oh && w< h ) || (ow < oh && w > h ) ) { |
589 | if ( ! mBlockUpdating && !globalFlagBlockStartup && !globalFlagBlockAgenda ) | 589 | if ( ! mBlockUpdating && !globalFlagBlockStartup && !globalFlagBlockAgenda ) |
590 | uc = true; | 590 | uc = true; |
591 | //qDebug("view changed %d %d %d %d ", ow, oh , w , h); | 591 | //qDebug("view changed %d %d %d %d ", ow, oh , w , h); |
592 | } | 592 | } |
593 | mUpcomingWidth = e->size().width() ; | 593 | mUpcomingWidth = e->size().width() ; |
594 | if ( mBlockUpdating || uc ) { | 594 | if ( mBlockUpdating || uc ) { |
595 | mBlockUpdating = false; | 595 | mBlockUpdating = false; |
596 | //mAgenda->setMinimumSize(800 , 600 ); | 596 | //mAgenda->setMinimumSize(800 , 600 ); |
597 | //qDebug("mAgenda->resize+++++++++++++++ "); | 597 | //qDebug("mAgenda->resize+++++++++++++++ "); |
598 | updateConfig(); | 598 | updateConfig(); |
599 | //qDebug("KOAgendaView::Updating now possible "); | 599 | //qDebug("KOAgendaView::Updating now possible "); |
600 | } else | 600 | } else |
601 | createDayLabels(); | 601 | createDayLabels(); |
602 | //qDebug("resizeEvent end "); | 602 | //qDebug("resizeEvent end "); |
603 | 603 | ||
604 | } | 604 | } |
605 | void KOAgendaView::createDayLabels() | 605 | void KOAgendaView::createDayLabels() |
606 | { | 606 | { |
607 | 607 | ||
608 | if ( mBlockUpdating || globalFlagBlockLabel == 1) { | 608 | if ( mBlockUpdating || globalFlagBlockLabel == 1) { |
609 | // qDebug(" KOAgendaView::createDayLabels() blocked "); | 609 | // qDebug(" KOAgendaView::createDayLabels() blocked "); |
610 | return; | 610 | return; |
611 | 611 | ||
612 | } | 612 | } |
613 | int newHight; | 613 | int newHight; |
614 | 614 | ||
615 | // ### Before deleting and recreating we could check if mSelectedDates changed... | 615 | // ### Before deleting and recreating we could check if mSelectedDates changed... |
616 | // It would remove some flickering and gain speed (since this is called by | 616 | // It would remove some flickering and gain speed (since this is called by |
617 | // each updateView() call) | 617 | // each updateView() call) |
618 | 618 | ||
619 | int maxWid = mUpcomingWidth - mTimeLabels->width()- mAgenda->verticalScrollBar()->width() - 2; | 619 | int maxWid = mUpcomingWidth - mTimeLabels->width()- mAgenda->verticalScrollBar()->width() - 2; |
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index e255b83..94c459b 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -1,588 +1,590 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | 3 | ||
4 | Copyright (c) 2001 | 4 | Copyright (c) 2001 |
5 | Cornelius Schumacher <schumacher@kde.org> | 5 | Cornelius Schumacher <schumacher@kde.org> |
6 | 6 | ||
7 | This program is free software; you can redistribute it and/or modify | 7 | This program is free software; you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by | 8 | it under the terms of the GNU General Public License as published by |
9 | the Free Software Foundation; either version 2 of the License, or | 9 | the Free Software Foundation; either version 2 of the License, or |
10 | (at your option) any later version. | 10 | (at your option) any later version. |
11 | 11 | ||
12 | This program is distributed in the hope that it will be useful, | 12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the |
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. |
16 | 16 | ||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License |
18 | along with this program; if not, write to the Free Software | 18 | along with this program; if not, write to the Free Software |
19 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 19 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
20 | 20 | ||
21 | As a special exception, permission is given to link this program | 21 | As a special exception, permission is given to link this program |
22 | with any edition of Qt, and distribute the resulting executable, | 22 | with any edition of Qt, and distribute the resulting executable, |
23 | without including the source code for Qt in the source distribution. | 23 | without including the source code for Qt in the source distribution. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include <qwidgetstack.h> | 26 | #include <qwidgetstack.h> |
27 | 27 | ||
28 | #include <kconfig.h> | 28 | #include <kconfig.h> |
29 | #include <kglobal.h> | 29 | #include <kglobal.h> |
30 | #ifndef DESKTOP_VERSION | 30 | #ifndef DESKTOP_VERSION |
31 | #include <qpe/qpeapplication.h> | 31 | #include <qpe/qpeapplication.h> |
32 | #else | 32 | #else |
33 | #include <qapplication.h> | 33 | #include <qapplication.h> |
34 | #endif | 34 | #endif |
35 | #include <qdatetime.h> | 35 | #include <qdatetime.h> |
36 | #include "calendarview.h" | 36 | #include "calendarview.h" |
37 | #include "datenavigator.h" | 37 | #include "datenavigator.h" |
38 | #include "kotodoview.h" | 38 | #include "kotodoview.h" |
39 | #include "koagendaview.h" | 39 | #include "koagendaview.h" |
40 | #include "kodialogmanager.h" | 40 | #include "kodialogmanager.h" |
41 | #include "komonthview.h" | 41 | #include "komonthview.h" |
42 | #include "kolistview.h" | 42 | #include "kolistview.h" |
43 | #include "kowhatsnextview.h" | 43 | #include "kowhatsnextview.h" |
44 | #include "kojournalview.h" | 44 | #include "kojournalview.h" |
45 | #include "kotimespanview.h" | 45 | #include "kotimespanview.h" |
46 | #include "koprefs.h" | 46 | #include "koprefs.h" |
47 | #include "navigatorbar.h" | 47 | #include "navigatorbar.h" |
48 | #include "kdatenavigator.h" | 48 | #include "kdatenavigator.h" |
49 | 49 | ||
50 | #include "koviewmanager.h" | 50 | #include "koviewmanager.h" |
51 | //extern bool externFlagMonthviewBlockPainting; | 51 | //extern bool externFlagMonthviewBlockPainting; |
52 | 52 | ||
53 | //bool globalFlagBlockPainting = false; | 53 | //bool globalFlagBlockPainting = false; |
54 | int globalFlagBlockAgenda = 0; | 54 | int globalFlagBlockAgenda = 0; |
55 | int globalFlagBlockLabel = 0; | 55 | int globalFlagBlockLabel = 0; |
56 | int globalFlagBlockAgendaItemPaint = 1; | 56 | int globalFlagBlockAgendaItemPaint = 1; |
57 | int globalFlagBlockAgendaItemUpdate = 1; | 57 | int globalFlagBlockAgendaItemUpdate = 1; |
58 | 58 | ||
59 | 59 | ||
60 | KOViewManager::KOViewManager( CalendarView *mainView ) : | 60 | KOViewManager::KOViewManager( CalendarView *mainView ) : |
61 | QObject(), mMainView( mainView ) | 61 | QObject(), mMainView( mainView ) |
62 | { | 62 | { |
63 | mCurrentView = 0; | 63 | mCurrentView = 0; |
64 | 64 | ||
65 | mWhatsNextView = 0; | 65 | mWhatsNextView = 0; |
66 | mTodoView = 0; | 66 | mTodoView = 0; |
67 | mAgendaView = 0; | 67 | mAgendaView = 0; |
68 | mMonthView = 0; | 68 | mMonthView = 0; |
69 | mListView = 0; | 69 | mListView = 0; |
70 | mJournalView = 0; | 70 | mJournalView = 0; |
71 | mTimeSpanView = 0; | 71 | mTimeSpanView = 0; |
72 | mCurrentAgendaView = 0 ; | 72 | mCurrentAgendaView = 0 ; |
73 | mFlagShowNextxDays = false; | 73 | mFlagShowNextxDays = false; |
74 | } | 74 | } |
75 | 75 | ||
76 | KOViewManager::~KOViewManager() | 76 | KOViewManager::~KOViewManager() |
77 | { | 77 | { |
78 | } | 78 | } |
79 | 79 | ||
80 | 80 | ||
81 | KOrg::BaseView *KOViewManager::currentView() | 81 | KOrg::BaseView *KOViewManager::currentView() |
82 | { | 82 | { |
83 | return mCurrentView; | 83 | return mCurrentView; |
84 | } | 84 | } |
85 | 85 | ||
86 | void KOViewManager::readSettings(KConfig *config) | 86 | void KOViewManager::readSettings(KConfig *config) |
87 | { | 87 | { |
88 | config->setGroup("General"); | 88 | config->setGroup("General"); |
89 | QString view = config->readEntry("Current View"); | 89 | QString view = config->readEntry("Current View"); |
90 | if (view == "WhatsNext") showWhatsNextView(); | 90 | if (view == "WhatsNext") showWhatsNextView(); |
91 | else if (view == "Month") showMonthView(); | 91 | else if (view == "Month") showMonthView(); |
92 | else if (view == "List") showListView(); | 92 | else if (view == "List") showListView(); |
93 | else if (view == "Journal") showJournalView(); | 93 | else if (view == "Journal") showJournalView(); |
94 | else if (view == "TimeSpan") showTimeSpanView(); | 94 | else if (view == "TimeSpan") showTimeSpanView(); |
95 | else if (view == "Todo") showTodoView(); | 95 | else if (view == "Todo") showTodoView(); |
96 | else { | 96 | else { |
97 | showAgendaView(); | 97 | showAgendaView(); |
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | void KOViewManager::writeSettings(KConfig *config) | 101 | void KOViewManager::writeSettings(KConfig *config) |
102 | { | 102 | { |
103 | config->setGroup("General"); | 103 | config->setGroup("General"); |
104 | 104 | ||
105 | QString view; | 105 | QString view; |
106 | if (mCurrentView == mWhatsNextView) view = "WhatsNext"; | 106 | if (mCurrentView == mWhatsNextView) view = "WhatsNext"; |
107 | else if (mCurrentView == mMonthView) view = "Month"; | 107 | else if (mCurrentView == mMonthView) view = "Month"; |
108 | else if (mCurrentView == mListView) view = "List"; | 108 | else if (mCurrentView == mListView) view = "List"; |
109 | else if (mCurrentView == mJournalView) view = "Journal"; | 109 | else if (mCurrentView == mJournalView) view = "Journal"; |
110 | else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; | 110 | else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; |
111 | else if (mCurrentView == mTodoView) view = "Todo"; | 111 | else if (mCurrentView == mTodoView) view = "Todo"; |
112 | else view = "Agenda"; | 112 | else view = "Agenda"; |
113 | 113 | ||
114 | config->writeEntry("Current View",view); | 114 | config->writeEntry("Current View",view); |
115 | 115 | ||
116 | if (mAgendaView) { | 116 | if (mAgendaView) { |
117 | mAgendaView->writeSettings(config); | 117 | mAgendaView->writeSettings(config); |
118 | } | 118 | } |
119 | if (mTimeSpanView) { | 119 | if (mTimeSpanView) { |
120 | mTimeSpanView->writeSettings(config); | 120 | mTimeSpanView->writeSettings(config); |
121 | } | 121 | } |
122 | if (mListView) { | 122 | if (mListView) { |
123 | mListView->writeSettings(config); | 123 | mListView->writeSettings(config); |
124 | } | 124 | } |
125 | if (mTodoView) { | 125 | if (mTodoView) { |
126 | mTodoView->saveLayout(config,"Todo View"); | 126 | mTodoView->saveLayout(config,"Todo View"); |
127 | } | 127 | } |
128 | } | 128 | } |
129 | 129 | ||
130 | void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) | 130 | void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) |
131 | { | 131 | { |
132 | 132 | ||
133 | //mFlagShowNextxDays = false; | 133 | //mFlagShowNextxDays = false; |
134 | //if(view == mCurrentView) return; | 134 | //if(view == mCurrentView) return; |
135 | if ( view == 0 ) { | 135 | if ( view == 0 ) { |
136 | view = mCurrentView; | 136 | view = mCurrentView; |
137 | if ( view == 0 ) | 137 | if ( view == 0 ) |
138 | return; | 138 | return; |
139 | } | 139 | } |
140 | bool full = fullScreen; | 140 | bool full = fullScreen; |
141 | if(view == mCurrentView && view != mWhatsNextView ) { | 141 | if(view == mCurrentView && view != mWhatsNextView ) { |
142 | if ( mCurrentAgendaView < 0 ) | 142 | if ( mCurrentAgendaView < 0 ) |
143 | return; | 143 | return; |
144 | full = mMainView->leftFrame()->isVisible(); | 144 | full = mMainView->leftFrame()->isVisible(); |
145 | } else { | 145 | } else { |
146 | mCurrentView = view; | 146 | mCurrentView = view; |
147 | 147 | ||
148 | // bool full = fullScreen; | 148 | // bool full = fullScreen; |
149 | bool isFull = !mMainView->leftFrame()->isVisible(); | 149 | bool isFull = !mMainView->leftFrame()->isVisible(); |
150 | if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) | 150 | if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) |
151 | full = true; | 151 | full = true; |
152 | if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) | 152 | if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) |
153 | full = false; | 153 | full = false; |
154 | } | 154 | } |
155 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); | 155 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); |
156 | //raiseCurrentView( full ); | 156 | //raiseCurrentView( full ); |
157 | mMainView->processIncidenceSelection( 0 ); | 157 | mMainView->processIncidenceSelection( 0 ); |
158 | mMainView->updateView(); | 158 | mMainView->updateView(); |
159 | raiseCurrentView( full ); | 159 | raiseCurrentView( full ); |
160 | mMainView->adaptNavigationUnits(); | 160 | mMainView->adaptNavigationUnits(); |
161 | } | 161 | } |
162 | 162 | ||
163 | void KOViewManager::raiseCurrentView( bool fullScreen ) | 163 | void KOViewManager::raiseCurrentView( bool fullScreen ) |
164 | { | 164 | { |
165 | //qDebug("raiseCurrentView "); | 165 | //qDebug("raiseCurrentView "); |
166 | mCurrentAgendaView = 0; | 166 | mCurrentAgendaView = 0; |
167 | int wid = mMainView->width() ; | 167 | int wid = mMainView->width() ; |
168 | int hei = mMainView->height(); | 168 | int hei = mMainView->height(); |
169 | if ( mCurrentView == mMonthView ) { | 169 | if ( mCurrentView == mMonthView ) { |
170 | mMainView->navigatorBar()->show(); | 170 | mMainView->navigatorBar()->show(); |
171 | hei -= mMainView->navigatorBar()->sizeHint().height(); | 171 | hei -= mMainView->navigatorBar()->sizeHint().height(); |
172 | //mMainView->navigatorBar()->hide(); | 172 | //mMainView->navigatorBar()->hide(); |
173 | } else { | 173 | } else { |
174 | mMainView->navigatorBar()->hide(); | 174 | mMainView->navigatorBar()->hide(); |
175 | } | 175 | } |
176 | if ( fullScreen ) { | 176 | if ( fullScreen ) { |
177 | mMainView->leftFrame()->hide(); | 177 | mMainView->leftFrame()->hide(); |
178 | } else { | 178 | } else { |
179 | mMainView->leftFrame()->show(); | 179 | mMainView->leftFrame()->show(); |
180 | if ( KOPrefs::instance()->mVerticalScreen ) | 180 | if ( KOPrefs::instance()->mVerticalScreen ) |
181 | hei -= mMainView->leftFrame()->height(); | 181 | hei -= mMainView->leftFrame()->height(); |
182 | else | 182 | else |
183 | wid -= mMainView->leftFrame()->width(); | 183 | wid -= mMainView->leftFrame()->width(); |
184 | } | 184 | } |
185 | 185 | emit signalFullScreen( !fullScreen ); | |
186 | if ( globalFlagBlockAgenda == 5 ) { | 186 | if ( globalFlagBlockAgenda == 5 ) { |
187 | globalFlagBlockAgenda = 4; | 187 | globalFlagBlockAgenda = 4; |
188 | globalFlagBlockAgendaItemPaint = 1; | 188 | globalFlagBlockAgendaItemPaint = 1; |
189 | } | 189 | } |
190 | mMainView->viewStack()->raiseWidget(mCurrentView); | 190 | mMainView->viewStack()->raiseWidget(mCurrentView); |
191 | if ( globalFlagBlockAgenda == 4 ) { | 191 | if ( globalFlagBlockAgenda == 4 ) { |
192 | if ( mCurrentView == mAgendaView ) { | 192 | if ( mCurrentView == mAgendaView ) { |
193 | //globalFlagBlockAgenda =1 ; | 193 | //globalFlagBlockAgenda =1 ; |
194 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) | 194 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) |
195 | mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); | 195 | mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); |
196 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) | 196 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) |
197 | mAgendaView->setStartHour( QTime::currentTime ().hour() ); | 197 | mAgendaView->setStartHour( QTime::currentTime ().hour() ); |
198 | qApp->processEvents(); | 198 | qApp->processEvents(); |
199 | //qDebug("qApp->processEvents() "); | 199 | //qDebug("qApp->processEvents() "); |
200 | globalFlagBlockAgenda = 0; | 200 | globalFlagBlockAgenda = 0; |
201 | mAgendaView->repaintAgenda(); | 201 | mAgendaView->repaintAgenda(); |
202 | 202 | ||
203 | } | 203 | } |
204 | globalFlagBlockAgenda = 0; | 204 | globalFlagBlockAgenda = 0; |
205 | } | 205 | } |
206 | emit signalAgendaView( mCurrentView == mAgendaView ); | ||
206 | //qDebug("raiseCurrentView ende "); | 207 | //qDebug("raiseCurrentView ende "); |
208 | |||
207 | } | 209 | } |
208 | 210 | ||
209 | void KOViewManager::updateView() | 211 | void KOViewManager::updateView() |
210 | { | 212 | { |
211 | // qDebug("KOViewManager::updateView() "); | 213 | // qDebug("KOViewManager::updateView() "); |
212 | // if we are updating mTodoView, we get endless recursion | 214 | // if we are updating mTodoView, we get endless recursion |
213 | if ( mTodoView == mCurrentView ) | 215 | if ( mTodoView == mCurrentView ) |
214 | return; | 216 | return; |
215 | if ( mCurrentView ) mCurrentView->updateView(); | 217 | if ( mCurrentView ) mCurrentView->updateView(); |
216 | 218 | ||
217 | } | 219 | } |
218 | 220 | ||
219 | void KOViewManager::updateView(const QDate &start, const QDate &end) | 221 | void KOViewManager::updateView(const QDate &start, const QDate &end) |
220 | { | 222 | { |
221 | // kdDebug() << "KOViewManager::updateView()" << endl; | 223 | // kdDebug() << "KOViewManager::updateView()" << endl; |
222 | 224 | ||
223 | if (mCurrentView) mCurrentView->showDates(start, end); | 225 | if (mCurrentView) mCurrentView->showDates(start, end); |
224 | 226 | ||
225 | if (mTodoView) mTodoView->updateView(); | 227 | if (mTodoView) mTodoView->updateView(); |
226 | } | 228 | } |
227 | 229 | ||
228 | 230 | ||
229 | void KOViewManager::updateWNview() | 231 | void KOViewManager::updateWNview() |
230 | { | 232 | { |
231 | if ( mCurrentView == mWhatsNextView && mWhatsNextView ) | 233 | if ( mCurrentView == mWhatsNextView && mWhatsNextView ) |
232 | mWhatsNextView->updateView(); | 234 | mWhatsNextView->updateView(); |
233 | 235 | ||
234 | } | 236 | } |
235 | void KOViewManager::showWhatsNextView() | 237 | void KOViewManager::showWhatsNextView() |
236 | { | 238 | { |
237 | if (!mWhatsNextView) { | 239 | if (!mWhatsNextView) { |
238 | mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), | 240 | mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), |
239 | "KOViewManager::WhatsNextView"); | 241 | "KOViewManager::WhatsNextView"); |
240 | mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); | 242 | mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); |
241 | connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); | 243 | connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); |
242 | addView(mWhatsNextView); | 244 | addView(mWhatsNextView); |
243 | connect(this, SIGNAL( printWNV() ), | 245 | connect(this, SIGNAL( printWNV() ), |
244 | mWhatsNextView, SLOT( printMe() ) ); | 246 | mWhatsNextView, SLOT( printMe() ) ); |
245 | } | 247 | } |
246 | globalFlagBlockAgenda = 1; | 248 | globalFlagBlockAgenda = 1; |
247 | showView(mWhatsNextView, true ); | 249 | showView(mWhatsNextView, true ); |
248 | //mWhatsNextView->updateView(); | 250 | //mWhatsNextView->updateView(); |
249 | 251 | ||
250 | } | 252 | } |
251 | 253 | ||
252 | void KOViewManager::showListView() | 254 | void KOViewManager::showListView() |
253 | { | 255 | { |
254 | if (!mListView) { | 256 | if (!mListView) { |
255 | mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); | 257 | mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); |
256 | addView(mListView); | 258 | addView(mListView); |
257 | 259 | ||
258 | connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), | 260 | connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), |
259 | mMainView, SLOT(showIncidence(Incidence *))); | 261 | mMainView, SLOT(showIncidence(Incidence *))); |
260 | connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), | 262 | connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), |
261 | mMainView, SLOT(editIncidence(Incidence *))); | 263 | mMainView, SLOT(editIncidence(Incidence *))); |
262 | connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), | 264 | connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), |
263 | mMainView, SLOT(deleteIncidence(Incidence *))); | 265 | mMainView, SLOT(deleteIncidence(Incidence *))); |
264 | connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), | 266 | connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), |
265 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 267 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
266 | connect( mListView, SIGNAL( signalNewEvent() ), | 268 | connect( mListView, SIGNAL( signalNewEvent() ), |
267 | mMainView, SLOT( newEvent() ) ); | 269 | mMainView, SLOT( newEvent() ) ); |
268 | connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); | 270 | connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); |
269 | connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), | 271 | connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), |
270 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); | 272 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); |
271 | connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), | 273 | connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), |
272 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); | 274 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); |
273 | connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 275 | connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
274 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 276 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
275 | connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 277 | connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
276 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 278 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
277 | } | 279 | } |
278 | // bool temp = mFlagShowNextxDays; | 280 | // bool temp = mFlagShowNextxDays; |
279 | //globalFlagBlockPainting = true; | 281 | //globalFlagBlockPainting = true; |
280 | globalFlagBlockAgenda = 1; | 282 | globalFlagBlockAgenda = 1; |
281 | if ( KOPrefs::instance()->mListViewMonthTimespan ) { | 283 | if ( KOPrefs::instance()->mListViewMonthTimespan ) { |
282 | mMainView->setBlockShowDates( true ); | 284 | mMainView->setBlockShowDates( true ); |
283 | mMainView->dateNavigator()->selectMonth(); | 285 | mMainView->dateNavigator()->selectMonth(); |
284 | mMainView->setBlockShowDates( false ); | 286 | mMainView->setBlockShowDates( false ); |
285 | } | 287 | } |
286 | showView(mListView, KOPrefs::instance()->mFullViewTodo); | 288 | showView(mListView, KOPrefs::instance()->mFullViewTodo); |
287 | //mFlagShowNextxDays = temp; | 289 | //mFlagShowNextxDays = temp; |
288 | } | 290 | } |
289 | 291 | ||
290 | void KOViewManager::showAgendaView( bool fullScreen ) | 292 | void KOViewManager::showAgendaView( bool fullScreen ) |
291 | { | 293 | { |
292 | 294 | ||
293 | mMainView->dialogManager()->hideSearchDialog(); | 295 | mMainView->dialogManager()->hideSearchDialog(); |
294 | // qDebug("KOViewManager::showAgendaView "); | 296 | // qDebug("KOViewManager::showAgendaView "); |
295 | bool full; | 297 | bool full; |
296 | full = fullScreen; | 298 | full = fullScreen; |
297 | if (!mAgendaView) { | 299 | if (!mAgendaView) { |
298 | full = false; | 300 | full = false; |
299 | mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); | 301 | mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); |
300 | addView(mAgendaView); | 302 | addView(mAgendaView); |
301 | #ifndef DESKTOP_VERSION | 303 | #ifndef DESKTOP_VERSION |
302 | QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold ); | 304 | QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold ); |
303 | #endif | 305 | #endif |
304 | connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )), | 306 | connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )), |
305 | mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) )); | 307 | mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) )); |
306 | 308 | ||
307 | // SIGNALS/SLOTS FOR DAY/WEEK VIEW | 309 | // SIGNALS/SLOTS FOR DAY/WEEK VIEW |
308 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)), | 310 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)), |
309 | mMainView, SLOT(newEvent(QDateTime))); | 311 | mMainView, SLOT(newEvent(QDateTime))); |
310 | // connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)), | 312 | // connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)), |
311 | // mMainView, SLOT(newEvent(QDateTime,QDateTime))); | 313 | // mMainView, SLOT(newEvent(QDateTime,QDateTime))); |
312 | connect(mAgendaView,SIGNAL(newEventSignal(QDate)), | 314 | connect(mAgendaView,SIGNAL(newEventSignal(QDate)), |
313 | mMainView, SLOT(newEvent(QDate))); | 315 | mMainView, SLOT(newEvent(QDate))); |
314 | 316 | ||
315 | connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)), | 317 | connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)), |
316 | mMainView, SLOT(editIncidence(Incidence *))); | 318 | mMainView, SLOT(editIncidence(Incidence *))); |
317 | connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)), | 319 | connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)), |
318 | mMainView, SLOT(showIncidence(Incidence *))); | 320 | mMainView, SLOT(showIncidence(Incidence *))); |
319 | connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)), | 321 | connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)), |
320 | mMainView, SLOT(deleteIncidence(Incidence *))); | 322 | mMainView, SLOT(deleteIncidence(Incidence *))); |
321 | 323 | ||
322 | connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ), | 324 | connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ), |
323 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 325 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
324 | 326 | ||
325 | connect(mAgendaView, SIGNAL( toggleExpand() ), | 327 | connect(mAgendaView, SIGNAL( toggleExpand() ), |
326 | mMainView, SLOT( toggleExpand() ) ); | 328 | mMainView, SLOT( toggleExpand() ) ); |
327 | 329 | ||
328 | connect(mMainView, SIGNAL( calendarViewExpanded( bool ) ), | 330 | connect(mMainView, SIGNAL( calendarViewExpanded( bool ) ), |
329 | mAgendaView, SLOT( setExpandedButton( bool ) ) ); | 331 | mAgendaView, SLOT( setExpandedButton( bool ) ) ); |
330 | connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ), | 332 | connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ), |
331 | mMainView, SLOT(cloneIncidence(Incidence *) ) ) ; | 333 | mMainView, SLOT(cloneIncidence(Incidence *) ) ) ; |
332 | connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ), | 334 | connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ), |
333 | mMainView, SLOT(cancelIncidence(Incidence *) ) ) ; | 335 | mMainView, SLOT(cancelIncidence(Incidence *) ) ) ; |
334 | connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig())); | 336 | connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig())); |
335 | connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView, | 337 | connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView, |
336 | SLOT( updateTodo( Todo *, int ) ) ); | 338 | SLOT( updateTodo( Todo *, int ) ) ); |
337 | connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )), | 339 | connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )), |
338 | mMainView, SIGNAL( todoModified( Todo *, int ))); | 340 | mMainView, SIGNAL( todoModified( Todo *, int ))); |
339 | connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 341 | connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
340 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 342 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
341 | connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 343 | connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
342 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 344 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
343 | mAgendaView->readSettings(); | 345 | mAgendaView->readSettings(); |
344 | mAgendaView->updateConfig(); | 346 | mAgendaView->updateConfig(); |
345 | } | 347 | } |
346 | 348 | ||
347 | showView( mAgendaView, full); | 349 | showView( mAgendaView, full); |
348 | 350 | ||
349 | } | 351 | } |
350 | 352 | ||
351 | void KOViewManager::showDayView() | 353 | void KOViewManager::showDayView() |
352 | { | 354 | { |
353 | mFlagShowNextxDays = false; | 355 | mFlagShowNextxDays = false; |
354 | globalFlagBlockLabel = 1; | 356 | globalFlagBlockLabel = 1; |
355 | globalFlagBlockAgenda = 1; | 357 | globalFlagBlockAgenda = 1; |
356 | if ( mCurrentAgendaView != 1 ) | 358 | if ( mCurrentAgendaView != 1 ) |
357 | mCurrentAgendaView = -1; | 359 | mCurrentAgendaView = -1; |
358 | showAgendaView(); | 360 | showAgendaView(); |
359 | qApp->processEvents(); | 361 | qApp->processEvents(); |
360 | globalFlagBlockAgenda = 2; | 362 | globalFlagBlockAgenda = 2; |
361 | globalFlagBlockLabel = 0; | 363 | globalFlagBlockLabel = 0; |
362 | mMainView->dateNavigator()->selectDates( 1 ); | 364 | mMainView->dateNavigator()->selectDates( 1 ); |
363 | mCurrentAgendaView = 1 ; | 365 | mCurrentAgendaView = 1 ; |
364 | 366 | ||
365 | } | 367 | } |
366 | 368 | ||
367 | void KOViewManager::showWorkWeekView() | 369 | void KOViewManager::showWorkWeekView() |
368 | { | 370 | { |
369 | mFlagShowNextxDays = false; | 371 | mFlagShowNextxDays = false; |
370 | globalFlagBlockAgenda = 1; | 372 | globalFlagBlockAgenda = 1; |
371 | globalFlagBlockLabel = 1; | 373 | globalFlagBlockLabel = 1; |
372 | if ( mCurrentAgendaView != 5 ) | 374 | if ( mCurrentAgendaView != 5 ) |
373 | mCurrentAgendaView = -1; | 375 | mCurrentAgendaView = -1; |
374 | showAgendaView(); | 376 | showAgendaView(); |
375 | qApp->processEvents(); | 377 | qApp->processEvents(); |
376 | globalFlagBlockAgenda = 2; | 378 | globalFlagBlockAgenda = 2; |
377 | globalFlagBlockLabel = 0; | 379 | globalFlagBlockLabel = 0; |
378 | mMainView->dateNavigator()->selectWorkWeek(); | 380 | mMainView->dateNavigator()->selectWorkWeek(); |
379 | mCurrentAgendaView = 5 ; | 381 | mCurrentAgendaView = 5 ; |
380 | 382 | ||
381 | } | 383 | } |
382 | 384 | ||
383 | void KOViewManager::showWeekView() | 385 | void KOViewManager::showWeekView() |
384 | { | 386 | { |
385 | /* | 387 | /* |
386 | globalFlagBlockAgenda = 2; | 388 | globalFlagBlockAgenda = 2; |
387 | qDebug("4globalFlagBlockAgenda = 2; "); | 389 | qDebug("4globalFlagBlockAgenda = 2; "); |
388 | //globalFlagBlockPainting = true; | 390 | //globalFlagBlockPainting = true; |
389 | mMainView->dateNavigator()->selectWeek(); | 391 | mMainView->dateNavigator()->selectWeek(); |
390 | showAgendaView(); | 392 | showAgendaView(); |
391 | */ | 393 | */ |
392 | 394 | ||
393 | 395 | ||
394 | mFlagShowNextxDays = false; | 396 | mFlagShowNextxDays = false; |
395 | globalFlagBlockAgenda = 1; | 397 | globalFlagBlockAgenda = 1; |
396 | globalFlagBlockLabel = 1; | 398 | globalFlagBlockLabel = 1; |
397 | if ( mCurrentAgendaView != 7 ) | 399 | if ( mCurrentAgendaView != 7 ) |
398 | mCurrentAgendaView = -1; | 400 | mCurrentAgendaView = -1; |
399 | showAgendaView(); | 401 | showAgendaView(); |
400 | qApp->processEvents(); | 402 | qApp->processEvents(); |
401 | globalFlagBlockAgenda = 2; | 403 | globalFlagBlockAgenda = 2; |
402 | globalFlagBlockLabel = 0; | 404 | globalFlagBlockLabel = 0; |
403 | mMainView->dateNavigator()->selectWeek(); | 405 | mMainView->dateNavigator()->selectWeek(); |
404 | mCurrentAgendaView = 7 ; | 406 | mCurrentAgendaView = 7 ; |
405 | } | 407 | } |
406 | 408 | ||
407 | void KOViewManager::showNextXView() | 409 | void KOViewManager::showNextXView() |
408 | { | 410 | { |
409 | 411 | ||
410 | globalFlagBlockAgenda = 1; | 412 | globalFlagBlockAgenda = 1; |
411 | if ( mCurrentAgendaView != 3 ) | 413 | if ( mCurrentAgendaView != 3 ) |
412 | mCurrentAgendaView = -1; | 414 | mCurrentAgendaView = -1; |
413 | showAgendaView(KOPrefs::instance()->mFullViewMonth); | 415 | showAgendaView(KOPrefs::instance()->mFullViewMonth); |
414 | globalFlagBlockAgenda = 2; | 416 | globalFlagBlockAgenda = 2; |
415 | mMainView->dateNavigator()->selectDates( QDate::currentDate(), | 417 | mMainView->dateNavigator()->selectDates( QDate::currentDate(), |
416 | KOPrefs::instance()->mNextXDays ); | 418 | KOPrefs::instance()->mNextXDays ); |
417 | mFlagShowNextxDays = true; | 419 | mFlagShowNextxDays = true; |
418 | mCurrentAgendaView = 3 ; | 420 | mCurrentAgendaView = 3 ; |
419 | } | 421 | } |
420 | bool KOViewManager::showsNextDays() | 422 | bool KOViewManager::showsNextDays() |
421 | { | 423 | { |
422 | return mFlagShowNextxDays; | 424 | return mFlagShowNextxDays; |
423 | } | 425 | } |
424 | void KOViewManager::showMonthView() | 426 | void KOViewManager::showMonthView() |
425 | { | 427 | { |
426 | if (!mMonthView) { | 428 | if (!mMonthView) { |
427 | mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); | 429 | mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); |
428 | 430 | ||
429 | addView(mMonthView); | 431 | addView(mMonthView); |
430 | // mMonthView->show(); | 432 | // mMonthView->show(); |
431 | // SIGNALS/SLOTS FOR MONTH VIEW | 433 | // SIGNALS/SLOTS FOR MONTH VIEW |
432 | connect(mMonthView, SIGNAL(newEventSignal(QDateTime)), | 434 | connect(mMonthView, SIGNAL(newEventSignal(QDateTime)), |
433 | mMainView, SLOT(newEvent(QDateTime))); | 435 | mMainView, SLOT(newEvent(QDateTime))); |
434 | 436 | ||
435 | connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)), | 437 | connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)), |
436 | mMainView, SLOT(showIncidence(Incidence *))); | 438 | mMainView, SLOT(showIncidence(Incidence *))); |
437 | connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)), | 439 | connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)), |
438 | mMainView, SLOT(editIncidence(Incidence *))); | 440 | mMainView, SLOT(editIncidence(Incidence *))); |
439 | connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), | 441 | connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), |
440 | mMainView, SLOT(deleteIncidence(Incidence *))); | 442 | mMainView, SLOT(deleteIncidence(Incidence *))); |
441 | 443 | ||
442 | connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), | 444 | connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), |
443 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 445 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
444 | connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), | 446 | connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), |
445 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); | 447 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); |
446 | connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), | 448 | connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), |
447 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); | 449 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); |
448 | 450 | ||
449 | connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 451 | connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
450 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 452 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
451 | connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 453 | connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
452 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 454 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
453 | connect( mMonthView, SIGNAL( selectWeekNum( int ) ), | 455 | connect( mMonthView, SIGNAL( selectWeekNum( int ) ), |
454 | mMainView, SLOT ( selectWeekNum( int ) ) ); | 456 | mMainView, SLOT ( selectWeekNum( int ) ) ); |
455 | connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), | 457 | connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), |
456 | mMainView, SLOT ( showDay( QDate ) ) ); | 458 | mMainView, SLOT ( showDay( QDate ) ) ); |
457 | connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); | 459 | connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); |
458 | mMonthView->updateConfig(); | 460 | mMonthView->updateConfig(); |
459 | } | 461 | } |
460 | 462 | ||
461 | globalFlagBlockAgenda = 1; | 463 | globalFlagBlockAgenda = 1; |
462 | //mFlagShowNextxDays = false; | 464 | //mFlagShowNextxDays = false; |
463 | // if(mMonthView == mCurrentView) return; | 465 | // if(mMonthView == mCurrentView) return; |
464 | mMainView->dateNavigator()->selectMonth(); | 466 | mMainView->dateNavigator()->selectMonth(); |
465 | // DateList tmpList = mMainView->dateNavigator()->selectedDates( ); | 467 | // DateList tmpList = mMainView->dateNavigator()->selectedDates( ); |
466 | //mMonthView->showDates(tmpList.first(), tmpList.last()); | 468 | //mMonthView->showDates(tmpList.first(), tmpList.last()); |
467 | 469 | ||
468 | showView(mMonthView, true ); | 470 | showView(mMonthView, true ); |
469 | 471 | ||
470 | } | 472 | } |
471 | 473 | ||
472 | void KOViewManager::showTodoView() | 474 | void KOViewManager::showTodoView() |
473 | { | 475 | { |
474 | //mFlagShowNextxDays = false; | 476 | //mFlagShowNextxDays = false; |
475 | if ( !mTodoView ) { | 477 | if ( !mTodoView ) { |
476 | mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), | 478 | mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), |
477 | "KOViewManager::TodoView" ); | 479 | "KOViewManager::TodoView" ); |
478 | 480 | ||
479 | addView( mTodoView ); | 481 | addView( mTodoView ); |
480 | // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); | 482 | // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); |
481 | 483 | ||
482 | // SIGNALS/SLOTS FOR TODO VIEW | 484 | // SIGNALS/SLOTS FOR TODO VIEW |
483 | connect( mTodoView, SIGNAL( newTodoSignal() ), | 485 | connect( mTodoView, SIGNAL( newTodoSignal() ), |
484 | mMainView, SLOT( newTodo() ) ); | 486 | mMainView, SLOT( newTodo() ) ); |
485 | connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ), | 487 | connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ), |
486 | mMainView, SLOT( newSubTodo( Todo *) ) ); | 488 | mMainView, SLOT( newSubTodo( Todo *) ) ); |
487 | connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ), | 489 | connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ), |
488 | mMainView, SLOT( showTodo( Todo * ) ) ); | 490 | mMainView, SLOT( showTodo( Todo * ) ) ); |
489 | connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ), | 491 | connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ), |
490 | mMainView, SLOT( editTodo( Todo * ) ) ); | 492 | mMainView, SLOT( editTodo( Todo * ) ) ); |
491 | connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ), | 493 | connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ), |
492 | mMainView, SLOT( deleteTodo( Todo * ) ) ); | 494 | mMainView, SLOT( deleteTodo( Todo * ) ) ); |
493 | connect( mTodoView, SIGNAL( purgeCompletedSignal() ), | 495 | connect( mTodoView, SIGNAL( purgeCompletedSignal() ), |
494 | mMainView, SLOT( purgeCompleted() ) ); | 496 | mMainView, SLOT( purgeCompleted() ) ); |
495 | 497 | ||
496 | connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ), | 498 | connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ), |
497 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 499 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
498 | 500 | ||
499 | connect( mMainView, SIGNAL( configChanged() ), mTodoView, | 501 | connect( mMainView, SIGNAL( configChanged() ), mTodoView, |
500 | SLOT( updateConfig() ) ); | 502 | SLOT( updateConfig() ) ); |
501 | connect( mMainView, SIGNAL( todoModified( Todo *, int )), mTodoView, | 503 | connect( mMainView, SIGNAL( todoModified( Todo *, int )), mTodoView, |
502 | SLOT( updateTodo( Todo *, int ) ) ); | 504 | SLOT( updateTodo( Todo *, int ) ) ); |
503 | connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ), | 505 | connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ), |
504 | mMainView, SIGNAL ( todoModified( Todo *, int ) ) ); | 506 | mMainView, SIGNAL ( todoModified( Todo *, int ) ) ); |
505 | connect( mTodoView, SIGNAL( cloneTodoSignal( Incidence * ) ), | 507 | connect( mTodoView, SIGNAL( cloneTodoSignal( Incidence * ) ), |
506 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); | 508 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); |
507 | connect( mTodoView, SIGNAL( cancelTodoSignal( Incidence * ) ), | 509 | connect( mTodoView, SIGNAL( cancelTodoSignal( Incidence * ) ), |
508 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); | 510 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); |
509 | connect( mTodoView, SIGNAL( unparentTodoSignal( Todo * ) ), | 511 | connect( mTodoView, SIGNAL( unparentTodoSignal( Todo * ) ), |
510 | mMainView, SLOT ( todo_unsub( Todo * ) ) ); | 512 | mMainView, SLOT ( todo_unsub( Todo * ) ) ); |
511 | connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), | 513 | connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), |
512 | mMainView, SLOT ( todo_resub( Todo *, Todo *) ) ); | 514 | mMainView, SLOT ( todo_resub( Todo *, Todo *) ) ); |
513 | connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ), | 515 | connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ), |
514 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 516 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
515 | connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ), | 517 | connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ), |
516 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 518 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
517 | KConfig *config = KOGlobals::config(); | 519 | KConfig *config = KOGlobals::config(); |
518 | mTodoView->restoreLayout(config,"Todo View"); | 520 | mTodoView->restoreLayout(config,"Todo View"); |
519 | mTodoView->setNavigator( mMainView->dateNavigator() ); | 521 | mTodoView->setNavigator( mMainView->dateNavigator() ); |
520 | } | 522 | } |
521 | 523 | ||
522 | globalFlagBlockAgenda = 1; | 524 | globalFlagBlockAgenda = 1; |
523 | showView( mTodoView, true ); | 525 | showView( mTodoView, true ); |
524 | 526 | ||
525 | } | 527 | } |
526 | 528 | ||
527 | void KOViewManager::showJournalView() | 529 | void KOViewManager::showJournalView() |
528 | { | 530 | { |
529 | //mFlagShowNextxDays = false; | 531 | //mFlagShowNextxDays = false; |
530 | if (!mJournalView) { | 532 | if (!mJournalView) { |
531 | mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(), | 533 | mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(), |
532 | "KOViewManager::JournalView"); | 534 | "KOViewManager::JournalView"); |
533 | connect( mMainView, SIGNAL( configChanged() ), mJournalView, | 535 | connect( mMainView, SIGNAL( configChanged() ), mJournalView, |
534 | SLOT( updateConfig() ) ); | 536 | SLOT( updateConfig() ) ); |
535 | connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) ); | 537 | connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) ); |
536 | addView(mJournalView); | 538 | addView(mJournalView); |
537 | } | 539 | } |
538 | 540 | ||
539 | showView(mJournalView); | 541 | showView(mJournalView); |
540 | } | 542 | } |
541 | 543 | ||
542 | void KOViewManager::showTimeSpanView() | 544 | void KOViewManager::showTimeSpanView() |
543 | { | 545 | { |
544 | //mFlagShowNextxDays = false; | 546 | //mFlagShowNextxDays = false; |
545 | if (!mTimeSpanView) { | 547 | if (!mTimeSpanView) { |
546 | mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(), | 548 | mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(), |
547 | "KOViewManager::TimeSpanView"); | 549 | "KOViewManager::TimeSpanView"); |
548 | addView(mTimeSpanView); | 550 | addView(mTimeSpanView); |
549 | 551 | ||
550 | mTimeSpanView->readSettings(); | 552 | mTimeSpanView->readSettings(); |
551 | } | 553 | } |
552 | 554 | ||
553 | showView(mTimeSpanView); | 555 | showView(mTimeSpanView); |
554 | } | 556 | } |
555 | 557 | ||
556 | Incidence *KOViewManager::currentSelection() | 558 | Incidence *KOViewManager::currentSelection() |
557 | { | 559 | { |
558 | if (!mCurrentView) return 0; | 560 | if (!mCurrentView) return 0; |
559 | if ( mCurrentView == mListView ) { | 561 | if ( mCurrentView == mListView ) { |
560 | if ( mListView->currentItem() ) | 562 | if ( mListView->currentItem() ) |
561 | return mListView->currentItem(); | 563 | return mListView->currentItem(); |
562 | } | 564 | } |
563 | return mCurrentView->selectedIncidences().first(); | 565 | return mCurrentView->selectedIncidences().first(); |
564 | } | 566 | } |
565 | 567 | ||
566 | QDate KOViewManager::currentSelectionDate() | 568 | QDate KOViewManager::currentSelectionDate() |
567 | { | 569 | { |
568 | QDate qd; | 570 | QDate qd; |
569 | if (mCurrentView) { | 571 | if (mCurrentView) { |
570 | DateList qvl = mCurrentView->selectedDates(); | 572 | DateList qvl = mCurrentView->selectedDates(); |
571 | if (!qvl.isEmpty()) qd = qvl.first(); | 573 | if (!qvl.isEmpty()) qd = qvl.first(); |
572 | } | 574 | } |
573 | return qd; | 575 | return qd; |
574 | } | 576 | } |
575 | 577 | ||
576 | void KOViewManager::addView(KOrg::BaseView *view) | 578 | void KOViewManager::addView(KOrg::BaseView *view) |
577 | { | 579 | { |
578 | #if QT_VERSION >= 0x030000 | 580 | #if QT_VERSION >= 0x030000 |
579 | mMainView->viewStack()->addWidget( view ); | 581 | mMainView->viewStack()->addWidget( view ); |
580 | #else | 582 | #else |
581 | mMainView->viewStack()->addWidget( view, 1 ); | 583 | mMainView->viewStack()->addWidget( view, 1 ); |
582 | #endif | 584 | #endif |
583 | } | 585 | } |
584 | 586 | ||
585 | void KOViewManager::setDocumentId( const QString &id ) | 587 | void KOViewManager::setDocumentId( const QString &id ) |
586 | { | 588 | { |
587 | if (mTodoView) mTodoView->setDocumentId( id ); | 589 | if (mTodoView) mTodoView->setDocumentId( id ); |
588 | } | 590 | } |
diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h index 3c251fb..c8c7a7a 100644 --- a/korganizer/koviewmanager.h +++ b/korganizer/koviewmanager.h | |||
@@ -1,115 +1,117 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2001 | 3 | Copyright (c) 2001 |
4 | Cornelius Schumacher <schumacher@kde.org> | 4 | Cornelius Schumacher <schumacher@kde.org> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
8 | the Free Software Foundation; either version 2 of the License, or | 8 | the Free Software Foundation; either version 2 of the License, or |
9 | (at your option) any later version. | 9 | (at your option) any later version. |
10 | 10 | ||
11 | This program is distributed in the hope that it will be useful, | 11 | This program is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the |
14 | GNU General Public License for more details. | 14 | GNU General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU General Public License | 16 | You should have received a copy of the GNU General Public License |
17 | along with this program; if not, write to the Free Software | 17 | along with this program; if not, write to the Free Software |
18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 | 19 | ||
20 | As a special exception, permission is given to link this program | 20 | As a special exception, permission is given to link this program |
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | #ifndef KOVIEWMANAGER_H | 24 | #ifndef KOVIEWMANAGER_H |
25 | #define KOVIEWMANAGER_H | 25 | #define KOVIEWMANAGER_H |
26 | 26 | ||
27 | #include <qobject.h> | 27 | #include <qobject.h> |
28 | 28 | ||
29 | #include <korganizer/baseview.h> | 29 | #include <korganizer/baseview.h> |
30 | 30 | ||
31 | class CalendarView; | 31 | class CalendarView; |
32 | 32 | ||
33 | class KOListView; | 33 | class KOListView; |
34 | class KOAgendaView; | 34 | class KOAgendaView; |
35 | class KOMonthView; | 35 | class KOMonthView; |
36 | class KOTimeSpanView; | 36 | class KOTimeSpanView; |
37 | class KOTodoView; | 37 | class KOTodoView; |
38 | class KOWhatsNextView; | 38 | class KOWhatsNextView; |
39 | class KOJournalView; | 39 | class KOJournalView; |
40 | 40 | ||
41 | using namespace KCal; | 41 | using namespace KCal; |
42 | 42 | ||
43 | /** | 43 | /** |
44 | This class manages the views of the calendar. It owns the objects and handles | 44 | This class manages the views of the calendar. It owns the objects and handles |
45 | creation and selection. | 45 | creation and selection. |
46 | */ | 46 | */ |
47 | class KOViewManager : public QObject | 47 | class KOViewManager : public QObject |
48 | { | 48 | { |
49 | Q_OBJECT | 49 | Q_OBJECT |
50 | public: | 50 | public: |
51 | KOViewManager( CalendarView * ); | 51 | KOViewManager( CalendarView * ); |
52 | virtual ~KOViewManager(); | 52 | virtual ~KOViewManager(); |
53 | 53 | ||
54 | /** changes the view to be the currently selected view */ | 54 | /** changes the view to be the currently selected view */ |
55 | void showView(KOrg::BaseView *, bool fullScreen = false ); | 55 | void showView(KOrg::BaseView *, bool fullScreen = false ); |
56 | void updateWNview(); | 56 | void updateWNview(); |
57 | void readSettings(KConfig *config); | 57 | void readSettings(KConfig *config); |
58 | void writeSettings(KConfig *config); | 58 | void writeSettings(KConfig *config); |
59 | bool showsNextDays(); | 59 | bool showsNextDays(); |
60 | /** Read which view was shown last from config file */ | 60 | /** Read which view was shown last from config file */ |
61 | void readCurrentView(KConfig *); | 61 | void readCurrentView(KConfig *); |
62 | /** Write which view is currently shown to config file */ | 62 | /** Write which view is currently shown to config file */ |
63 | void writeCurrentView(KConfig *); | 63 | void writeCurrentView(KConfig *); |
64 | 64 | ||
65 | KOrg::BaseView *currentView(); | 65 | KOrg::BaseView *currentView(); |
66 | 66 | ||
67 | void setDocumentId( const QString & ); | 67 | void setDocumentId( const QString & ); |
68 | 68 | ||
69 | void updateView( const QDate &start, const QDate &end ); | 69 | void updateView( const QDate &start, const QDate &end ); |
70 | 70 | ||
71 | void raiseCurrentView( bool fullScreen = false ); | 71 | void raiseCurrentView( bool fullScreen = false ); |
72 | 72 | ||
73 | void addView(KOrg::BaseView *); | 73 | void addView(KOrg::BaseView *); |
74 | 74 | ||
75 | Incidence *currentSelection(); | 75 | Incidence *currentSelection(); |
76 | QDate currentSelectionDate(); | 76 | QDate currentSelectionDate(); |
77 | 77 | ||
78 | KOAgendaView *agendaView() const { return mAgendaView; } | 78 | KOAgendaView *agendaView() const { return mAgendaView; } |
79 | 79 | ||
80 | signals: | 80 | signals: |
81 | void printWNV(); | 81 | void printWNV(); |
82 | void signalFullScreen( bool ); | ||
83 | void signalAgendaView( bool ); | ||
82 | public slots: | 84 | public slots: |
83 | void updateView(); | 85 | void updateView(); |
84 | void showWhatsNextView(); | 86 | void showWhatsNextView(); |
85 | void showListView(); | 87 | void showListView(); |
86 | void showAgendaView( bool fullScreen = false ); | 88 | void showAgendaView( bool fullScreen = false ); |
87 | void showDayView(); | 89 | void showDayView(); |
88 | void showWorkWeekView(); | 90 | void showWorkWeekView(); |
89 | void showWeekView(); | 91 | void showWeekView(); |
90 | void showNextXView(); | 92 | void showNextXView(); |
91 | void showMonthView(); | 93 | void showMonthView(); |
92 | void showTodoView(); | 94 | void showTodoView(); |
93 | void showJournalView(); | 95 | void showJournalView(); |
94 | void showTimeSpanView(); | 96 | void showTimeSpanView(); |
95 | 97 | ||
96 | private: | 98 | private: |
97 | CalendarView *mMainView; | 99 | CalendarView *mMainView; |
98 | 100 | ||
99 | int mCurrentAgendaView; | 101 | int mCurrentAgendaView; |
100 | KOAgendaView *mAgendaView; | 102 | KOAgendaView *mAgendaView; |
101 | KOListView *mListView; | 103 | KOListView *mListView; |
102 | KOMonthView *mMonthView; | 104 | KOMonthView *mMonthView; |
103 | KOTodoView *mTodoView; | 105 | KOTodoView *mTodoView; |
104 | KOWhatsNextView *mWhatsNextView; | 106 | KOWhatsNextView *mWhatsNextView; |
105 | KOJournalView *mJournalView; | 107 | KOJournalView *mJournalView; |
106 | KOTimeSpanView *mTimeSpanView; | 108 | KOTimeSpanView *mTimeSpanView; |
107 | 109 | ||
108 | KOrg::BaseView *mCurrentView; // currently active event view | 110 | KOrg::BaseView *mCurrentView; // currently active event view |
109 | 111 | ||
110 | int mAgendaViewMode; | 112 | int mAgendaViewMode; |
111 | bool mFlagShowNextxDays; | 113 | bool mFlagShowNextxDays; |
112 | 114 | ||
113 | }; | 115 | }; |
114 | 116 | ||
115 | #endif | 117 | #endif |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 877b6f2..145b36c 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -164,835 +164,845 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
164 | if ( KOPrefs::instance()->mUseAppColors ) | 164 | if ( KOPrefs::instance()->mUseAppColors ) |
165 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 165 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
166 | globalFlagBlockStartup = 1; | 166 | globalFlagBlockStartup = 1; |
167 | iconToolBar = new QPEToolBar( this ); | 167 | iconToolBar = new QPEToolBar( this ); |
168 | addToolBar (iconToolBar , tbd ); | 168 | addToolBar (iconToolBar , tbd ); |
169 | mCalendarModifiedFlag = false; | 169 | mCalendarModifiedFlag = false; |
170 | 170 | ||
171 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); | 171 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); |
172 | splash->setAlignment ( AlignCenter ); | 172 | splash->setAlignment ( AlignCenter ); |
173 | setCentralWidget( splash ); | 173 | setCentralWidget( splash ); |
174 | #ifndef DESKTOP_VERSION | 174 | #ifndef DESKTOP_VERSION |
175 | showMaximized(); | 175 | showMaximized(); |
176 | #endif | 176 | #endif |
177 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); | 177 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); |
178 | setDefaultPreferences(); | 178 | setDefaultPreferences(); |
179 | mCalendar = new CalendarLocal(); | 179 | mCalendar = new CalendarLocal(); |
180 | mView = new CalendarView( mCalendar, this,"mCalendar " ); | 180 | mView = new CalendarView( mCalendar, this,"mCalendar " ); |
181 | mView->hide(); | 181 | mView->hide(); |
182 | //mView->resize(splash->size() ); | 182 | //mView->resize(splash->size() ); |
183 | initActions(); | 183 | initActions(); |
184 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); | 184 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); |
185 | mSyncManager->setBlockSave(false); | 185 | mSyncManager->setBlockSave(false); |
186 | mView->setSyncManager(mSyncManager); | 186 | mView->setSyncManager(mSyncManager); |
187 | #ifndef DESKTOP_VERSION | 187 | #ifndef DESKTOP_VERSION |
188 | iconToolBar->show(); | 188 | iconToolBar->show(); |
189 | qApp->processEvents(); | 189 | qApp->processEvents(); |
190 | #endif | 190 | #endif |
191 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); | 191 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); |
192 | int vh = height() ; | 192 | int vh = height() ; |
193 | int vw = width(); | 193 | int vw = width(); |
194 | //qDebug("Toolbar hei %d ",iconToolBar->height() ); | 194 | //qDebug("Toolbar hei %d ",iconToolBar->height() ); |
195 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { | 195 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { |
196 | vh -= iconToolBar->height(); | 196 | vh -= iconToolBar->height(); |
197 | } else { | 197 | } else { |
198 | vw -= iconToolBar->height(); | 198 | vw -= iconToolBar->height(); |
199 | } | 199 | } |
200 | //mView->setMaximumSize( splash->size() ); | 200 | //mView->setMaximumSize( splash->size() ); |
201 | //mView->resize( splash->size() ); | 201 | //mView->resize( splash->size() ); |
202 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 202 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
203 | mView->readSettings(); | 203 | mView->readSettings(); |
204 | bool newFile = false; | 204 | bool newFile = false; |
205 | if( !QFile::exists( defaultFileName() ) ) { | 205 | if( !QFile::exists( defaultFileName() ) ) { |
206 | QFileInfo finfo ( defaultFileName() ); | 206 | QFileInfo finfo ( defaultFileName() ); |
207 | QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); | 207 | QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); |
208 | qDebug("oldfile %s ", oldFile.latin1()); | 208 | qDebug("oldfile %s ", oldFile.latin1()); |
209 | 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"; | 209 | 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"; |
210 | finfo.setFile( oldFile ); | 210 | finfo.setFile( oldFile ); |
211 | if (finfo.exists() ) { | 211 | if (finfo.exists() ) { |
212 | KMessageBox::information( this, message); | 212 | KMessageBox::information( this, message); |
213 | mView->openCalendar( oldFile ); | 213 | mView->openCalendar( oldFile ); |
214 | qApp->processEvents(); | 214 | qApp->processEvents(); |
215 | } else { | 215 | } else { |
216 | oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); | 216 | oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); |
217 | finfo.setFile( oldFile ); | 217 | finfo.setFile( oldFile ); |
218 | if (finfo.exists() ) { | 218 | if (finfo.exists() ) { |
219 | KMessageBox::information( this, message); | 219 | KMessageBox::information( this, message); |
220 | mView->openCalendar( oldFile ); | 220 | mView->openCalendar( oldFile ); |
221 | qApp->processEvents(); | 221 | qApp->processEvents(); |
222 | } | 222 | } |
223 | } | 223 | } |
224 | mView->saveCalendar( defaultFileName() ); | 224 | mView->saveCalendar( defaultFileName() ); |
225 | newFile = true; | 225 | newFile = true; |
226 | } | 226 | } |
227 | 227 | ||
228 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 228 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
229 | mView->openCalendar( defaultFileName() ); | 229 | mView->openCalendar( defaultFileName() ); |
230 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 230 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
231 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); | 231 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); |
232 | 232 | ||
233 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { | 233 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { |
234 | KOPrefs::instance()->setCategoryDefaults(); | 234 | KOPrefs::instance()->setCategoryDefaults(); |
235 | int count = mView->addCategories(); | 235 | int count = mView->addCategories(); |
236 | } | 236 | } |
237 | processIncidenceSelection( 0 ); | 237 | processIncidenceSelection( 0 ); |
238 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), | 238 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), |
239 | SLOT( processIncidenceSelection( Incidence * ) ) ); | 239 | SLOT( processIncidenceSelection( Incidence * ) ) ); |
240 | connect( mView, SIGNAL( modifiedChanged( bool ) ), | 240 | connect( mView, SIGNAL( modifiedChanged( bool ) ), |
241 | SLOT( slotModifiedChanged( bool ) ) ); | 241 | SLOT( slotModifiedChanged( bool ) ) ); |
242 | 242 | ||
243 | 243 | ||
244 | connect( mView, SIGNAL( tempDisableBR(bool) ), | 244 | connect( mView, SIGNAL( tempDisableBR(bool) ), |
245 | SLOT( disableBR(bool) ) ); | 245 | SLOT( disableBR(bool) ) ); |
246 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); | 246 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); |
247 | mView->setModified( false ); | 247 | mView->setModified( false ); |
248 | mBlockAtStartup = false; | 248 | mBlockAtStartup = false; |
249 | mView->setModified( false ); | 249 | mView->setModified( false ); |
250 | setCentralWidget( mView ); | 250 | setCentralWidget( mView ); |
251 | globalFlagBlockStartup = 0; | 251 | globalFlagBlockStartup = 0; |
252 | mView->show(); | 252 | mView->show(); |
253 | delete splash; | 253 | delete splash; |
254 | if ( newFile ) | 254 | if ( newFile ) |
255 | mView->updateConfig(); | 255 | mView->updateConfig(); |
256 | // qApp->processEvents(); | 256 | // qApp->processEvents(); |
257 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 257 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
258 | //fillSyncMenu(); | 258 | //fillSyncMenu(); |
259 | 259 | ||
260 | 260 | ||
261 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); | 261 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); |
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( defaultFileName()); | 264 | mSyncManager->setDefaultFileName( defaultFileName()); |
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 | 285 | ||
286 | mBRdisabled = false; | 286 | mBRdisabled = false; |
287 | //toggleBeamReceive(); | 287 | //toggleBeamReceive(); |
288 | } | 288 | } |
289 | MainWindow::~MainWindow() | 289 | MainWindow::~MainWindow() |
290 | { | 290 | { |
291 | //qDebug("MainWindow::~MainWindow() "); | 291 | //qDebug("MainWindow::~MainWindow() "); |
292 | //save toolbar location | 292 | //save toolbar location |
293 | delete mCalendar; | 293 | delete mCalendar; |
294 | delete mSyncManager; | 294 | delete mSyncManager; |
295 | #ifndef DESKTOP_VERSION | 295 | #ifndef DESKTOP_VERSION |
296 | if ( infrared ) | 296 | if ( infrared ) |
297 | delete infrared; | 297 | delete infrared; |
298 | #endif | 298 | #endif |
299 | 299 | ||
300 | 300 | ||
301 | } | 301 | } |
302 | 302 | ||
303 | void MainWindow::disableBR(bool b) | 303 | void MainWindow::disableBR(bool b) |
304 | { | 304 | { |
305 | #ifndef DESKTOP_VERSION | 305 | #ifndef DESKTOP_VERSION |
306 | if ( b ) { | 306 | if ( b ) { |
307 | if ( infrared ) { | 307 | if ( infrared ) { |
308 | toggleBeamReceive(); | 308 | toggleBeamReceive(); |
309 | mBRdisabled = true; | 309 | mBRdisabled = true; |
310 | } | 310 | } |
311 | mBRdisabled = true; | 311 | mBRdisabled = true; |
312 | } else { | 312 | } else { |
313 | if ( mBRdisabled ) { | 313 | if ( mBRdisabled ) { |
314 | mBRdisabled = false; | 314 | mBRdisabled = false; |
315 | //makes no sense,because other cal ap is probably running | 315 | //makes no sense,because other cal ap is probably running |
316 | // toggleBeamReceive(); | 316 | // toggleBeamReceive(); |
317 | } | 317 | } |
318 | } | 318 | } |
319 | #endif | 319 | #endif |
320 | 320 | ||
321 | } | 321 | } |
322 | bool MainWindow::beamReceiveEnabled() | 322 | bool MainWindow::beamReceiveEnabled() |
323 | { | 323 | { |
324 | #ifndef DESKTOP_VERSION | 324 | #ifndef DESKTOP_VERSION |
325 | return ( infrared != 0 ); | 325 | return ( infrared != 0 ); |
326 | #endif | 326 | #endif |
327 | return false; | 327 | return false; |
328 | } | 328 | } |
329 | 329 | ||
330 | void MainWindow::toggleBeamReceive() | 330 | void MainWindow::toggleBeamReceive() |
331 | { | 331 | { |
332 | if ( mBRdisabled ) | 332 | if ( mBRdisabled ) |
333 | return; | 333 | return; |
334 | #ifndef DESKTOP_VERSION | 334 | #ifndef DESKTOP_VERSION |
335 | if ( infrared ) { | 335 | if ( infrared ) { |
336 | qDebug("disable BeamReceive "); | 336 | qDebug("disable BeamReceive "); |
337 | delete infrared; | 337 | delete infrared; |
338 | infrared = 0; | 338 | infrared = 0; |
339 | brAction->setOn(false); | 339 | brAction->setOn(false); |
340 | return; | 340 | return; |
341 | } | 341 | } |
342 | qDebug("enable BeamReceive "); | 342 | qDebug("enable BeamReceive "); |
343 | brAction->setOn(true); | 343 | brAction->setOn(true); |
344 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; | 344 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; |
345 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); | 345 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); |
346 | #endif | 346 | #endif |
347 | } | 347 | } |
348 | void MainWindow::showMaximized () | 348 | void MainWindow::showMaximized () |
349 | { | 349 | { |
350 | #ifndef DESKTOP_VERSION | 350 | #ifndef DESKTOP_VERSION |
351 | if ( ! globalFlagBlockStartup ) | 351 | if ( ! globalFlagBlockStartup ) |
352 | if ( mClosed ) | 352 | if ( mClosed ) |
353 | mView->goToday(); | 353 | mView->goToday(); |
354 | #endif | 354 | #endif |
355 | QWidget::showMaximized () ; | 355 | QWidget::showMaximized () ; |
356 | mClosed = false; | 356 | mClosed = false; |
357 | } | 357 | } |
358 | void MainWindow::closeEvent( QCloseEvent* ce ) | 358 | void MainWindow::closeEvent( QCloseEvent* ce ) |
359 | { | 359 | { |
360 | 360 | ||
361 | 361 | ||
362 | 362 | ||
363 | if ( ! KOPrefs::instance()->mAskForQuit ) { | 363 | if ( ! KOPrefs::instance()->mAskForQuit ) { |
364 | saveOnClose(); | 364 | saveOnClose(); |
365 | mClosed = true; | 365 | mClosed = true; |
366 | ce->accept(); | 366 | ce->accept(); |
367 | return; | 367 | return; |
368 | 368 | ||
369 | } | 369 | } |
370 | 370 | ||
371 | switch( QMessageBox::information( this, "KO/Pi", | 371 | switch( QMessageBox::information( this, "KO/Pi", |
372 | i18n("Do you really want\nto close KO/Pi?"), | 372 | i18n("Do you really want\nto close KO/Pi?"), |
373 | i18n("Close"), i18n("No"), | 373 | i18n("Close"), i18n("No"), |
374 | 0, 0 ) ) { | 374 | 0, 0 ) ) { |
375 | case 0: | 375 | case 0: |
376 | saveOnClose(); | 376 | saveOnClose(); |
377 | mClosed = true; | 377 | mClosed = true; |
378 | ce->accept(); | 378 | ce->accept(); |
379 | break; | 379 | break; |
380 | case 1: | 380 | case 1: |
381 | ce->ignore(); | 381 | ce->ignore(); |
382 | break; | 382 | break; |
383 | case 2: | 383 | case 2: |
384 | 384 | ||
385 | default: | 385 | default: |
386 | break; | 386 | break; |
387 | } | 387 | } |
388 | 388 | ||
389 | 389 | ||
390 | } | 390 | } |
391 | 391 | ||
392 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | 392 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) |
393 | { | 393 | { |
394 | QDataStream stream( data, IO_ReadOnly ); | 394 | QDataStream stream( data, IO_ReadOnly ); |
395 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); | 395 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); |
396 | //QString datamess; | 396 | //QString datamess; |
397 | //qDebug("message "); | 397 | //qDebug("message "); |
398 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); | 398 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); |
399 | 399 | ||
400 | if ( cmsg == "setDocument(QString)" ) { | 400 | if ( cmsg == "setDocument(QString)" ) { |
401 | QDataStream stream( data, IO_ReadOnly ); | 401 | QDataStream stream( data, IO_ReadOnly ); |
402 | QString fileName; | 402 | QString fileName; |
403 | stream >> fileName; | 403 | stream >> fileName; |
404 | //qDebug("filename %s ", fileName.latin1()); | 404 | //qDebug("filename %s ", fileName.latin1()); |
405 | showMaximized(); | 405 | showMaximized(); |
406 | raise(); | 406 | raise(); |
407 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; | 407 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; |
408 | mSyncManager->slotSyncMenu( 1002 ); | 408 | mSyncManager->slotSyncMenu( 1002 ); |
409 | return; | 409 | return; |
410 | } | 410 | } |
411 | 411 | ||
412 | if ( cmsg == "-writeFile" ) { | 412 | if ( cmsg == "-writeFile" ) { |
413 | // I made from the "-writeFile" an "-writeAlarm" | 413 | // I made from the "-writeFile" an "-writeAlarm" |
414 | mView->viewManager()->showWhatsNextView(); | 414 | mView->viewManager()->showWhatsNextView(); |
415 | mCalendar->checkAlarmForIncidence( 0, true); | 415 | mCalendar->checkAlarmForIncidence( 0, true); |
416 | showMaximized(); | 416 | showMaximized(); |
417 | raise(); | 417 | raise(); |
418 | return; | 418 | return; |
419 | 419 | ||
420 | } | 420 | } |
421 | if ( cmsg == "-writeFileSilent" ) { | 421 | if ( cmsg == "-writeFileSilent" ) { |
422 | // I made from the "-writeFile" an "-writeAlarm" | 422 | // I made from the "-writeFile" an "-writeAlarm" |
423 | // mView->viewManager()->showWhatsNextView(); | 423 | // mView->viewManager()->showWhatsNextView(); |
424 | mCalendar->checkAlarmForIncidence( 0, true); | 424 | mCalendar->checkAlarmForIncidence( 0, true); |
425 | //showMaximized(); | 425 | //showMaximized(); |
426 | //raise(); | 426 | //raise(); |
427 | hide(); | 427 | hide(); |
428 | return; | 428 | return; |
429 | } | 429 | } |
430 | if ( cmsg == "-newCountdown" ) { | 430 | if ( cmsg == "-newCountdown" ) { |
431 | qDebug("newCountdown "); | 431 | qDebug("newCountdown "); |
432 | 432 | ||
433 | } | 433 | } |
434 | QString msg ; | 434 | QString msg ; |
435 | QString allmsg = cmsg; | 435 | QString allmsg = cmsg; |
436 | while ( allmsg.length() > 0 ) { | 436 | while ( allmsg.length() > 0 ) { |
437 | int nextC = allmsg.find( "-", 1 ); | 437 | int nextC = allmsg.find( "-", 1 ); |
438 | if ( nextC == -1 ) { | 438 | if ( nextC == -1 ) { |
439 | msg = allmsg; | 439 | msg = allmsg; |
440 | allmsg = ""; | 440 | allmsg = ""; |
441 | } else{ | 441 | } else{ |
442 | msg = allmsg.left( nextC ); | 442 | msg = allmsg.left( nextC ); |
443 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); | 443 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); |
444 | } | 444 | } |
445 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); | 445 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); |
446 | if ( msg == "-newEvent" ) { | 446 | if ( msg == "-newEvent" ) { |
447 | mView->newEvent(); | 447 | mView->newEvent(); |
448 | } | 448 | } |
449 | if ( msg == "-newTodo" ) { | 449 | if ( msg == "-newTodo" ) { |
450 | mView->newTodo(); | 450 | mView->newTodo(); |
451 | 451 | ||
452 | } | 452 | } |
453 | if ( msg == "-showWN" ) { | 453 | if ( msg == "-showWN" ) { |
454 | mView->viewManager()->showWhatsNextView(); | 454 | mView->viewManager()->showWhatsNextView(); |
455 | } | 455 | } |
456 | if ( msg == "-showTodo" ) { | 456 | if ( msg == "-showTodo" ) { |
457 | mView->viewManager()->showTodoView(); | 457 | mView->viewManager()->showTodoView(); |
458 | } | 458 | } |
459 | if ( msg == "-showList" ) { | 459 | if ( msg == "-showList" ) { |
460 | mView->viewManager()->showListView(); | 460 | mView->viewManager()->showListView(); |
461 | } | 461 | } |
462 | else if ( msg == "-showDay" ) { | 462 | else if ( msg == "-showDay" ) { |
463 | mView->viewManager()->showDayView(); | 463 | mView->viewManager()->showDayView(); |
464 | } | 464 | } |
465 | else if ( msg == "-showWWeek" ) { | 465 | else if ( msg == "-showWWeek" ) { |
466 | mView->viewManager()->showWorkWeekView(); | 466 | mView->viewManager()->showWorkWeekView(); |
467 | } | 467 | } |
468 | else if ( msg == "-ringSync" ) { | 468 | else if ( msg == "-ringSync" ) { |
469 | mSyncManager->multiSync( false ); | 469 | mSyncManager->multiSync( false ); |
470 | } | 470 | } |
471 | else if ( msg == "-showWeek" ) { | 471 | else if ( msg == "-showWeek" ) { |
472 | mView->viewManager()->showWeekView(); | 472 | mView->viewManager()->showWeekView(); |
473 | } | 473 | } |
474 | else if ( msg == "-showTodo" ) { | 474 | else if ( msg == "-showTodo" ) { |
475 | mView->viewManager()->showTodoView(); | 475 | mView->viewManager()->showTodoView(); |
476 | } | 476 | } |
477 | else if ( msg == "-showJournal" ) { | 477 | else if ( msg == "-showJournal" ) { |
478 | mView->dateNavigator()->selectDates( 1 ); | 478 | mView->dateNavigator()->selectDates( 1 ); |
479 | mView->dateNavigator()->selectToday(); | 479 | mView->dateNavigator()->selectToday(); |
480 | mView->viewManager()->showJournalView(); | 480 | mView->viewManager()->showJournalView(); |
481 | } | 481 | } |
482 | else if ( msg == "-showKO" ) { | 482 | else if ( msg == "-showKO" ) { |
483 | mView->viewManager()->showNextXView(); | 483 | mView->viewManager()->showNextXView(); |
484 | } | 484 | } |
485 | else if ( msg == "-showWNext" || msg == "nextView()" ) { | 485 | else if ( msg == "-showWNext" || msg == "nextView()" ) { |
486 | mView->viewManager()->showWhatsNextView(); | 486 | mView->viewManager()->showWhatsNextView(); |
487 | } | 487 | } |
488 | else if ( msg == "-showNextXView" ) { | 488 | else if ( msg == "-showNextXView" ) { |
489 | mView->viewManager()->showNextXView(); | 489 | mView->viewManager()->showNextXView(); |
490 | } | 490 | } |
491 | 491 | ||
492 | 492 | ||
493 | } | 493 | } |
494 | 494 | ||
495 | showMaximized(); | 495 | showMaximized(); |
496 | raise(); | 496 | raise(); |
497 | } | 497 | } |
498 | 498 | ||
499 | QPixmap MainWindow::loadPixmap( QString name ) | 499 | QPixmap MainWindow::loadPixmap( QString name ) |
500 | { | 500 | { |
501 | return SmallIcon( name ); | 501 | return SmallIcon( name ); |
502 | 502 | ||
503 | } | 503 | } |
504 | void MainWindow::initActions() | 504 | void MainWindow::initActions() |
505 | { | 505 | { |
506 | //KOPrefs::instance()->mShowFullMenu | 506 | //KOPrefs::instance()->mShowFullMenu |
507 | iconToolBar->clear(); | 507 | iconToolBar->clear(); |
508 | KOPrefs *p = KOPrefs::instance(); | 508 | KOPrefs *p = KOPrefs::instance(); |
509 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 509 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
510 | 510 | ||
511 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 511 | QPopupMenu *viewMenu = new QPopupMenu( this ); |
512 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 512 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
513 | QPopupMenu *importMenu = new QPopupMenu( this ); | 513 | QPopupMenu *importMenu = new QPopupMenu( this ); |
514 | selectFilterMenu = new QPopupMenu( this ); | 514 | selectFilterMenu = new QPopupMenu( this ); |
515 | selectFilterMenu->setCheckable( true ); | 515 | selectFilterMenu->setCheckable( true ); |
516 | syncMenu = new QPopupMenu( this ); | 516 | syncMenu = new QPopupMenu( this ); |
517 | configureAgendaMenu = new QPopupMenu( this ); | 517 | configureAgendaMenu = new QPopupMenu( this ); |
518 | configureToolBarMenu = new QPopupMenu( this ); | 518 | configureToolBarMenu = new QPopupMenu( this ); |
519 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 519 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
520 | if ( KOPrefs::instance()->mShowFullMenu ) { | 520 | if ( KOPrefs::instance()->mShowFullMenu ) { |
521 | QMenuBar *menuBar1; | 521 | QMenuBar *menuBar1; |
522 | menuBar1 = menuBar(); | 522 | menuBar1 = menuBar(); |
523 | menuBar1->insertItem( i18n("File"), importMenu ); | 523 | menuBar1->insertItem( i18n("File"), importMenu ); |
524 | menuBar1->insertItem( i18n("View"), viewMenu ); | 524 | menuBar1->insertItem( i18n("View"), viewMenu ); |
525 | menuBar1->insertItem( i18n("Actions"), actionMenu ); | 525 | menuBar1->insertItem( i18n("Actions"), actionMenu ); |
526 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); | 526 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); |
527 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 527 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
528 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 528 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
529 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); | 529 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); |
530 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 530 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
531 | } else { | 531 | } else { |
532 | QPEMenuBar *menuBar1; | 532 | QPEMenuBar *menuBar1; |
533 | menuBar1 = new QPEMenuBar( iconToolBar ); | 533 | menuBar1 = new QPEMenuBar( iconToolBar ); |
534 | QPopupMenu *menuBar = new QPopupMenu( this ); | 534 | QPopupMenu *menuBar = new QPopupMenu( this ); |
535 | menuBar1->insertItem( i18n("ME"), menuBar); | 535 | menuBar1->insertItem( i18n("ME"), menuBar); |
536 | menuBar->insertItem( i18n("File"), importMenu ); | 536 | menuBar->insertItem( i18n("File"), importMenu ); |
537 | menuBar->insertItem( i18n("View"), viewMenu ); | 537 | menuBar->insertItem( i18n("View"), viewMenu ); |
538 | menuBar->insertItem( i18n("Actions"), actionMenu ); | 538 | menuBar->insertItem( i18n("Actions"), actionMenu ); |
539 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); | 539 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); |
540 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 540 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
541 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 541 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
542 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); | 542 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); |
543 | menuBar->insertItem( i18n("Help"), helpMenu ); | 543 | menuBar->insertItem( i18n("Help"), helpMenu ); |
544 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); | 544 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); |
545 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); | 545 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); |
546 | } | 546 | } |
547 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 547 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
548 | connect ( selectFilterMenu, SIGNAL( aboutToShow () ), this, SLOT (fillFilterMenu() ) ); | 548 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); |
549 | 549 | ||
550 | // ****************** | 550 | // ****************** |
551 | QAction *action; | 551 | QAction *action; |
552 | QIconSet icon; | 552 | QIconSet icon; |
553 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); | 553 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); |
554 | configureToolBarMenu->setCheckable( true ); | 554 | configureToolBarMenu->setCheckable( true ); |
555 | 555 | ||
556 | QString pathString = ""; | 556 | QString pathString = ""; |
557 | if ( !p->mToolBarMiniIcons ) { | 557 | if ( !p->mToolBarMiniIcons ) { |
558 | if ( QApplication::desktop()->width() < 480 ) | 558 | if ( QApplication::desktop()->width() < 480 ) |
559 | pathString += "icons16/"; | 559 | pathString += "icons16/"; |
560 | } else | 560 | } else |
561 | pathString += "iconsmini/"; | 561 | pathString += "iconsmini/"; |
562 | configureAgendaMenu->setCheckable( true ); | 562 | configureAgendaMenu->setCheckable( true ); |
563 | configureAgendaMenu->insertItem(i18n("Tiny"), 4 ); | 563 | int iii ; |
564 | configureAgendaMenu->insertItem(i18n("Small"), 6 ); | 564 | for ( iii = 1;iii<= 10 ;++iii ){ |
565 | configureAgendaMenu->insertItem(i18n("Medium"), 8 ); | 565 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); |
566 | configureAgendaMenu->insertItem(i18n("Normal"), 10 ); | 566 | } |
567 | configureAgendaMenu->insertItem(i18n("Large"), 12 ); | ||
568 | configureAgendaMenu->insertItem(i18n("Big"), 14 ); | ||
569 | configureAgendaMenu->insertItem(i18n("Bigger"), 16 ); | ||
570 | configureAgendaMenu->insertItem(i18n("Biggest"), 18 ); | ||
571 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 567 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
572 | 568 | ||
569 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), | ||
570 | this, SLOT( showConfigureAgenda( ) ) ); | ||
571 | |||
573 | icon = loadPixmap( pathString + "configure" ); | 572 | icon = loadPixmap( pathString + "configure" ); |
574 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); | 573 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); |
575 | action->addTo( actionMenu ); | 574 | action->addTo( actionMenu ); |
576 | connect( action, SIGNAL( activated() ), | 575 | connect( action, SIGNAL( activated() ), |
577 | mView, SLOT( edit_options() ) ); | 576 | mView, SLOT( edit_options() ) ); |
578 | actionMenu->insertSeparator(); | 577 | actionMenu->insertSeparator(); |
579 | 578 | ||
580 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); | 579 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); |
581 | action->addTo( actionMenu ); | 580 | action->addTo( actionMenu ); |
582 | connect( action, SIGNAL( activated() ), | 581 | connect( action, SIGNAL( activated() ), |
583 | mView, SLOT( undo_delete() ) ); | 582 | mView, SLOT( undo_delete() ) ); |
584 | actionMenu->insertSeparator(); | 583 | actionMenu->insertSeparator(); |
585 | 584 | ||
586 | icon = loadPixmap( pathString + "newevent" ); | 585 | icon = loadPixmap( pathString + "newevent" ); |
587 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 586 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
588 | configureToolBarMenu->insertSeparator(); | 587 | configureToolBarMenu->insertSeparator(); |
589 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 588 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
590 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 589 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); |
591 | ne_action->addTo( actionMenu ); | 590 | ne_action->addTo( actionMenu ); |
592 | connect( ne_action, SIGNAL( activated() ), | 591 | connect( ne_action, SIGNAL( activated() ), |
593 | mView, SLOT( newEvent() ) ); | 592 | mView, SLOT( newEvent() ) ); |
594 | icon = loadPixmap( pathString + "newtodo" ); | 593 | icon = loadPixmap( pathString + "newtodo" ); |
595 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 594 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); |
596 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | 595 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); |
597 | nt_action->addTo( actionMenu ); | 596 | nt_action->addTo( actionMenu ); |
598 | connect( nt_action, SIGNAL( activated() ), | 597 | connect( nt_action, SIGNAL( activated() ), |
599 | mView, SLOT( newTodo() ) ); | 598 | mView, SLOT( newTodo() ) ); |
600 | icon = loadPixmap( pathString + "navi" ); | 599 | icon = loadPixmap( pathString + "navi" ); |
601 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 600 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
602 | action->addTo( viewMenu ); | 601 | action->addTo( viewMenu ); |
603 | connect( action, SIGNAL( activated() ), | 602 | connect( action, SIGNAL( activated() ), |
604 | mView, SLOT( toggleDateNavigatorWidget() ) ); | 603 | mView, SLOT( toggleDateNavigatorWidget() ) ); |
604 | mToggleNav = action ; | ||
605 | icon = loadPixmap( pathString + "filter" ); | 605 | icon = loadPixmap( pathString + "filter" ); |
606 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); | 606 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); |
607 | action->addTo( viewMenu ); | 607 | action->addTo( viewMenu ); |
608 | connect( action, SIGNAL( activated() ), | 608 | connect( action, SIGNAL( activated() ), |
609 | mView, SLOT( toggleFilter() ) ); | 609 | mView, SLOT( toggleFilter() ) ); |
610 | mToggleFilter = action; | ||
610 | icon = loadPixmap( pathString + "allday" ); | 611 | icon = loadPixmap( pathString + "allday" ); |
611 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); | 612 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); |
612 | action->addTo( viewMenu ); | 613 | action->addTo( viewMenu ); |
613 | connect( action, SIGNAL( activated() ), | 614 | connect( action, SIGNAL( activated() ), |
614 | mView, SLOT( toggleAllDaySize() ) ); | 615 | mView, SLOT( toggleAllDaySize() ) ); |
616 | mToggleAllday = action; | ||
617 | |||
618 | |||
619 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | ||
620 | mToggleNav, SLOT( setEnabled ( bool ) ) ); | ||
621 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | ||
622 | mToggleFilter, SLOT( setEnabled ( bool ) ) ); | ||
623 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | ||
624 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); | ||
615 | 625 | ||
616 | viewMenu->insertSeparator(); | 626 | viewMenu->insertSeparator(); |
617 | icon = loadPixmap( pathString + "picker" ); | 627 | icon = loadPixmap( pathString + "picker" ); |
618 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); | 628 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); |
619 | action->addTo( viewMenu ); | 629 | action->addTo( viewMenu ); |
620 | connect( action, SIGNAL( activated() ), | 630 | connect( action, SIGNAL( activated() ), |
621 | mView, SLOT( showDatePicker() ) ); | 631 | mView, SLOT( showDatePicker() ) ); |
622 | action->addTo( iconToolBar ); | 632 | action->addTo( iconToolBar ); |
623 | viewMenu->insertSeparator(); | 633 | viewMenu->insertSeparator(); |
624 | icon = loadPixmap( pathString + "list" ); | 634 | icon = loadPixmap( pathString + "list" ); |
625 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); | 635 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); |
626 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); | 636 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); |
627 | showlist_action->addTo( viewMenu ); | 637 | showlist_action->addTo( viewMenu ); |
628 | connect( showlist_action, SIGNAL( activated() ), | 638 | connect( showlist_action, SIGNAL( activated() ), |
629 | mView->viewManager(), SLOT( showListView() ) ); | 639 | mView->viewManager(), SLOT( showListView() ) ); |
630 | 640 | ||
631 | 641 | ||
632 | icon = loadPixmap( pathString + "day" ); | 642 | icon = loadPixmap( pathString + "day" ); |
633 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); | 643 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); |
634 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); | 644 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); |
635 | day1_action->addTo( viewMenu ); | 645 | day1_action->addTo( viewMenu ); |
636 | // action->addTo( toolBar ); | 646 | // action->addTo( toolBar ); |
637 | connect( day1_action, SIGNAL( activated() ), | 647 | connect( day1_action, SIGNAL( activated() ), |
638 | mView->viewManager(), SLOT( showDayView() ) ); | 648 | mView->viewManager(), SLOT( showDayView() ) ); |
639 | 649 | ||
640 | icon = loadPixmap( pathString + "workweek" ); | 650 | icon = loadPixmap( pathString + "workweek" ); |
641 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); | 651 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); |
642 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); | 652 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); |
643 | day5_action->addTo( viewMenu ); | 653 | day5_action->addTo( viewMenu ); |
644 | connect( day5_action, SIGNAL( activated() ), | 654 | connect( day5_action, SIGNAL( activated() ), |
645 | mView->viewManager(), SLOT( showWorkWeekView() ) ); | 655 | mView->viewManager(), SLOT( showWorkWeekView() ) ); |
646 | 656 | ||
647 | icon = loadPixmap( pathString + "week" ); | 657 | icon = loadPixmap( pathString + "week" ); |
648 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); | 658 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); |
649 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); | 659 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); |
650 | day7_action->addTo( viewMenu ); | 660 | day7_action->addTo( viewMenu ); |
651 | connect( day7_action, SIGNAL( activated() ), | 661 | connect( day7_action, SIGNAL( activated() ), |
652 | mView->viewManager(), SLOT( showWeekView() ) ); | 662 | mView->viewManager(), SLOT( showWeekView() ) ); |
653 | 663 | ||
654 | icon = loadPixmap( pathString + "month" ); | 664 | icon = loadPixmap( pathString + "month" ); |
655 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); | 665 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); |
656 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); | 666 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); |
657 | month_action->addTo( viewMenu ); | 667 | month_action->addTo( viewMenu ); |
658 | connect( month_action, SIGNAL( activated() ), | 668 | connect( month_action, SIGNAL( activated() ), |
659 | mView->viewManager(), SLOT( showMonthView() ) ); | 669 | mView->viewManager(), SLOT( showMonthView() ) ); |
660 | 670 | ||
661 | icon = loadPixmap( pathString + "todo" ); | 671 | icon = loadPixmap( pathString + "todo" ); |
662 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); | 672 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); |
663 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); | 673 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); |
664 | todoview_action->addTo( viewMenu ); | 674 | todoview_action->addTo( viewMenu ); |
665 | connect( todoview_action, SIGNAL( activated() ), | 675 | connect( todoview_action, SIGNAL( activated() ), |
666 | mView->viewManager(), SLOT( showTodoView() ) ); | 676 | mView->viewManager(), SLOT( showTodoView() ) ); |
667 | 677 | ||
668 | icon = loadPixmap( pathString + "journal" ); | 678 | icon = loadPixmap( pathString + "journal" ); |
669 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); | 679 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); |
670 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); | 680 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); |
671 | viewjournal_action->addTo( viewMenu ); | 681 | viewjournal_action->addTo( viewMenu ); |
672 | connect( viewjournal_action, SIGNAL( activated() ), | 682 | connect( viewjournal_action, SIGNAL( activated() ), |
673 | mView->viewManager(), SLOT( showJournalView() ) ); | 683 | mView->viewManager(), SLOT( showJournalView() ) ); |
674 | 684 | ||
675 | icon = loadPixmap( pathString + "xdays" ); | 685 | icon = loadPixmap( pathString + "xdays" ); |
676 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); | 686 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); |
677 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); | 687 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); |
678 | xdays_action->addTo( viewMenu ); | 688 | xdays_action->addTo( viewMenu ); |
679 | connect( xdays_action, SIGNAL( activated() ), | 689 | connect( xdays_action, SIGNAL( activated() ), |
680 | mView->viewManager(), SLOT( showNextXView() ) ); | 690 | mView->viewManager(), SLOT( showNextXView() ) ); |
681 | 691 | ||
682 | icon = loadPixmap( pathString + "whatsnext" ); | 692 | icon = loadPixmap( pathString + "whatsnext" ); |
683 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); | 693 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); |
684 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); | 694 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); |
685 | whatsnext_action->addTo( viewMenu ); | 695 | whatsnext_action->addTo( viewMenu ); |
686 | connect( whatsnext_action, SIGNAL( activated() ), | 696 | connect( whatsnext_action, SIGNAL( activated() ), |
687 | mView->viewManager(), SLOT( showWhatsNextView() ) ); | 697 | mView->viewManager(), SLOT( showWhatsNextView() ) ); |
688 | 698 | ||
689 | #if 0 | 699 | #if 0 |
690 | action = new QAction( "view_timespan", "Time Span", 0, this ); | 700 | action = new QAction( "view_timespan", "Time Span", 0, this ); |
691 | action->addTo( viewMenu ); | 701 | action->addTo( viewMenu ); |
692 | connect( action, SIGNAL( activated() ), | 702 | connect( action, SIGNAL( activated() ), |
693 | mView->viewManager(), SLOT( showTimeSpanView() ) ); | 703 | mView->viewManager(), SLOT( showTimeSpanView() ) ); |
694 | #endif | 704 | #endif |
695 | 705 | ||
696 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, | 706 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, |
697 | this ); | 707 | this ); |
698 | mNewSubTodoAction->addTo( actionMenu ); | 708 | mNewSubTodoAction->addTo( actionMenu ); |
699 | connect( mNewSubTodoAction, SIGNAL( activated() ), | 709 | connect( mNewSubTodoAction, SIGNAL( activated() ), |
700 | mView, SLOT( newSubTodo() ) ); | 710 | mView, SLOT( newSubTodo() ) ); |
701 | 711 | ||
702 | actionMenu->insertSeparator(); | 712 | actionMenu->insertSeparator(); |
703 | 713 | ||
704 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); | 714 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); |
705 | mShowAction->addTo( actionMenu ); | 715 | mShowAction->addTo( actionMenu ); |
706 | connect( mShowAction, SIGNAL( activated() ), | 716 | connect( mShowAction, SIGNAL( activated() ), |
707 | mView, SLOT( showIncidence() ) ); | 717 | mView, SLOT( showIncidence() ) ); |
708 | 718 | ||
709 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | 719 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); |
710 | mEditAction->addTo( actionMenu ); | 720 | mEditAction->addTo( actionMenu ); |
711 | connect( mEditAction, SIGNAL( activated() ), | 721 | connect( mEditAction, SIGNAL( activated() ), |
712 | mView, SLOT( editIncidence() ) ); | 722 | mView, SLOT( editIncidence() ) ); |
713 | 723 | ||
714 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | 724 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); |
715 | mDeleteAction->addTo( actionMenu ); | 725 | mDeleteAction->addTo( actionMenu ); |
716 | connect( mDeleteAction, SIGNAL( activated() ), | 726 | connect( mDeleteAction, SIGNAL( activated() ), |
717 | mView, SLOT( deleteIncidence() ) ); | 727 | mView, SLOT( deleteIncidence() ) ); |
718 | 728 | ||
719 | 729 | ||
720 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); | 730 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); |
721 | mCloneAction->addTo( actionMenu ); | 731 | mCloneAction->addTo( actionMenu ); |
722 | connect( mCloneAction, SIGNAL( activated() ), | 732 | connect( mCloneAction, SIGNAL( activated() ), |
723 | mView, SLOT( cloneIncidence() ) ); | 733 | mView, SLOT( cloneIncidence() ) ); |
724 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); | 734 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); |
725 | mMoveAction->addTo( actionMenu ); | 735 | mMoveAction->addTo( actionMenu ); |
726 | connect( mMoveAction, SIGNAL( activated() ), | 736 | connect( mMoveAction, SIGNAL( activated() ), |
727 | mView, SLOT( moveIncidence() ) ); | 737 | mView, SLOT( moveIncidence() ) ); |
728 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); | 738 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); |
729 | mBeamAction->addTo( actionMenu ); | 739 | mBeamAction->addTo( actionMenu ); |
730 | connect( mBeamAction, SIGNAL( activated() ), | 740 | connect( mBeamAction, SIGNAL( activated() ), |
731 | mView, SLOT( beamIncidence() ) ); | 741 | mView, SLOT( beamIncidence() ) ); |
732 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); | 742 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); |
733 | mCancelAction->addTo( actionMenu ); | 743 | mCancelAction->addTo( actionMenu ); |
734 | connect( mCancelAction, SIGNAL( activated() ), | 744 | connect( mCancelAction, SIGNAL( activated() ), |
735 | mView, SLOT( toggleCancelIncidence() ) ); | 745 | mView, SLOT( toggleCancelIncidence() ) ); |
736 | 746 | ||
737 | actionMenu->insertSeparator(); | 747 | actionMenu->insertSeparator(); |
738 | 748 | ||
739 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, | 749 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, |
740 | this ); | 750 | this ); |
741 | action->addTo( actionMenu ); | 751 | action->addTo( actionMenu ); |
742 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); | 752 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); |
743 | 753 | ||
744 | icon = loadPixmap( pathString + "search" ); | 754 | icon = loadPixmap( pathString + "search" ); |
745 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 755 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); |
746 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); | 756 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); |
747 | search_action->addTo( actionMenu ); | 757 | search_action->addTo( actionMenu ); |
748 | connect( search_action, SIGNAL( activated() ), | 758 | connect( search_action, SIGNAL( activated() ), |
749 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | 759 | mView->dialogManager(), SLOT( showSearchDialog() ) ); |
750 | 760 | ||
751 | icon = loadPixmap( pathString + "today" ); | 761 | icon = loadPixmap( pathString + "today" ); |
752 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); | 762 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); |
753 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | 763 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); |
754 | today_action->addTo( actionMenu ); | 764 | today_action->addTo( actionMenu ); |
755 | connect( today_action, SIGNAL( activated() ), | 765 | connect( today_action, SIGNAL( activated() ), |
756 | mView, SLOT( goToday() ) ); | 766 | mView, SLOT( goToday() ) ); |
757 | 767 | ||
758 | if ( KOPrefs::instance()->mShowFullMenu ) { | 768 | if ( KOPrefs::instance()->mShowFullMenu ) { |
759 | actionMenu->insertSeparator(); | 769 | actionMenu->insertSeparator(); |
760 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); | 770 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); |
761 | 771 | ||
762 | } | 772 | } |
763 | // actionMenu->insertSeparator(); | 773 | // actionMenu->insertSeparator(); |
764 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, | 774 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, |
765 | this ); | 775 | this ); |
766 | action->addTo( importMenu ); | 776 | action->addTo( importMenu ); |
767 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); | 777 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); |
768 | action = new QAction( "import_quick", i18n("Import last file"), 0, | 778 | action = new QAction( "import_quick", i18n("Import last file"), 0, |
769 | this ); | 779 | this ); |
770 | action->addTo( importMenu ); | 780 | action->addTo( importMenu ); |
771 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); | 781 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); |
772 | importMenu->insertSeparator(); | 782 | importMenu->insertSeparator(); |
773 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, | 783 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, |
774 | this ); | 784 | this ); |
775 | action->addTo( importMenu ); | 785 | action->addTo( importMenu ); |
776 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); | 786 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); |
777 | #ifndef DESKTOP_VERSION | 787 | #ifndef DESKTOP_VERSION |
778 | importMenu->insertSeparator(); | 788 | importMenu->insertSeparator(); |
779 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, | 789 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, |
780 | this ); | 790 | this ); |
781 | action->addTo( importMenu ); | 791 | action->addTo( importMenu ); |
782 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); | 792 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); |
783 | #else | 793 | #else |
784 | #ifdef _OL_IMPORT_ | 794 | #ifdef _OL_IMPORT_ |
785 | importMenu->insertSeparator(); | 795 | importMenu->insertSeparator(); |
786 | action = new QAction( "import_ol", i18n("Import from OL"), 0, | 796 | action = new QAction( "import_ol", i18n("Import from OL"), 0, |
787 | this ); | 797 | this ); |
788 | action->addTo( importMenu ); | 798 | action->addTo( importMenu ); |
789 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); | 799 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); |
790 | #endif | 800 | #endif |
791 | #endif | 801 | #endif |
792 | 802 | ||
793 | importMenu->insertSeparator(); | 803 | importMenu->insertSeparator(); |
794 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, | 804 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, |
795 | this ); | 805 | this ); |
796 | action->addTo( importMenu ); | 806 | action->addTo( importMenu ); |
797 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); | 807 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); |
798 | 808 | ||
799 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, | 809 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, |
800 | this ); | 810 | this ); |
801 | action->addTo( importMenu ); | 811 | action->addTo( importMenu ); |
802 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); | 812 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); |
803 | 813 | ||
804 | importMenu->insertSeparator(); | 814 | importMenu->insertSeparator(); |
805 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, | 815 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, |
806 | this ); | 816 | this ); |
807 | action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); | 817 | action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); |
808 | 818 | ||
809 | 819 | ||
810 | //LR | 820 | //LR |
811 | QPopupMenu *ex2phone = new QPopupMenu( this ); | 821 | QPopupMenu *ex2phone = new QPopupMenu( this ); |
812 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 822 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
813 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 823 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
814 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); | 824 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); |
815 | importMenu->insertItem( i18n("Export to phone"), ex2phone ); | 825 | importMenu->insertItem( i18n("Export to phone"), ex2phone ); |
816 | 826 | ||
817 | importMenu->insertSeparator(); | 827 | importMenu->insertSeparator(); |
818 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, | 828 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, |
819 | this ); | 829 | this ); |
820 | action->addTo( importMenu ); | 830 | action->addTo( importMenu ); |
821 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); | 831 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); |
822 | #ifndef DESKTOP_VERSION | 832 | #ifndef DESKTOP_VERSION |
823 | importMenu->insertSeparator(); | 833 | importMenu->insertSeparator(); |
824 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, | 834 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, |
825 | this ); | 835 | this ); |
826 | brAction->addTo( importMenu ); | 836 | brAction->addTo( importMenu ); |
827 | brAction->setToggleAction (true ) ; | 837 | brAction->setToggleAction (true ) ; |
828 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); | 838 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); |
829 | 839 | ||
830 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, | 840 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, |
831 | this ); | 841 | this ); |
832 | action->addTo( importMenu ); | 842 | action->addTo( importMenu ); |
833 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); | 843 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); |
834 | 844 | ||
835 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, | 845 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, |
836 | this ); | 846 | this ); |
837 | action->addTo( importMenu ); | 847 | action->addTo( importMenu ); |
838 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); | 848 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); |
839 | #else | 849 | #else |
840 | importMenu->insertSeparator(); | 850 | importMenu->insertSeparator(); |
841 | icon = loadPixmap( pathString + "print" ); | 851 | icon = loadPixmap( pathString + "print" ); |
842 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); | 852 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); |
843 | action->addTo( importMenu ); | 853 | action->addTo( importMenu ); |
844 | connect( action, SIGNAL( activated() ), | 854 | connect( action, SIGNAL( activated() ), |
845 | this, SLOT( printCal() ) ); | 855 | this, SLOT( printCal() ) ); |
846 | 856 | ||
847 | icon = loadPixmap( pathString + "print" ); | 857 | icon = loadPixmap( pathString + "print" ); |
848 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); | 858 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); |
849 | action->addTo( importMenu ); | 859 | action->addTo( importMenu ); |
850 | connect( action, SIGNAL( activated() ), | 860 | connect( action, SIGNAL( activated() ), |
851 | this, SLOT( printSel() ) ); | 861 | this, SLOT( printSel() ) ); |
852 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); | 862 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); |
853 | action->addTo( importMenu ); | 863 | action->addTo( importMenu ); |
854 | connect( action, SIGNAL( activated() ), | 864 | connect( action, SIGNAL( activated() ), |
855 | mView->viewManager(), SIGNAL( printWNV() ) ); | 865 | mView->viewManager(), SIGNAL( printWNV() ) ); |
856 | #endif | 866 | #endif |
857 | importMenu->insertSeparator(); | 867 | importMenu->insertSeparator(); |
858 | action = new QAction( "beam all", i18n("Save"), 0, | 868 | action = new QAction( "beam all", i18n("Save"), 0, |
859 | this ); | 869 | this ); |
860 | action->addTo( importMenu ); | 870 | action->addTo( importMenu ); |
861 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); | 871 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); |
862 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, | 872 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, |
863 | this ); | 873 | this ); |
864 | action->addTo( importMenu ); | 874 | action->addTo( importMenu ); |
865 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); | 875 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); |
866 | 876 | ||
867 | //menuBar->insertItem( "Configure",configureMenu ); | 877 | //menuBar->insertItem( "Configure",configureMenu ); |
868 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); | 878 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); |
869 | icon = loadPixmap( "korganizer/korganizer" ); | 879 | icon = loadPixmap( "korganizer/korganizer" ); |
870 | 880 | ||
871 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); | 881 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); |
872 | action->addTo( helpMenu ); | 882 | action->addTo( helpMenu ); |
873 | connect( action, SIGNAL( activated() ), | 883 | connect( action, SIGNAL( activated() ), |
874 | SLOT( whatsNew() ) ); | 884 | SLOT( whatsNew() ) ); |
875 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); | 885 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); |
876 | action->addTo( helpMenu ); | 886 | action->addTo( helpMenu ); |
877 | connect( action, SIGNAL( activated() ), | 887 | connect( action, SIGNAL( activated() ), |
878 | SLOT( features() ) ); | 888 | SLOT( features() ) ); |
879 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); | 889 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); |
880 | action->addTo( helpMenu ); | 890 | action->addTo( helpMenu ); |
881 | connect( action, SIGNAL( activated() ), | 891 | connect( action, SIGNAL( activated() ), |
882 | SLOT( keyBindings() ) ); | 892 | SLOT( keyBindings() ) ); |
883 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); | 893 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); |
884 | action->addTo( helpMenu ); | 894 | action->addTo( helpMenu ); |
885 | connect( action, SIGNAL( activated() ), | 895 | connect( action, SIGNAL( activated() ), |
886 | SLOT( synchowto() ) ); | 896 | SLOT( synchowto() ) ); |
887 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); | 897 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); |
888 | action->addTo( helpMenu ); | 898 | action->addTo( helpMenu ); |
889 | connect( action, SIGNAL( activated() ), | 899 | connect( action, SIGNAL( activated() ), |
890 | SLOT( kdesynchowto() ) ); | 900 | SLOT( kdesynchowto() ) ); |
891 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); | 901 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); |
892 | action->addTo( helpMenu ); | 902 | action->addTo( helpMenu ); |
893 | connect( action, SIGNAL( activated() ), | 903 | connect( action, SIGNAL( activated() ), |
894 | SLOT( multisynchowto() ) ); | 904 | SLOT( multisynchowto() ) ); |
895 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); | 905 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); |
896 | action->addTo( helpMenu ); | 906 | action->addTo( helpMenu ); |
897 | connect( action, SIGNAL( activated() ), | 907 | connect( action, SIGNAL( activated() ), |
898 | SLOT( aboutAutoSaving() ) ); | 908 | SLOT( aboutAutoSaving() ) ); |
899 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); | 909 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); |
900 | action->addTo( helpMenu ); | 910 | action->addTo( helpMenu ); |
901 | connect( action, SIGNAL( activated() ), | 911 | connect( action, SIGNAL( activated() ), |
902 | SLOT( aboutKnownBugs() ) ); | 912 | SLOT( aboutKnownBugs() ) ); |
903 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); | 913 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); |
904 | action->addTo( helpMenu ); | 914 | action->addTo( helpMenu ); |
905 | connect( action, SIGNAL( activated() ), | 915 | connect( action, SIGNAL( activated() ), |
906 | SLOT( usertrans() ) ); | 916 | SLOT( usertrans() ) ); |
907 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); | 917 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); |
908 | action->addTo( helpMenu ); | 918 | action->addTo( helpMenu ); |
909 | connect( action, SIGNAL( activated() ), | 919 | connect( action, SIGNAL( activated() ), |
910 | SLOT( faq() ) ); | 920 | SLOT( faq() ) ); |
911 | action = new QAction( "licence", i18n("Licence..."), 0, this ); | 921 | action = new QAction( "licence", i18n("Licence..."), 0, this ); |
912 | action->addTo( helpMenu ); | 922 | action->addTo( helpMenu ); |
913 | connect( action, SIGNAL( activated() ), | 923 | connect( action, SIGNAL( activated() ), |
914 | SLOT( licence() ) ); | 924 | SLOT( licence() ) ); |
915 | action = new QAction( "about", i18n("About..."), 0, this ); | 925 | action = new QAction( "about", i18n("About..."), 0, this ); |
916 | action->addTo( helpMenu ); | 926 | action->addTo( helpMenu ); |
917 | connect( action, SIGNAL( activated() ), | 927 | connect( action, SIGNAL( activated() ), |
918 | SLOT( about() ) ); | 928 | SLOT( about() ) ); |
919 | //menuBar->insertSeparator(); | 929 | //menuBar->insertSeparator(); |
920 | 930 | ||
921 | // ****************************************************** | 931 | // ****************************************************** |
922 | // menubar icons | 932 | // menubar icons |
923 | 933 | ||
924 | 934 | ||
925 | iconToolBar->setHorizontalStretchable (true ); | 935 | iconToolBar->setHorizontalStretchable (true ); |
926 | //menuBar->insertItem( iconToolBar ); | 936 | //menuBar->insertItem( iconToolBar ); |
927 | //xdays_action | 937 | //xdays_action |
928 | if (p-> mShowIconNewEvent) | 938 | if (p-> mShowIconNewEvent) |
929 | ne_action->addTo( iconToolBar ); | 939 | ne_action->addTo( iconToolBar ); |
930 | if (p->mShowIconNewTodo ) | 940 | if (p->mShowIconNewTodo ) |
931 | nt_action->addTo( iconToolBar ); | 941 | nt_action->addTo( iconToolBar ); |
932 | if (p-> mShowIconSearch) | 942 | if (p-> mShowIconSearch) |
933 | search_action->addTo( iconToolBar ); | 943 | search_action->addTo( iconToolBar ); |
934 | if (p-> mShowIconNext) | 944 | if (p-> mShowIconNext) |
935 | whatsnext_action->addTo( iconToolBar ); | 945 | whatsnext_action->addTo( iconToolBar ); |
936 | if (p-> mShowIconNextDays) | 946 | if (p-> mShowIconNextDays) |
937 | xdays_action->addTo( iconToolBar ); | 947 | xdays_action->addTo( iconToolBar ); |
938 | if (p-> mShowIconList) | 948 | if (p-> mShowIconList) |
939 | showlist_action->addTo( iconToolBar ); | 949 | showlist_action->addTo( iconToolBar ); |
940 | if (p-> mShowIconDay1) | 950 | if (p-> mShowIconDay1) |
941 | day1_action->addTo( iconToolBar ); | 951 | day1_action->addTo( iconToolBar ); |
942 | if (p-> mShowIconDay5) | 952 | if (p-> mShowIconDay5) |
943 | day5_action->addTo( iconToolBar ); | 953 | day5_action->addTo( iconToolBar ); |
944 | if (p-> mShowIconDay7) | 954 | if (p-> mShowIconDay7) |
945 | day7_action->addTo( iconToolBar ); | 955 | day7_action->addTo( iconToolBar ); |
946 | if (p-> mShowIconMonth) | 956 | if (p-> mShowIconMonth) |
947 | month_action->addTo( iconToolBar ); | 957 | month_action->addTo( iconToolBar ); |
948 | if (p-> mShowIconTodoview) | 958 | if (p-> mShowIconTodoview) |
949 | todoview_action->addTo( iconToolBar ); | 959 | todoview_action->addTo( iconToolBar ); |
950 | if (p-> mShowIconJournal) | 960 | if (p-> mShowIconJournal) |
951 | viewjournal_action->addTo( iconToolBar ); | 961 | viewjournal_action->addTo( iconToolBar ); |
952 | icon = loadPixmap( pathString + "2leftarrowB" ); | 962 | icon = loadPixmap( pathString + "2leftarrowB" ); |
953 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); | 963 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); |
954 | if (p-> mShowIconBackFast) { | 964 | if (p-> mShowIconBackFast) { |
955 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); | 965 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); |
956 | connect( action, SIGNAL( activated() ), | 966 | connect( action, SIGNAL( activated() ), |
957 | mView, SLOT( goPreviousMonth() ) ); | 967 | mView, SLOT( goPreviousMonth() ) ); |
958 | action->addTo( iconToolBar ); | 968 | action->addTo( iconToolBar ); |
959 | } | 969 | } |
960 | icon = loadPixmap( pathString + "1leftarrowB" ); | 970 | icon = loadPixmap( pathString + "1leftarrowB" ); |
961 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); | 971 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); |
962 | if (p-> mShowIconBack) { | 972 | if (p-> mShowIconBack) { |
963 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); | 973 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); |
964 | connect( action, SIGNAL( activated() ), | 974 | connect( action, SIGNAL( activated() ), |
965 | mView, SLOT( goPrevious() ) ); | 975 | mView, SLOT( goPrevious() ) ); |
966 | action->addTo( iconToolBar ); | 976 | action->addTo( iconToolBar ); |
967 | } | 977 | } |
968 | if (p-> mShowIconToday) | 978 | if (p-> mShowIconToday) |
969 | today_action->addTo( iconToolBar ); | 979 | today_action->addTo( iconToolBar ); |
970 | icon = loadPixmap( pathString + "1rightarrowB" ); | 980 | icon = loadPixmap( pathString + "1rightarrowB" ); |
971 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); | 981 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); |
972 | if (p-> mShowIconForward) { | 982 | if (p-> mShowIconForward) { |
973 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); | 983 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); |
974 | connect( action, SIGNAL( activated() ), | 984 | connect( action, SIGNAL( activated() ), |
975 | mView, SLOT( goNext() ) ); | 985 | mView, SLOT( goNext() ) ); |
976 | action->addTo( iconToolBar ); | 986 | action->addTo( iconToolBar ); |
977 | } | 987 | } |
978 | icon = loadPixmap( pathString + "2rightarrowB" ); | 988 | icon = loadPixmap( pathString + "2rightarrowB" ); |
979 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); | 989 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); |
980 | if (p-> mShowIconForwardFast) { | 990 | if (p-> mShowIconForwardFast) { |
981 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); | 991 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); |
982 | connect( action, SIGNAL( activated() ), | 992 | connect( action, SIGNAL( activated() ), |
983 | mView, SLOT( goNextMonth() ) ); | 993 | mView, SLOT( goNextMonth() ) ); |
984 | action->addTo( iconToolBar ); | 994 | action->addTo( iconToolBar ); |
985 | } | 995 | } |
986 | 996 | ||
987 | 997 | ||
988 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); | 998 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); |
989 | 999 | ||
990 | if (p-> mShowIconNewEvent) | 1000 | if (p-> mShowIconNewEvent) |
991 | configureToolBarMenu->setItemChecked( 10, true ); | 1001 | configureToolBarMenu->setItemChecked( 10, true ); |
992 | if (p->mShowIconNewTodo ) | 1002 | if (p->mShowIconNewTodo ) |
993 | configureToolBarMenu->setItemChecked( 20, true ); | 1003 | configureToolBarMenu->setItemChecked( 20, true ); |
994 | if (p-> mShowIconSearch) | 1004 | if (p-> mShowIconSearch) |
995 | configureToolBarMenu->setItemChecked( 120, true ); | 1005 | configureToolBarMenu->setItemChecked( 120, true ); |
996 | if (p-> mShowIconList) | 1006 | if (p-> mShowIconList) |
997 | configureToolBarMenu->setItemChecked( 30, true ); | 1007 | configureToolBarMenu->setItemChecked( 30, true ); |
998 | if (p-> mShowIconDay1) | 1008 | if (p-> mShowIconDay1) |
@@ -1339,576 +1349,571 @@ void MainWindow::processIncidenceSelection( Incidence *incidence ) | |||
1339 | if ( incidence->type() == "Event" ) { | 1349 | if ( incidence->type() == "Event" ) { |
1340 | mShowAction->setText( i18n("Show Event...") ); | 1350 | mShowAction->setText( i18n("Show Event...") ); |
1341 | mEditAction->setText( i18n("Edit Event...") ); | 1351 | mEditAction->setText( i18n("Edit Event...") ); |
1342 | mDeleteAction->setText( i18n("Delete Event...") ); | 1352 | mDeleteAction->setText( i18n("Delete Event...") ); |
1343 | 1353 | ||
1344 | mNewSubTodoAction->setEnabled( false ); | 1354 | mNewSubTodoAction->setEnabled( false ); |
1345 | } else if ( incidence->type() == "Todo" ) { | 1355 | } else if ( incidence->type() == "Todo" ) { |
1346 | mShowAction->setText( i18n("Show Todo...") ); | 1356 | mShowAction->setText( i18n("Show Todo...") ); |
1347 | mEditAction->setText( i18n("Edit Todo...") ); | 1357 | mEditAction->setText( i18n("Edit Todo...") ); |
1348 | mDeleteAction->setText( i18n("Delete Todo...") ); | 1358 | mDeleteAction->setText( i18n("Delete Todo...") ); |
1349 | 1359 | ||
1350 | mNewSubTodoAction->setEnabled( true ); | 1360 | mNewSubTodoAction->setEnabled( true ); |
1351 | } else { | 1361 | } else { |
1352 | mShowAction->setText( i18n("Show...") ); | 1362 | mShowAction->setText( i18n("Show...") ); |
1353 | mShowAction->setText( i18n("Edit...") ); | 1363 | mShowAction->setText( i18n("Edit...") ); |
1354 | mShowAction->setText( i18n("Delete...") ); | 1364 | mShowAction->setText( i18n("Delete...") ); |
1355 | 1365 | ||
1356 | mNewSubTodoAction->setEnabled( false ); | 1366 | mNewSubTodoAction->setEnabled( false ); |
1357 | } | 1367 | } |
1358 | } | 1368 | } |
1359 | 1369 | ||
1360 | void MainWindow::enableIncidenceActions( bool enabled ) | 1370 | void MainWindow::enableIncidenceActions( bool enabled ) |
1361 | { | 1371 | { |
1362 | mShowAction->setEnabled( enabled ); | 1372 | mShowAction->setEnabled( enabled ); |
1363 | mEditAction->setEnabled( enabled ); | 1373 | mEditAction->setEnabled( enabled ); |
1364 | mDeleteAction->setEnabled( enabled ); | 1374 | mDeleteAction->setEnabled( enabled ); |
1365 | 1375 | ||
1366 | mCloneAction->setEnabled( enabled ); | 1376 | mCloneAction->setEnabled( enabled ); |
1367 | mMoveAction->setEnabled( enabled ); | 1377 | mMoveAction->setEnabled( enabled ); |
1368 | mBeamAction->setEnabled( enabled ); | 1378 | mBeamAction->setEnabled( enabled ); |
1369 | mCancelAction->setEnabled( enabled ); | 1379 | mCancelAction->setEnabled( enabled ); |
1370 | } | 1380 | } |
1371 | 1381 | ||
1372 | void MainWindow::importOL() | 1382 | void MainWindow::importOL() |
1373 | { | 1383 | { |
1374 | #ifdef _OL_IMPORT_ | 1384 | #ifdef _OL_IMPORT_ |
1375 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); | 1385 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); |
1376 | id->exec(); | 1386 | id->exec(); |
1377 | delete id; | 1387 | delete id; |
1378 | mView->updateView(); | 1388 | mView->updateView(); |
1379 | #endif | 1389 | #endif |
1380 | } | 1390 | } |
1381 | void MainWindow::importBday() | 1391 | void MainWindow::importBday() |
1382 | { | 1392 | { |
1383 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1393 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1384 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), | 1394 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), |
1385 | i18n("Import!"), i18n("Cancel"), 0, | 1395 | i18n("Import!"), i18n("Cancel"), 0, |
1386 | 0, 1 ); | 1396 | 0, 1 ); |
1387 | if ( result == 0 ) { | 1397 | if ( result == 0 ) { |
1388 | mView->importBday(); | 1398 | mView->importBday(); |
1389 | 1399 | ||
1390 | } | 1400 | } |
1391 | 1401 | ||
1392 | 1402 | ||
1393 | } | 1403 | } |
1394 | void MainWindow::importQtopia() | 1404 | void MainWindow::importQtopia() |
1395 | { | 1405 | { |
1396 | #ifndef DESKTOP_VERSION | 1406 | #ifndef DESKTOP_VERSION |
1397 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1407 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1398 | 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"), | 1408 | 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"), |
1399 | i18n("Import!"), i18n("Cancel"), 0, | 1409 | i18n("Import!"), i18n("Cancel"), 0, |
1400 | 0, 1 ); | 1410 | 0, 1 ); |
1401 | if ( result == 0 ) { | 1411 | if ( result == 0 ) { |
1402 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); | 1412 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); |
1403 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); | 1413 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); |
1404 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; | 1414 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; |
1405 | mView->importQtopia( categories, datebook, todolist ); | 1415 | mView->importQtopia( categories, datebook, todolist ); |
1406 | } | 1416 | } |
1407 | #else | 1417 | #else |
1408 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1418 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1409 | i18n("Not supported \non desktop!\n"), | 1419 | i18n("Not supported \non desktop!\n"), |
1410 | i18n("Ok"), i18n("Cancel"), 0, | 1420 | i18n("Ok"), i18n("Cancel"), 0, |
1411 | 0, 1 ); | 1421 | 0, 1 ); |
1412 | 1422 | ||
1413 | #endif | 1423 | #endif |
1414 | } | 1424 | } |
1415 | 1425 | ||
1416 | void MainWindow::saveOnClose() | 1426 | void MainWindow::saveOnClose() |
1417 | { | 1427 | { |
1418 | KOPrefs *p = KOPrefs::instance(); | 1428 | KOPrefs *p = KOPrefs::instance(); |
1419 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); | 1429 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); |
1420 | p->mToolBarUp = iconToolBar->x() > width()/2 || | 1430 | p->mToolBarUp = iconToolBar->x() > width()/2 || |
1421 | iconToolBar->y() > height()/2; | 1431 | iconToolBar->y() > height()/2; |
1422 | mView->writeSettings(); | 1432 | mView->writeSettings(); |
1423 | if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) | 1433 | if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) |
1424 | save(); | 1434 | save(); |
1425 | } | 1435 | } |
1426 | void MainWindow::slotModifiedChanged( bool changed ) | 1436 | void MainWindow::slotModifiedChanged( bool changed ) |
1427 | { | 1437 | { |
1428 | if ( mBlockAtStartup ) | 1438 | if ( mBlockAtStartup ) |
1429 | return; | 1439 | return; |
1430 | int msec; | 1440 | int msec; |
1431 | // we store the changes after 1 minute, | 1441 | // we store the changes after 1 minute, |
1432 | // and for safety reasons after 10 minutes again | 1442 | // and for safety reasons after 10 minutes again |
1433 | if ( !mSyncManager->blockSave() ) | 1443 | if ( !mSyncManager->blockSave() ) |
1434 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; | 1444 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; |
1435 | else | 1445 | else |
1436 | msec = 1000 * 600; | 1446 | msec = 1000 * 600; |
1437 | mSaveTimer.start( msec, true ); // 1 minute | 1447 | mSaveTimer.start( msec, true ); // 1 minute |
1438 | qDebug("KO: Saving File in %d secs!", msec/1000); | 1448 | qDebug("KO: Saving File in %d secs!", msec/1000); |
1439 | mCalendarModifiedFlag = true; | 1449 | mCalendarModifiedFlag = true; |
1440 | } | 1450 | } |
1441 | void MainWindow::save() | 1451 | void MainWindow::save() |
1442 | { | 1452 | { |
1443 | if ( mSyncManager->blockSave() ) | 1453 | if ( mSyncManager->blockSave() ) |
1444 | return; | 1454 | return; |
1445 | mSyncManager->setBlockSave(true); | 1455 | mSyncManager->setBlockSave(true); |
1446 | if ( mView->checkFileVersion( defaultFileName()) ) { | 1456 | if ( mView->checkFileVersion( defaultFileName()) ) { |
1447 | 1457 | ||
1448 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 1458 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
1449 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); | 1459 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); |
1450 | qDebug("KO: Start saving data to file!"); | 1460 | qDebug("KO: Start saving data to file!"); |
1451 | mView->saveCalendar( defaultFileName() ); | 1461 | mView->saveCalendar( defaultFileName() ); |
1452 | 1462 | ||
1453 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 1463 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
1454 | qDebug("KO: Needed %d ms for saving.",msNeeded ); | 1464 | qDebug("KO: Needed %d ms for saving.",msNeeded ); |
1455 | QString savemes; | 1465 | QString savemes; |
1456 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); | 1466 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); |
1457 | setCaption(savemes); | 1467 | setCaption(savemes); |
1458 | } else | 1468 | } else |
1459 | setCaption(i18n("Saving cancelled!")); | 1469 | setCaption(i18n("Saving cancelled!")); |
1460 | mCalendarModifiedFlag = false; | 1470 | mCalendarModifiedFlag = false; |
1461 | mSyncManager->setBlockSave( false ); | 1471 | mSyncManager->setBlockSave( false ); |
1462 | } | 1472 | } |
1463 | 1473 | ||
1464 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) | 1474 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) |
1465 | { | 1475 | { |
1466 | if ( !e->isAutoRepeat() ) { | 1476 | if ( !e->isAutoRepeat() ) { |
1467 | mFlagKeyPressed = false; | 1477 | mFlagKeyPressed = false; |
1468 | } | 1478 | } |
1469 | } | 1479 | } |
1470 | void MainWindow::keyPressEvent ( QKeyEvent * e ) | 1480 | void MainWindow::keyPressEvent ( QKeyEvent * e ) |
1471 | { | 1481 | { |
1472 | qApp->processEvents(); | 1482 | qApp->processEvents(); |
1473 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { | 1483 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { |
1474 | e->ignore(); | 1484 | e->ignore(); |
1475 | // qDebug(" ignore %d",e->isAutoRepeat() ); | 1485 | // qDebug(" ignore %d",e->isAutoRepeat() ); |
1476 | return; | 1486 | return; |
1477 | } | 1487 | } |
1478 | if (! e->isAutoRepeat() ) | 1488 | if (! e->isAutoRepeat() ) |
1479 | mFlagKeyPressed = true; | 1489 | mFlagKeyPressed = true; |
1480 | KOPrefs *p = KOPrefs::instance(); | 1490 | KOPrefs *p = KOPrefs::instance(); |
1481 | bool showSelectedDates = false; | 1491 | bool showSelectedDates = false; |
1482 | int size; | 1492 | int size; |
1483 | int pro = 0; | 1493 | int pro = 0; |
1484 | //qDebug("MainWindow::keyPressEvent "); | 1494 | //qDebug("MainWindow::keyPressEvent "); |
1485 | switch ( e->key() ) { | 1495 | switch ( e->key() ) { |
1486 | case Qt::Key_Right: | 1496 | case Qt::Key_Right: |
1487 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) | 1497 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
1488 | mView->goNextMonth(); | 1498 | mView->goNextMonth(); |
1489 | else | 1499 | else |
1490 | mView->goNext(); | 1500 | mView->goNext(); |
1491 | showSelectedDates = true; | 1501 | showSelectedDates = true; |
1492 | break; | 1502 | break; |
1493 | case Qt::Key_Left: | 1503 | case Qt::Key_Left: |
1494 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1504 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1495 | mView->goPreviousMonth(); | 1505 | mView->goPreviousMonth(); |
1496 | else | 1506 | else |
1497 | mView->goPrevious(); | 1507 | mView->goPrevious(); |
1498 | showSelectedDates = true; | 1508 | showSelectedDates = true; |
1499 | break; | 1509 | break; |
1500 | case Qt::Key_Down: | 1510 | case Qt::Key_Down: |
1501 | mView->viewManager()->agendaView()->scrollOneHourDown(); | 1511 | mView->viewManager()->agendaView()->scrollOneHourDown(); |
1502 | break; | 1512 | break; |
1503 | case Qt::Key_Up: | 1513 | case Qt::Key_Up: |
1504 | mView->viewManager()->agendaView()->scrollOneHourUp(); | 1514 | mView->viewManager()->agendaView()->scrollOneHourUp(); |
1505 | break; | 1515 | break; |
1506 | case Qt::Key_I: | 1516 | case Qt::Key_I: |
1507 | mView->showIncidence(); | 1517 | mView->showIncidence(); |
1508 | break; | 1518 | break; |
1509 | case Qt::Key_Delete: | 1519 | case Qt::Key_Delete: |
1510 | case Qt::Key_Backspace: | 1520 | case Qt::Key_Backspace: |
1511 | mView->deleteIncidence(); | 1521 | mView->deleteIncidence(); |
1512 | break; | 1522 | break; |
1513 | case Qt::Key_D: | 1523 | case Qt::Key_D: |
1514 | mView->viewManager()->showDayView(); | 1524 | mView->viewManager()->showDayView(); |
1515 | showSelectedDates = true; | 1525 | showSelectedDates = true; |
1516 | break; | 1526 | break; |
1517 | case Qt::Key_O: | 1527 | case Qt::Key_O: |
1518 | mView->toggleFilerEnabled( ); | 1528 | mView->toggleFilerEnabled( ); |
1519 | break; | 1529 | break; |
1520 | case Qt::Key_0: | 1530 | case Qt::Key_0: |
1521 | case Qt::Key_1: | 1531 | case Qt::Key_1: |
1522 | case Qt::Key_2: | 1532 | case Qt::Key_2: |
1523 | case Qt::Key_3: | 1533 | case Qt::Key_3: |
1524 | case Qt::Key_4: | 1534 | case Qt::Key_4: |
1525 | case Qt::Key_5: | 1535 | case Qt::Key_5: |
1526 | case Qt::Key_6: | 1536 | case Qt::Key_6: |
1527 | case Qt::Key_7: | 1537 | case Qt::Key_7: |
1528 | case Qt::Key_8: | 1538 | case Qt::Key_8: |
1529 | case Qt::Key_9: | 1539 | case Qt::Key_9: |
1530 | pro = e->key()-48; | 1540 | pro = e->key()-48; |
1531 | if ( pro == 0 ) | 1541 | if ( pro == 0 ) |
1532 | pro = 10; | 1542 | pro = 10; |
1533 | if ( e->state() == Qt::ControlButton) | 1543 | if ( e->state() == Qt::ControlButton) |
1534 | pro += 10; | 1544 | pro += 10; |
1535 | break; | 1545 | break; |
1536 | case Qt::Key_M: | 1546 | case Qt::Key_M: |
1537 | mView->viewManager()->showMonthView(); | 1547 | mView->viewManager()->showMonthView(); |
1538 | showSelectedDates = true; | 1548 | showSelectedDates = true; |
1539 | break; | 1549 | break; |
1540 | case Qt::Key_Insert: | 1550 | case Qt::Key_Insert: |
1541 | mView->newEvent(); | 1551 | mView->newEvent(); |
1542 | break; | 1552 | break; |
1543 | case Qt::Key_S : | 1553 | case Qt::Key_S : |
1544 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) | 1554 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
1545 | mView->newSubTodo(); | 1555 | mView->newSubTodo(); |
1546 | else | 1556 | else |
1547 | mView->dialogManager()->showSearchDialog(); | 1557 | mView->dialogManager()->showSearchDialog(); |
1548 | break; | 1558 | break; |
1549 | case Qt::Key_Y : | 1559 | case Qt::Key_Y : |
1550 | case Qt::Key_Z : | 1560 | case Qt::Key_Z : |
1551 | mView->viewManager()->showWorkWeekView(); | 1561 | mView->viewManager()->showWorkWeekView(); |
1552 | showSelectedDates = true; | 1562 | showSelectedDates = true; |
1553 | break; | 1563 | break; |
1554 | case Qt::Key_U : | 1564 | case Qt::Key_U : |
1555 | mView->viewManager()->showWeekView(); | 1565 | mView->viewManager()->showWeekView(); |
1556 | showSelectedDates = true; | 1566 | showSelectedDates = true; |
1557 | break; | 1567 | break; |
1558 | case Qt::Key_H : | 1568 | case Qt::Key_H : |
1559 | keyBindings(); | 1569 | keyBindings(); |
1560 | break; | 1570 | break; |
1561 | case Qt::Key_W: | 1571 | case Qt::Key_W: |
1562 | mView->viewManager()->showWhatsNextView(); | 1572 | mView->viewManager()->showWhatsNextView(); |
1563 | break; | 1573 | break; |
1564 | case Qt::Key_L: | 1574 | case Qt::Key_L: |
1565 | mView->viewManager()->showListView(); | 1575 | mView->viewManager()->showListView(); |
1566 | break; | 1576 | break; |
1567 | case Qt::Key_N: | 1577 | case Qt::Key_N: |
1568 | mView->viewManager()->showNextXView(); | 1578 | mView->viewManager()->showNextXView(); |
1569 | showSelectedDates = true; | 1579 | showSelectedDates = true; |
1570 | break; | 1580 | break; |
1571 | case Qt::Key_V: | 1581 | case Qt::Key_V: |
1572 | mView->viewManager()->showTodoView(); | 1582 | mView->viewManager()->showTodoView(); |
1573 | break; | 1583 | break; |
1574 | case Qt::Key_C: | 1584 | case Qt::Key_C: |
1575 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); | 1585 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); |
1576 | break; | 1586 | break; |
1577 | case Qt::Key_P: | 1587 | case Qt::Key_P: |
1578 | mView->showDatePicker( ); | 1588 | mView->showDatePicker( ); |
1579 | break; | 1589 | break; |
1580 | case Qt::Key_F: | 1590 | case Qt::Key_F: |
1581 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1591 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1582 | mView->editFilters(); | 1592 | mView->editFilters(); |
1583 | else | 1593 | else |
1584 | mView->toggleFilter(); | 1594 | mView->toggleFilter(); |
1585 | break; | 1595 | break; |
1586 | case Qt::Key_X: | 1596 | case Qt::Key_X: |
1587 | mView->toggleDateNavigatorWidget(); | 1597 | mView->toggleDateNavigatorWidget(); |
1588 | break; | 1598 | break; |
1589 | case Qt::Key_Space: | 1599 | case Qt::Key_Space: |
1590 | mView->toggleExpand(); | 1600 | mView->toggleExpand(); |
1591 | break; | 1601 | break; |
1592 | case Qt::Key_A: | 1602 | case Qt::Key_A: |
1593 | mView->toggleAllDaySize(); | 1603 | mView->toggleAllDaySize(); |
1594 | break; | 1604 | break; |
1595 | case Qt::Key_T: | 1605 | case Qt::Key_T: |
1596 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1606 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1597 | mView->newTodo(); | 1607 | mView->newTodo(); |
1598 | else { | 1608 | else { |
1599 | mView->goToday(); | 1609 | mView->goToday(); |
1600 | showSelectedDates = true; | 1610 | showSelectedDates = true; |
1601 | } | 1611 | } |
1602 | break; | 1612 | break; |
1603 | case Qt::Key_J: | 1613 | case Qt::Key_J: |
1604 | mView->viewManager()->showJournalView(); | 1614 | mView->viewManager()->showJournalView(); |
1605 | break; | 1615 | break; |
1606 | case Qt::Key_B: | 1616 | case Qt::Key_B: |
1607 | mView->editIncidenceDescription();; | 1617 | mView->editIncidenceDescription();; |
1608 | break; | 1618 | break; |
1609 | // case Qt::Key_Return: | 1619 | // case Qt::Key_Return: |
1610 | case Qt::Key_E: | 1620 | case Qt::Key_E: |
1611 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1621 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1612 | mView->newEvent(); | 1622 | mView->newEvent(); |
1613 | else | 1623 | else |
1614 | mView->editIncidence(); | 1624 | mView->editIncidence(); |
1615 | break; | 1625 | break; |
1616 | case Qt::Key_Plus: | 1626 | case Qt::Key_Plus: |
1617 | size = p->mHourSize +2; | 1627 | size = p->mHourSize +2; |
1618 | if ( size <= 18 ) | 1628 | if ( size <= 18 ) |
1619 | configureAgenda( size ); | 1629 | configureAgenda( size ); |
1620 | break; | 1630 | break; |
1621 | case Qt::Key_Minus: | 1631 | case Qt::Key_Minus: |
1622 | size = p->mHourSize - 2; | 1632 | size = p->mHourSize - 2; |
1623 | if ( size >= 4 ) | 1633 | if ( size >= 4 ) |
1624 | configureAgenda( size ); | 1634 | configureAgenda( size ); |
1625 | break; | 1635 | break; |
1626 | 1636 | ||
1627 | 1637 | ||
1628 | default: | 1638 | default: |
1629 | e->ignore(); | 1639 | e->ignore(); |
1630 | } | 1640 | } |
1631 | if ( pro > 0 ) { | 1641 | if ( pro > 0 ) { |
1632 | mView->selectFilter( pro-1 ); | 1642 | mView->selectFilter( pro-1 ); |
1633 | } | 1643 | } |
1634 | if ( showSelectedDates ) { | 1644 | if ( showSelectedDates ) { |
1635 | ;// setCaptionToDates(); | 1645 | ;// setCaptionToDates(); |
1636 | } | 1646 | } |
1637 | 1647 | ||
1638 | } | 1648 | } |
1639 | 1649 | ||
1640 | void MainWindow::fillFilterMenu() | 1650 | void MainWindow::fillFilterMenu() |
1641 | { | 1651 | { |
1642 | selectFilterMenu->clear(); | 1652 | selectFilterMenu->clear(); |
1643 | bool disable = false; | 1653 | bool disable = false; |
1644 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); | 1654 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); |
1645 | selectFilterMenu->insertSeparator(); | 1655 | selectFilterMenu->insertSeparator(); |
1646 | if ( mView->filterView()->filtersEnabled() ) { | 1656 | if ( mView->filterView()->filtersEnabled() ) { |
1647 | selectFilterMenu->insertItem(i18n ( "Turn filter off" ), 1 ); | 1657 | selectFilterMenu->insertItem(i18n ( "Turn filter off" ), 1 ); |
1648 | } | 1658 | } |
1649 | else { | 1659 | else { |
1650 | selectFilterMenu->insertItem(i18n ( "Turn filter on" ), 1 ); | 1660 | selectFilterMenu->insertItem(i18n ( "Turn filter on" ), 1 ); |
1651 | disable = true; | 1661 | disable = true; |
1652 | } | 1662 | } |
1653 | selectFilterMenu->insertSeparator(); | 1663 | selectFilterMenu->insertSeparator(); |
1654 | QPtrList<CalFilter> fili = mView->filters(); | 1664 | QPtrList<CalFilter> fili = mView->filters(); |
1655 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 1665 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
1656 | CalFilter *filter = fili.first(); | 1666 | CalFilter *filter = fili.first(); |
1657 | int iii = 2; | 1667 | int iii = 2; |
1658 | while(filter) { | 1668 | while(filter) { |
1659 | selectFilterMenu->insertItem( filter->name(), iii ); | 1669 | selectFilterMenu->insertItem( filter->name(), iii ); |
1660 | if ( filter == curfilter) | 1670 | if ( filter == curfilter) |
1661 | selectFilterMenu->setItemChecked( iii, true ); | 1671 | selectFilterMenu->setItemChecked( iii, true ); |
1662 | if ( disable ) | 1672 | if ( disable ) |
1663 | selectFilterMenu->setItemEnabled( iii, false ); | 1673 | selectFilterMenu->setItemEnabled( iii, false ); |
1664 | filter = fili.next(); | 1674 | filter = fili.next(); |
1665 | ++iii; | 1675 | ++iii; |
1666 | } | 1676 | } |
1667 | } | 1677 | } |
1668 | void MainWindow::selectFilter( int fil ) | 1678 | void MainWindow::selectFilter( int fil ) |
1669 | { | 1679 | { |
1670 | if ( fil == 0 ) { | 1680 | if ( fil == 0 ) { |
1671 | mView->editFilters( ); | 1681 | mView->editFilters( ); |
1672 | } else if ( fil == 1 ){ | 1682 | } else if ( fil == 1 ){ |
1673 | mView->toggleFilerEnabled( ); | 1683 | mView->toggleFilerEnabled( ); |
1674 | } else { | 1684 | } else { |
1675 | mView->selectFilter( fil-2 ); | 1685 | mView->selectFilter( fil-2 ); |
1676 | } | 1686 | } |
1677 | } | 1687 | } |
1678 | void MainWindow::configureToolBar( int item ) | 1688 | void MainWindow::configureToolBar( int item ) |
1679 | { | 1689 | { |
1680 | 1690 | ||
1681 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); | 1691 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); |
1682 | KOPrefs *p = KOPrefs::instance(); | 1692 | KOPrefs *p = KOPrefs::instance(); |
1683 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); | 1693 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); |
1684 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); | 1694 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); |
1685 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); | 1695 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); |
1686 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); | 1696 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); |
1687 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); | 1697 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); |
1688 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); | 1698 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); |
1689 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); | 1699 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); |
1690 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); | 1700 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); |
1691 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); | 1701 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); |
1692 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); | 1702 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); |
1693 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); | 1703 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); |
1694 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); | 1704 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); |
1695 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); | 1705 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); |
1696 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); | 1706 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); |
1697 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); | 1707 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); |
1698 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); | 1708 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); |
1699 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); | 1709 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); |
1700 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); | 1710 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); |
1701 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); | 1711 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); |
1702 | // initActions(); | 1712 | // initActions(); |
1703 | } | 1713 | } |
1704 | 1714 | ||
1705 | void MainWindow::setCaptionToDates() | 1715 | void MainWindow::setCaptionToDates() |
1706 | { | 1716 | { |
1707 | QString selDates; | 1717 | QString selDates; |
1708 | selDates = KGlobal::locale()->formatDate(mView->startDate(), true); | 1718 | selDates = KGlobal::locale()->formatDate(mView->startDate(), true); |
1709 | if (mView->startDate() < mView->endDate() ) | 1719 | if (mView->startDate() < mView->endDate() ) |
1710 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); | 1720 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); |
1711 | else { | 1721 | else { |
1712 | QString addString; | 1722 | QString addString; |
1713 | if ( mView->startDate() == QDateTime::currentDateTime().date() ) | 1723 | if ( mView->startDate() == QDateTime::currentDateTime().date() ) |
1714 | addString = i18n("Today"); | 1724 | addString = i18n("Today"); |
1715 | else if ( mView->startDate() == QDateTime::currentDateTime().date().addDays(1) ) | 1725 | else if ( mView->startDate() == QDateTime::currentDateTime().date().addDays(1) ) |
1716 | addString = i18n("Tomorrow"); | 1726 | addString = i18n("Tomorrow"); |
1717 | if ( !addString.isEmpty() ) | 1727 | if ( !addString.isEmpty() ) |
1718 | selDates = addString+", "+selDates ; | 1728 | selDates = addString+", "+selDates ; |
1719 | } | 1729 | } |
1720 | setCaption( i18n("Dates: ") + selDates ); | 1730 | setCaption( i18n("Dates: ") + selDates ); |
1721 | 1731 | ||
1722 | } | 1732 | } |
1723 | // parameter item == 0: reinit | 1733 | void MainWindow::showConfigureAgenda( ) |
1734 | { | ||
1735 | int iii; | ||
1736 | for ( iii = 1;iii<= 10 ;++iii ){ | ||
1737 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); | ||
1738 | } | ||
1739 | configureAgendaMenu->setItemChecked( KOPrefs::instance()->mHourSize, true ); | ||
1740 | } | ||
1724 | void MainWindow::configureAgenda( int item ) | 1741 | void MainWindow::configureAgenda( int item ) |
1725 | { | 1742 | { |
1726 | 1743 | if ( KOPrefs::instance()->mHourSize == item ) | |
1727 | KOPrefs *p = KOPrefs::instance(); | ||
1728 | |||
1729 | int i; | ||
1730 | // do not allow 4 for widgets higher than 480 | ||
1731 | // if ( QApplication::desktop()->height() > 480 ) { | ||
1732 | // if ( item == 4 ) | ||
1733 | // item = 6; | ||
1734 | // } | ||
1735 | for ( i = 4; i <= 18; i= i+2 ) | ||
1736 | configureAgendaMenu->setItemChecked( i, false ); | ||
1737 | configureAgendaMenu->setItemChecked( item, true ); | ||
1738 | if ( p->mHourSize == item ) | ||
1739 | return; | 1744 | return; |
1740 | p->mHourSize=item; | 1745 | KOPrefs::instance()->mHourSize=item; |
1741 | mView->viewManager()->agendaView()->updateConfig(); | 1746 | mView->viewManager()->agendaView()->updateConfig(); |
1742 | } | 1747 | } |
1743 | 1748 | ||
1744 | void MainWindow::saveCalendar() | 1749 | void MainWindow::saveCalendar() |
1745 | { | 1750 | { |
1746 | QString fn = KOPrefs::instance()->mLastSaveFile; | 1751 | QString fn = KOPrefs::instance()->mLastSaveFile; |
1747 | fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this ); | 1752 | fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this ); |
1748 | 1753 | ||
1749 | if ( fn == "" ) | 1754 | if ( fn == "" ) |
1750 | return; | 1755 | return; |
1751 | QFileInfo info; | 1756 | QFileInfo info; |
1752 | info.setFile( fn ); | 1757 | info.setFile( fn ); |
1753 | QString mes; | 1758 | QString mes; |
1754 | bool createbup = true; | 1759 | bool createbup = true; |
1755 | if ( info. exists() ) { | 1760 | if ( info. exists() ) { |
1756 | mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ; | 1761 | mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ; |
1757 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, | 1762 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, |
1758 | i18n("Overwrite!"), i18n("Cancel"), 0, | 1763 | i18n("Overwrite!"), i18n("Cancel"), 0, |
1759 | 0, 1 ); | 1764 | 0, 1 ); |
1760 | if ( result != 0 ) { | 1765 | if ( result != 0 ) { |
1761 | createbup = false; | 1766 | createbup = false; |
1762 | } | 1767 | } |
1763 | } | 1768 | } |
1764 | if ( createbup ) { | 1769 | if ( createbup ) { |
1765 | mView->saveCalendar( fn ); | 1770 | mView->saveCalendar( fn ); |
1766 | mes = i18n("KO/Pi:Saved %1").arg(fn); | 1771 | mes = i18n("KO/Pi:Saved %1").arg(fn); |
1767 | KOPrefs::instance()->mLastSaveFile = fn; | 1772 | KOPrefs::instance()->mLastSaveFile = fn; |
1768 | setCaption(mes); | 1773 | setCaption(mes); |
1769 | } | 1774 | } |
1770 | } | 1775 | } |
1771 | void MainWindow::loadCalendar() | 1776 | void MainWindow::loadCalendar() |
1772 | { | 1777 | { |
1773 | 1778 | ||
1774 | QString fn = KOPrefs::instance()->mLastLoadFile; | 1779 | QString fn = KOPrefs::instance()->mLastLoadFile; |
1775 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); | 1780 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); |
1776 | 1781 | ||
1777 | if ( fn == "" ) | 1782 | if ( fn == "" ) |
1778 | return; | 1783 | return; |
1779 | QFileInfo info; | 1784 | QFileInfo info; |
1780 | info.setFile( fn ); | 1785 | info.setFile( fn ); |
1781 | QString mess; | 1786 | QString mess; |
1782 | bool loadbup = true; | 1787 | bool loadbup = true; |
1783 | if ( info. exists() ) { | 1788 | if ( info. exists() ) { |
1784 | mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); | 1789 | mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); |
1785 | int result = QMessageBox::warning( this, "KO/Pi: Warning!", | 1790 | int result = QMessageBox::warning( this, "KO/Pi: Warning!", |
1786 | mess, | 1791 | mess, |
1787 | i18n("Load!"), i18n("Cancel"), 0, | 1792 | i18n("Load!"), i18n("Cancel"), 0, |
1788 | 0, 1 ); | 1793 | 0, 1 ); |
1789 | if ( result != 0 ) { | 1794 | if ( result != 0 ) { |
1790 | loadbup = false; | 1795 | loadbup = false; |
1791 | } | 1796 | } |
1792 | } else { | 1797 | } else { |
1793 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1798 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1794 | i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, | 1799 | i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, |
1795 | 0, 1 ); | 1800 | 0, 1 ); |
1796 | 1801 | ||
1797 | return; | 1802 | return; |
1798 | } | 1803 | } |
1799 | if ( loadbup ) { | 1804 | if ( loadbup ) { |
1800 | mView->openCalendar( fn ); | 1805 | mView->openCalendar( fn ); |
1801 | KOPrefs::instance()->mLastLoadFile = fn; | 1806 | KOPrefs::instance()->mLastLoadFile = fn; |
1802 | mess = i18n("KO/Pi:Loaded %1").arg(fn) ; | 1807 | mess = i18n("KO/Pi:Loaded %1").arg(fn) ; |
1803 | setCaption(mess); | 1808 | setCaption(mess); |
1804 | } | 1809 | } |
1805 | 1810 | ||
1806 | } | 1811 | } |
1807 | void MainWindow::quickImportIcal() | 1812 | void MainWindow::quickImportIcal() |
1808 | { | 1813 | { |
1809 | importFile( KOPrefs::instance()->mLastImportFile, false ); | 1814 | importFile( KOPrefs::instance()->mLastImportFile, false ); |
1810 | } | 1815 | } |
1811 | void MainWindow::importFile( QString fn, bool quick ) | 1816 | void MainWindow::importFile( QString fn, bool quick ) |
1812 | { | 1817 | { |
1813 | QFileInfo info; | 1818 | QFileInfo info; |
1814 | info.setFile( fn ); | 1819 | info.setFile( fn ); |
1815 | QString mess; | 1820 | QString mess; |
1816 | bool loadbup = true; | 1821 | bool loadbup = true; |
1817 | if ( !info. exists() ) { | 1822 | if ( !info. exists() ) { |
1818 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); | 1823 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); |
1819 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1824 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1820 | mess ); | 1825 | mess ); |
1821 | return; | 1826 | return; |
1822 | } | 1827 | } |
1823 | int result = 0; | 1828 | int result = 0; |
1824 | if ( !quick ) { | 1829 | if ( !quick ) { |
1825 | 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 )); | 1830 | 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 )); |
1826 | result = QMessageBox::warning( this, "KO/Pi: Warning!", | 1831 | result = QMessageBox::warning( this, "KO/Pi: Warning!", |
1827 | mess, | 1832 | mess, |
1828 | "Import", "Cancel", 0, | 1833 | "Import", "Cancel", 0, |
1829 | 0, 1 ); | 1834 | 0, 1 ); |
1830 | } | 1835 | } |
1831 | if ( result == 0 ) { | 1836 | if ( result == 0 ) { |
1832 | if ( mView->openCalendar( fn, true )) { | 1837 | if ( mView->openCalendar( fn, true )) { |
1833 | KOPrefs::instance()->mLastImportFile = fn; | 1838 | KOPrefs::instance()->mLastImportFile = fn; |
1834 | setCaption(i18n("Imported file successfully")); | 1839 | setCaption(i18n("Imported file successfully")); |
1835 | } else { | 1840 | } else { |
1836 | setCaption(i18n("Error importing file")); | 1841 | setCaption(i18n("Error importing file")); |
1837 | } | 1842 | } |
1838 | } | 1843 | } |
1839 | } | 1844 | } |
1840 | 1845 | ||
1841 | void MainWindow::importIcal() | 1846 | void MainWindow::importIcal() |
1842 | { | 1847 | { |
1843 | 1848 | ||
1844 | QString fn =KOPrefs::instance()->mLastImportFile; | 1849 | QString fn =KOPrefs::instance()->mLastImportFile; |
1845 | 1850 | ||
1846 | fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); | 1851 | fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); |
1847 | if ( fn == "" ) | 1852 | if ( fn == "" ) |
1848 | return; | 1853 | return; |
1849 | importFile( fn, true ); | 1854 | importFile( fn, true ); |
1850 | 1855 | ||
1851 | } | 1856 | } |
1852 | 1857 | ||
1853 | void MainWindow::exportVCalendar() | 1858 | void MainWindow::exportVCalendar() |
1854 | { | 1859 | { |
1855 | QString fn = KOPrefs::instance()->mLastVcalFile; | 1860 | QString fn = KOPrefs::instance()->mLastVcalFile; |
1856 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); | 1861 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); |
1857 | if ( fn == "" ) | 1862 | if ( fn == "" ) |
1858 | return; | 1863 | return; |
1859 | QFileInfo info; | 1864 | QFileInfo info; |
1860 | info.setFile( fn ); | 1865 | info.setFile( fn ); |
1861 | QString mes; | 1866 | QString mes; |
1862 | bool createbup = true; | 1867 | bool createbup = true; |
1863 | if ( info. exists() ) { | 1868 | if ( info. exists() ) { |
1864 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); | 1869 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); |
1865 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, | 1870 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, |
1866 | i18n("Overwrite!"), i18n("Cancel"), 0, | 1871 | i18n("Overwrite!"), i18n("Cancel"), 0, |
1867 | 0, 1 ); | 1872 | 0, 1 ); |
1868 | if ( result != 0 ) { | 1873 | if ( result != 0 ) { |
1869 | createbup = false; | 1874 | createbup = false; |
1870 | } | 1875 | } |
1871 | } | 1876 | } |
1872 | if ( createbup ) { | 1877 | if ( createbup ) { |
1873 | if ( mView->exportVCalendar( fn ) ) { | 1878 | if ( mView->exportVCalendar( fn ) ) { |
1874 | KOPrefs::instance()->mLastVcalFile = fn; | 1879 | KOPrefs::instance()->mLastVcalFile = fn; |
1875 | if ( fn.length() > 20 ) | 1880 | if ( fn.length() > 20 ) |
1876 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; | 1881 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; |
1877 | else | 1882 | else |
1878 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); | 1883 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); |
1879 | setCaption(mes); | 1884 | setCaption(mes); |
1880 | } | 1885 | } |
1881 | } | 1886 | } |
1882 | 1887 | ||
1883 | } | 1888 | } |
1884 | 1889 | ||
1885 | void MainWindow::syncFileRequest() | 1890 | void MainWindow::syncFileRequest() |
1886 | { | 1891 | { |
1887 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 1892 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
1888 | mSyncManager->slotSyncMenu( 999 ); | 1893 | mSyncManager->slotSyncMenu( 999 ); |
1889 | } | 1894 | } |
1890 | save(); | 1895 | save(); |
1891 | } | 1896 | } |
1892 | void MainWindow::getFile( bool success ) | 1897 | void MainWindow::getFile( bool success ) |
1893 | { | 1898 | { |
1894 | if ( ! success ) { | 1899 | if ( ! success ) { |
1895 | setCaption( i18n("Error receiving file. Nothing changed!") ); | 1900 | setCaption( i18n("Error receiving file. Nothing changed!") ); |
1896 | return; | 1901 | return; |
1897 | } | 1902 | } |
1898 | mView->openCalendar( defaultFileName() ); | 1903 | mView->openCalendar( defaultFileName() ); |
1899 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 1904 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
1900 | mSyncManager->slotSyncMenu( 999 ); | 1905 | mSyncManager->slotSyncMenu( 999 ); |
1901 | } | 1906 | } |
1902 | setCaption( i18n("Pi-Sync successful!") ); | 1907 | setCaption( i18n("Pi-Sync successful!") ); |
1903 | } | 1908 | } |
1904 | 1909 | ||
1905 | void MainWindow::printSel( ) | 1910 | void MainWindow::printSel( ) |
1906 | { | 1911 | { |
1907 | mView->viewManager()->agendaView()->agenda()->printSelection(); | 1912 | mView->viewManager()->agendaView()->agenda()->printSelection(); |
1908 | } | 1913 | } |
1909 | 1914 | ||
1910 | void MainWindow::printCal() | 1915 | void MainWindow::printCal() |
1911 | { | 1916 | { |
1912 | mView->print();//mCp->showDialog(); | 1917 | mView->print();//mCp->showDialog(); |
1913 | } | 1918 | } |
1914 | 1919 | ||
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 96e627e..6de0543 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -1,139 +1,141 @@ | |||
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 <qtextstream.h> | 8 | #include <qtextstream.h> |
9 | #include <qregexp.h> | 9 | #include <qregexp.h> |
10 | 10 | ||
11 | #include <libkcal/incidence.h> | 11 | #include <libkcal/incidence.h> |
12 | #include "simplealarmclient.h" | 12 | #include "simplealarmclient.h" |
13 | #include <ksyncmanager.h> | 13 | #include <ksyncmanager.h> |
14 | #ifndef DESKTOP_VERSION | 14 | #ifndef DESKTOP_VERSION |
15 | #include <qcopchannel_qws.h> | 15 | #include <qcopchannel_qws.h> |
16 | #endif | 16 | #endif |
17 | class QAction; | 17 | class QAction; |
18 | class CalendarView; | 18 | class CalendarView; |
19 | class KSyncProfile; | 19 | class KSyncProfile; |
20 | #ifdef DESKTOP_VERSION | 20 | #ifdef DESKTOP_VERSION |
21 | 21 | ||
22 | #define QPEToolBar QToolBar | 22 | #define QPEToolBar QToolBar |
23 | #define QPEMenuBar QMenuBar | 23 | #define QPEMenuBar QMenuBar |
24 | #endif | 24 | #endif |
25 | class QPEToolBar; | 25 | class QPEToolBar; |
26 | 26 | ||
27 | 27 | ||
28 | namespace KCal { | 28 | namespace KCal { |
29 | class CalendarLocal; | 29 | class CalendarLocal; |
30 | } | 30 | } |
31 | 31 | ||
32 | using namespace KCal; | 32 | using namespace KCal; |
33 | 33 | ||
34 | class MainWindow : public QMainWindow | 34 | class MainWindow : public QMainWindow |
35 | { | 35 | { |
36 | Q_OBJECT | 36 | Q_OBJECT |
37 | public: | 37 | public: |
38 | MainWindow( QWidget *parent = 0, const char *name = 0, QString command = ""); | 38 | MainWindow( QWidget *parent = 0, const char *name = 0, QString command = ""); |
39 | ~MainWindow(); | 39 | ~MainWindow(); |
40 | bool beamReceiveEnabled(); | 40 | bool beamReceiveEnabled(); |
41 | static QString defaultFileName(); | ||
42 | static QString syncFileName(); | ||
43 | static QString resourcePath(); | ||
41 | public slots: | 44 | public slots: |
42 | virtual void showMaximized (); | 45 | virtual void showMaximized (); |
43 | void configureAgenda( int ); | 46 | void configureAgenda( int ); |
44 | void recieve( const QCString& msg, const QByteArray& data ); | 47 | void recieve( const QCString& msg, const QByteArray& data ); |
45 | static QString defaultFileName(); | 48 | protected slots: |
46 | static QString syncFileName(); | ||
47 | static QString resourcePath(); | ||
48 | protected slots: | ||
49 | void setCaptionToDates(); | 49 | void setCaptionToDates(); |
50 | void about(); | 50 | void about(); |
51 | void licence(); | 51 | void licence(); |
52 | void faq(); | 52 | void faq(); |
53 | void usertrans(); | 53 | void usertrans(); |
54 | void features(); | 54 | void features(); |
55 | void synchowto(); | 55 | void synchowto(); |
56 | void kdesynchowto(); | 56 | void kdesynchowto(); |
57 | void multisynchowto(); | 57 | void multisynchowto(); |
58 | void whatsNew(); | 58 | void whatsNew(); |
59 | void keyBindings(); | 59 | void keyBindings(); |
60 | void aboutAutoSaving();; | 60 | void aboutAutoSaving();; |
61 | void aboutKnownBugs(); | 61 | void aboutKnownBugs(); |
62 | 62 | ||
63 | void processIncidenceSelection( Incidence * ); | 63 | void processIncidenceSelection( Incidence * ); |
64 | 64 | ||
65 | void importQtopia(); | 65 | void importQtopia(); |
66 | void importBday(); | 66 | void importBday(); |
67 | void importOL(); | 67 | void importOL(); |
68 | void importIcal(); | 68 | void importIcal(); |
69 | void importFile( QString, bool ); | 69 | void importFile( QString, bool ); |
70 | void quickImportIcal(); | 70 | void quickImportIcal(); |
71 | 71 | ||
72 | void slotModifiedChanged( bool ); | 72 | void slotModifiedChanged( bool ); |
73 | 73 | ||
74 | void save(); | 74 | void save(); |
75 | void configureToolBar( int ); | 75 | void configureToolBar( int ); |
76 | void printSel(); | 76 | void printSel(); |
77 | void printCal(); | 77 | void printCal(); |
78 | void saveCalendar(); | 78 | void saveCalendar(); |
79 | void loadCalendar(); | 79 | void loadCalendar(); |
80 | void exportVCalendar(); | 80 | void exportVCalendar(); |
81 | void fillFilterMenu(); | 81 | void fillFilterMenu(); |
82 | void selectFilter( int ); | 82 | void selectFilter( int ); |
83 | void exportToPhone( int ); | 83 | void exportToPhone( int ); |
84 | void toggleBeamReceive(); | 84 | void toggleBeamReceive(); |
85 | void disableBR(bool); | 85 | void disableBR(bool); |
86 | 86 | ||
87 | private slots: | ||
88 | void showConfigureAgenda(); | ||
89 | void getFile( bool ); | ||
90 | void syncFileRequest(); | ||
87 | 91 | ||
88 | protected: | 92 | protected: |
89 | void displayText( QString, QString); | 93 | void displayText( QString, QString); |
90 | |||
91 | void enableIncidenceActions( bool ); | 94 | void enableIncidenceActions( bool ); |
92 | 95 | ||
93 | private slots: | ||
94 | QSocket* piSocket; | ||
95 | QString piFileString; | ||
96 | QTime piTime; | ||
97 | void getFile( bool ); | ||
98 | void syncFileRequest(); | ||
99 | private: | 96 | private: |
100 | bool mBRdisabled; | 97 | bool mBRdisabled; |
101 | #ifndef DESKTOP_VERSION | 98 | #ifndef DESKTOP_VERSION |
102 | QCopChannel* infrared; | 99 | QCopChannel* infrared; |
103 | #endif | 100 | #endif |
104 | QAction* brAction; | 101 | QAction* brAction; |
105 | KSyncManager* mSyncManager; | 102 | KSyncManager* mSyncManager; |
106 | bool mClosed; | 103 | bool mClosed; |
107 | void saveOnClose(); | 104 | void saveOnClose(); |
108 | bool mFlagKeyPressed; | 105 | bool mFlagKeyPressed; |
109 | bool mBlockAtStartup; | 106 | bool mBlockAtStartup; |
110 | QPEToolBar *iconToolBar; | 107 | QPEToolBar *iconToolBar; |
111 | void initActions(); | 108 | void initActions(); |
112 | void setDefaultPreferences(); | 109 | void setDefaultPreferences(); |
113 | void keyPressEvent ( QKeyEvent * ) ; | 110 | void keyPressEvent ( QKeyEvent * ) ; |
114 | void keyReleaseEvent ( QKeyEvent * ) ; | 111 | void keyReleaseEvent ( QKeyEvent * ) ; |
115 | QPopupMenu *configureToolBarMenu; | 112 | QPopupMenu *configureToolBarMenu; |
116 | QPopupMenu *selectFilterMenu; | 113 | QPopupMenu *selectFilterMenu; |
117 | QPopupMenu *configureAgendaMenu, *syncMenu; | 114 | QPopupMenu *configureAgendaMenu, *syncMenu; |
118 | CalendarLocal *mCalendar; | 115 | CalendarLocal *mCalendar; |
119 | CalendarView *mView; | 116 | CalendarView *mView; |
120 | QAction *mNewSubTodoAction; | 117 | QAction *mNewSubTodoAction; |
121 | 118 | ||
122 | QAction *mShowAction; | 119 | QAction *mShowAction; |
123 | QAction *mEditAction; | 120 | QAction *mEditAction; |
124 | QAction *mDeleteAction; | 121 | QAction *mDeleteAction; |
125 | QAction *mCloneAction; | 122 | QAction *mCloneAction; |
126 | QAction *mMoveAction; | 123 | QAction *mMoveAction; |
127 | QAction *mBeamAction; | 124 | QAction *mBeamAction; |
128 | QAction *mCancelAction; | 125 | QAction *mCancelAction; |
129 | 126 | ||
127 | QAction *mToggleNav; | ||
128 | QAction *mToggleFilter; | ||
129 | QAction *mToggleAllday; | ||
130 | |||
131 | |||
130 | void closeEvent( QCloseEvent* ce ); | 132 | void closeEvent( QCloseEvent* ce ); |
131 | SimpleAlarmClient mAlarmClient; | 133 | SimpleAlarmClient mAlarmClient; |
132 | QTimer mSaveTimer; | 134 | QTimer mSaveTimer; |
133 | //bool mBlockSaveFlag; | 135 | //bool mBlockSaveFlag; |
134 | bool mCalendarModifiedFlag; | 136 | bool mCalendarModifiedFlag; |
135 | QPixmap loadPixmap( QString ); | 137 | QPixmap loadPixmap( QString ); |
136 | }; | 138 | }; |
137 | 139 | ||
138 | 140 | ||
139 | #endif | 141 | #endif |