summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-30 20:15:13 (UTC)
committer zautrix <zautrix>2005-03-30 20:15:13 (UTC)
commit28ac86e2efbc10f210dbd2d5ac0053f4e6198d57 (patch) (unidiff)
treefce7d5a7d9f834f0df1f76a206537b976981cbbf
parentb9ec42913b1dc7fc39848f245e55c7b36d7c2fa6 (diff)
downloadkdepimpi-28ac86e2efbc10f210dbd2d5ac0053f4e6198d57.zip
kdepimpi-28ac86e2efbc10f210dbd2d5ac0053f4e6198d57.tar.gz
kdepimpi-28ac86e2efbc10f210dbd2d5ac0053f4e6198d57.tar.bz2
fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koviewmanager.cpp120
-rw-r--r--korganizer/koviewmanager.h3
2 files changed, 76 insertions, 47 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 548ffd3..f97aa98 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -1,128 +1,128 @@
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;
54int globalFlagBlockAgenda = 0; 54int globalFlagBlockAgenda = 0;
55int globalFlagBlockLabel = 0; 55int globalFlagBlockLabel = 0;
56int globalFlagBlockAgendaItemPaint = 1; 56int globalFlagBlockAgendaItemPaint = 1;
57int globalFlagBlockAgendaItemUpdate = 1; 57int globalFlagBlockAgendaItemUpdate = 1;
58 58
59 59
60KOViewManager::KOViewManager( CalendarView *mainView ) : 60KOViewManager::KOViewManager( CalendarView *mainView ) :
61 QObject(), mMainView( mainView ) 61 QObject(), mMainView( mainView )
62{ 62{
63 mCurrentView = 0; 63 mCurrentView = 0;
64 64 flagResetViewChangeDate = 0;
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
76KOViewManager::~KOViewManager() 76KOViewManager::~KOViewManager()
77{ 77{
78} 78}
79 79
80 80
81KOrg::BaseView *KOViewManager::currentView() 81KOrg::BaseView *KOViewManager::currentView()
82{ 82{
83 return mCurrentView; 83 return mCurrentView;
84} 84}
85 85
86void KOViewManager::readSettings(KConfig *config) 86void 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") { 91 else if (view == "Month") {
92 if ( !KOPrefs::instance()->mMonthViewWeek ) 92 if ( !KOPrefs::instance()->mMonthViewWeek )
93 showMonthView(); 93 showMonthView();
94 else 94 else
95 showMonthViewWeek(); 95 showMonthViewWeek();
96 } 96 }
97 else if (view == "List") showListView(); 97 else if (view == "List") showListView();
98 else if (view == "Journal") showJournalView(); 98 else if (view == "Journal") showJournalView();
99 else if (view == "TimeSpan") showTimeSpanView(); 99 else if (view == "TimeSpan") showTimeSpanView();
100 else if (view == "Todo") showTodoView(); 100 else if (view == "Todo") showTodoView();
101 else { 101 else {
102 config->setGroup( "Views" ); 102 config->setGroup( "Views" );
103 int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); 103 int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
104 mCurrentAgendaView = dateCount; 104 mCurrentAgendaView = dateCount;
105 showAgendaView(); 105 showAgendaView();
106 mCurrentAgendaView = dateCount; 106 mCurrentAgendaView = dateCount;
107#ifdef DESKTOP_VERSION 107#ifdef DESKTOP_VERSION
108 QTimer::singleShot( 1000, mAgendaView, SLOT ( setInitStartHour() ) ); 108 QTimer::singleShot( 1000, mAgendaView, SLOT ( setInitStartHour() ) );
109#endif 109#endif
110 } 110 }
111} 111}
112 112
113void KOViewManager::showDateView( int view, QDate date) 113void KOViewManager::showDateView( int view, QDate date)
114{ 114{
115 static int lastMode = 0; 115 static int lastMode = 0;
116 static int lastCount = 0; 116 static int lastCount = 0;
117 static bool lastNDMode = false; 117 static bool lastNDMode = false;
118 static QDate lastDate; 118 static QDate lastDate;
119 //qDebug("date %d %s", view, date.toString().latin1()); 119 //qDebug("date %d %s", view, date.toString().latin1());
120 120
121 if (view != 9) 121 if (view != 9)
122 lastMode = 0; 122 lastMode = 0;
123 //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays ); 123 //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays );
124 bool savemFlagShowNextxDays = mFlagShowNextxDays; 124 bool savemFlagShowNextxDays = mFlagShowNextxDays;
125 mFlagShowNextxDays = false; 125 mFlagShowNextxDays = false;
126 if ( view == 3 ) { 126 if ( view == 3 ) {
127 //mCurrentAgendaView = 1 ; 127 //mCurrentAgendaView = 1 ;
128 lastDate = mMainView->dateNavigator()->selectedDates().first(); 128 lastDate = mMainView->dateNavigator()->selectedDates().first();
@@ -139,196 +139,222 @@ void KOViewManager::showDateView( int view, QDate date)
139 mMainView->dateNavigator()->selectDates( date, 14); 139 mMainView->dateNavigator()->selectDates( date, 14);
140 } else if (view == 6 ) { 140 } else if (view == 6 ) {
141 //mMainView->dateNavigator()->selectDates( date, 7 ); 141 //mMainView->dateNavigator()->selectDates( date, 7 );
142 showMonthView(); 142 showMonthView();
143 } else if (view == 7 ) { 143 } else if (view == 7 ) {
144 mMainView->dateNavigator()->selectDate( date ); 144 mMainView->dateNavigator()->selectDate( date );
145 showJournalView(); 145 showJournalView();
146 } else if (view == 8 ) { 146 } else if (view == 8 ) {
147 globalFlagBlockAgenda = 1; 147 globalFlagBlockAgenda = 1;
148 if ( mCurrentAgendaView != 3 ) 148 if ( mCurrentAgendaView != 3 )
149 mCurrentAgendaView = -1; 149 mCurrentAgendaView = -1;
150 showAgendaView(KOPrefs::instance()->mFullViewMonth); 150 showAgendaView(KOPrefs::instance()->mFullViewMonth);
151 globalFlagBlockAgenda = 2; 151 globalFlagBlockAgenda = 2;
152 mMainView->dateNavigator()->selectDates( date , 152 mMainView->dateNavigator()->selectDates( date ,
153 KOPrefs::instance()->mNextXDays ); 153 KOPrefs::instance()->mNextXDays );
154 mFlagShowNextxDays = true; 154 mFlagShowNextxDays = true;
155 mCurrentAgendaView = 3 ; 155 mCurrentAgendaView = 3 ;
156 } if (view == 9) { // return behaviour, for getting back from mode == 3 (single day mode ) 156 } if (view == 9) { // return behaviour, for getting back from mode == 3 (single day mode )
157 if ( lastMode ) { 157 if ( lastMode ) {
158 mCurrentAgendaView = lastCount ; 158 mCurrentAgendaView = lastCount ;
159 mMainView->dateNavigator()->selectDates( lastDate, lastCount); 159 mMainView->dateNavigator()->selectDates( lastDate, lastCount);
160 mFlagShowNextxDays = lastNDMode; 160 mFlagShowNextxDays = lastNDMode;
161 if ( mFlagShowNextxDays ) { 161 if ( mFlagShowNextxDays ) {
162 mCurrentAgendaView = 3 ; 162 mCurrentAgendaView = 3 ;
163 } 163 }
164 } else 164 } else
165 showWeekView(); 165 showWeekView();
166 } else if (view == 10) { 166 } else if (view == 10) {
167 mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() ); 167 mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() );
168 } 168 }
169} 169}
170 170
171 171
172 172
173void KOViewManager::writeSettings(KConfig *config) 173void KOViewManager::writeSettings(KConfig *config)
174{ 174{
175 config->setGroup("General"); 175 config->setGroup("General");
176 176
177 QString view; 177 QString view;
178 if (mCurrentView == mWhatsNextView) view = "WhatsNext"; 178 if (mCurrentView == mWhatsNextView) view = "WhatsNext";
179 else if (mCurrentView == mMonthView) view = "Month"; 179 else if (mCurrentView == mMonthView) view = "Month";
180 else if (mCurrentView == mListView) view = "List"; 180 else if (mCurrentView == mListView) view = "List";
181 else if (mCurrentView == mJournalView) view = "Journal"; 181 else if (mCurrentView == mJournalView) view = "Journal";
182 else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; 182 else if (mCurrentView == mTimeSpanView) view = "TimeSpan";
183 else if (mCurrentView == mTodoView) view = "Todo"; 183 else if (mCurrentView == mTodoView) view = "Todo";
184 else view = "Agenda"; 184 else view = "Agenda";
185 185
186 config->writeEntry("Current View",view); 186 config->writeEntry("Current View",view);
187 187
188 if (mAgendaView) { 188 if (mAgendaView) {
189 mAgendaView->writeSettings(config); 189 mAgendaView->writeSettings(config);
190 } 190 }
191 if (mTimeSpanView) { 191 if (mTimeSpanView) {
192 mTimeSpanView->writeSettings(config); 192 mTimeSpanView->writeSettings(config);
193 } 193 }
194 if (mListView) { 194 if (mListView) {
195 mListView->writeSettings(config); 195 mListView->writeSettings(config);
196 } 196 }
197 if (mTodoView) { 197 if (mTodoView) {
198 mTodoView->saveLayout(config,"Todo View"); 198 mTodoView->saveLayout(config,"Todo View");
199 } 199 }
200} 200}
201void KOViewManager::showNextView() 201void KOViewManager::showNextView()
202{ 202{
203 static int selecteddatescount = 0;
204 static QDate selecteddate = QDate ( 2000, 1, 1 );
205 static QDate baseCycleDate = QDate ( 2000, 1, 1 );
206 int newCount = mMainView->dateNavigator()->selectedDates().count();
207 if ( selecteddatescount != newCount && flagResetViewChangeDate == 0 ) {
208 flagResetViewChangeDate = 1;
209 }
210 if ( selecteddate != mMainView->dateNavigator()->selectedDates().first() )
211 flagResetViewChangeDate = 1;
212 if ( flagResetViewChangeDate > 0 ) {
213 baseCycleDate = mMainView->dateNavigator()->selectedDates().first();
214 //qDebug("newCycle ");
215 }
203 if (mCurrentView == mWhatsNextView) goto NEXT_X; 216 if (mCurrentView == mWhatsNextView) goto NEXT_X;
204
205 if (mCurrentView == mAgendaView && mFlagShowNextxDays) goto JOURNAL; 217 if (mCurrentView == mAgendaView && mFlagShowNextxDays) goto JOURNAL;
206
207 if (mCurrentView == mJournalView ) goto DAY_1; 218 if (mCurrentView == mJournalView ) goto DAY_1;
208
209 if (mCurrentView == mAgendaView && mCurrentAgendaView == 1 ) goto DAY_5; 219 if (mCurrentView == mAgendaView && mCurrentAgendaView == 1 ) goto DAY_5;
210
211 if (mCurrentView == mAgendaView && mCurrentAgendaView == 5 ) goto DAY_7; 220 if (mCurrentView == mAgendaView && mCurrentAgendaView == 5 ) goto DAY_7;
212
213 if (mCurrentView == mAgendaView ) goto DAY_6; 221 if (mCurrentView == mAgendaView ) goto DAY_6;
214
215 if (mCurrentView == mMonthView && KOPrefs::instance()->mMonthViewWeek) goto MONTH; 222 if (mCurrentView == mMonthView && KOPrefs::instance()->mMonthViewWeek) goto MONTH;
216
217 if (mCurrentView == mMonthView ) goto LIST; 223 if (mCurrentView == mMonthView ) goto LIST;
218
219 if (mCurrentView == mListView ) goto TODO; 224 if (mCurrentView == mListView ) goto TODO;
220 225 // if (mCurrentView == mTodoView ) goto NEXT;
221 // if (mCurrentView == mTodoView ) goto LIST;
222
223
224 NEXT: 226 NEXT:
225 if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();return ;} 227 if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();goto ENTE ;}
226 NEXT_X: 228 NEXT_X:
227 if ( KOPrefs::instance()->mShowIconNextDays ) { showNextXView() ;return ;} 229 if ( KOPrefs::instance()->mShowIconNextDays ) {
230 globalFlagBlockAgenda = 1;
231 if ( mCurrentAgendaView != 3 )
232 mCurrentAgendaView = -1;
233 showAgendaView(KOPrefs::instance()->mFullViewMonth);
234 globalFlagBlockAgenda = 2;
235 mMainView->dateNavigator()->selectDates( baseCycleDate ,
236 KOPrefs::instance()->mNextXDays );
237 mFlagShowNextxDays = true;
238 mCurrentAgendaView = 3 ;
239 goto ENTE ;
240 }
228 JOURNAL: 241 JOURNAL:
229 if ( KOPrefs::instance()->mShowIconJournal ) { showJournalView() ;return ;} 242 if ( KOPrefs::instance()->mShowIconJournal ) {
243 resetDateSilent( baseCycleDate , 1 );
244 showJournalView() ;goto ENTE ;}
230 DAY_1: 245 DAY_1:
231 if ( KOPrefs::instance()->mShowIconDay1 ) { showDayView() ;return ;} 246 if ( KOPrefs::instance()->mShowIconDay1 ) {
247 resetDateSilent( baseCycleDate , 2 );
248 showDayView() ;goto ENTE ;}
232 DAY_5: 249 DAY_5:
233 if ( KOPrefs::instance()->mShowIconDay5 ) { showWorkWeekView() ;return ;} 250 if ( KOPrefs::instance()->mShowIconDay5 ) {
251 resetDateSilent( baseCycleDate , 2 );
252 showWorkWeekView() ;goto ENTE ;}
234 DAY_7: 253 DAY_7:
235 if ( KOPrefs::instance()->mShowIconDay7 ) { showWeekView();return ;} 254 if ( KOPrefs::instance()->mShowIconDay7 ) {
255 resetDateSilent( baseCycleDate , 2 );
256 showWeekView();goto ENTE ;}
236 DAY_6: 257 DAY_6:
237 if ( KOPrefs::instance()->mShowIconDay6 ) { showMonthViewWeek();return ;} 258 if ( KOPrefs::instance()->mShowIconDay6 ) {
259 resetDateSilent( baseCycleDate , 2 );
260 showMonthViewWeek();goto ENTE ;}
238 MONTH: 261 MONTH:
239 if ( KOPrefs::instance()->mShowIconMonth ) { showMonthView();return ;} 262 if ( KOPrefs::instance()->mShowIconMonth ) {
263 resetDateSilent( baseCycleDate , 2 );
264 showMonthView();goto ENTE ;}
240 LIST: 265 LIST:
241 if ( KOPrefs::instance()->mShowIconList ) { showListView() ;return ;} 266 if ( KOPrefs::instance()->mShowIconList ) {
267 resetDateSilent( baseCycleDate , 2 );
268 showListView() ;goto ENTE ;}
242 TODO: 269 TODO:
243 if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;return ;} 270 if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;goto ENTE ;}
244 271 if ( KOPrefs::instance()->mShowIconNext ) { goto NEXT ;}
245 if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();return ;} 272 if ( KOPrefs::instance()->mShowIconNextDays ) { goto NEXT_X ;}
246 273 if ( KOPrefs::instance()->mShowIconJournal ) { goto JOURNAL;}
247 if ( KOPrefs::instance()->mShowIconNextDays ) { showNextXView() ;return ;} 274 if ( KOPrefs::instance()->mShowIconDay1 ) { goto DAY_1 ;}
248 275 if ( KOPrefs::instance()->mShowIconDay5 ) { goto DAY_5 ;}
249 if ( KOPrefs::instance()->mShowIconJournal ) { showJournalView() ;return ;} 276 if ( KOPrefs::instance()->mShowIconDay7 ) { goto DAY_7 ;}
250 277 if ( KOPrefs::instance()->mShowIconDay6 ) { goto DAY_6 ;}
251 if ( KOPrefs::instance()->mShowIconDay1 ) { showDayView() ;return ;} 278 if ( KOPrefs::instance()->mShowIconMonth ) {goto MONTH ;}
252 279 if ( KOPrefs::instance()->mShowIconList ) { goto LIST ;}
253 if ( KOPrefs::instance()->mShowIconDay5 ) { showWorkWeekView() ;return ;} 280 //if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;goto ENTE ;}
254 281 ENTE:
255 if ( KOPrefs::instance()->mShowIconDay7 ) { showWeekView();return ;} 282 flagResetViewChangeDate = 0;
256 283 selecteddatescount = mMainView->dateNavigator()->selectedDates().count();
257 if ( KOPrefs::instance()->mShowIconDay6 ) { showMonthViewWeek();return ;} 284 selecteddate = mMainView->dateNavigator()->selectedDates().first();
258 285
259 if ( KOPrefs::instance()->mShowIconMonth ) { showMonthView();return ;} 286}
260 287void KOViewManager::resetDateSilent( QDate date , int days )
261 if ( KOPrefs::instance()->mShowIconList ) { showListView() ;return ;} 288{
262 289 mMainView->dateNavigator()->blockSignals( true );
263 //if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;return ;} 290 mMainView->dateNavigator()->selectDates( date , days );
264 291 mMainView->dateNavigator()->blockSignals( false );
265
266
267} 292}
268void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) 293void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
269{ 294{
270 295 if ( flagResetViewChangeDate < 10 )
296 ++flagResetViewChangeDate;
271 //mFlagShowNextxDays = false; 297 //mFlagShowNextxDays = false;
272 //if(view == mCurrentView) return; 298 //if(view == mCurrentView) return;
273 if ( view == 0 ) { 299 if ( view == 0 ) {
274 view = mCurrentView; 300 view = mCurrentView;
275 if ( view == 0 ) 301 if ( view == 0 )
276 return; 302 return;
277 } 303 }
278 bool callupdate = !(view == mCurrentView); 304 bool callupdate = !(view == mCurrentView);
279 bool full = fullScreen; 305 bool full = fullScreen;
280 if(view == mCurrentView && view != mWhatsNextView ) { 306 if(view == mCurrentView && view != mWhatsNextView ) {
281 if ( mCurrentAgendaView < 0 ) 307 if ( mCurrentAgendaView < 0 )
282 return; 308 return;
283 if ( view != mMonthView ) 309 if ( view != mMonthView )
284 full = mMainView->leftFrame()->isVisible(); 310 full = mMainView->leftFrame()->isVisible();
285 } else { 311 } else {
286 if ( view == mMonthView && mMonthView) 312 if ( view == mMonthView && mMonthView)
287 ;//mMonthView->skipResize = true ; 313 ;//mMonthView->skipResize = true ;
288 mCurrentView = view; 314 mCurrentView = view;
289 // bool full = fullScreen; 315 // bool full = fullScreen;
290 bool isFull = !mMainView->leftFrame()->isVisible(); 316 bool isFull = !mMainView->leftFrame()->isVisible();
291 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) 317 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen )
292 full = true; 318 full = true;
293 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) 319 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen )
294 full = false; 320 full = false;
295 } 321 }
296 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); 322 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime();
297 //raiseCurrentView( full ); 323 //raiseCurrentView( full );
298 mMainView->processIncidenceSelection( 0 ); 324 mMainView->processIncidenceSelection( 0 );
299 //mMainView->updateView(); 325 //mMainView->updateView();
300 raiseCurrentView( full, callupdate ); 326 raiseCurrentView( full, callupdate );
301 mMainView->adaptNavigationUnits(); 327 mMainView->adaptNavigationUnits();
302} 328}
303 329
304void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) 330void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView )
305{ 331{
306 mCurrentAgendaView = 0; 332 mCurrentAgendaView = 0;
307 if ( fullScreen ) { 333 if ( fullScreen ) {
308 mMainView->leftFrame()->hide(); 334 mMainView->leftFrame()->hide();
309 } else { 335 } else {
310 mMainView->leftFrame()->show(); 336 mMainView->leftFrame()->show();
311 } 337 }
312 //if ( mCurrentView == mMonthView ) qApp->processEvents(); 338 //if ( mCurrentView == mMonthView ) qApp->processEvents();
313 emit signalFullScreen( !fullScreen ); 339 emit signalFullScreen( !fullScreen );
314 if ( callUpdateView ) 340 if ( callUpdateView )
315 mMainView->updateView(); 341 mMainView->updateView();
316 342
317 if ( globalFlagBlockAgenda == 5 ) { 343 if ( globalFlagBlockAgenda == 5 ) {
318 globalFlagBlockAgenda = 4; 344 globalFlagBlockAgenda = 4;
319 globalFlagBlockAgendaItemPaint = 1; 345 globalFlagBlockAgendaItemPaint = 1;
320 } 346 }
321 mMainView->viewStack()->raiseWidget(mCurrentView); 347 mMainView->viewStack()->raiseWidget(mCurrentView);
322 if ( globalFlagBlockAgenda == 4 ) { 348 if ( globalFlagBlockAgenda == 4 ) {
323 if ( mCurrentView == mAgendaView ) { 349 if ( mCurrentView == mAgendaView ) {
324 //globalFlagBlockAgenda =1 ; 350 //globalFlagBlockAgenda =1 ;
325 if ( KOPrefs::instance()->mSetTimeToDayStartAt ) 351 if ( KOPrefs::instance()->mSetTimeToDayStartAt )
326 mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); 352 mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins );
327 else if ( KOPrefs::instance()->mCenterOnCurrentTime ) 353 else if ( KOPrefs::instance()->mCenterOnCurrentTime )
328 mAgendaView->setStartHour( QTime::currentTime ().hour() ); 354 mAgendaView->setStartHour( QTime::currentTime ().hour() );
329 qApp->processEvents(); 355 qApp->processEvents();
330 //qDebug("qApp->processEvents() "); 356 //qDebug("qApp->processEvents() ");
331 globalFlagBlockAgenda = 0; 357 globalFlagBlockAgenda = 0;
332 mAgendaView->repaintAgenda(); 358 mAgendaView->repaintAgenda();
333 359
334 } 360 }
diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h
index 1d565a6..8dc03e0 100644
--- a/korganizer/koviewmanager.h
+++ b/korganizer/koviewmanager.h
@@ -40,84 +40,87 @@ class KOJournalView;
40 40
41using namespace KCal; 41using 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*/
47class KOViewManager : public QObject 47class 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 , bool updateView = false); 71 void raiseCurrentView( bool fullScreen = false , bool updateView = 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 ); 82 void signalFullScreen( bool );
83 void signalAgendaView( bool ); 83 void signalAgendaView( bool );
84 public slots: 84 public slots:
85 void slotprintWNV(); 85 void slotprintWNV();
86 void showNextView(); 86 void showNextView();
87 void showMonth( const QDate & ); 87 void showMonth( const QDate & );
88 void showDateView( int, QDate ); 88 void showDateView( int, QDate );
89 void updateView(); 89 void updateView();
90 void showWhatsNextView(); 90 void showWhatsNextView();
91 void showListView(); 91 void showListView();
92 void showAgendaView( bool fullScreen = false ); 92 void showAgendaView( bool fullScreen = false );
93 void showDayView(); 93 void showDayView();
94 void showWorkWeekView(); 94 void showWorkWeekView();
95 void showWeekView(); 95 void showWeekView();
96 void showNextXView(); 96 void showNextXView();
97 void showMonthView(); 97 void showMonthView();
98 void showMonthViewWeek(); 98 void showMonthViewWeek();
99 void showTodoView(); 99 void showTodoView();
100 void showJournalView(); 100 void showJournalView();
101 void showTimeSpanView(); 101 void showTimeSpanView();
102 102
103 private: 103 private:
104 void resetDateSilent( QDate date , int days );
105 int flagResetViewChangeDate;
106 QDate currentViewChangeDate;
104 void createMonthView(); 107 void createMonthView();
105 CalendarView *mMainView; 108 CalendarView *mMainView;
106 109
107 int mCurrentAgendaView; 110 int mCurrentAgendaView;
108 KOAgendaView *mAgendaView; 111 KOAgendaView *mAgendaView;
109 KOListView *mListView; 112 KOListView *mListView;
110 KOMonthView *mMonthView; 113 KOMonthView *mMonthView;
111 KOTodoView *mTodoView; 114 KOTodoView *mTodoView;
112 KOWhatsNextView *mWhatsNextView; 115 KOWhatsNextView *mWhatsNextView;
113 KOJournalView *mJournalView; 116 KOJournalView *mJournalView;
114 KOTimeSpanView *mTimeSpanView; 117 KOTimeSpanView *mTimeSpanView;
115 118
116 KOrg::BaseView *mCurrentView; // currently active event view 119 KOrg::BaseView *mCurrentView; // currently active event view
117 120
118 int mAgendaViewMode; 121 int mAgendaViewMode;
119 bool mFlagShowNextxDays; 122 bool mFlagShowNextxDays;
120 123
121}; 124};
122 125
123#endif 126#endif