summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-02-20 11:14:04 (UTC)
committer zautrix <zautrix>2005-02-20 11:14:04 (UTC)
commitbb74ffa01010ca364e101e05a6b3e090ae363a0e (patch) (unidiff)
tree573f3b5244f064996c9cb4c73cc0ad04816bda9b /korganizer
parentce9aa88149547443452a2077f5c3832fbea34f63 (diff)
downloadkdepimpi-bb74ffa01010ca364e101e05a6b3e090ae363a0e.zip
kdepimpi-bb74ffa01010ca364e101e05a6b3e090ae363a0e.tar.gz
kdepimpi-bb74ffa01010ca364e101e05a6b3e090ae363a0e.tar.bz2
minor month-weekview fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/komonthview.h2
-rw-r--r--korganizer/koviewmanager.cpp1
2 files changed, 2 insertions, 1 deletions
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index b79a41f..f92a69a 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -1,301 +1,301 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,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 19
20#ifndef _KOMONTHVIEW_H 20#ifndef _KOMONTHVIEW_H
21#define _KOMONTHVIEW_H 21#define _KOMONTHVIEW_H
22 22
23#include <qlabel.h> 23#include <qlabel.h>
24#include <qframe.h> 24#include <qframe.h>
25#include <qdatetime.h> 25#include <qdatetime.h>
26#include <qlistbox.h> 26#include <qlistbox.h>
27#include <qpoint.h> 27#include <qpoint.h>
28#include <qwidgetstack.h> 28#include <qwidgetstack.h>
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qintdict.h> 30#include <qintdict.h>
31#include <qpushbutton.h> 31#include <qpushbutton.h>
32#include <qvaluelist.h> 32#include <qvaluelist.h>
33#include <qptrvector.h> 33#include <qptrvector.h>
34 34
35#include <libkcal/calendar.h> 35#include <libkcal/calendar.h>
36#include <libkcal/event.h> 36#include <libkcal/event.h>
37 37
38#include "koeventview.h" 38#include "koeventview.h"
39#include "navigatorbar.h" 39#include "navigatorbar.h"
40 40
41#ifdef DESKTOP_VERSION 41#ifdef DESKTOP_VERSION
42class QToolTipGroup; 42class QToolTipGroup;
43#endif 43#endif
44 44
45class KNOWhatsThis; 45class KNOWhatsThis;
46class KOWeekButton : public QPushButton 46class KOWeekButton : public QPushButton
47{ 47{
48 Q_OBJECT 48 Q_OBJECT
49 public: 49 public:
50 KOWeekButton( QWidget *parent=0, const char *name=0 ) : 50 KOWeekButton( QWidget *parent=0, const char *name=0 ) :
51 QPushButton( parent, name) 51 QPushButton( parent, name)
52 { 52 {
53 connect( this, SIGNAL( clicked() ), 53 connect( this, SIGNAL( clicked() ),
54 SLOT( bottonClicked() )); 54 SLOT( bottonClicked() ));
55 mNumber = -1; 55 mNumber = -1;
56 } 56 }
57 void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));} 57 void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));}
58 int getWeekNum() { return mNumber;} 58 int getWeekNum() { return mNumber;}
59 signals: 59 signals:
60 void selectWeekNum ( int ); 60 void selectWeekNum ( int );
61private: 61private:
62 int mNumber; 62 int mNumber;
63private slots : 63private slots :
64 void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); } 64 void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); }
65}; 65};
66 66
67class KNoScrollListBox: public QListBox 67class KNoScrollListBox: public QListBox
68{ 68{
69 Q_OBJECT 69 Q_OBJECT
70 public: 70 public:
71 KNoScrollListBox(QWidget *parent=0, const char *name=0); 71 KNoScrollListBox(QWidget *parent=0, const char *name=0);
72 ~KNoScrollListBox(); 72 ~KNoScrollListBox();
73 QString getWhatsThisText(QPoint p) ; 73 QString getWhatsThisText(QPoint p) ;
74 74
75 signals: 75 signals:
76 void shiftDown(); 76 void shiftDown();
77 void shiftUp(); 77 void shiftUp();
78 void rightClick(); 78 void rightClick();
79 79
80 protected slots: 80 protected slots:
81 void oneDown(); 81 void oneDown();
82 void keyPressEvent(QKeyEvent *); 82 void keyPressEvent(QKeyEvent *);
83 void keyReleaseEvent(QKeyEvent *); 83 void keyReleaseEvent(QKeyEvent *);
84 void mousePressEvent(QMouseEvent *); 84 void mousePressEvent(QMouseEvent *);
85 85
86 private: 86 private:
87 KNOWhatsThis * mWT; 87 KNOWhatsThis * mWT;
88}; 88};
89 89
90 90
91class MonthViewItem: public QListBoxItem 91class MonthViewItem: public QListBoxItem
92{ 92{
93 public: 93 public:
94 MonthViewItem( Incidence *, QDate qd, const QString & title ); 94 MonthViewItem( Incidence *, QDate qd, const QString & title );
95 95
96 void setRecur(bool on) { mRecur = on; } 96 void setRecur(bool on) { mRecur = on; }
97 void setAlarm(bool on) { mAlarm = on; } 97 void setAlarm(bool on) { mAlarm = on; }
98 void setReply(bool on) { mReply = on; } 98 void setReply(bool on) { mReply = on; }
99 void setMoreInfo(bool on) { mInfo = on; } 99 void setMoreInfo(bool on) { mInfo = on; }
100 void setMultiDay(int type) { mMultiday = type; } 100 void setMultiDay(int type) { mMultiday = type; }
101 101
102 102
103 void setPalette(const QPalette &p) { mPalette = p; } 103 void setPalette(const QPalette &p) { mPalette = p; }
104 QPalette palette() const { return mPalette; } 104 QPalette palette() const { return mPalette; }
105 105
106 Incidence *incidence() const { return mIncidence; } 106 Incidence *incidence() const { return mIncidence; }
107 QDate incidenceDate() { return mDate; } 107 QDate incidenceDate() { return mDate; }
108 108
109 protected: 109 protected:
110 virtual void paint(QPainter *); 110 virtual void paint(QPainter *);
111 virtual int height(const QListBox *) const; 111 virtual int height(const QListBox *) const;
112 virtual int width(const QListBox *) const; 112 virtual int width(const QListBox *) const;
113 113
114 private: 114 private:
115 int mMultiday; 115 int mMultiday;
116 bool mRecur; 116 bool mRecur;
117 bool mAlarm; 117 bool mAlarm;
118 bool mReply; 118 bool mReply;
119 bool mInfo; 119 bool mInfo;
120 120
121 QPalette mPalette; 121 QPalette mPalette;
122 QDate mDate; 122 QDate mDate;
123 123
124 Incidence *mIncidence; 124 Incidence *mIncidence;
125}; 125};
126 126
127 127
128class KOMonthView; 128class KOMonthView;
129 129
130class MonthViewCell : public QWidget 130class MonthViewCell : public QWidget
131{ 131{
132 Q_OBJECT 132 Q_OBJECT
133 public: 133 public:
134 MonthViewCell(KOMonthView *,QWidget* ); 134 MonthViewCell(KOMonthView *,QWidget* );
135 135
136 void setDate( const QDate & ); 136 void setDate( const QDate & );
137 QDate date() const; 137 QDate date() const;
138 138
139 void setPrimary( bool ); 139 void setPrimary( bool );
140 bool isPrimary() const; 140 bool isPrimary() const;
141 141
142 void setHoliday( bool ); 142 void setHoliday( bool );
143 void setHoliday( const QString & ); 143 void setHoliday( const QString & );
144 144
145 void updateCell(); 145 void updateCell();
146 void startUpdateCell(); 146 void startUpdateCell();
147 void finishUpdateCell(); 147 void finishUpdateCell();
148 void insertEvent(Event *); 148 void insertEvent(Event *);
149 void insertTodo(Todo *); 149 void insertTodo(Todo *);
150 150
151 void updateConfig( bool bigFont = false ); 151 void updateConfig( bool bigFont = false );
152 152
153 void enableScrollBars( bool ); 153 void enableScrollBars( bool );
154 154
155 Incidence *selectedIncidence(); 155 Incidence *selectedIncidence();
156 QDate selectedIncidenceDate(); 156 QDate selectedIncidenceDate();
157 157
158 void deselect(); 158 void deselect();
159 void select(); 159 void select();
160 160
161#ifdef DESKTOP_VERSION 161#ifdef DESKTOP_VERSION
162 static QToolTipGroup *toolTipGroup(); 162 static QToolTipGroup *toolTipGroup();
163#endif 163#endif
164 signals: 164 signals:
165 void defaultAction( Incidence * ); 165 void defaultAction( Incidence * );
166 void newEventSignal( QDateTime ); 166 void newEventSignal( QDateTime );
167 void showDaySignal( QDate ); 167 void showDaySignal( QDate );
168 168
169 protected: 169 protected:
170 QString mToolTip; 170 QString mToolTip;
171 void resizeEvent( QResizeEvent * ); 171 void resizeEvent( QResizeEvent * );
172 172
173 protected slots: 173 protected slots:
174 void defaultAction( QListBoxItem * ); 174 void defaultAction( QListBoxItem * );
175 void contextMenu( QListBoxItem * ); 175 void contextMenu( QListBoxItem * );
176 void selection( QListBoxItem * ); 176 void selection( QListBoxItem * );
177 void cellClicked( QListBoxItem * ); 177 void cellClicked( QListBoxItem * );
178 void newEvent(); 178 void newEvent();
179 void showDay(); 179 void showDay();
180 180
181 private: 181 private:
182 KOMonthView *mMonthView; 182 KOMonthView *mMonthView;
183 183
184 QDate mDate; 184 QDate mDate;
185 bool mPrimary; 185 bool mPrimary;
186 bool mHoliday; 186 bool mHoliday;
187 QString mHolidayString; 187 QString mHolidayString;
188 188
189 //QLabel *mLabel; 189 //QLabel *mLabel;
190 QPushButton *mLabel; 190 QPushButton *mLabel;
191 QListBox *mItemList; 191 QListBox *mItemList;
192#ifdef DESKTOP_VERSION 192#ifdef DESKTOP_VERSION
193 static QToolTipGroup *mToolTipGroup; 193 static QToolTipGroup *mToolTipGroup;
194#endif 194#endif
195 QSize mLabelSize; 195 QSize mLabelSize;
196 QSize mLabelBigSize; 196 QSize mLabelBigSize;
197 QPalette mHolidayPalette; 197 QPalette mHolidayPalette;
198 QPalette mStandardPalette; 198 QPalette mStandardPalette;
199 QPalette mPrimaryPalette; 199 QPalette mPrimaryPalette;
200 QPalette mNonPrimaryPalette; 200 QPalette mNonPrimaryPalette;
201 void setMyPalette(); 201 void setMyPalette();
202 QPalette getPalette (); 202 QPalette getPalette ();
203 void keyPressEvent ( QKeyEvent * ) ; 203 void keyPressEvent ( QKeyEvent * ) ;
204 204
205}; 205};
206 206
207 207
208class KOMonthView: public KOEventView 208class KOMonthView: public KOEventView
209{ 209{
210 Q_OBJECT 210 Q_OBJECT
211 public: 211 public:
212 KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 ); 212 KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 );
213 ~KOMonthView(); 213 ~KOMonthView();
214 214
215 /** Returns maximum number of days supported by the komonthview */ 215 /** Returns maximum number of days supported by the komonthview */
216 virtual int maxDatesHint(); 216 virtual int maxDatesHint();
217 217
218 /** Returns number of currently shown dates. */ 218 /** Returns number of currently shown dates. */
219 virtual int currentDateCount(); 219 virtual int currentDateCount();
220 220
221 /** returns the currently selected events */ 221 /** returns the currently selected events */
222 virtual QPtrList<Incidence> selectedIncidences(); 222 virtual QPtrList<Incidence> selectedIncidences();
223 223
224 /** returns dates of the currently selected events */ 224 /** returns dates of the currently selected events */
225 virtual DateList selectedDates(); 225 virtual DateList selectedDates();
226 226
227 virtual void printPreview(CalPrinter *calPrinter, 227 virtual void printPreview(CalPrinter *calPrinter,
228 const QDate &, const QDate &); 228 const QDate &, const QDate &);
229 bool isMonthView() { return true; } 229 bool isMonthView() { return !mShowWeekView; }
230 bool isUpdatePossible() { return updatePossible; } 230 bool isUpdatePossible() { return updatePossible; }
231 231
232 MonthViewCell * selectedCell(); 232 MonthViewCell * selectedCell();
233 bool skipResize; 233 bool skipResize;
234 NavigatorBar* navigatorBar() { return mNavigatorBar ;} 234 NavigatorBar* navigatorBar() { return mNavigatorBar ;}
235 public slots: 235 public slots:
236 virtual void updateView(); 236 virtual void updateView();
237 virtual void updateConfig(); 237 virtual void updateConfig();
238 virtual void showDates(const QDate &start, const QDate &end); 238 virtual void showDates(const QDate &start, const QDate &end);
239 virtual void showEvents(QPtrList<Event> eventList); 239 virtual void showEvents(QPtrList<Event> eventList);
240 240
241 void changeEventDisplay(Event *, int); 241 void changeEventDisplay(Event *, int);
242 242
243 void clearSelection(); 243 void clearSelection();
244 244
245 void showContextMenu( Incidence * ); 245 void showContextMenu( Incidence * );
246 246
247 void setSelectedCell( MonthViewCell * ); 247 void setSelectedCell( MonthViewCell * );
248 void switchView(); 248 void switchView();
249 249
250 protected slots: 250 protected slots:
251 void selectInternalWeekNum ( int ); 251 void selectInternalWeekNum ( int );
252 void processSelectionChange(); 252 void processSelectionChange();
253 signals: 253 signals:
254 void nextMonth(); 254 void nextMonth();
255 void prevMonth(); 255 void prevMonth();
256 void selectWeekNum ( int ); 256 void selectWeekNum ( int );
257 void selectMonth (); 257 void selectMonth ();
258 void showDaySignal( QDate ); 258 void showDaySignal( QDate );
259 protected: 259 protected:
260 void resizeEvent(QResizeEvent *); 260 void resizeEvent(QResizeEvent *);
261 void viewChanged(); 261 void viewChanged();
262 void updateDayLabels(); 262 void updateDayLabels();
263 263
264 private: 264 private:
265 NavigatorBar* mNavigatorBar; 265 NavigatorBar* mNavigatorBar;
266 int currentWeek(); 266 int currentWeek();
267 bool clPending; 267 bool clPending;
268 QWidgetStack * mWidStack; 268 QWidgetStack * mWidStack;
269 QWidget* mMonthView; 269 QWidget* mMonthView;
270 QWidget* mWeekView; 270 QWidget* mWeekView;
271 bool mShowWeekView; 271 bool mShowWeekView;
272 bool updatePossible; 272 bool updatePossible;
273 int mDaysPerWeek; 273 int mDaysPerWeek;
274 int mNumWeeks; 274 int mNumWeeks;
275 int mNumCells; 275 int mNumCells;
276 bool mWeekStartsMonday; 276 bool mWeekStartsMonday;
277 bool mShowSatSunComp; 277 bool mShowSatSunComp;
278 void computeLayout(); 278 void computeLayout();
279 void computeLayoutWeek(); 279 void computeLayoutWeek();
280 280
281 QPtrVector<MonthViewCell> mCells; 281 QPtrVector<MonthViewCell> mCells;
282 QPtrVector<QLabel> mDayLabels; 282 QPtrVector<QLabel> mDayLabels;
283 QPtrVector<KOWeekButton> mWeekLabels; 283 QPtrVector<KOWeekButton> mWeekLabels;
284 QPtrVector<MonthViewCell> mCellsW; 284 QPtrVector<MonthViewCell> mCellsW;
285 QPtrVector<QLabel> mDayLabelsW; 285 QPtrVector<QLabel> mDayLabelsW;
286 QPtrVector<KOWeekButton> mWeekLabelsW; 286 QPtrVector<KOWeekButton> mWeekLabelsW;
287 287
288 bool mShortDayLabelsM; 288 bool mShortDayLabelsM;
289 bool mShortDayLabelsW; 289 bool mShortDayLabelsW;
290 int mWidthLongDayLabel; 290 int mWidthLongDayLabel;
291 291
292 QDate mStartDate; 292 QDate mStartDate;
293 293
294 MonthViewCell *mSelectedCell; 294 MonthViewCell *mSelectedCell;
295 295
296 KOEventPopupMenu *mContextMenu; 296 KOEventPopupMenu *mContextMenu;
297 void keyPressEvent ( QKeyEvent * ) ; 297 void keyPressEvent ( QKeyEvent * ) ;
298 298
299}; 299};
300 300
301#endif 301#endif
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index ac67b58..a9f5a41 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -176,539 +176,540 @@ void KOViewManager::writeSettings(KConfig *config)
176 QString view; 176 QString view;
177 if (mCurrentView == mWhatsNextView) view = "WhatsNext"; 177 if (mCurrentView == mWhatsNextView) view = "WhatsNext";
178 else if (mCurrentView == mMonthView) view = "Month"; 178 else if (mCurrentView == mMonthView) view = "Month";
179 else if (mCurrentView == mListView) view = "List"; 179 else if (mCurrentView == mListView) view = "List";
180 else if (mCurrentView == mJournalView) view = "Journal"; 180 else if (mCurrentView == mJournalView) view = "Journal";
181 else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; 181 else if (mCurrentView == mTimeSpanView) view = "TimeSpan";
182 else if (mCurrentView == mTodoView) view = "Todo"; 182 else if (mCurrentView == mTodoView) view = "Todo";
183 else view = "Agenda"; 183 else view = "Agenda";
184 184
185 config->writeEntry("Current View",view); 185 config->writeEntry("Current View",view);
186 186
187 if (mAgendaView) { 187 if (mAgendaView) {
188 mAgendaView->writeSettings(config); 188 mAgendaView->writeSettings(config);
189 } 189 }
190 if (mTimeSpanView) { 190 if (mTimeSpanView) {
191 mTimeSpanView->writeSettings(config); 191 mTimeSpanView->writeSettings(config);
192 } 192 }
193 if (mListView) { 193 if (mListView) {
194 mListView->writeSettings(config); 194 mListView->writeSettings(config);
195 } 195 }
196 if (mTodoView) { 196 if (mTodoView) {
197 mTodoView->saveLayout(config,"Todo View"); 197 mTodoView->saveLayout(config,"Todo View");
198 } 198 }
199} 199}
200 200
201void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) 201void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
202{ 202{
203 203
204 //mFlagShowNextxDays = false; 204 //mFlagShowNextxDays = false;
205 //if(view == mCurrentView) return; 205 //if(view == mCurrentView) return;
206 if ( view == 0 ) { 206 if ( view == 0 ) {
207 view = mCurrentView; 207 view = mCurrentView;
208 if ( view == 0 ) 208 if ( view == 0 )
209 return; 209 return;
210 } 210 }
211 bool full = fullScreen; 211 bool full = fullScreen;
212 if(view == mCurrentView && view != mWhatsNextView ) { 212 if(view == mCurrentView && view != mWhatsNextView ) {
213 if ( mCurrentAgendaView < 0 ) 213 if ( mCurrentAgendaView < 0 )
214 return; 214 return;
215 if ( view != mMonthView ) 215 if ( view != mMonthView )
216 full = mMainView->leftFrame()->isVisible(); 216 full = mMainView->leftFrame()->isVisible();
217 } else { 217 } else {
218 if ( view == mMonthView && mMonthView) 218 if ( view == mMonthView && mMonthView)
219 ;//mMonthView->skipResize = true ; 219 ;//mMonthView->skipResize = true ;
220 mCurrentView = view; 220 mCurrentView = view;
221 // bool full = fullScreen; 221 // bool full = fullScreen;
222 bool isFull = !mMainView->leftFrame()->isVisible(); 222 bool isFull = !mMainView->leftFrame()->isVisible();
223 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) 223 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen )
224 full = true; 224 full = true;
225 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) 225 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen )
226 full = false; 226 full = false;
227 } 227 }
228 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); 228 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime();
229 //raiseCurrentView( full ); 229 //raiseCurrentView( full );
230 mMainView->processIncidenceSelection( 0 ); 230 mMainView->processIncidenceSelection( 0 );
231 //mMainView->updateView(); 231 //mMainView->updateView();
232 raiseCurrentView( full, true ); 232 raiseCurrentView( full, true );
233 mMainView->adaptNavigationUnits(); 233 mMainView->adaptNavigationUnits();
234} 234}
235 235
236void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) 236void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView )
237{ 237{
238 mCurrentAgendaView = 0; 238 mCurrentAgendaView = 0;
239 if ( fullScreen ) { 239 if ( fullScreen ) {
240 mMainView->leftFrame()->hide(); 240 mMainView->leftFrame()->hide();
241 } else { 241 } else {
242 mMainView->leftFrame()->show(); 242 mMainView->leftFrame()->show();
243 } 243 }
244 emit signalFullScreen( !fullScreen ); 244 emit signalFullScreen( !fullScreen );
245 if ( callUpdateView ) 245 if ( callUpdateView )
246 mMainView->updateView(); 246 mMainView->updateView();
247 247
248 if ( globalFlagBlockAgenda == 5 ) { 248 if ( globalFlagBlockAgenda == 5 ) {
249 globalFlagBlockAgenda = 4; 249 globalFlagBlockAgenda = 4;
250 globalFlagBlockAgendaItemPaint = 1; 250 globalFlagBlockAgendaItemPaint = 1;
251 } 251 }
252 mMainView->viewStack()->raiseWidget(mCurrentView); 252 mMainView->viewStack()->raiseWidget(mCurrentView);
253 if ( globalFlagBlockAgenda == 4 ) { 253 if ( globalFlagBlockAgenda == 4 ) {
254 if ( mCurrentView == mAgendaView ) { 254 if ( mCurrentView == mAgendaView ) {
255 //globalFlagBlockAgenda =1 ; 255 //globalFlagBlockAgenda =1 ;
256 if ( KOPrefs::instance()->mSetTimeToDayStartAt ) 256 if ( KOPrefs::instance()->mSetTimeToDayStartAt )
257 mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); 257 mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins );
258 else if ( KOPrefs::instance()->mCenterOnCurrentTime ) 258 else if ( KOPrefs::instance()->mCenterOnCurrentTime )
259 mAgendaView->setStartHour( QTime::currentTime ().hour() ); 259 mAgendaView->setStartHour( QTime::currentTime ().hour() );
260 qApp->processEvents(); 260 qApp->processEvents();
261 //qDebug("qApp->processEvents() "); 261 //qDebug("qApp->processEvents() ");
262 globalFlagBlockAgenda = 0; 262 globalFlagBlockAgenda = 0;
263 mAgendaView->repaintAgenda(); 263 mAgendaView->repaintAgenda();
264 264
265 } 265 }
266 globalFlagBlockAgenda = 0; 266 globalFlagBlockAgenda = 0;
267 } 267 }
268 emit signalAgendaView( mCurrentView == mAgendaView ); 268 emit signalAgendaView( mCurrentView == mAgendaView );
269 //qDebug("raiseCurrentView ende "); 269 //qDebug("raiseCurrentView ende ");
270 270
271} 271}
272 272
273void KOViewManager::updateView() 273void KOViewManager::updateView()
274{ 274{
275 // qDebug("KOViewManager::updateView() "); 275 // qDebug("KOViewManager::updateView() ");
276 // if we are updating mTodoView, we get endless recursion 276 // if we are updating mTodoView, we get endless recursion
277 if ( mTodoView == mCurrentView ) 277 if ( mTodoView == mCurrentView )
278 return; 278 return;
279 if ( mCurrentView ) mCurrentView->updateView(); 279 if ( mCurrentView ) mCurrentView->updateView();
280 280
281} 281}
282 282
283void KOViewManager::updateView(const QDate &start, const QDate &end) 283void KOViewManager::updateView(const QDate &start, const QDate &end)
284{ 284{
285 // kdDebug() << "KOViewManager::updateView()" << endl; 285 // kdDebug() << "KOViewManager::updateView()" << endl;
286 286
287 if (mCurrentView) mCurrentView->showDates(start, end); 287 if (mCurrentView) mCurrentView->showDates(start, end);
288 288
289 if (mTodoView && mTodoView == mCurrentView ) mTodoView->updateView(); 289 if (mTodoView && mTodoView == mCurrentView ) mTodoView->updateView();
290} 290}
291 291
292 292
293void KOViewManager::updateWNview() 293void KOViewManager::updateWNview()
294{ 294{
295 if ( mCurrentView == mWhatsNextView && mWhatsNextView ) 295 if ( mCurrentView == mWhatsNextView && mWhatsNextView )
296 mWhatsNextView->updateView(); 296 mWhatsNextView->updateView();
297 297
298} 298}
299void KOViewManager::showWhatsNextView() 299void KOViewManager::showWhatsNextView()
300{ 300{
301 if (!mWhatsNextView) { 301 if (!mWhatsNextView) {
302 mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), 302 mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(),
303 "KOViewManager::WhatsNextView"); 303 "KOViewManager::WhatsNextView");
304 mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); 304 mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog());
305 connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); 305 connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig()));
306 addView(mWhatsNextView); 306 addView(mWhatsNextView);
307 connect(this, SIGNAL( printWNV() ), 307 connect(this, SIGNAL( printWNV() ),
308 mWhatsNextView, SLOT( printMe() ) ); 308 mWhatsNextView, SLOT( printMe() ) );
309 } 309 }
310 globalFlagBlockAgenda = 1; 310 globalFlagBlockAgenda = 1;
311 showView(mWhatsNextView, true ); 311 showView(mWhatsNextView, true );
312 //mWhatsNextView->updateView(); 312 //mWhatsNextView->updateView();
313 313
314} 314}
315 315
316void KOViewManager::showListView() 316void KOViewManager::showListView()
317{ 317{
318 if (!mListView) { 318 if (!mListView) {
319 mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); 319 mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView");
320 addView(mListView); 320 addView(mListView);
321 321
322 connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), 322 connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)),
323 mMainView, SLOT(showIncidence(Incidence *))); 323 mMainView, SLOT(showIncidence(Incidence *)));
324 connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), 324 connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)),
325 mMainView, SLOT(editIncidence(Incidence *))); 325 mMainView, SLOT(editIncidence(Incidence *)));
326 connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), 326 connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)),
327 mMainView, SLOT(deleteIncidence(Incidence *))); 327 mMainView, SLOT(deleteIncidence(Incidence *)));
328 connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), 328 connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ),
329 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 329 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
330 connect( mListView, SIGNAL( signalNewEvent() ), 330 connect( mListView, SIGNAL( signalNewEvent() ),
331 mMainView, SLOT( newEvent() ) ); 331 mMainView, SLOT( newEvent() ) );
332 connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); 332 connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig()));
333 connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), 333 connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ),
334 mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); 334 mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
335 connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), 335 connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ),
336 mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); 336 mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
337 connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), 337 connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
338 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 338 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
339 connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 339 connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
340 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 340 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
341 } 341 }
342 // bool temp = mFlagShowNextxDays; 342 // bool temp = mFlagShowNextxDays;
343 //globalFlagBlockPainting = true; 343 //globalFlagBlockPainting = true;
344 globalFlagBlockAgenda = 1; 344 globalFlagBlockAgenda = 1;
345 if ( KOPrefs::instance()->mListViewMonthTimespan ) { 345 if ( KOPrefs::instance()->mListViewMonthTimespan ) {
346 mMainView->setBlockShowDates( true ); 346 mMainView->setBlockShowDates( true );
347 mMainView->dateNavigator()->selectMonth(); 347 mMainView->dateNavigator()->selectMonth();
348 mMainView->setBlockShowDates( false ); 348 mMainView->setBlockShowDates( false );
349 } 349 }
350 showView(mListView, KOPrefs::instance()->mFullViewTodo); 350 showView(mListView, KOPrefs::instance()->mFullViewTodo);
351 //mFlagShowNextxDays = temp; 351 //mFlagShowNextxDays = temp;
352} 352}
353 353
354void KOViewManager::showAgendaView( bool fullScreen ) 354void KOViewManager::showAgendaView( bool fullScreen )
355{ 355{
356 356
357 mMainView->dialogManager()->hideSearchDialog(); 357 mMainView->dialogManager()->hideSearchDialog();
358 // qDebug("KOViewManager::showAgendaView "); 358 // qDebug("KOViewManager::showAgendaView ");
359 bool full; 359 bool full;
360 full = fullScreen; 360 full = fullScreen;
361 if (!mAgendaView) { 361 if (!mAgendaView) {
362 full = false; 362 full = false;
363 mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); 363 mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView");
364 addView(mAgendaView); 364 addView(mAgendaView);
365#ifndef DESKTOP_VERSION 365#ifndef DESKTOP_VERSION
366 QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold ); 366 QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold );
367#endif 367#endif
368 connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )), 368 connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )),
369 mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) )); 369 mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) ));
370 370
371 // SIGNALS/SLOTS FOR DAY/WEEK VIEW 371 // SIGNALS/SLOTS FOR DAY/WEEK VIEW
372 372
373 connect(mAgendaView,SIGNAL(showDateView( int, QDate )),SLOT(showDateView( int, QDate ))); 373 connect(mAgendaView,SIGNAL(showDateView( int, QDate )),SLOT(showDateView( int, QDate )));
374 374
375 connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)), 375 connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)),
376 mMainView, SLOT(newTodoDateTime(QDateTime,bool))); 376 mMainView, SLOT(newTodoDateTime(QDateTime,bool)));
377 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)), 377 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)),
378 mMainView, SLOT(newEvent(QDateTime))); 378 mMainView, SLOT(newEvent(QDateTime)));
379 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)), 379 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)),
380 mMainView, SLOT(newEvent(QDateTime,QDateTime))); 380 mMainView, SLOT(newEvent(QDateTime,QDateTime)));
381 connect(mAgendaView,SIGNAL(newEventSignal(QDate)), 381 connect(mAgendaView,SIGNAL(newEventSignal(QDate)),
382 mMainView, SLOT(newEvent(QDate))); 382 mMainView, SLOT(newEvent(QDate)));
383 383
384 connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)), 384 connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)),
385 mMainView, SLOT(editIncidence(Incidence *))); 385 mMainView, SLOT(editIncidence(Incidence *)));
386 connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)), 386 connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)),
387 mMainView, SLOT(showIncidence(Incidence *))); 387 mMainView, SLOT(showIncidence(Incidence *)));
388 connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)), 388 connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)),
389 mMainView, SLOT(deleteIncidence(Incidence *))); 389 mMainView, SLOT(deleteIncidence(Incidence *)));
390 390
391 connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ), 391 connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ),
392 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 392 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
393 393
394 connect(mAgendaView, SIGNAL( toggleExpand() ), 394 connect(mAgendaView, SIGNAL( toggleExpand() ),
395 mMainView, SLOT( toggleExpand() ) ); 395 mMainView, SLOT( toggleExpand() ) );
396 396
397 connect(mMainView, SIGNAL( calendarViewExpanded( bool ) ), 397 connect(mMainView, SIGNAL( calendarViewExpanded( bool ) ),
398 mAgendaView, SLOT( setExpandedButton( bool ) ) ); 398 mAgendaView, SLOT( setExpandedButton( bool ) ) );
399 connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ), 399 connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ),
400 mMainView, SLOT(cloneIncidence(Incidence *) ) ) ; 400 mMainView, SLOT(cloneIncidence(Incidence *) ) ) ;
401 connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ), 401 connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ),
402 mMainView, SLOT(cancelIncidence(Incidence *) ) ) ; 402 mMainView, SLOT(cancelIncidence(Incidence *) ) ) ;
403 connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig())); 403 connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig()));
404 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView, 404 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView,
405 SLOT( updateTodo( Todo *, int ) ) ); 405 SLOT( updateTodo( Todo *, int ) ) );
406 connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )), 406 connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )),
407 mMainView, SIGNAL( todoModified( Todo *, int ))); 407 mMainView, SIGNAL( todoModified( Todo *, int )));
408 connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), 408 connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
409 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 409 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
410 connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 410 connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
411 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 411 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
412 connect( mAgendaView, SIGNAL( selectWeekNum( int ) ), 412 connect( mAgendaView, SIGNAL( selectWeekNum( int ) ),
413 mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) ); 413 mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) );
414 mAgendaView->readSettings(); 414 mAgendaView->readSettings();
415 mAgendaView->updateConfig(); 415 mAgendaView->updateConfig();
416 } 416 }
417 417
418 showView( mAgendaView, full); 418 showView( mAgendaView, full);
419 419
420} 420}
421 421
422void KOViewManager::showDayView() 422void KOViewManager::showDayView()
423{ 423{
424 mFlagShowNextxDays = false; 424 mFlagShowNextxDays = false;
425 globalFlagBlockLabel = 1; 425 globalFlagBlockLabel = 1;
426 globalFlagBlockAgenda = 1; 426 globalFlagBlockAgenda = 1;
427 if ( mCurrentAgendaView != 1 ) 427 if ( mCurrentAgendaView != 1 )
428 mCurrentAgendaView = -1; 428 mCurrentAgendaView = -1;
429 showAgendaView(); 429 showAgendaView();
430 qApp->processEvents(); 430 qApp->processEvents();
431 globalFlagBlockAgenda = 2; 431 globalFlagBlockAgenda = 2;
432 globalFlagBlockLabel = 0; 432 globalFlagBlockLabel = 0;
433 mMainView->dateNavigator()->selectDates( 1 ); 433 mMainView->dateNavigator()->selectDates( 1 );
434 mCurrentAgendaView = 1 ; 434 mCurrentAgendaView = 1 ;
435 435
436} 436}
437 437
438void KOViewManager::showWorkWeekView() 438void KOViewManager::showWorkWeekView()
439{ 439{
440 mFlagShowNextxDays = false; 440 mFlagShowNextxDays = false;
441 globalFlagBlockAgenda = 1; 441 globalFlagBlockAgenda = 1;
442 globalFlagBlockLabel = 1; 442 globalFlagBlockLabel = 1;
443 if ( mCurrentAgendaView != 5 ) 443 if ( mCurrentAgendaView != 5 )
444 mCurrentAgendaView = -1; 444 mCurrentAgendaView = -1;
445 showAgendaView(); 445 showAgendaView();
446 qApp->processEvents(); 446 qApp->processEvents();
447 globalFlagBlockAgenda = 2; 447 globalFlagBlockAgenda = 2;
448 globalFlagBlockLabel = 0; 448 globalFlagBlockLabel = 0;
449 mMainView->dateNavigator()->selectWorkWeek(); 449 mMainView->dateNavigator()->selectWorkWeek();
450 mCurrentAgendaView = 5 ; 450 mCurrentAgendaView = 5 ;
451 451
452} 452}
453 453
454void KOViewManager::showWeekView() 454void KOViewManager::showWeekView()
455{ 455{
456 /* 456 /*
457 globalFlagBlockAgenda = 2; 457 globalFlagBlockAgenda = 2;
458 qDebug("4globalFlagBlockAgenda = 2; "); 458 qDebug("4globalFlagBlockAgenda = 2; ");
459 //globalFlagBlockPainting = true; 459 //globalFlagBlockPainting = true;
460 mMainView->dateNavigator()->selectWeek(); 460 mMainView->dateNavigator()->selectWeek();
461 showAgendaView(); 461 showAgendaView();
462 */ 462 */
463 463
464 464
465 mFlagShowNextxDays = false; 465 mFlagShowNextxDays = false;
466 globalFlagBlockAgenda = 1; 466 globalFlagBlockAgenda = 1;
467 globalFlagBlockLabel = 1; 467 globalFlagBlockLabel = 1;
468 if ( mCurrentAgendaView != 7 ) 468 if ( mCurrentAgendaView != 7 )
469 mCurrentAgendaView = -1; 469 mCurrentAgendaView = -1;
470 showAgendaView(); 470 showAgendaView();
471 qApp->processEvents(); 471 qApp->processEvents();
472 globalFlagBlockAgenda = 2; 472 globalFlagBlockAgenda = 2;
473 globalFlagBlockLabel = 0; 473 globalFlagBlockLabel = 0;
474 mMainView->dateNavigator()->selectWeek(); 474 mMainView->dateNavigator()->selectWeek();
475 mCurrentAgendaView = 7 ; 475 mCurrentAgendaView = 7 ;
476} 476}
477 477
478void KOViewManager::showNextXView() 478void KOViewManager::showNextXView()
479{ 479{
480 480
481 globalFlagBlockAgenda = 1; 481 globalFlagBlockAgenda = 1;
482 if ( mCurrentAgendaView != 3 ) 482 if ( mCurrentAgendaView != 3 )
483 mCurrentAgendaView = -1; 483 mCurrentAgendaView = -1;
484 showAgendaView(KOPrefs::instance()->mFullViewMonth); 484 showAgendaView(KOPrefs::instance()->mFullViewMonth);
485 globalFlagBlockAgenda = 2; 485 globalFlagBlockAgenda = 2;
486 mMainView->dateNavigator()->selectDates( QDate::currentDate(), 486 mMainView->dateNavigator()->selectDates( QDate::currentDate(),
487 KOPrefs::instance()->mNextXDays ); 487 KOPrefs::instance()->mNextXDays );
488 mFlagShowNextxDays = true; 488 mFlagShowNextxDays = true;
489 mCurrentAgendaView = 3 ; 489 mCurrentAgendaView = 3 ;
490} 490}
491bool KOViewManager::showsNextDays() 491bool KOViewManager::showsNextDays()
492{ 492{
493 return mFlagShowNextxDays; 493 return mFlagShowNextxDays;
494} 494}
495void KOViewManager::createMonthView() 495void KOViewManager::createMonthView()
496{ 496{
497if (!mMonthView) { 497if (!mMonthView) {
498 mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); 498 mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView");
499 499
500 addView(mMonthView); 500 addView(mMonthView);
501 // mMonthView->show(); 501 // mMonthView->show();
502 // SIGNALS/SLOTS FOR MONTH VIEW 502 // SIGNALS/SLOTS FOR MONTH VIEW
503 connect(mMonthView, SIGNAL(newEventSignal(QDateTime)), 503 connect(mMonthView, SIGNAL(newEventSignal(QDateTime)),
504 mMainView, SLOT(newEvent(QDateTime))); 504 mMainView, SLOT(newEvent(QDateTime)));
505 505
506 connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)), 506 connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)),
507 mMainView, SLOT(showIncidence(Incidence *))); 507 mMainView, SLOT(showIncidence(Incidence *)));
508 connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)), 508 connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)),
509 mMainView, SLOT(editIncidence(Incidence *))); 509 mMainView, SLOT(editIncidence(Incidence *)));
510 connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), 510 connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)),
511 mMainView, SLOT(deleteIncidence(Incidence *))); 511 mMainView, SLOT(deleteIncidence(Incidence *)));
512 512
513 connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), 513 connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ),
514 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 514 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
515 connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), 515 connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ),
516 mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); 516 mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
517 connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), 517 connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ),
518 mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); 518 mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
519 519
520 connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), 520 connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
521 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 521 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
522 connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 522 connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
523 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 523 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
524 connect( mMonthView, SIGNAL( selectWeekNum( int ) ), 524 connect( mMonthView, SIGNAL( selectWeekNum( int ) ),
525 mMainView->dateNavigator(), SLOT ( selectWeekFromMonthView( int ) ) ); 525 mMainView->dateNavigator(), SLOT ( selectWeekFromMonthView( int ) ) );
526 connect( mMonthView, SIGNAL( selectMonth() ), 526 connect( mMonthView, SIGNAL( selectMonth() ),
527 mMainView->dateNavigator(), SLOT ( selectMonthFromMonthview() ) ); 527 mMainView->dateNavigator(), SLOT ( selectMonthFromMonthview() ) );
528 connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), 528 connect( mMonthView, SIGNAL( showDaySignal( QDate ) ),
529 mMainView, SLOT ( showDay( QDate ) ) ); 529 mMainView, SLOT ( showDay( QDate ) ) );
530 connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); 530 connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig()));
531 connect( mMonthView, SIGNAL(nextMonth() ), 531 connect( mMonthView, SIGNAL(nextMonth() ),
532 mMonthView->navigatorBar(), SIGNAL(goNextMonth() ) ); 532 mMonthView->navigatorBar(), SIGNAL(goNextMonth() ) );
533 connect( mMonthView, SIGNAL(prevMonth() ), 533 connect( mMonthView, SIGNAL(prevMonth() ),
534 mMonthView->navigatorBar(), SIGNAL(goPrevMonth() ) ); 534 mMonthView->navigatorBar(), SIGNAL(goPrevMonth() ) );
535 connect( mMonthView->navigatorBar(), SIGNAL( goPrevYear() ), 535 connect( mMonthView->navigatorBar(), SIGNAL( goPrevYear() ),
536 mMainView->dateNavigator(), SLOT( selectPreviousYear() ) ); 536 mMainView->dateNavigator(), SLOT( selectPreviousYear() ) );
537 connect( mMonthView->navigatorBar(), SIGNAL( goNextYear() ), 537 connect( mMonthView->navigatorBar(), SIGNAL( goNextYear() ),
538 mMainView->dateNavigator(), SLOT( selectNextYear() ) ); 538 mMainView->dateNavigator(), SLOT( selectNextYear() ) );
539 connect( mMonthView->navigatorBar(), SIGNAL( goPrevMonth() ), 539 connect( mMonthView->navigatorBar(), SIGNAL( goPrevMonth() ),
540 mMainView->dateNavigator(), SLOT( selectPreviousMonth() ) ); 540 mMainView->dateNavigator(), SLOT( selectPreviousMonth() ) );
541 connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ), 541 connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ),
542 mMainView->dateNavigator(), SLOT( selectNextMonth() ) ); 542 mMainView->dateNavigator(), SLOT( selectNextMonth() ) );
543 connect( mMonthView->navigatorBar(), SIGNAL( goPrevWeek() ), 543 connect( mMonthView->navigatorBar(), SIGNAL( goPrevWeek() ),
544 mMainView->dateNavigator(), SLOT( selectPreviousWeek() ) ); 544 mMainView->dateNavigator(), SLOT( selectPreviousWeek() ) );
545 connect( mMonthView->navigatorBar(), SIGNAL( goNextWeek() ), 545 connect( mMonthView->navigatorBar(), SIGNAL( goNextWeek() ),
546 mMainView->dateNavigator(), SLOT( selectNextWeek() ) ); 546 mMainView->dateNavigator(), SLOT( selectNextWeek() ) );
547 547
548 connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), 548 connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
549 mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) ); 549 mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) );
550 550
551 551
552 connect( mMonthView->navigatorBar(), SIGNAL( monthSelected ( int ) ), 552 connect( mMonthView->navigatorBar(), SIGNAL( monthSelected ( int ) ),
553 mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) ); 553 mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) );
554 554
555 } 555 }
556} 556}
557void KOViewManager::showMonthViewWeek() 557void KOViewManager::showMonthViewWeek()
558{ 558{
559 createMonthView(); 559 createMonthView();
560 globalFlagBlockAgenda = 1;
560 bool full = true; 561 bool full = true;
561 if ( mCurrentView == mMonthView) 562 if ( mCurrentView == mMonthView)
562 full = mMainView->leftFrame()->isVisible(); 563 full = mMainView->leftFrame()->isVisible();
563 if ( !KOPrefs::instance()->mMonthViewWeek ) { 564 if ( !KOPrefs::instance()->mMonthViewWeek ) {
564 mMonthView->switchView(); 565 mMonthView->switchView();
565 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) 566 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() )
566 full = false; 567 full = false;
567 else 568 else
568 full = true; 569 full = true;
569 } 570 }
570 mMainView->dateNavigator()->selectWeek(); 571 mMainView->dateNavigator()->selectWeek();
571 showView(mMonthView, full ); 572 showView(mMonthView, full );
572} 573}
573 574
574void KOViewManager::showMonthView() 575void KOViewManager::showMonthView()
575 { 576 {
576 577
577 createMonthView(); 578 createMonthView();
578 globalFlagBlockAgenda = 1; 579 globalFlagBlockAgenda = 1;
579 //mFlagShowNextxDays = false; 580 //mFlagShowNextxDays = false;
580 bool full = true; 581 bool full = true;
581 if ( mCurrentView == mMonthView) 582 if ( mCurrentView == mMonthView)
582 full = mMainView->leftFrame()->isVisible(); 583 full = mMainView->leftFrame()->isVisible();
583 // if(mMonthView == mCurrentView) return; 584 // if(mMonthView == mCurrentView) return;
584 if ( KOPrefs::instance()->mMonthViewWeek ) { 585 if ( KOPrefs::instance()->mMonthViewWeek ) {
585 mMonthView->switchView(); 586 mMonthView->switchView();
586 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) 587 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() )
587 full = false; 588 full = false;
588 else 589 else
589 full = true; 590 full = true;
590 } 591 }
591 mMainView->dateNavigator()->selectMonth(); 592 mMainView->dateNavigator()->selectMonth();
592 593
593 showView(mMonthView, full ); 594 showView(mMonthView, full );
594 595
595} 596}
596 597
597void KOViewManager::showTodoView() 598void KOViewManager::showTodoView()
598{ 599{
599 //mFlagShowNextxDays = false; 600 //mFlagShowNextxDays = false;
600 if ( !mTodoView ) { 601 if ( !mTodoView ) {
601 mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), 602 mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(),
602 "KOViewManager::TodoView" ); 603 "KOViewManager::TodoView" );
603 604
604 addView( mTodoView ); 605 addView( mTodoView );
605 // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); 606 // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold );
606 607
607 // SIGNALS/SLOTS FOR TODO VIEW 608 // SIGNALS/SLOTS FOR TODO VIEW
608 connect( mTodoView, SIGNAL( newTodoSignal() ), 609 connect( mTodoView, SIGNAL( newTodoSignal() ),
609 mMainView, SLOT( newTodo() ) ); 610 mMainView, SLOT( newTodo() ) );
610 connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ), 611 connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ),
611 mMainView, SLOT( newSubTodo( Todo *) ) ); 612 mMainView, SLOT( newSubTodo( Todo *) ) );
612 connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ), 613 connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ),
613 mMainView, SLOT( showTodo( Todo * ) ) ); 614 mMainView, SLOT( showTodo( Todo * ) ) );
614 connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ), 615 connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ),
615 mMainView, SLOT( editTodo( Todo * ) ) ); 616 mMainView, SLOT( editTodo( Todo * ) ) );
616 connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ), 617 connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ),
617 mMainView, SLOT( deleteTodo( Todo * ) ) ); 618 mMainView, SLOT( deleteTodo( Todo * ) ) );
618 connect( mTodoView, SIGNAL( purgeCompletedSignal() ), 619 connect( mTodoView, SIGNAL( purgeCompletedSignal() ),
619 mMainView, SLOT( purgeCompleted() ) ); 620 mMainView, SLOT( purgeCompleted() ) );
620 621
621 connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ), 622 connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ),
622 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 623 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
623 624
624 connect( mMainView, SIGNAL( configChanged() ), mTodoView, 625 connect( mMainView, SIGNAL( configChanged() ), mTodoView,
625 SLOT( updateConfig() ) ); 626 SLOT( updateConfig() ) );
626 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mTodoView, 627 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mTodoView,
627 SLOT( updateTodo( Todo *, int ) ) ); 628 SLOT( updateTodo( Todo *, int ) ) );
628 connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ), 629 connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ),
629 mMainView, SIGNAL ( todoModified( Todo *, int ) ) ); 630 mMainView, SIGNAL ( todoModified( Todo *, int ) ) );
630 connect( mTodoView, SIGNAL( cloneTodoSignal( Incidence * ) ), 631 connect( mTodoView, SIGNAL( cloneTodoSignal( Incidence * ) ),
631 mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); 632 mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
632 connect( mTodoView, SIGNAL( cancelTodoSignal( Incidence * ) ), 633 connect( mTodoView, SIGNAL( cancelTodoSignal( Incidence * ) ),
633 mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); 634 mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
634 connect( mTodoView, SIGNAL( unparentTodoSignal( Todo * ) ), 635 connect( mTodoView, SIGNAL( unparentTodoSignal( Todo * ) ),
635 mMainView, SLOT ( todo_unsub( Todo * ) ) ); 636 mMainView, SLOT ( todo_unsub( Todo * ) ) );
636 connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), 637 connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ),
637 mMainView, SLOT ( todo_resub( Todo *, Todo *) ) ); 638 mMainView, SLOT ( todo_resub( Todo *, Todo *) ) );
638 connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ), 639 connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ),
639 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 640 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
640 connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ), 641 connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ),
641 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 642 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
642 KConfig *config = KOGlobals::config(); 643 KConfig *config = KOGlobals::config();
643 mTodoView->restoreLayout(config,"Todo View"); 644 mTodoView->restoreLayout(config,"Todo View");
644 mTodoView->setNavigator( mMainView->dateNavigator() ); 645 mTodoView->setNavigator( mMainView->dateNavigator() );
645 } 646 }
646 647
647 globalFlagBlockAgenda = 1; 648 globalFlagBlockAgenda = 1;
648 showView( mTodoView, true ); 649 showView( mTodoView, true );
649 650
650} 651}
651 652
652void KOViewManager::showJournalView() 653void KOViewManager::showJournalView()
653{ 654{
654 //mFlagShowNextxDays = false; 655 //mFlagShowNextxDays = false;
655 if (!mJournalView) { 656 if (!mJournalView) {
656 mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(), 657 mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(),
657 "KOViewManager::JournalView"); 658 "KOViewManager::JournalView");
658 connect( mMainView, SIGNAL( configChanged() ), mJournalView, 659 connect( mMainView, SIGNAL( configChanged() ), mJournalView,
659 SLOT( updateConfig() ) ); 660 SLOT( updateConfig() ) );
660 connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) ); 661 connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) );
661 addView(mJournalView); 662 addView(mJournalView);
662 } 663 }
663 664
664 showView(mJournalView); 665 showView(mJournalView);
665 mMainView->dateNavigator()->selectDates( 1 ); 666 mMainView->dateNavigator()->selectDates( 1 );
666} 667}
667 668
668void KOViewManager::showTimeSpanView() 669void KOViewManager::showTimeSpanView()
669{ 670{
670 //mFlagShowNextxDays = false; 671 //mFlagShowNextxDays = false;
671 if (!mTimeSpanView) { 672 if (!mTimeSpanView) {
672 mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(), 673 mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(),
673 "KOViewManager::TimeSpanView"); 674 "KOViewManager::TimeSpanView");
674 addView(mTimeSpanView); 675 addView(mTimeSpanView);
675 676
676 mTimeSpanView->readSettings(); 677 mTimeSpanView->readSettings();
677 } 678 }
678 679
679 showView(mTimeSpanView); 680 showView(mTimeSpanView);
680} 681}
681 682
682Incidence *KOViewManager::currentSelection() 683Incidence *KOViewManager::currentSelection()
683{ 684{
684 if (!mCurrentView) return 0; 685 if (!mCurrentView) return 0;
685 if ( mCurrentView == mListView ) { 686 if ( mCurrentView == mListView ) {
686 if ( mListView->currentItem() ) 687 if ( mListView->currentItem() )
687 return mListView->currentItem(); 688 return mListView->currentItem();
688 } 689 }
689 return mCurrentView->selectedIncidences().first(); 690 return mCurrentView->selectedIncidences().first();
690} 691}
691 692
692QDate KOViewManager::currentSelectionDate() 693QDate KOViewManager::currentSelectionDate()
693{ 694{
694 QDate qd; 695 QDate qd;
695 if (mCurrentView) { 696 if (mCurrentView) {
696 DateList qvl = mCurrentView->selectedDates(); 697 DateList qvl = mCurrentView->selectedDates();
697 if (!qvl.isEmpty()) qd = qvl.first(); 698 if (!qvl.isEmpty()) qd = qvl.first();
698 } 699 }
699 return qd; 700 return qd;
700} 701}
701 702
702void KOViewManager::addView(KOrg::BaseView *view) 703void KOViewManager::addView(KOrg::BaseView *view)
703{ 704{
704#if QT_VERSION >= 0x030000 705#if QT_VERSION >= 0x030000
705 mMainView->viewStack()->addWidget( view ); 706 mMainView->viewStack()->addWidget( view );
706#else 707#else
707 mMainView->viewStack()->addWidget( view, 1 ); 708 mMainView->viewStack()->addWidget( view, 1 );
708#endif 709#endif
709} 710}
710 711
711void KOViewManager::setDocumentId( const QString &id ) 712void KOViewManager::setDocumentId( const QString &id )
712{ 713{
713 if (mTodoView) mTodoView->setDocumentId( id ); 714 if (mTodoView) mTodoView->setDocumentId( id );
714} 715}