-rw-r--r-- | korganizer/calendarview.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 0956c78..bf98ad4 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1,383 +1,384 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | 3 | ||
4 | Requires the Qt and KDE widget libraries, available at no cost at | 4 | Requires the Qt and KDE widget libraries, available at no cost at |
5 | http://www.troll.no and http://www.kde.org respectively | 5 | http://www.troll.no and http://www.kde.org respectively |
6 | 6 | ||
7 | Copyright (c) 1997, 1998, 1999 | 7 | Copyright (c) 1997, 1998, 1999 |
8 | Preston Brown (preston.brown@yale.edu) | 8 | Preston Brown (preston.brown@yale.edu) |
9 | Fester Zigterman (F.J.F.ZigtermanRustenburg@student.utwente.nl) | 9 | Fester Zigterman (F.J.F.ZigtermanRustenburg@student.utwente.nl) |
10 | Ian Dawes (iadawes@globalserve.net) | 10 | Ian Dawes (iadawes@globalserve.net) |
11 | Laszlo Boloni (boloni@cs.purdue.edu) | 11 | Laszlo Boloni (boloni@cs.purdue.edu) |
12 | 12 | ||
13 | Copyright (c) 2000, 2001, 2002 | 13 | Copyright (c) 2000, 2001, 2002 |
14 | Cornelius Schumacher <schumacher@kde.org> | 14 | Cornelius Schumacher <schumacher@kde.org> |
15 | 15 | ||
16 | This program is free software; you can redistribute it and/or modify | 16 | This program is free software; you can redistribute it and/or modify |
17 | it under the terms of the GNU General Public License as published by | 17 | it under the terms of the GNU General Public License as published by |
18 | the Free Software Foundation; either version 2 of the License, or | 18 | the Free Software Foundation; either version 2 of the License, or |
19 | (at your option) any later version. | 19 | (at your option) any later version. |
20 | 20 | ||
21 | This program is distributed in the hope that it will be useful, | 21 | This program is distributed in the hope that it will be useful, |
22 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 22 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the | 23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the |
24 | GNU General Public License for more details. | 24 | GNU General Public License for more details. |
25 | 25 | ||
26 | You should have received a copy of the GNU General Public License | 26 | You should have received a copy of the GNU General Public License |
27 | along with this program; if not, write to the Free Software | 27 | along with this program; if not, write to the Free Software |
28 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 28 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <stdlib.h> | 31 | #include <stdlib.h> |
32 | 32 | ||
33 | #include <qapplication.h> | 33 | #include <qapplication.h> |
34 | #include <qradiobutton.h> | 34 | #include <qradiobutton.h> |
35 | #include <qbuttongroup.h> | 35 | #include <qbuttongroup.h> |
36 | #include <qlayout.h> | 36 | #include <qlayout.h> |
37 | #include <qclipboard.h> | 37 | #include <qclipboard.h> |
38 | #include <qcursor.h> | 38 | #include <qcursor.h> |
39 | #include <qmessagebox.h> | 39 | #include <qmessagebox.h> |
40 | #include <qprogressbar.h> | 40 | #include <qprogressbar.h> |
41 | #include <qmultilineedit.h> | 41 | #include <qmultilineedit.h> |
42 | #include <qtimer.h> | 42 | #include <qtimer.h> |
43 | #include <qwidgetstack.h> | 43 | #include <qwidgetstack.h> |
44 | #include <qptrlist.h> | 44 | #include <qptrlist.h> |
45 | #include <qregexp.h> | 45 | #include <qregexp.h> |
46 | #include <qgroupbox.h> | 46 | #include <qgroupbox.h> |
47 | #include <qfile.h> | 47 | #include <qfile.h> |
48 | #include <qdir.h> | 48 | #include <qdir.h> |
49 | #ifndef KORG_NOSPLITTER | 49 | #ifndef KORG_NOSPLITTER |
50 | #include <qsplitter.h> | 50 | #include <qsplitter.h> |
51 | #endif | 51 | #endif |
52 | 52 | ||
53 | #include <kglobal.h> | 53 | #include <kglobal.h> |
54 | #include <kdebug.h> | 54 | #include <kdebug.h> |
55 | #include <kstandarddirs.h> | 55 | #include <kstandarddirs.h> |
56 | #include <kfiledialog.h> | 56 | #include <kfiledialog.h> |
57 | #include <kmessagebox.h> | 57 | #include <kmessagebox.h> |
58 | #include <knotifyclient.h> | 58 | #include <knotifyclient.h> |
59 | #include <kconfig.h> | 59 | #include <kconfig.h> |
60 | 60 | ||
61 | #include "kosyncprefsdialog.h" | 61 | #include "kosyncprefsdialog.h" |
62 | #include <krun.h> | 62 | #include <krun.h> |
63 | #include <kdirwatch.h> | 63 | #include <kdirwatch.h> |
64 | #include <libkdepim/kdatepicker.h> | 64 | #include <libkdepim/kdatepicker.h> |
65 | #include <libkdepim/ksyncprofile.h> | 65 | #include <libkdepim/ksyncprofile.h> |
66 | 66 | ||
67 | #include <libkcal/vcaldrag.h> | 67 | #include <libkcal/vcaldrag.h> |
68 | #include <libkcal/icaldrag.h> | 68 | #include <libkcal/icaldrag.h> |
69 | #include <libkcal/icalformat.h> | 69 | #include <libkcal/icalformat.h> |
70 | #include <libkcal/vcalformat.h> | 70 | #include <libkcal/vcalformat.h> |
71 | #include <libkcal/scheduler.h> | 71 | #include <libkcal/scheduler.h> |
72 | #include <libkcal/calendarlocal.h> | 72 | #include <libkcal/calendarlocal.h> |
73 | #include <libkcal/journal.h> | 73 | #include <libkcal/journal.h> |
74 | #include <libkcal/calfilter.h> | 74 | #include <libkcal/calfilter.h> |
75 | #include <libkcal/attendee.h> | 75 | #include <libkcal/attendee.h> |
76 | #include <libkcal/dndfactory.h> | 76 | #include <libkcal/dndfactory.h> |
77 | #include <libkcal/freebusy.h> | 77 | #include <libkcal/freebusy.h> |
78 | #include <libkcal/filestorage.h> | 78 | #include <libkcal/filestorage.h> |
79 | #include <libkcal/calendarresources.h> | 79 | #include <libkcal/calendarresources.h> |
80 | #include <libkcal/qtopiaformat.h> | 80 | #include <libkcal/qtopiaformat.h> |
81 | #include "../kalarmd/alarmdialog.h" | 81 | #include "../kalarmd/alarmdialog.h" |
82 | 82 | ||
83 | #ifndef DESKTOP_VERSION | 83 | #ifndef DESKTOP_VERSION |
84 | #include <libkcal/sharpformat.h> | 84 | #include <libkcal/sharpformat.h> |
85 | #endif | 85 | #endif |
86 | #ifndef KORG_NOMAIL | 86 | #ifndef KORG_NOMAIL |
87 | #include "komailclient.h" | 87 | #include "komailclient.h" |
88 | #endif | 88 | #endif |
89 | #ifndef KORG_NOPRINTER | 89 | #ifndef KORG_NOPRINTER |
90 | #include "calprinter.h" | 90 | #include "calprinter.h" |
91 | #endif | 91 | #endif |
92 | #ifndef KORG_NOPLUGINS | 92 | #ifndef KORG_NOPLUGINS |
93 | #include "kocore.h" | 93 | #include "kocore.h" |
94 | #endif | 94 | #endif |
95 | #include "koeventeditor.h" | 95 | #include "koeventeditor.h" |
96 | #include "kotodoeditor.h" | 96 | #include "kotodoeditor.h" |
97 | #include "koprefs.h" | 97 | #include "koprefs.h" |
98 | #include "koeventviewerdialog.h" | 98 | #include "koeventviewerdialog.h" |
99 | #include "publishdialog.h" | 99 | #include "publishdialog.h" |
100 | #include "kofilterview.h" | 100 | #include "kofilterview.h" |
101 | #include "koglobals.h" | 101 | #include "koglobals.h" |
102 | #include "koviewmanager.h" | 102 | #include "koviewmanager.h" |
103 | #include "koagendaview.h" | 103 | #include "koagendaview.h" |
104 | #include "kodialogmanager.h" | 104 | #include "kodialogmanager.h" |
105 | #include "outgoingdialog.h" | 105 | #include "outgoingdialog.h" |
106 | #include "incomingdialog.h" | 106 | #include "incomingdialog.h" |
107 | #include "statusdialog.h" | 107 | #include "statusdialog.h" |
108 | #include "kdatenavigator.h" | 108 | #include "kdatenavigator.h" |
109 | #include "kotodoview.h" | 109 | #include "kotodoview.h" |
110 | #include "datenavigator.h" | 110 | #include "datenavigator.h" |
111 | #include "resourceview.h" | 111 | #include "resourceview.h" |
112 | #include "navigatorbar.h" | 112 | #include "navigatorbar.h" |
113 | #include "searchdialog.h" | 113 | #include "searchdialog.h" |
114 | #include "mainwindow.h" | 114 | #include "mainwindow.h" |
115 | 115 | ||
116 | #include "calendarview.h" | 116 | #include "calendarview.h" |
117 | #ifndef DESKTOP_VERSION | 117 | #ifndef DESKTOP_VERSION |
118 | #include <qtopia/alarmserver.h> | 118 | #include <qtopia/alarmserver.h> |
119 | #endif | 119 | #endif |
120 | #ifndef _WIN32_ | 120 | #ifndef _WIN32_ |
121 | #include <stdlib.h> | 121 | #include <stdlib.h> |
122 | #include <stdio.h> | 122 | #include <stdio.h> |
123 | #include <unistd.h> | 123 | #include <unistd.h> |
124 | #else | 124 | #else |
125 | #include <qprocess.h> | 125 | #include <qprocess.h> |
126 | #endif | 126 | #endif |
127 | using namespace KOrg; | 127 | using namespace KOrg; |
128 | using namespace KCal; | ||
128 | extern int globalFlagBlockAgenda; | 129 | extern int globalFlagBlockAgenda; |
129 | extern int globalFlagBlockStartup; | 130 | extern int globalFlagBlockStartup; |
130 | 131 | ||
131 | #define SYNC_MODE_NORMAL 0 | 132 | #define SYNC_MODE_NORMAL 0 |
132 | #define SYNC_MODE_SHARP 1 | 133 | #define SYNC_MODE_SHARP 1 |
133 | #define SYNC_MODE_QTOPIA 2 | 134 | #define SYNC_MODE_QTOPIA 2 |
134 | 135 | ||
135 | class KOBeamPrefs : public QDialog | 136 | class KOBeamPrefs : public QDialog |
136 | { | 137 | { |
137 | public: | 138 | public: |
138 | KOBeamPrefs( QWidget *parent=0, const char *name=0 ) : | 139 | KOBeamPrefs( QWidget *parent=0, const char *name=0 ) : |
139 | QDialog( parent, name, true ) | 140 | QDialog( parent, name, true ) |
140 | { | 141 | { |
141 | setCaption( i18n("Beam Options") ); | 142 | setCaption( i18n("Beam Options") ); |
142 | QVBoxLayout* lay = new QVBoxLayout( this ); | 143 | QVBoxLayout* lay = new QVBoxLayout( this ); |
143 | lay->setSpacing( 3 ); | 144 | lay->setSpacing( 3 ); |
144 | lay->setMargin( 3 ); | 145 | lay->setMargin( 3 ); |
145 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this ); | 146 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this ); |
146 | lay->addWidget( format ); | 147 | lay->addWidget( format ); |
147 | format->setExclusive ( true ) ; | 148 | format->setExclusive ( true ) ; |
148 | QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this ); | 149 | QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this ); |
149 | lay->addWidget( time ); time->setExclusive ( true ) ; | 150 | lay->addWidget( time ); time->setExclusive ( true ) ; |
150 | vcal = new QRadioButton(" vCalendar ", format ); | 151 | vcal = new QRadioButton(" vCalendar ", format ); |
151 | ical = new QRadioButton(" iCalendar ", format ); | 152 | ical = new QRadioButton(" iCalendar ", format ); |
152 | vcal->setChecked( true ); | 153 | vcal->setChecked( true ); |
153 | tz = new QRadioButton(i18n(" With timezone "), time ); | 154 | tz = new QRadioButton(i18n(" With timezone "), time ); |
154 | local = new QRadioButton(i18n(" Local time "), time ); | 155 | local = new QRadioButton(i18n(" Local time "), time ); |
155 | tz->setChecked( true ); | 156 | tz->setChecked( true ); |
156 | QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this ); | 157 | QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this ); |
157 | lay->addWidget( ok ); | 158 | lay->addWidget( ok ); |
158 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 159 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
159 | lay->addWidget( cancel ); | 160 | lay->addWidget( cancel ); |
160 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 161 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
161 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 162 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
162 | resize( 200, 200 ); | 163 | resize( 200, 200 ); |
163 | } | 164 | } |
164 | 165 | ||
165 | bool beamVcal() { return vcal->isChecked(); } | 166 | bool beamVcal() { return vcal->isChecked(); } |
166 | bool beamLocal() { return local->isChecked(); } | 167 | bool beamLocal() { return local->isChecked(); } |
167 | private: | 168 | private: |
168 | QRadioButton* vcal, *ical, *local, *tz; | 169 | QRadioButton* vcal, *ical, *local, *tz; |
169 | }; | 170 | }; |
170 | class KOCatPrefs : public QDialog | 171 | class KOCatPrefs : public QDialog |
171 | { | 172 | { |
172 | public: | 173 | public: |
173 | KOCatPrefs( QWidget *parent=0, const char *name=0 ) : | 174 | KOCatPrefs( QWidget *parent=0, const char *name=0 ) : |
174 | QDialog( parent, name, true ) | 175 | QDialog( parent, name, true ) |
175 | { | 176 | { |
176 | setCaption( i18n("Manage new Categories") ); | 177 | setCaption( i18n("Manage new Categories") ); |
177 | QVBoxLayout* lay = new QVBoxLayout( this ); | 178 | QVBoxLayout* lay = new QVBoxLayout( this ); |
178 | lay->setSpacing( 3 ); | 179 | lay->setSpacing( 3 ); |
179 | lay->setMargin( 3 ); | 180 | lay->setMargin( 3 ); |
180 | QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); | 181 | QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); |
181 | lay->addWidget( lab ); | 182 | lay->addWidget( lab ); |
182 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); | 183 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); |
183 | lay->addWidget( format ); | 184 | lay->addWidget( format ); |
184 | format->setExclusive ( true ) ; | 185 | format->setExclusive ( true ) ; |
185 | addCatBut = new QRadioButton(i18n("Add to category list"), format ); | 186 | addCatBut = new QRadioButton(i18n("Add to category list"), format ); |
186 | new QRadioButton(i18n("Remove from Events/Todos"), format ); | 187 | new QRadioButton(i18n("Remove from Events/Todos"), format ); |
187 | addCatBut->setChecked( true ); | 188 | addCatBut->setChecked( true ); |
188 | QPushButton * ok = new QPushButton( i18n("OK"), this ); | 189 | QPushButton * ok = new QPushButton( i18n("OK"), this ); |
189 | lay->addWidget( ok ); | 190 | lay->addWidget( ok ); |
190 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 191 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
191 | lay->addWidget( cancel ); | 192 | lay->addWidget( cancel ); |
192 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 193 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
193 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 194 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
194 | resize( 200, 200 ); | 195 | resize( 200, 200 ); |
195 | } | 196 | } |
196 | 197 | ||
197 | bool addCat() { return addCatBut->isChecked(); } | 198 | bool addCat() { return addCatBut->isChecked(); } |
198 | private: | 199 | private: |
199 | QRadioButton* addCatBut; | 200 | QRadioButton* addCatBut; |
200 | }; | 201 | }; |
201 | 202 | ||
202 | 203 | ||
203 | 204 | ||
204 | CalendarView::CalendarView( CalendarResources *calendar, | 205 | CalendarView::CalendarView( CalendarResources *calendar, |
205 | QWidget *parent, const char *name ) | 206 | QWidget *parent, const char *name ) |
206 | : CalendarViewBase( parent, name ), | 207 | : CalendarViewBase( parent, name ), |
207 | mCalendar( calendar ), | 208 | mCalendar( calendar ), |
208 | mResourceManager( calendar->resourceManager() ) | 209 | mResourceManager( calendar->resourceManager() ) |
209 | { | 210 | { |
210 | 211 | ||
211 | mEventEditor = 0; | 212 | mEventEditor = 0; |
212 | mTodoEditor = 0; | 213 | mTodoEditor = 0; |
213 | 214 | ||
214 | init(); | 215 | init(); |
215 | } | 216 | } |
216 | 217 | ||
217 | CalendarView::CalendarView( Calendar *calendar, | 218 | CalendarView::CalendarView( Calendar *calendar, |
218 | QWidget *parent, const char *name ) | 219 | QWidget *parent, const char *name ) |
219 | : CalendarViewBase( parent, name ), | 220 | : CalendarViewBase( parent, name ), |
220 | mCalendar( calendar ), | 221 | mCalendar( calendar ), |
221 | mResourceManager( 0 ) | 222 | mResourceManager( 0 ) |
222 | { | 223 | { |
223 | 224 | ||
224 | mEventEditor = 0; | 225 | mEventEditor = 0; |
225 | mTodoEditor = 0; | 226 | mTodoEditor = 0; |
226 | init();} | 227 | init();} |
227 | 228 | ||
228 | void CalendarView::init() | 229 | void CalendarView::init() |
229 | { | 230 | { |
230 | beamDialog = new KOBeamPrefs(); | 231 | beamDialog = new KOBeamPrefs(); |
231 | mDatePickerMode = 0; | 232 | mDatePickerMode = 0; |
232 | mCurrentSyncDevice = ""; | 233 | mCurrentSyncDevice = ""; |
233 | writeLocale(); | 234 | writeLocale(); |
234 | mViewManager = new KOViewManager( this ); | 235 | mViewManager = new KOViewManager( this ); |
235 | mDialogManager = new KODialogManager( this ); | 236 | mDialogManager = new KODialogManager( this ); |
236 | mEventViewerDialog = 0; | 237 | mEventViewerDialog = 0; |
237 | mModified = false; | 238 | mModified = false; |
238 | mReadOnly = false; | 239 | mReadOnly = false; |
239 | mSelectedIncidence = 0; | 240 | mSelectedIncidence = 0; |
240 | mSyncProfiles.setAutoDelete(true); | 241 | mSyncProfiles.setAutoDelete(true); |
241 | mCalPrinter = 0; | 242 | mCalPrinter = 0; |
242 | mFilters.setAutoDelete(true); | 243 | mFilters.setAutoDelete(true); |
243 | 244 | ||
244 | mCalendar->registerObserver( this ); | 245 | mCalendar->registerObserver( this ); |
245 | // TODO: Make sure that view is updated, when calendar is changed. | 246 | // TODO: Make sure that view is updated, when calendar is changed. |
246 | 247 | ||
247 | mStorage = new FileStorage( mCalendar ); | 248 | mStorage = new FileStorage( mCalendar ); |
248 | mNavigator = new DateNavigator( this, "datevav", mViewManager ); | 249 | mNavigator = new DateNavigator( this, "datevav", mViewManager ); |
249 | 250 | ||
250 | QBoxLayout *topLayout = (QBoxLayout*)layout(); | 251 | QBoxLayout *topLayout = (QBoxLayout*)layout(); |
251 | #ifndef KORG_NOSPLITTER | 252 | #ifndef KORG_NOSPLITTER |
252 | // create the main layout frames. | 253 | // create the main layout frames. |
253 | mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); | 254 | mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); |
254 | topLayout->addWidget(mPanner); | 255 | topLayout->addWidget(mPanner); |
255 | 256 | ||
256 | mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, | 257 | mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, |
257 | "CalendarView::LeftFrame"); | 258 | "CalendarView::LeftFrame"); |
258 | mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); | 259 | mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); |
259 | 260 | ||
260 | mDateNavigator = new KDateNavigator(mLeftSplitter, mCalendar, TRUE, | 261 | mDateNavigator = new KDateNavigator(mLeftSplitter, mCalendar, TRUE, |
261 | "CalendarView::DateNavigator", QDate::currentDate() ); | 262 | "CalendarView::DateNavigator", QDate::currentDate() ); |
262 | mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); | 263 | mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); |
263 | mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); | 264 | mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); |
264 | mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); | 265 | mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); |
265 | 266 | ||
266 | #ifdef KORG_NORESOURCEVIEW | 267 | #ifdef KORG_NORESOURCEVIEW |
267 | mResourceView = 0; | 268 | mResourceView = 0; |
268 | #else | 269 | #else |
269 | if ( mResourceManager ) { | 270 | if ( mResourceManager ) { |
270 | mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); | 271 | mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); |
271 | mResourceView->updateView(); | 272 | mResourceView->updateView(); |
272 | connect( mResourceView, SIGNAL( resourcesChanged() ), | 273 | connect( mResourceView, SIGNAL( resourcesChanged() ), |
273 | SLOT( updateView() ) ); | 274 | SLOT( updateView() ) ); |
274 | } else { | 275 | } else { |
275 | mResourceView = 0; | 276 | mResourceView = 0; |
276 | } | 277 | } |
277 | #endif | 278 | #endif |
278 | QWidget *rightBox = new QWidget( mPanner ); | 279 | QWidget *rightBox = new QWidget( mPanner ); |
279 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); | 280 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); |
280 | 281 | ||
281 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); | 282 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); |
282 | rightLayout->addWidget( mNavigatorBar ); | 283 | rightLayout->addWidget( mNavigatorBar ); |
283 | 284 | ||
284 | mRightFrame = new QWidgetStack( rightBox ); | 285 | mRightFrame = new QWidgetStack( rightBox ); |
285 | rightLayout->addWidget( mRightFrame, 1 ); | 286 | rightLayout->addWidget( mRightFrame, 1 ); |
286 | 287 | ||
287 | mLeftFrame = mLeftSplitter; | 288 | mLeftFrame = mLeftSplitter; |
288 | #else | 289 | #else |
289 | QWidget *mainBox = new QWidget( this ); | 290 | QWidget *mainBox = new QWidget( this ); |
290 | QWidget *leftFrame = new QWidget( mainBox ); | 291 | QWidget *leftFrame = new QWidget( mainBox ); |
291 | 292 | ||
292 | QBoxLayout * mainBoxLayout; | 293 | QBoxLayout * mainBoxLayout; |
293 | QBoxLayout * leftFrameLayout; | 294 | QBoxLayout * leftFrameLayout; |
294 | if ( KOPrefs::instance()->mVerticalScreen ) { | 295 | if ( KOPrefs::instance()->mVerticalScreen ) { |
295 | mainBoxLayout = new QVBoxLayout(mainBox); | 296 | mainBoxLayout = new QVBoxLayout(mainBox); |
296 | leftFrameLayout = new QHBoxLayout(leftFrame ); | 297 | leftFrameLayout = new QHBoxLayout(leftFrame ); |
297 | } else { | 298 | } else { |
298 | mainBoxLayout = new QHBoxLayout(mainBox); | 299 | mainBoxLayout = new QHBoxLayout(mainBox); |
299 | leftFrameLayout = new QVBoxLayout(leftFrame ); | 300 | leftFrameLayout = new QVBoxLayout(leftFrame ); |
300 | } | 301 | } |
301 | topLayout->addWidget( mainBox ); | 302 | topLayout->addWidget( mainBox ); |
302 | mainBoxLayout->addWidget (leftFrame); | 303 | mainBoxLayout->addWidget (leftFrame); |
303 | mDateNavigator = new KDateNavigator(leftFrame, mCalendar, TRUE, | 304 | mDateNavigator = new KDateNavigator(leftFrame, mCalendar, TRUE, |
304 | "CalendarView::DateNavigator", QDate::currentDate()); | 305 | "CalendarView::DateNavigator", QDate::currentDate()); |
305 | // mDateNavigator->blockSignals( true ); | 306 | // mDateNavigator->blockSignals( true ); |
306 | leftFrameLayout->addWidget( mDateNavigator ); | 307 | leftFrameLayout->addWidget( mDateNavigator ); |
307 | mFilterView = new KOFilterView(&mFilters,leftFrame,"CalendarView::FilterView"); | 308 | mFilterView = new KOFilterView(&mFilters,leftFrame,"CalendarView::FilterView"); |
308 | mTodoList = new KOTodoView(mCalendar, leftFrame, "todolist"); | 309 | mTodoList = new KOTodoView(mCalendar, leftFrame, "todolist"); |
309 | 310 | ||
310 | if ( QApplication::desktop()->width() < 480 ) { | 311 | if ( QApplication::desktop()->width() < 480 ) { |
311 | leftFrameLayout->addWidget(mFilterView); | 312 | leftFrameLayout->addWidget(mFilterView); |
312 | leftFrameLayout->addWidget(mTodoList, 2 ); | 313 | leftFrameLayout->addWidget(mTodoList, 2 ); |
313 | 314 | ||
314 | } else { | 315 | } else { |
315 | leftFrameLayout->addWidget(mTodoList,2 ); | 316 | leftFrameLayout->addWidget(mTodoList,2 ); |
316 | leftFrameLayout->addWidget(mFilterView ); | 317 | leftFrameLayout->addWidget(mFilterView ); |
317 | } | 318 | } |
318 | mFilterView->hide(); | 319 | mFilterView->hide(); |
319 | QWidget *rightBox = new QWidget( mainBox ); | 320 | QWidget *rightBox = new QWidget( mainBox ); |
320 | mainBoxLayout->addWidget ( rightBox, 10 ); | 321 | mainBoxLayout->addWidget ( rightBox, 10 ); |
321 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); | 322 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); |
322 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); | 323 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); |
323 | mRightFrame = new QWidgetStack( rightBox ); | 324 | mRightFrame = new QWidgetStack( rightBox ); |
324 | rightLayout->addWidget( mNavigatorBar ); | 325 | rightLayout->addWidget( mNavigatorBar ); |
325 | rightLayout->addWidget( mRightFrame, 10 ); | 326 | rightLayout->addWidget( mRightFrame, 10 ); |
326 | 327 | ||
327 | mLeftFrame = leftFrame; | 328 | mLeftFrame = leftFrame; |
328 | if ( KOPrefs::instance()->mVerticalScreen ) { | 329 | if ( KOPrefs::instance()->mVerticalScreen ) { |
329 | mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); | 330 | mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); |
330 | leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); | 331 | leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); |
331 | } else { | 332 | } else { |
332 | mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); | 333 | mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); |
333 | leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); | 334 | leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); |
334 | } | 335 | } |
335 | 336 | ||
336 | //qDebug("Calendarview Size %d %d ", width(), height()); | 337 | //qDebug("Calendarview Size %d %d ", width(), height()); |
337 | #endif | 338 | #endif |
338 | 339 | ||
339 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 340 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
340 | SLOT( showDates( const KCal::DateList & ) ) ); | 341 | SLOT( showDates( const KCal::DateList & ) ) ); |
341 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 342 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
342 | mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); | 343 | mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); |
343 | 344 | ||
344 | connect( mNavigatorBar, SIGNAL( goPrevYear() ), | 345 | connect( mNavigatorBar, SIGNAL( goPrevYear() ), |
345 | mNavigator, SLOT( selectPreviousYear() ) ); | 346 | mNavigator, SLOT( selectPreviousYear() ) ); |
346 | connect( mNavigatorBar, SIGNAL( goNextYear() ), | 347 | connect( mNavigatorBar, SIGNAL( goNextYear() ), |
347 | mNavigator, SLOT( selectNextYear() ) ); | 348 | mNavigator, SLOT( selectNextYear() ) ); |
348 | connect( mNavigatorBar, SIGNAL( goPrevMonth() ), | 349 | connect( mNavigatorBar, SIGNAL( goPrevMonth() ), |
349 | mNavigator, SLOT( selectPreviousMonth() ) ); | 350 | mNavigator, SLOT( selectPreviousMonth() ) ); |
350 | connect( mNavigatorBar, SIGNAL( goNextMonth() ), | 351 | connect( mNavigatorBar, SIGNAL( goNextMonth() ), |
351 | mNavigator, SLOT( selectNextMonth() ) ); | 352 | mNavigator, SLOT( selectNextMonth() ) ); |
352 | 353 | ||
353 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 354 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
354 | mNavigatorBar, SLOT( selectDates( const KCal::DateList & ) ) ); | 355 | mNavigatorBar, SLOT( selectDates( const KCal::DateList & ) ) ); |
355 | 356 | ||
356 | connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), | 357 | connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), |
357 | mNavigator, SLOT( selectWeek( const QDate & ) ) ); | 358 | mNavigator, SLOT( selectWeek( const QDate & ) ) ); |
358 | 359 | ||
359 | connect( mDateNavigator, SIGNAL( goPrevYear() ), | 360 | connect( mDateNavigator, SIGNAL( goPrevYear() ), |
360 | mNavigator, SLOT( selectPreviousYear() ) ); | 361 | mNavigator, SLOT( selectPreviousYear() ) ); |
361 | connect( mDateNavigator, SIGNAL( goNextYear() ), | 362 | connect( mDateNavigator, SIGNAL( goNextYear() ), |
362 | mNavigator, SLOT( selectNextYear() ) ); | 363 | mNavigator, SLOT( selectNextYear() ) ); |
363 | connect( mDateNavigator, SIGNAL( goPrevMonth() ), | 364 | connect( mDateNavigator, SIGNAL( goPrevMonth() ), |
364 | mNavigator, SLOT( selectPreviousMonth() ) ); | 365 | mNavigator, SLOT( selectPreviousMonth() ) ); |
365 | connect( mDateNavigator, SIGNAL( goNextMonth() ), | 366 | connect( mDateNavigator, SIGNAL( goNextMonth() ), |
366 | mNavigator, SLOT( selectNextMonth() ) ); | 367 | mNavigator, SLOT( selectNextMonth() ) ); |
367 | 368 | ||
368 | connect( mDateNavigator, SIGNAL( goPrevious() ), | 369 | connect( mDateNavigator, SIGNAL( goPrevious() ), |
369 | mNavigator, SLOT( selectPrevious() ) ); | 370 | mNavigator, SLOT( selectPrevious() ) ); |
370 | connect( mDateNavigator, SIGNAL( goNext() ), | 371 | connect( mDateNavigator, SIGNAL( goNext() ), |
371 | mNavigator, SLOT( selectNext() ) ); | 372 | mNavigator, SLOT( selectNext() ) ); |
372 | connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), | 373 | connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), |
373 | mNavigator, SLOT( slotMonthSelect( int ) ) ); | 374 | mNavigator, SLOT( slotMonthSelect( int ) ) ); |
374 | connect( mNavigatorBar, SIGNAL( monthSelected ( int ) ), | 375 | connect( mNavigatorBar, SIGNAL( monthSelected ( int ) ), |
375 | mNavigator, SLOT( slotMonthSelect( int ) ) ); | 376 | mNavigator, SLOT( slotMonthSelect( int ) ) ); |
376 | 377 | ||
377 | connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 378 | connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
378 | mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); | 379 | mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); |
379 | 380 | ||
380 | connect( mDateNavigator, SIGNAL( eventDropped( Event * ) ), | 381 | connect( mDateNavigator, SIGNAL( eventDropped( Event * ) ), |
381 | SLOT( eventAdded( Event *) ) ); | 382 | SLOT( eventAdded( Event *) ) ); |
382 | 383 | ||
383 | connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); | 384 | connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); |