-rw-r--r-- | core/pim/datebook/datebookday.cpp | 2 | ||||
-rw-r--r-- | core/pim/datebook/datebookweek.cpp | 2 | ||||
-rw-r--r-- | core/pim/datebook/datebookweeklst.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/core/pim/datebook/datebookday.cpp b/core/pim/datebook/datebookday.cpp index 5d472a6..af98e06 100644 --- a/core/pim/datebook/datebookday.cpp +++ b/core/pim/datebook/datebookday.cpp | |||
@@ -280,65 +280,65 @@ void DateBookDay::dateChanged( int y, int m, int d ) | |||
280 | QTableSelection ts; | 280 | QTableSelection ts; |
281 | 281 | ||
282 | if (jumpToCurTime && this->date() == QDate::currentDate()) | 282 | if (jumpToCurTime && this->date() == QDate::currentDate()) |
283 | { | 283 | { |
284 | ts.init( QTime::currentTime().hour(), 0); | 284 | ts.init( QTime::currentTime().hour(), 0); |
285 | ts.expandTo( QTime::currentTime().hour(), 0); | 285 | ts.expandTo( QTime::currentTime().hour(), 0); |
286 | } else | 286 | } else |
287 | { | 287 | { |
288 | ts.init( startTime, 0 ); | 288 | ts.init( startTime, 0 ); |
289 | ts.expandTo( startTime, 0 ); | 289 | ts.expandTo( startTime, 0 ); |
290 | } | 290 | } |
291 | 291 | ||
292 | dayView()->addSelection( ts ); | 292 | dayView()->addSelection( ts ); |
293 | 293 | ||
294 | selectedWidget = 0; | 294 | selectedWidget = 0; |
295 | 295 | ||
296 | } | 296 | } |
297 | 297 | ||
298 | void DateBookDay::redraw() | 298 | void DateBookDay::redraw() |
299 | { | 299 | { |
300 | if ( isUpdatesEnabled() ) | 300 | if ( isUpdatesEnabled() ) |
301 | relayoutPage(); | 301 | relayoutPage(); |
302 | } | 302 | } |
303 | 303 | ||
304 | void DateBookDay::getEvents() | 304 | void DateBookDay::getEvents() |
305 | { | 305 | { |
306 | widgetList.clear(); | 306 | widgetList.clear(); |
307 | 307 | ||
308 | QValueList<EffectiveEvent> eventList = db->getEffectiveEvents( currDate, currDate ); | 308 | QValueList<EffectiveEvent> eventList = db->getEffectiveEvents( currDate, currDate ); |
309 | QValueListIterator<EffectiveEvent> it; | 309 | QValueListIterator<EffectiveEvent> it; |
310 | for ( it = eventList.begin(); it != eventList.end(); ++it ) { | 310 | for ( it = eventList.begin(); it != eventList.end(); ++it ) { |
311 | EffectiveEvent ev=*it; | 311 | EffectiveEvent ev=*it; |
312 | if(!(ev.end().hour()==ev.start().hour() && ev.end().minute()==ev.start().minute())) {// Skip effective events with no duration. (i.e ending at 00:00) | 312 | if(!((ev.end().hour()==0) && (ev.end().minute()==0) && (ev.startDate()!=ev.date()))) {// Skip events ending at 00:00 starting at another day. |
313 | DateBookDayWidget* w = new DateBookDayWidget( *it, this ); | 313 | DateBookDayWidget* w = new DateBookDayWidget( *it, this ); |
314 | connect( w, SIGNAL( deleteMe( const Event & ) ), | 314 | connect( w, SIGNAL( deleteMe( const Event & ) ), |
315 | this, SIGNAL( removeEvent( const Event & ) ) ); | 315 | this, SIGNAL( removeEvent( const Event & ) ) ); |
316 | connect( w, SIGNAL( duplicateMe( const Event & ) ), | 316 | connect( w, SIGNAL( duplicateMe( const Event & ) ), |
317 | this, SIGNAL( duplicateEvent( const Event & ) ) ); | 317 | this, SIGNAL( duplicateEvent( const Event & ) ) ); |
318 | connect( w, SIGNAL( editMe( const Event & ) ), | 318 | connect( w, SIGNAL( editMe( const Event & ) ), |
319 | this, SIGNAL( editEvent( const Event & ) ) ); | 319 | this, SIGNAL( editEvent( const Event & ) ) ); |
320 | connect( w, SIGNAL( beamMe( const Event & ) ), | 320 | connect( w, SIGNAL( beamMe( const Event & ) ), |
321 | this, SIGNAL( beamEvent( const Event & ) ) ); | 321 | this, SIGNAL( beamEvent( const Event & ) ) ); |
322 | widgetList.append( w ); | 322 | widgetList.append( w ); |
323 | } | 323 | } |
324 | } | 324 | } |
325 | 325 | ||
326 | } | 326 | } |
327 | 327 | ||
328 | static int place( const DateBookDayWidget *item, bool *used, int maxn ) | 328 | static int place( const DateBookDayWidget *item, bool *used, int maxn ) |
329 | { | 329 | { |
330 | int place = 0; | 330 | int place = 0; |
331 | int start = item->event().start().hour(); | 331 | int start = item->event().start().hour(); |
332 | QTime e = item->event().end(); | 332 | QTime e = item->event().end(); |
333 | int end = e.hour(); | 333 | int end = e.hour(); |
334 | if ( e.minute() < 5 ) | 334 | if ( e.minute() < 5 ) |
335 | end--; | 335 | end--; |
336 | if ( end < start ) | 336 | if ( end < start ) |
337 | end = start; | 337 | end = start; |
338 | while ( place < maxn ) { | 338 | while ( place < maxn ) { |
339 | bool free = TRUE; | 339 | bool free = TRUE; |
340 | int s = start; | 340 | int s = start; |
341 | while( s <= end ) { | 341 | while( s <= end ) { |
342 | if ( used[10*s+place] ) { | 342 | if ( used[10*s+place] ) { |
343 | free = FALSE; | 343 | free = FALSE; |
344 | break; | 344 | break; |
diff --git a/core/pim/datebook/datebookweek.cpp b/core/pim/datebook/datebookweek.cpp index 5bbf86a..874cf24 100644 --- a/core/pim/datebook/datebookweek.cpp +++ b/core/pim/datebook/datebookweek.cpp | |||
@@ -110,65 +110,65 @@ void DateBookWeekView::initNames() | |||
110 | } | 110 | } |
111 | bFirst = false; | 111 | bFirst = false; |
112 | } else { | 112 | } else { |
113 | // we are change things... | 113 | // we are change things... |
114 | if ( bOnMonday ) { | 114 | if ( bOnMonday ) { |
115 | header->setLabel( 1, tr("M", "Monday") ); | 115 | header->setLabel( 1, tr("M", "Monday") ); |
116 | header->setLabel( 2, tr("T", "Tuesday") ); | 116 | header->setLabel( 2, tr("T", "Tuesday") ); |
117 | header->setLabel( 3, tr("W", "Wednesday" ) ); | 117 | header->setLabel( 3, tr("W", "Wednesday" ) ); |
118 | header->setLabel( 4, tr("T", "Thursday" ) ); | 118 | header->setLabel( 4, tr("T", "Thursday" ) ); |
119 | header->setLabel( 5, tr("F", "Friday" ) ); | 119 | header->setLabel( 5, tr("F", "Friday" ) ); |
120 | header->setLabel( 6, tr("S", "Saturday" ) ); | 120 | header->setLabel( 6, tr("S", "Saturday" ) ); |
121 | header->setLabel( 7, tr("S", "Sunday" ) ); | 121 | header->setLabel( 7, tr("S", "Sunday" ) ); |
122 | } else { | 122 | } else { |
123 | header->setLabel( 1, tr("S", "Sunday" ) ); | 123 | header->setLabel( 1, tr("S", "Sunday" ) ); |
124 | header->setLabel( 2, tr("M", "Monday") ); | 124 | header->setLabel( 2, tr("M", "Monday") ); |
125 | header->setLabel( 3, tr("T", "Tuesday") ); | 125 | header->setLabel( 3, tr("T", "Tuesday") ); |
126 | header->setLabel( 4, tr("W", "Wednesday" ) ); | 126 | header->setLabel( 4, tr("W", "Wednesday" ) ); |
127 | header->setLabel( 5, tr("T", "Thursday" ) ); | 127 | header->setLabel( 5, tr("T", "Thursday" ) ); |
128 | header->setLabel( 6, tr("F", "Friday" ) ); | 128 | header->setLabel( 6, tr("F", "Friday" ) ); |
129 | header->setLabel( 7, tr("S", "Saturday" ) ); | 129 | header->setLabel( 7, tr("S", "Saturday" ) ); |
130 | } | 130 | } |
131 | } | 131 | } |
132 | } | 132 | } |
133 | 133 | ||
134 | 134 | ||
135 | 135 | ||
136 | void DateBookWeekView::showEvents( QValueList<EffectiveEvent> &ev ) | 136 | void DateBookWeekView::showEvents( QValueList<EffectiveEvent> &ev ) |
137 | { | 137 | { |
138 | items.clear(); | 138 | items.clear(); |
139 | QValueListIterator<EffectiveEvent> it; | 139 | QValueListIterator<EffectiveEvent> it; |
140 | for ( it = ev.begin(); it != ev.end(); ++it ) { | 140 | for ( it = ev.begin(); it != ev.end(); ++it ) { |
141 | DateBookWeekItem *i = new DateBookWeekItem( *it ); | 141 | DateBookWeekItem *i = new DateBookWeekItem( *it ); |
142 | if(!(i->event().end().hour()==i->event().start().hour() && i->event().end().minute()==i->event().start().minute())) {// Skip effective events with no duration. (i.e ending at 00:00) | 142 | if(!((i->event().end().hour()==0) && (i->event().end().minute()==0) && (i->event().startDate()!=i->event().date()))) {// Skip events ending at 00:00 starting at another day. |
143 | positionItem( i ); | 143 | positionItem( i ); |
144 | items.append( i ); | 144 | items.append( i ); |
145 | } | 145 | } |
146 | } | 146 | } |
147 | viewport()->update(); | 147 | viewport()->update(); |
148 | } | 148 | } |
149 | 149 | ||
150 | void DateBookWeekView::moveToHour( int h ) | 150 | void DateBookWeekView::moveToHour( int h ) |
151 | { | 151 | { |
152 | int offset = h*rowHeight; | 152 | int offset = h*rowHeight; |
153 | setContentsPos( 0, offset ); | 153 | setContentsPos( 0, offset ); |
154 | } | 154 | } |
155 | 155 | ||
156 | void DateBookWeekView::keyPressEvent( QKeyEvent *e ) | 156 | void DateBookWeekView::keyPressEvent( QKeyEvent *e ) |
157 | { | 157 | { |
158 | e->ignore(); | 158 | e->ignore(); |
159 | } | 159 | } |
160 | 160 | ||
161 | void DateBookWeekView::slotChangeClock( bool c ) | 161 | void DateBookWeekView::slotChangeClock( bool c ) |
162 | { | 162 | { |
163 | ampm = c; | 163 | ampm = c; |
164 | viewport()->update(); | 164 | viewport()->update(); |
165 | } | 165 | } |
166 | 166 | ||
167 | static inline int db_round30min( int m ) | 167 | static inline int db_round30min( int m ) |
168 | { | 168 | { |
169 | if ( m < 15 ) | 169 | if ( m < 15 ) |
170 | m = 0; | 170 | m = 0; |
171 | else if ( m < 45 ) | 171 | else if ( m < 45 ) |
172 | m = 1; | 172 | m = 1; |
173 | else | 173 | else |
174 | m = 2; | 174 | m = 2; |
diff --git a/core/pim/datebook/datebookweeklst.cpp b/core/pim/datebook/datebookweeklst.cpp index 4ceb360..3d6a029 100644 --- a/core/pim/datebook/datebookweeklst.cpp +++ b/core/pim/datebook/datebookweeklst.cpp | |||
@@ -182,65 +182,65 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev, | |||
182 | setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding)); | 182 | setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding)); |
183 | 183 | ||
184 | QVBoxLayout *layout = new QVBoxLayout( this ); | 184 | QVBoxLayout *layout = new QVBoxLayout( this ); |
185 | 185 | ||
186 | qBubbleSort(ev); | 186 | qBubbleSort(ev); |
187 | QValueListIterator<EffectiveEvent> it; | 187 | QValueListIterator<EffectiveEvent> it; |
188 | it=ev.begin(); | 188 | it=ev.begin(); |
189 | 189 | ||
190 | int dayOrder[7]; | 190 | int dayOrder[7]; |
191 | if (onMonday) | 191 | if (onMonday) |
192 | for (int d=0; d<7; d++) dayOrder[d]=d+1; | 192 | for (int d=0; d<7; d++) dayOrder[d]=d+1; |
193 | else { | 193 | else { |
194 | for (int d=0; d<7; d++) dayOrder[d]=d; | 194 | for (int d=0; d<7; d++) dayOrder[d]=d; |
195 | dayOrder[0]=7; | 195 | dayOrder[0]=7; |
196 | } | 196 | } |
197 | 197 | ||
198 | for (int i=0; i<7; i++) { | 198 | for (int i=0; i<7; i++) { |
199 | // Header | 199 | // Header |
200 | DateBookWeekLstDayHdr *hdr=new DateBookWeekLstDayHdr(d.addDays(i), | 200 | DateBookWeekLstDayHdr *hdr=new DateBookWeekLstDayHdr(d.addDays(i), |
201 | onMonday,this); | 201 | onMonday,this); |
202 | connect(hdr, SIGNAL(showDate(int,int,int)), | 202 | connect(hdr, SIGNAL(showDate(int,int,int)), |
203 | this, SIGNAL(showDate(int,int,int))); | 203 | this, SIGNAL(showDate(int,int,int))); |
204 | connect(hdr, SIGNAL(addEvent(const QDateTime &, | 204 | connect(hdr, SIGNAL(addEvent(const QDateTime &, |
205 | const QDateTime &, | 205 | const QDateTime &, |
206 | const QString &, const QString &)), | 206 | const QString &, const QString &)), |
207 | this, SIGNAL(addEvent(const QDateTime &, | 207 | this, SIGNAL(addEvent(const QDateTime &, |
208 | const QDateTime &, | 208 | const QDateTime &, |
209 | const QString &, const QString &))); | 209 | const QString &, const QString &))); |
210 | layout->addWidget(hdr); | 210 | layout->addWidget(hdr); |
211 | 211 | ||
212 | // Events | 212 | // Events |
213 | while ( (*it).date().dayOfWeek() == dayOrder[i] && it!=ev.end() ) { | 213 | while ( (*it).date().dayOfWeek() == dayOrder[i] && it!=ev.end() ) { |
214 | if(!((*it).end().hour()==(*it).start().hour() && (*it).end().minute()==(*it).start().minute())) {// Skip effective events with no duration. (i.e ending at 00:00) | 214 | if(!(((*it).end().hour()==0) && ((*it).end().minute()==0) && ((*it).startDate()!=(*it).date()))) {// Skip events ending at 00:00 starting at another day. |
215 | DateBookWeekLstEvent *l=new DateBookWeekLstEvent(*it,this); | 215 | DateBookWeekLstEvent *l=new DateBookWeekLstEvent(*it,this); |
216 | layout->addWidget(l); | 216 | layout->addWidget(l); |
217 | connect (l, SIGNAL(editEvent(const Event &)), | 217 | connect (l, SIGNAL(editEvent(const Event &)), |
218 | this, SIGNAL(editEvent(const Event &))); | 218 | this, SIGNAL(editEvent(const Event &))); |
219 | } | 219 | } |
220 | it++; | 220 | it++; |
221 | } | 221 | } |
222 | 222 | ||
223 | layout->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding)); | 223 | layout->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding)); |
224 | } | 224 | } |
225 | } | 225 | } |
226 | DateBookWeekLstView::~DateBookWeekLstView(){} | 226 | DateBookWeekLstView::~DateBookWeekLstView(){} |
227 | void DateBookWeekLstView::keyPressEvent(QKeyEvent *e) {e->ignore();} | 227 | void DateBookWeekLstView::keyPressEvent(QKeyEvent *e) {e->ignore();} |
228 | 228 | ||
229 | DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1, | 229 | DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1, |
230 | QValueList<EffectiveEvent> &ev2, | 230 | QValueList<EffectiveEvent> &ev2, |
231 | QDate &d, bool onM, | 231 | QDate &d, bool onM, |
232 | QWidget* parent, | 232 | QWidget* parent, |
233 | const char* name, WFlags fl) | 233 | const char* name, WFlags fl) |
234 | : QWidget( parent, name, fl ) | 234 | : QWidget( parent, name, fl ) |
235 | { | 235 | { |
236 | QHBoxLayout *layout = new QHBoxLayout( this ); | 236 | QHBoxLayout *layout = new QHBoxLayout( this ); |
237 | 237 | ||
238 | DateBookWeekLstView *w=new DateBookWeekLstView(ev1,d,onM,this); | 238 | DateBookWeekLstView *w=new DateBookWeekLstView(ev1,d,onM,this); |
239 | layout->addWidget(w); | 239 | layout->addWidget(w); |
240 | connect (w, SIGNAL(editEvent(const Event &)), | 240 | connect (w, SIGNAL(editEvent(const Event &)), |
241 | this, SIGNAL(editEvent(const Event &))); | 241 | this, SIGNAL(editEvent(const Event &))); |
242 | connect (w, SIGNAL(showDate(int,int,int)), | 242 | connect (w, SIGNAL(showDate(int,int,int)), |
243 | this, SIGNAL(showDate(int,int,int))); | 243 | this, SIGNAL(showDate(int,int,int))); |
244 | connect (w, SIGNAL(addEvent(const QDateTime &, const QDateTime &, | 244 | connect (w, SIGNAL(addEvent(const QDateTime &, const QDateTime &, |
245 | const QString &,const QString &)), | 245 | const QString &,const QString &)), |
246 | this, SIGNAL(addEvent(const QDateTime &, const QDateTime &, | 246 | this, SIGNAL(addEvent(const QDateTime &, const QDateTime &, |