Diffstat (limited to 'korganizer/koviewmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koviewmanager.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index b2dd266..cf56fcf 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -145,192 +145,194 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) | |||
145 | mCurrentView = view; | 145 | mCurrentView = view; |
146 | 146 | ||
147 | // bool full = fullScreen; | 147 | // bool full = fullScreen; |
148 | bool isFull = !mMainView->leftFrame()->isVisible(); | 148 | bool isFull = !mMainView->leftFrame()->isVisible(); |
149 | if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) | 149 | if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) |
150 | full = true; | 150 | full = true; |
151 | if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) | 151 | if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) |
152 | full = false; | 152 | full = false; |
153 | } | 153 | } |
154 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); | 154 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); |
155 | raiseCurrentView( full ); | 155 | raiseCurrentView( full ); |
156 | mMainView->processIncidenceSelection( 0 ); | 156 | mMainView->processIncidenceSelection( 0 ); |
157 | mMainView->updateView(); | 157 | mMainView->updateView(); |
158 | mMainView->adaptNavigationUnits(); | 158 | mMainView->adaptNavigationUnits(); |
159 | } | 159 | } |
160 | 160 | ||
161 | void KOViewManager::raiseCurrentView( bool fullScreen ) | 161 | void KOViewManager::raiseCurrentView( bool fullScreen ) |
162 | { | 162 | { |
163 | //qDebug("raiseCurrentView "); | 163 | //qDebug("raiseCurrentView "); |
164 | mCurrentAgendaView = 0; | 164 | mCurrentAgendaView = 0; |
165 | int wid = mMainView->width() ; | 165 | int wid = mMainView->width() ; |
166 | int hei = mMainView->height(); | 166 | int hei = mMainView->height(); |
167 | if ( mCurrentView == mMonthView ) { | 167 | if ( mCurrentView == mMonthView ) { |
168 | mMainView->navigatorBar()->show(); | 168 | mMainView->navigatorBar()->show(); |
169 | hei -= mMainView->navigatorBar()->sizeHint().height(); | 169 | hei -= mMainView->navigatorBar()->sizeHint().height(); |
170 | //mMainView->navigatorBar()->hide(); | 170 | //mMainView->navigatorBar()->hide(); |
171 | } else { | 171 | } else { |
172 | mMainView->navigatorBar()->hide(); | 172 | mMainView->navigatorBar()->hide(); |
173 | } | 173 | } |
174 | if ( fullScreen ) { | 174 | if ( fullScreen ) { |
175 | mMainView->leftFrame()->hide(); | 175 | mMainView->leftFrame()->hide(); |
176 | } else { | 176 | } else { |
177 | mMainView->leftFrame()->show(); | 177 | mMainView->leftFrame()->show(); |
178 | if ( KOPrefs::instance()->mVerticalScreen ) | 178 | if ( KOPrefs::instance()->mVerticalScreen ) |
179 | hei -= mMainView->leftFrame()->height(); | 179 | hei -= mMainView->leftFrame()->height(); |
180 | else | 180 | else |
181 | wid -= mMainView->leftFrame()->width(); | 181 | wid -= mMainView->leftFrame()->width(); |
182 | } | 182 | } |
183 | 183 | ||
184 | if ( globalFlagBlockAgenda == 5 ) { | 184 | if ( globalFlagBlockAgenda == 5 ) { |
185 | globalFlagBlockAgenda = 4; | 185 | globalFlagBlockAgenda = 4; |
186 | globalFlagBlockAgendaItemPaint = 1; | 186 | globalFlagBlockAgendaItemPaint = 1; |
187 | } | 187 | } |
188 | mMainView->viewStack()->raiseWidget(mCurrentView); | 188 | mMainView->viewStack()->raiseWidget(mCurrentView); |
189 | if ( globalFlagBlockAgenda == 4 ) { | 189 | if ( globalFlagBlockAgenda == 4 ) { |
190 | if ( mCurrentView == mAgendaView ) { | 190 | if ( mCurrentView == mAgendaView ) { |
191 | //globalFlagBlockAgenda =1 ; | 191 | //globalFlagBlockAgenda =1 ; |
192 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) | 192 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) |
193 | mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); | 193 | mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); |
194 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) | 194 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) |
195 | mAgendaView->setStartHour( QTime::currentTime ().hour() ); | 195 | mAgendaView->setStartHour( QTime::currentTime ().hour() ); |
196 | qApp->processEvents(); | 196 | qApp->processEvents(); |
197 | //qDebug("qApp->processEvents() "); | 197 | //qDebug("qApp->processEvents() "); |
198 | globalFlagBlockAgenda = 0; | 198 | globalFlagBlockAgenda = 0; |
199 | mAgendaView->repaintAgenda(); | 199 | mAgendaView->repaintAgenda(); |
200 | 200 | ||
201 | } | 201 | } |
202 | globalFlagBlockAgenda = 0; | 202 | globalFlagBlockAgenda = 0; |
203 | } | 203 | } |
204 | //qDebug("raiseCurrentView ende "); | 204 | //qDebug("raiseCurrentView ende "); |
205 | } | 205 | } |
206 | 206 | ||
207 | void KOViewManager::updateView() | 207 | void KOViewManager::updateView() |
208 | { | 208 | { |
209 | // qDebug("KOViewManager::updateView() "); | 209 | // qDebug("KOViewManager::updateView() "); |
210 | // if we are updating mTodoView, we get endless recursion | 210 | // if we are updating mTodoView, we get endless recursion |
211 | if ( mTodoView == mCurrentView ) | 211 | if ( mTodoView == mCurrentView ) |
212 | return; | 212 | return; |
213 | if ( mCurrentView ) mCurrentView->updateView(); | 213 | if ( mCurrentView ) mCurrentView->updateView(); |
214 | 214 | ||
215 | } | 215 | } |
216 | 216 | ||
217 | void KOViewManager::updateView(const QDate &start, const QDate &end) | 217 | void KOViewManager::updateView(const QDate &start, const QDate &end) |
218 | { | 218 | { |
219 | // kdDebug() << "KOViewManager::updateView()" << endl; | 219 | // kdDebug() << "KOViewManager::updateView()" << endl; |
220 | 220 | ||
221 | if (mCurrentView) mCurrentView->showDates(start, end); | 221 | if (mCurrentView) mCurrentView->showDates(start, end); |
222 | 222 | ||
223 | if (mTodoView) mTodoView->updateView(); | 223 | if (mTodoView) mTodoView->updateView(); |
224 | } | 224 | } |
225 | 225 | ||
226 | 226 | ||
227 | void KOViewManager::updateWNview() | 227 | void KOViewManager::updateWNview() |
228 | { | 228 | { |
229 | if ( mCurrentView == mWhatsNextView && mWhatsNextView ) | 229 | if ( mCurrentView == mWhatsNextView && mWhatsNextView ) |
230 | mWhatsNextView->updateView(); | 230 | mWhatsNextView->updateView(); |
231 | 231 | ||
232 | } | 232 | } |
233 | void KOViewManager::showWhatsNextView() | 233 | void KOViewManager::showWhatsNextView() |
234 | { | 234 | { |
235 | if (!mWhatsNextView) { | 235 | if (!mWhatsNextView) { |
236 | mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), | 236 | mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), |
237 | "KOViewManager::WhatsNextView"); | 237 | "KOViewManager::WhatsNextView"); |
238 | mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); | 238 | mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); |
239 | connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); | 239 | connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); |
240 | addView(mWhatsNextView); | 240 | addView(mWhatsNextView); |
241 | connect(this, SIGNAL( printWNV() ), | ||
242 | mWhatsNextView, SLOT( printMe() ) ); | ||
241 | } | 243 | } |
242 | globalFlagBlockAgenda = 1; | 244 | globalFlagBlockAgenda = 1; |
243 | showView(mWhatsNextView, true ); | 245 | showView(mWhatsNextView, true ); |
244 | //mWhatsNextView->updateView(); | 246 | //mWhatsNextView->updateView(); |
245 | 247 | ||
246 | } | 248 | } |
247 | 249 | ||
248 | void KOViewManager::showListView() | 250 | void KOViewManager::showListView() |
249 | { | 251 | { |
250 | if (!mListView) { | 252 | if (!mListView) { |
251 | mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); | 253 | mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); |
252 | addView(mListView); | 254 | addView(mListView); |
253 | 255 | ||
254 | connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), | 256 | connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), |
255 | mMainView, SLOT(showIncidence(Incidence *))); | 257 | mMainView, SLOT(showIncidence(Incidence *))); |
256 | connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), | 258 | connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), |
257 | mMainView, SLOT(editIncidence(Incidence *))); | 259 | mMainView, SLOT(editIncidence(Incidence *))); |
258 | connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), | 260 | connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), |
259 | mMainView, SLOT(deleteIncidence(Incidence *))); | 261 | mMainView, SLOT(deleteIncidence(Incidence *))); |
260 | connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), | 262 | connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), |
261 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 263 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
262 | connect( mListView, SIGNAL( signalNewEvent() ), | 264 | connect( mListView, SIGNAL( signalNewEvent() ), |
263 | mMainView, SLOT( newEvent() ) ); | 265 | mMainView, SLOT( newEvent() ) ); |
264 | connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); | 266 | connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); |
265 | connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), | 267 | connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), |
266 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); | 268 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); |
267 | connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), | 269 | connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), |
268 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); | 270 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); |
269 | connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 271 | connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
270 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 272 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
271 | connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 273 | connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
272 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 274 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
273 | } | 275 | } |
274 | // bool temp = mFlagShowNextxDays; | 276 | // bool temp = mFlagShowNextxDays; |
275 | //globalFlagBlockPainting = true; | 277 | //globalFlagBlockPainting = true; |
276 | globalFlagBlockAgenda = 1; | 278 | globalFlagBlockAgenda = 1; |
277 | if ( KOPrefs::instance()->mListViewMonthTimespan ) | 279 | if ( KOPrefs::instance()->mListViewMonthTimespan ) |
278 | mMainView->dateNavigator()->selectMonth(); | 280 | mMainView->dateNavigator()->selectMonth(); |
279 | showView(mListView, KOPrefs::instance()->mFullViewTodo); | 281 | showView(mListView, KOPrefs::instance()->mFullViewTodo); |
280 | //mFlagShowNextxDays = temp; | 282 | //mFlagShowNextxDays = temp; |
281 | } | 283 | } |
282 | 284 | ||
283 | void KOViewManager::showAgendaView( bool fullScreen ) | 285 | void KOViewManager::showAgendaView( bool fullScreen ) |
284 | { | 286 | { |
285 | 287 | ||
286 | mMainView->dialogManager()->hideSearchDialog(); | 288 | mMainView->dialogManager()->hideSearchDialog(); |
287 | // qDebug("KOViewManager::showAgendaView "); | 289 | // qDebug("KOViewManager::showAgendaView "); |
288 | bool full; | 290 | bool full; |
289 | full = fullScreen; | 291 | full = fullScreen; |
290 | if (!mAgendaView) { | 292 | if (!mAgendaView) { |
291 | full = false; | 293 | full = false; |
292 | mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); | 294 | mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); |
293 | addView(mAgendaView); | 295 | addView(mAgendaView); |
294 | #ifndef DESKTOP_VERSION | 296 | #ifndef DESKTOP_VERSION |
295 | QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold ); | 297 | QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold ); |
296 | #endif | 298 | #endif |
297 | connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )), | 299 | connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )), |
298 | mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) )); | 300 | mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) )); |
299 | 301 | ||
300 | // SIGNALS/SLOTS FOR DAY/WEEK VIEW | 302 | // SIGNALS/SLOTS FOR DAY/WEEK VIEW |
301 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)), | 303 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)), |
302 | mMainView, SLOT(newEvent(QDateTime))); | 304 | mMainView, SLOT(newEvent(QDateTime))); |
303 | // connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)), | 305 | // connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)), |
304 | // mMainView, SLOT(newEvent(QDateTime,QDateTime))); | 306 | // mMainView, SLOT(newEvent(QDateTime,QDateTime))); |
305 | connect(mAgendaView,SIGNAL(newEventSignal(QDate)), | 307 | connect(mAgendaView,SIGNAL(newEventSignal(QDate)), |
306 | mMainView, SLOT(newEvent(QDate))); | 308 | mMainView, SLOT(newEvent(QDate))); |
307 | 309 | ||
308 | connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)), | 310 | connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)), |
309 | mMainView, SLOT(editIncidence(Incidence *))); | 311 | mMainView, SLOT(editIncidence(Incidence *))); |
310 | connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)), | 312 | connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)), |
311 | mMainView, SLOT(showIncidence(Incidence *))); | 313 | mMainView, SLOT(showIncidence(Incidence *))); |
312 | connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)), | 314 | connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)), |
313 | mMainView, SLOT(deleteIncidence(Incidence *))); | 315 | mMainView, SLOT(deleteIncidence(Incidence *))); |
314 | 316 | ||
315 | connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ), | 317 | connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ), |
316 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 318 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
317 | 319 | ||
318 | connect(mAgendaView, SIGNAL( toggleExpand() ), | 320 | connect(mAgendaView, SIGNAL( toggleExpand() ), |
319 | mMainView, SLOT( toggleExpand() ) ); | 321 | mMainView, SLOT( toggleExpand() ) ); |
320 | 322 | ||
321 | connect(mMainView, SIGNAL( calendarViewExpanded( bool ) ), | 323 | connect(mMainView, SIGNAL( calendarViewExpanded( bool ) ), |
322 | mAgendaView, SLOT( setExpandedButton( bool ) ) ); | 324 | mAgendaView, SLOT( setExpandedButton( bool ) ) ); |
323 | connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ), | 325 | connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ), |
324 | mMainView, SLOT(cloneIncidence(Incidence *) ) ) ; | 326 | mMainView, SLOT(cloneIncidence(Incidence *) ) ) ; |
325 | connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ), | 327 | connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ), |
326 | mMainView, SLOT(cancelIncidence(Incidence *) ) ) ; | 328 | mMainView, SLOT(cancelIncidence(Incidence *) ) ) ; |
327 | connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig())); | 329 | connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig())); |
328 | connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView, | 330 | connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView, |
329 | SLOT( updateTodo( Todo *, int ) ) ); | 331 | SLOT( updateTodo( Todo *, int ) ) ); |
330 | connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )), | 332 | connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )), |
331 | mMainView, SIGNAL( todoModified( Todo *, int ))); | 333 | mMainView, SIGNAL( todoModified( Todo *, int ))); |
332 | connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 334 | connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
333 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 335 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
334 | connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 336 | connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
335 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 337 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
336 | mAgendaView->readSettings(); | 338 | mAgendaView->readSettings(); |