summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koviewmanager.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 2cd8792..c95917f 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -89,97 +89,98 @@ void KOViewManager::readSettings(KConfig *config)
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 101
102void KOViewManager::showDateView( int view, QDate date) 102void KOViewManager::showDateView( int view, QDate date)
103{ 103{
104 104
105 //qDebug("date %d %s", view, date.toString().latin1()); 105 //qDebug("date %d %s", view, date.toString().latin1());
106#if 0 106#if 0
107 mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 ); 107 mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 );
108 mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next Week"),4 ); 108 mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next Week"),4 );
109 mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Two Weeks"),5 ); 109 mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Two Weeks"),5 );
110 mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Month"),6 ); 110 mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Month"),6 );
111 mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 ); 111 mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 );
112#endif 112#endif
113 if ( view == 3 ) { 113 if ( view == 3 ) {
114 mMainView->showDay( date ); 114 mMainView->showDay( date );
115 } else if (view == 4 ) { 115 } else if (view == 4 ) {
116 mMainView->dateNavigator()->selectDates( date, 7 ); 116 mMainView->dateNavigator()->selectDates( date, 7 );
117 } else if (view == 5 ) { 117 } else if (view == 5 ) {
118 mMainView->dateNavigator()->selectDates( date, 14); 118 mMainView->dateNavigator()->selectDates( date, 14);
119 } else if (view == 6 ) { 119 } else if (view == 6 ) {
120 mMainView->dateNavigator()->blockSignals( true ); 120 mMainView->dateNavigator()->blockSignals( true );
121 showMonthView();
122 qApp->processEvents();
121 mMainView->dateNavigator()->selectMonthByDate( date ); 123 mMainView->dateNavigator()->selectMonthByDate( date );
122 mMainView->dateNavigator()->selectDate( date );
123 mMainView->dateNavigator()->blockSignals( false ); 124 mMainView->dateNavigator()->blockSignals( false );
124 showMonthView(); 125 mMainView->dateNavigator()->selectDate( date );
125 } else if (view == 7 ) { 126 } else if (view == 7 ) {
126 mMainView->dateNavigator()->selectDate( date ); 127 mMainView->dateNavigator()->selectDate( date );
127 showJournalView(); 128 showJournalView();
128 } else if (view == 8 ) { 129 } else if (view == 8 ) {
129 globalFlagBlockAgenda = 1; 130 globalFlagBlockAgenda = 1;
130 if ( mCurrentAgendaView != 3 ) 131 if ( mCurrentAgendaView != 3 )
131 mCurrentAgendaView = -1; 132 mCurrentAgendaView = -1;
132 showAgendaView(KOPrefs::instance()->mFullViewMonth); 133 showAgendaView(KOPrefs::instance()->mFullViewMonth);
133 globalFlagBlockAgenda = 2; 134 globalFlagBlockAgenda = 2;
134 mMainView->dateNavigator()->selectDates( date , 135 mMainView->dateNavigator()->selectDates( date ,
135 KOPrefs::instance()->mNextXDays ); 136 KOPrefs::instance()->mNextXDays );
136 mFlagShowNextxDays = true; 137 mFlagShowNextxDays = true;
137 mCurrentAgendaView = 3 ; 138 mCurrentAgendaView = 3 ;
138 } 139 }
139 140
140#if 0 141#if 0
141 dateNavigator()->blockSignals( true ); 142 dateNavigator()->blockSignals( true );
142 dateNavigator()->selectDate( d ); 143 dateNavigator()->selectDate( d );
143 dateNavigator()->blockSignals( false ); 144 dateNavigator()->blockSignals( false );
144 mViewManager->showDayView(); 145 mViewManager->showDayView();
145#endif 146#endif
146 147
147} 148}
148 149
149 150
150 151
151void KOViewManager::writeSettings(KConfig *config) 152void KOViewManager::writeSettings(KConfig *config)
152{ 153{
153 config->setGroup("General"); 154 config->setGroup("General");
154 155
155 QString view; 156 QString view;
156 if (mCurrentView == mWhatsNextView) view = "WhatsNext"; 157 if (mCurrentView == mWhatsNextView) view = "WhatsNext";
157 else if (mCurrentView == mMonthView) view = "Month"; 158 else if (mCurrentView == mMonthView) view = "Month";
158 else if (mCurrentView == mListView) view = "List"; 159 else if (mCurrentView == mListView) view = "List";
159 else if (mCurrentView == mJournalView) view = "Journal"; 160 else if (mCurrentView == mJournalView) view = "Journal";
160 else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; 161 else if (mCurrentView == mTimeSpanView) view = "TimeSpan";
161 else if (mCurrentView == mTodoView) view = "Todo"; 162 else if (mCurrentView == mTodoView) view = "Todo";
162 else view = "Agenda"; 163 else view = "Agenda";
163 164
164 config->writeEntry("Current View",view); 165 config->writeEntry("Current View",view);
165 166
166 if (mAgendaView) { 167 if (mAgendaView) {
167 mAgendaView->writeSettings(config); 168 mAgendaView->writeSettings(config);
168 } 169 }
169 if (mTimeSpanView) { 170 if (mTimeSpanView) {
170 mTimeSpanView->writeSettings(config); 171 mTimeSpanView->writeSettings(config);
171 } 172 }
172 if (mListView) { 173 if (mListView) {
173 mListView->writeSettings(config); 174 mListView->writeSettings(config);
174 } 175 }
175 if (mTodoView) { 176 if (mTodoView) {
176 mTodoView->saveLayout(config,"Todo View"); 177 mTodoView->saveLayout(config,"Todo View");
177 } 178 }
178} 179}
179 180
180void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) 181void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
181{ 182{
182 183
183 //mFlagShowNextxDays = false; 184 //mFlagShowNextxDays = false;
184 //if(view == mCurrentView) return; 185 //if(view == mCurrentView) return;
185 if ( view == 0 ) { 186 if ( view == 0 ) {
@@ -494,69 +495,65 @@ void KOViewManager::showMonthView()
494 mMainView, SLOT(showIncidence(Incidence *))); 495 mMainView, SLOT(showIncidence(Incidence *)));
495 connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)), 496 connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)),
496 mMainView, SLOT(editIncidence(Incidence *))); 497 mMainView, SLOT(editIncidence(Incidence *)));
497 connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), 498 connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)),
498 mMainView, SLOT(deleteIncidence(Incidence *))); 499 mMainView, SLOT(deleteIncidence(Incidence *)));
499 500
500 connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), 501 connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ),
501 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 502 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
502 connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), 503 connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ),
503 mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); 504 mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
504 connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), 505 connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ),
505 mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); 506 mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
506 507
507 connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), 508 connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
508 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 509 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
509 connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 510 connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
510 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 511 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
511 connect( mMonthView, SIGNAL( selectWeekNum( int ) ), 512 connect( mMonthView, SIGNAL( selectWeekNum( int ) ),
512 mMainView, SLOT ( selectWeekNum( int ) ) ); 513 mMainView, SLOT ( selectWeekNum( int ) ) );
513 connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), 514 connect( mMonthView, SIGNAL( showDaySignal( QDate ) ),
514 mMainView, SLOT ( showDay( QDate ) ) ); 515 mMainView, SLOT ( showDay( QDate ) ) );
515 connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); 516 connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig()));
516 connect( mMonthView, SIGNAL(nextMonth() ), 517 connect( mMonthView, SIGNAL(nextMonth() ),
517 mMainView->navigatorBar(), SIGNAL(goNextMonth() ) ); 518 mMainView->navigatorBar(), SIGNAL(goNextMonth() ) );
518 connect( mMonthView, SIGNAL(prevMonth() ), 519 connect( mMonthView, SIGNAL(prevMonth() ),
519 mMainView->navigatorBar(), SIGNAL(goPrevMonth() ) ); 520 mMainView->navigatorBar(), SIGNAL(goPrevMonth() ) );
520 mMonthView->updateConfig(); 521 mMonthView->updateConfig();
521 } 522 }
522 523
523 globalFlagBlockAgenda = 1; 524 globalFlagBlockAgenda = 1;
524 //mFlagShowNextxDays = false; 525 //mFlagShowNextxDays = false;
525 // if(mMonthView == mCurrentView) return; 526 // if(mMonthView == mCurrentView) return;
526 mMainView->dateNavigator()->blockSignals( true );
527 mMainView->dateNavigator()->selectMonth(); 527 mMainView->dateNavigator()->selectMonth();
528 mMainView->dateNavigator()->blockSignals( false);
529 // DateList tmpList = mMainView->dateNavigator()->selectedDates( );
530 //mMonthView->showDates(tmpList.first(), tmpList.last());
531 528
532 showView(mMonthView, true ); 529 showView(mMonthView, true );
533 530
534} 531}
535 532
536void KOViewManager::showTodoView() 533void KOViewManager::showTodoView()
537{ 534{
538 //mFlagShowNextxDays = false; 535 //mFlagShowNextxDays = false;
539 if ( !mTodoView ) { 536 if ( !mTodoView ) {
540 mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), 537 mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(),
541 "KOViewManager::TodoView" ); 538 "KOViewManager::TodoView" );
542 539
543 addView( mTodoView ); 540 addView( mTodoView );
544 // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); 541 // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold );
545 542
546 // SIGNALS/SLOTS FOR TODO VIEW 543 // SIGNALS/SLOTS FOR TODO VIEW
547 connect( mTodoView, SIGNAL( newTodoSignal() ), 544 connect( mTodoView, SIGNAL( newTodoSignal() ),
548 mMainView, SLOT( newTodo() ) ); 545 mMainView, SLOT( newTodo() ) );
549 connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ), 546 connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ),
550 mMainView, SLOT( newSubTodo( Todo *) ) ); 547 mMainView, SLOT( newSubTodo( Todo *) ) );
551 connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ), 548 connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ),
552 mMainView, SLOT( showTodo( Todo * ) ) ); 549 mMainView, SLOT( showTodo( Todo * ) ) );
553 connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ), 550 connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ),
554 mMainView, SLOT( editTodo( Todo * ) ) ); 551 mMainView, SLOT( editTodo( Todo * ) ) );
555 connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ), 552 connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ),
556 mMainView, SLOT( deleteTodo( Todo * ) ) ); 553 mMainView, SLOT( deleteTodo( Todo * ) ) );
557 connect( mTodoView, SIGNAL( purgeCompletedSignal() ), 554 connect( mTodoView, SIGNAL( purgeCompletedSignal() ),
558 mMainView, SLOT( purgeCompleted() ) ); 555 mMainView, SLOT( purgeCompleted() ) );
559 556
560 connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ), 557 connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ),
561 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 558 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
562 559