author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /korganizer/koviewmanager.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-p1.zip kdepimpi-p1.tar.gz kdepimpi-p1.tar.bz2 |
initial public commit of qt4 portp1
Diffstat (limited to 'korganizer/koviewmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koviewmanager.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 4057ae0..07c4295 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -1,74 +1,76 @@ | |||
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 <q3widgetstack.h> |
27 | //Added by qt3to4: | ||
28 | #include <Q3PtrList> | ||
27 | 29 | ||
28 | #include <kconfig.h> | 30 | #include <kconfig.h> |
29 | #include <kglobal.h> | 31 | #include <kglobal.h> |
30 | #ifndef DESKTOP_VERSION | 32 | #ifndef DESKTOP_VERSION |
31 | #include <qpe/qpeapplication.h> | 33 | #include <qpe/qpeapplication.h> |
32 | #else | 34 | #else |
33 | #include <qapplication.h> | 35 | #include <qapplication.h> |
34 | #endif | 36 | #endif |
35 | #include <qdatetime.h> | 37 | #include <qdatetime.h> |
36 | #include "calendarview.h" | 38 | #include "calendarview.h" |
37 | #include "datenavigator.h" | 39 | #include "datenavigator.h" |
38 | #include "kotodoview.h" | 40 | #include "kotodoview.h" |
39 | #include "koagendaview.h" | 41 | #include "koagendaview.h" |
40 | #include "kodialogmanager.h" | 42 | #include "kodialogmanager.h" |
41 | #include "komonthview.h" | 43 | #include "komonthview.h" |
42 | #include "kolistview.h" | 44 | #include "kolistview.h" |
43 | #include "kowhatsnextview.h" | 45 | #include "kowhatsnextview.h" |
44 | #include "kojournalview.h" | 46 | #include "kojournalview.h" |
45 | #include "kotimespanview.h" | 47 | #include "kotimespanview.h" |
46 | #include "koprefs.h" | 48 | #include "koprefs.h" |
47 | #include "navigatorbar.h" | 49 | #include "navigatorbar.h" |
48 | #include "kdatenavigator.h" | 50 | #include "kdatenavigator.h" |
49 | 51 | ||
50 | #include "koviewmanager.h" | 52 | #include "koviewmanager.h" |
51 | //extern bool externFlagMonthviewBlockPainting; | 53 | //extern bool externFlagMonthviewBlockPainting; |
52 | 54 | ||
53 | //bool globalFlagBlockPainting = false; | 55 | //bool globalFlagBlockPainting = false; |
54 | int globalFlagBlockAgenda = 0; | 56 | int globalFlagBlockAgenda = 0; |
55 | int globalFlagBlockLabel = 0; | 57 | int globalFlagBlockLabel = 0; |
56 | int globalFlagBlockAgendaItemPaint = 1; | 58 | int globalFlagBlockAgendaItemPaint = 1; |
57 | int globalFlagBlockAgendaItemUpdate = 1; | 59 | int globalFlagBlockAgendaItemUpdate = 1; |
58 | 60 | ||
59 | 61 | ||
60 | KOViewManager::KOViewManager( CalendarView *mainView ) : | 62 | KOViewManager::KOViewManager( CalendarView *mainView ) : |
61 | QObject(), mMainView( mainView ) | 63 | QObject(), mMainView( mainView ) |
62 | { | 64 | { |
63 | 65 | ||
64 | lastMode = 0; | 66 | lastMode = 0; |
65 | lastCount = 0; | 67 | lastCount = 0; |
66 | lastNDMode = false; | 68 | lastNDMode = false; |
67 | selecteddatescount = 0; | 69 | selecteddatescount = 0; |
68 | selecteddate = QDate ( 2000, 1, 1 ); | 70 | selecteddate = QDate ( 2000, 1, 1 ); |
69 | baseCycleDate = QDate ( 2000, 1, 1 ); | 71 | baseCycleDate = QDate ( 2000, 1, 1 ); |
70 | mCurrentView = 0; | 72 | mCurrentView = 0; |
71 | flagResetViewChangeDate = 0; | 73 | flagResetViewChangeDate = 0; |
72 | mWhatsNextView = 0; | 74 | mWhatsNextView = 0; |
73 | mTodoView = 0; | 75 | mTodoView = 0; |
74 | mAgendaView = 0; | 76 | mAgendaView = 0; |
@@ -412,98 +414,98 @@ void KOViewManager::showWhatsNextView() | |||
412 | if (!mWhatsNextView) { | 414 | if (!mWhatsNextView) { |
413 | mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), | 415 | mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), |
414 | "KOViewManager::WhatsNextView"); | 416 | "KOViewManager::WhatsNextView"); |
415 | mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); | 417 | mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); |
416 | connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); | 418 | connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); |
417 | addView(mWhatsNextView); | 419 | addView(mWhatsNextView); |
418 | connect(this, SIGNAL( printWNV() ), | 420 | connect(this, SIGNAL( printWNV() ), |
419 | mWhatsNextView, SLOT( printMe() ) ); | 421 | mWhatsNextView, SLOT( printMe() ) ); |
420 | } | 422 | } |
421 | globalFlagBlockAgenda = 1; | 423 | globalFlagBlockAgenda = 1; |
422 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_WN_VIEW; | 424 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_WN_VIEW; |
423 | showView(mWhatsNextView, true ); | 425 | showView(mWhatsNextView, true ); |
424 | //mWhatsNextView->updateView(); | 426 | //mWhatsNextView->updateView(); |
425 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_WN_VIEW; | 427 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_WN_VIEW; |
426 | } | 428 | } |
427 | 429 | ||
428 | void KOViewManager::slotprintWNV() | 430 | void KOViewManager::slotprintWNV() |
429 | { | 431 | { |
430 | if (!mWhatsNextView) | 432 | if (!mWhatsNextView) |
431 | showWhatsNextView(); | 433 | showWhatsNextView(); |
432 | emit printWNV(); | 434 | emit printWNV(); |
433 | 435 | ||
434 | } | 436 | } |
435 | void KOViewManager::showListView() | 437 | void KOViewManager::showListView() |
436 | { | 438 | { |
437 | if (!mListView) { | 439 | if (!mListView) { |
438 | mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); | 440 | mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); |
439 | addView(mListView); | 441 | addView(mListView); |
440 | 442 | ||
441 | connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), | 443 | connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), |
442 | mMainView, SLOT(showIncidence(Incidence *))); | 444 | mMainView, SLOT(showIncidence(Incidence *))); |
443 | connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), | 445 | connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), |
444 | mMainView, SLOT(editIncidence(Incidence *))); | 446 | mMainView, SLOT(editIncidence(Incidence *))); |
445 | connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), | 447 | connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), |
446 | mMainView, SLOT(deleteIncidence(Incidence *))); | 448 | mMainView, SLOT(deleteIncidence(Incidence *))); |
447 | connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), | 449 | connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), |
448 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 450 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
449 | connect( mListView, SIGNAL( signalNewEvent() ), | 451 | connect( mListView, SIGNAL( signalNewEvent() ), |
450 | mMainView, SLOT( newEvent() ) ); | 452 | mMainView, SLOT( newEvent() ) ); |
451 | connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); | 453 | connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); |
452 | connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), | 454 | connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), |
453 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); | 455 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); |
454 | connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), | 456 | connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), |
455 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); | 457 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); |
456 | connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 458 | connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
457 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 459 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
458 | connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 460 | connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
459 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 461 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
460 | connect( mListView, SIGNAL( beamIncidenceList( QPtrList<Incidence> ) ), | 462 | connect( mListView, SIGNAL( beamIncidenceList( Q3PtrList<Incidence> ) ), |
461 | mMainView, SLOT ( beamIncidenceList( QPtrList<Incidence> ) ) ); | 463 | mMainView, SLOT ( beamIncidenceList( Q3PtrList<Incidence> ) ) ); |
462 | } | 464 | } |
463 | // bool temp = mFlagShowNextxDays; | 465 | // bool temp = mFlagShowNextxDays; |
464 | //globalFlagBlockPainting = true; | 466 | //globalFlagBlockPainting = true; |
465 | globalFlagBlockAgenda = 1; | 467 | globalFlagBlockAgenda = 1; |
466 | if ( KOPrefs::instance()->mListViewMonthTimespan ) { | 468 | if ( KOPrefs::instance()->mListViewMonthTimespan ) { |
467 | mMainView->setBlockShowDates( true ); | 469 | mMainView->setBlockShowDates( true ); |
468 | mMainView->dateNavigator()->selectMonth(); | 470 | mMainView->dateNavigator()->selectMonth(); |
469 | mMainView->setBlockShowDates( false ); | 471 | mMainView->setBlockShowDates( false ); |
470 | } | 472 | } |
471 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW; | 473 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW; |
472 | showView(mListView, KOPrefs::instance()->mFullViewTodo); | 474 | showView(mListView, KOPrefs::instance()->mFullViewTodo); |
473 | //mFlagShowNextxDays = temp; | 475 | //mFlagShowNextxDays = temp; |
474 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW; | 476 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW; |
475 | mMainView->setScrollBarStep( 7 ); | 477 | mMainView->setScrollBarStep( 7 ); |
476 | } | 478 | } |
477 | 479 | ||
478 | void KOViewManager::showAgendaView( bool fullScreen ) | 480 | void KOViewManager::showAgendaView( bool fullScreen ) |
479 | { | 481 | { |
480 | 482 | ||
481 | mMainView->dialogManager()->hideSearchDialog(); | 483 | mMainView->dialogManager()->hideSearchDialog(); |
482 | // qDebug("KOViewManager::showAgendaView "); | 484 | // qDebug("KOViewManager::showAgendaView "); |
483 | bool full; | 485 | bool full; |
484 | full = fullScreen; | 486 | full = fullScreen; |
485 | if (!mAgendaView) { | 487 | if (!mAgendaView) { |
486 | full = false; | 488 | full = false; |
487 | mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); | 489 | mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); |
488 | addView(mAgendaView); | 490 | addView(mAgendaView); |
489 | #ifndef DESKTOP_VERSION | 491 | #ifndef DESKTOP_VERSION |
490 | QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold ); | 492 | QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold ); |
491 | #endif | 493 | #endif |
492 | connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )), | 494 | connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )), |
493 | mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) )); | 495 | mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) )); |
494 | 496 | ||
495 | // SIGNALS/SLOTS FOR DAY/WEEK VIEW | 497 | // SIGNALS/SLOTS FOR DAY/WEEK VIEW |
496 | 498 | ||
497 | connect(mAgendaView,SIGNAL(showDateView( int, QDate )),SLOT(showDateView( int, QDate ))); | 499 | connect(mAgendaView,SIGNAL(showDateView( int, QDate )),SLOT(showDateView( int, QDate ))); |
498 | 500 | ||
499 | connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)), | 501 | connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)), |
500 | mMainView, SLOT(newTodoDateTime(QDateTime,bool))); | 502 | mMainView, SLOT(newTodoDateTime(QDateTime,bool))); |
501 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)), | 503 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)), |
502 | mMainView, SLOT(newEvent(QDateTime))); | 504 | mMainView, SLOT(newEvent(QDateTime))); |
503 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)), | 505 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)), |
504 | mMainView, SLOT(newEvent(QDateTime,QDateTime))); | 506 | mMainView, SLOT(newEvent(QDateTime,QDateTime))); |
505 | connect(mAgendaView,SIGNAL(newEventSignal(QDate)), | 507 | connect(mAgendaView,SIGNAL(newEventSignal(QDate)), |
506 | mMainView, SLOT(newEvent(QDate))); | 508 | mMainView, SLOT(newEvent(QDate))); |
507 | 509 | ||
508 | connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)), | 510 | connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)), |
509 | mMainView, SLOT(editIncidence(Incidence *))); | 511 | mMainView, SLOT(editIncidence(Incidence *))); |