summaryrefslogtreecommitdiff
path: root/core/pim
Unidiff
Diffstat (limited to 'core/pim') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebook.cpp14
-rw-r--r--core/pim/datebook/datebook.h2
-rw-r--r--core/pim/datebook/datebook.pro3
-rw-r--r--core/pim/datebook/datebookday.cpp65
-rw-r--r--core/pim/datebook/datebookday.h6
-rw-r--r--core/pim/datebook/datebooksettings.cpp20
-rw-r--r--core/pim/datebook/datebooksettings.h7
-rw-r--r--core/pim/datebook/datebooksettingsbase.ui371
-rw-r--r--core/pim/datebook/datebookweeklst.cpp64
9 files changed, 406 insertions, 146 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp
index c0d45c9..7dd93a6 100644
--- a/core/pim/datebook/datebook.cpp
+++ b/core/pim/datebook/datebook.cpp
@@ -77,12 +77,14 @@
77 77
78DateBook::DateBook( QWidget *parent, const char *, WFlags f ) 78DateBook::DateBook( QWidget *parent, const char *, WFlags f )
79 : QMainWindow( parent, "datebook", f ), 79 : QMainWindow( parent, "datebook", f ),
80 aPreset( FALSE ), 80 aPreset( FALSE ),
81 presetTime( -1 ), 81 presetTime( -1 ),
82 startTime( 8 ), // an acceptable default 82 startTime( 8 ), // an acceptable default
83 rowStyle( 0 ),
84 bJumpToCurTime(FALSE),
83 syncing(FALSE), 85 syncing(FALSE),
84 inSearch(FALSE), 86 inSearch(FALSE),
85 alarmCounter(0) 87 alarmCounter(0)
86{ 88{
87 QTime t; 89 QTime t;
88 t.start(); 90 t.start();
@@ -246,22 +248,28 @@ DateBook::~DateBook()
246 248
247void DateBook::slotSettings() 249void DateBook::slotSettings()
248{ 250{
249 DateBookSettings frmSettings( ampm, this ); 251 DateBookSettings frmSettings( ampm, this );
250 frmSettings.setStartTime( startTime ); 252 frmSettings.setStartTime( startTime );
251 frmSettings.setAlarmPreset( aPreset, presetTime ); 253 frmSettings.setAlarmPreset( aPreset, presetTime );
254 frmSettings.setJumpToCurTime( bJumpToCurTime );
255 frmSettings.setRowStyle( rowStyle );
252#if defined (Q_WS_QWS) || defined(_WS_QWS_) 256#if defined (Q_WS_QWS) || defined(_WS_QWS_)
253 frmSettings.showMaximized(); 257 frmSettings.showMaximized();
254#endif 258#endif
255 259
256 if ( frmSettings.exec() ) { 260 if ( frmSettings.exec() ) {
257 aPreset = frmSettings.alarmPreset(); 261 aPreset = frmSettings.alarmPreset();
258 presetTime = frmSettings.presetTime(); 262 presetTime = frmSettings.presetTime();
259 startTime = frmSettings.startTime(); 263 startTime = frmSettings.startTime();
264 bJumpToCurTime = frmSettings.jumpToCurTime();
265 rowStyle = frmSettings.rowStyle();
260 if ( dayView ) 266 if ( dayView )
261 dayView->setStartViewTime( startTime ); 267 dayView->setStartViewTime( startTime );
268 dayView->setJumpToCurTime( bJumpToCurTime );
269 dayView->setRowStyle( rowStyle );
262 if ( weekView ) 270 if ( weekView )
263 weekView->setStartViewTime( startTime ); 271 weekView->setStartViewTime( startTime );
264 saveSettings(); 272 saveSettings();
265 273
266 // make the change obvious 274 // make the change obvious
267 if ( views->visibleWidget() ) { 275 if ( views->visibleWidget() ) {
@@ -450,12 +458,14 @@ void DateBook::showDay( int year, int month, int day )
450void DateBook::initDay() 458void DateBook::initDay()
451{ 459{
452 if ( !dayView ) { 460 if ( !dayView ) {
453 dayView = new DateBookDay( ampm, onMonday, db, views, "day view" ); 461 dayView = new DateBookDay( ampm, onMonday, db, views, "day view" );
454 views->addWidget( dayView, DAY ); 462 views->addWidget( dayView, DAY );
455 dayView->setStartViewTime( startTime ); 463 dayView->setStartViewTime( startTime );
464 dayView->setJumpToCurTime( bJumpToCurTime );
465 dayView->setRowStyle( rowStyle );
456 connect( this, SIGNAL( newEvent() ), 466 connect( this, SIGNAL( newEvent() ),
457 dayView, SLOT( redraw() ) ); 467 dayView, SLOT( redraw() ) );
458 connect( dayView, SIGNAL( newEvent() ), 468 connect( dayView, SIGNAL( newEvent() ),
459 this, SLOT( fileNew() ) ); 469 this, SLOT( fileNew() ) );
460 connect( dayView, SIGNAL( removeEvent( const Event & ) ), 470 connect( dayView, SIGNAL( removeEvent( const Event & ) ),
461 this, SLOT( removeEvent( const Event & ) ) ); 471 this, SLOT( removeEvent( const Event & ) ) );
@@ -544,23 +554,27 @@ void DateBook::loadSettings()
544 { 554 {
545 Config config("DateBook"); 555 Config config("DateBook");
546 config.setGroup("Main"); 556 config.setGroup("Main");
547 startTime = config.readNumEntry("startviewtime", 8); 557 startTime = config.readNumEntry("startviewtime", 8);
548 aPreset = config.readBoolEntry("alarmpreset"); 558 aPreset = config.readBoolEntry("alarmpreset");
549 presetTime = config.readNumEntry("presettime"); 559 presetTime = config.readNumEntry("presettime");
560 bJumpToCurTime = config.readBoolEntry("jumptocurtime");
561 rowStyle = config.readNumEntry("rowstyle");
550 } 562 }
551} 563}
552 564
553void DateBook::saveSettings() 565void DateBook::saveSettings()
554{ 566{
555 Config config( "qpe" ); 567 Config config( "qpe" );
556 Config configDB( "DateBook" ); 568 Config configDB( "DateBook" );
557 configDB.setGroup( "Main" ); 569 configDB.setGroup( "Main" );
558 configDB.writeEntry("startviewtime",startTime); 570 configDB.writeEntry("startviewtime",startTime);
559 configDB.writeEntry("alarmpreset",aPreset); 571 configDB.writeEntry("alarmpreset",aPreset);
560 configDB.writeEntry("presettime",presetTime); 572 configDB.writeEntry("presettime",presetTime);
573 configDB.writeEntry("jumptocurtime", bJumpToCurTime);
574 configDB.writeEntry("rowstyle", rowStyle);
561} 575}
562 576
563void DateBook::newDefaultView(QAction *a) { 577void DateBook::newDefaultView(QAction *a) {
564 int val=DAY; 578 int val=DAY;
565 if (a->text() == "Day") val=DAY; 579 if (a->text() == "Day") val=DAY;
566 if (a->text() == "Week") val=WEEK; 580 if (a->text() == "Week") val=WEEK;
diff --git a/core/pim/datebook/datebook.h b/core/pim/datebook/datebook.h
index e7be0dd..ba8f97e 100644
--- a/core/pim/datebook/datebook.h
+++ b/core/pim/datebook/datebook.h
@@ -111,12 +111,14 @@ private:
111 DateBookMonth *monthView; 111 DateBookMonth *monthView;
112 DateBookWeekLst *weekLstView; 112 DateBookWeekLst *weekLstView;
113 QAction *dayAction, *weekAction, *weekLstAction, *monthAction; 113 QAction *dayAction, *weekAction, *weekLstAction, *monthAction;
114 bool aPreset; // have everything set to alarm? 114 bool aPreset; // have everything set to alarm?
115 int presetTime; // the standard time for the alarm 115 int presetTime; // the standard time for the alarm
116 int startTime; 116 int startTime;
117 int rowStyle;
118 bool bJumpToCurTime; //should jump to current time in dayview?
117 bool ampm; 119 bool ampm;
118 bool onMonday; 120 bool onMonday;
119 121
120 bool syncing; 122 bool syncing;
121 bool inSearch; 123 bool inSearch;
122 124
diff --git a/core/pim/datebook/datebook.pro b/core/pim/datebook/datebook.pro
index 609b7dc..1db3e3a 100644
--- a/core/pim/datebook/datebook.pro
+++ b/core/pim/datebook/datebook.pro
@@ -4,12 +4,13 @@ DESTDIR = $(OPIEDIR)/bin
4 4
5 HEADERS= datebookday.h \ 5 HEADERS= datebookday.h \
6 datebook.h \ 6 datebook.h \
7 dateentryimpl.h \ 7 dateentryimpl.h \
8 datebookdayheaderimpl.h \ 8 datebookdayheaderimpl.h \
9 datebooksettings.h \ 9 datebooksettings.h \
10 datebooksettingsbase.h \
10 datebookweek.h \ 11 datebookweek.h \
11 datebookweeklst.h \ 12 datebookweeklst.h \
12 datebookweekheaderimpl.h \ 13 datebookweekheaderimpl.h \
13 repeatentry.h \ 14 repeatentry.h \
14 timepicker.h \ 15 timepicker.h \
15 noteentryimpl.h \ 16 noteentryimpl.h \
@@ -17,24 +18,24 @@ HEADERS = datebookday.h \
17 18
18 SOURCES= main.cpp \ 19 SOURCES= main.cpp \
19 datebookday.cpp \ 20 datebookday.cpp \
20 datebook.cpp \ 21 datebook.cpp \
21 dateentryimpl.cpp \ 22 dateentryimpl.cpp \
22 datebookdayheaderimpl.cpp \ 23 datebookdayheaderimpl.cpp \
24 datebooksettingsbase.cpp \
23 datebooksettings.cpp \ 25 datebooksettings.cpp \
24 datebookweek.cpp \ 26 datebookweek.cpp \
25 datebookweeklst.cpp \ 27 datebookweeklst.cpp \
26 datebookweekheaderimpl.cpp \ 28 datebookweekheaderimpl.cpp \
27 repeatentry.cpp \ 29 repeatentry.cpp \
28 timepicker.cpp \ 30 timepicker.cpp \
29 noteentryimpl.cpp \ 31 noteentryimpl.cpp \
30 onoteedit.cpp 32 onoteedit.cpp
31 33
32 INTERFACES= dateentry.ui \ 34 INTERFACES= dateentry.ui \
33 datebookdayheader.ui \ 35 datebookdayheader.ui \
34 datebooksettingsbase.ui \
35 datebookweekheader.ui \ 36 datebookweekheader.ui \
36 datebookweeklstheader.ui \ 37 datebookweeklstheader.ui \
37 datebookweeklstdayhdr.ui \ 38 datebookweeklstdayhdr.ui \
38 repeatentrybase.ui \ 39 repeatentrybase.ui \
39 noteentry.ui 40 noteentry.ui
40 41
diff --git a/core/pim/datebook/datebookday.cpp b/core/pim/datebook/datebookday.cpp
index c15ccef..9cc5fcd 100644
--- a/core/pim/datebook/datebookday.cpp
+++ b/core/pim/datebook/datebookday.cpp
@@ -57,13 +57,13 @@ DateBookDayView::DateBookDayView( bool whichClock, QWidget *parent,
57 // get rid of being able to edit things... 57 // get rid of being able to edit things...
58 QTableItem *tmp; 58 QTableItem *tmp;
59 int row; 59 int row;
60 for ( row = 0; row < numRows(); row++ ) { 60 for ( row = 0; row < numRows(); row++ ) {
61 tmp = new QTableItem( this, QTableItem::Never, QString::null); 61 tmp = new QTableItem( this, QTableItem::Never, QString::null);
62 setItem( row, 0, tmp ); 62 setItem( row, 0, tmp );
63 setRowHeight( row, 40); 63 //setRowHeight( row, 40);
64 } 64 }
65 initHeader(); 65 initHeader();
66 QObject::connect( qApp, SIGNAL(clockChanged(bool)), 66 QObject::connect( qApp, SIGNAL(clockChanged(bool)),
67 this, SLOT(slotChangeClock(bool)) ); 67 this, SLOT(slotChangeClock(bool)) );
68} 68}
69 69
@@ -156,12 +156,19 @@ void DateBookDayView::keyPressEvent( QKeyEvent *e )
156 } else { 156 } else {
157 // I don't know what this key is, do you? 157 // I don't know what this key is, do you?
158 e->ignore(); 158 e->ignore();
159 } 159 }
160} 160}
161 161
162void DateBookDayView::setRowStyle( int style )
163{
164 if (style<0) style = 0;
165
166 for (int i=0; i<numRows(); i++)
167 setRowHeight(i, style*10+20);
168}
162 169
163//=========================================================================== 170//===========================================================================
164 171
165DateBookDay::DateBookDay( bool ampm, bool startOnMonday, 172DateBookDay::DateBookDay( bool ampm, bool startOnMonday,
166 DateBookDB *newDb, QWidget *parent, 173 DateBookDB *newDb, QWidget *parent,
167 const char *name ) 174 const char *name )
@@ -171,12 +178,13 @@ DateBookDay::DateBookDay( bool ampm, bool startOnMonday,
171 startTime( 0 ) 178 startTime( 0 )
172{ 179{
173 widgetList.setAutoDelete( true ); 180 widgetList.setAutoDelete( true );
174 header = new DateBookDayHeader( startOnMonday, this, "day header" ); 181 header = new DateBookDayHeader( startOnMonday, this, "day header" );
175 header->setDate( currDate.year(), currDate.month(), currDate.day() ); 182 header->setDate( currDate.year(), currDate.month(), currDate.day() );
176 view = new DateBookDayView( ampm, this, "day view" ); 183 view = new DateBookDayView( ampm, this, "day view" );
184
177 connect( header, SIGNAL( dateChanged( int, int, int ) ), 185 connect( header, SIGNAL( dateChanged( int, int, int ) ),
178 this, SLOT( dateChanged( int, int, int ) ) ); 186 this, SLOT( dateChanged( int, int, int ) ) );
179 connect( view, SIGNAL( sigColWidthChanged() ), 187 connect( view, SIGNAL( sigColWidthChanged() ),
180 this, SLOT( slotColWidthChanged() ) ); 188 this, SLOT( slotColWidthChanged() ) );
181 connect( qApp, SIGNAL(weekChanged(bool)), 189 connect( qApp, SIGNAL(weekChanged(bool)),
182 this, SLOT(slotWeekChanged(bool)) ); 190 this, SLOT(slotWeekChanged(bool)) );
@@ -190,12 +198,24 @@ DateBookDay::DateBookDay( bool ampm, bool startOnMonday,
190 timer->start( 1000*60*5, FALSE ); //update every 5min 198 timer->start( 1000*60*5, FALSE ); //update every 5min
191 199
192 selectedWidget = 0; 200 selectedWidget = 0;
193 201
194 timeMarker = new DateBookDayTimeMarker( this ); 202 timeMarker = new DateBookDayTimeMarker( this );
195 timeMarker->setTime( QTime::currentTime() ); 203 timeMarker->setTime( QTime::currentTime() );
204 rowStyle = -1; // initialize with bogus values
205}
206
207void DateBookDay::setJumpToCurTime( bool bJump )
208{
209 jumpToCurTime = bJump;
210}
211
212void DateBookDay::setRowStyle( int style )
213{
214 if (rowStyle != style) view->setRowStyle( style );
215 rowStyle = style;
196} 216}
197 217
198void DateBookDay::updateView( void ) 218void DateBookDay::updateView( void )
199{ 219{
200 timeMarker->setTime( QTime::currentTime() ); 220 timeMarker->setTime( QTime::currentTime() );
201 //need to find a way to update all DateBookDayWidgets 221 //need to find a way to update all DateBookDayWidgets
@@ -254,21 +274,27 @@ void DateBookDay::dateChanged( int y, int m, int d )
254 if ( currDate == date ) 274 if ( currDate == date )
255 return; 275 return;
256 currDate.setYMD( y, m, d ); 276 currDate.setYMD( y, m, d );
257 relayoutPage(); 277 relayoutPage();
258 dayView()->clearSelection(); 278 dayView()->clearSelection();
259 QTableSelection ts; 279 QTableSelection ts;
260 ts.init( startTime, 0 ); 280
261 ts.expandTo( startTime, 0 ); 281 if (jumpToCurTime && this->date() == QDate::currentDate())
282 {
283 ts.init( QTime::currentTime().hour(), 0);
284 ts.expandTo( QTime::currentTime().hour(), 0);
285 } else
286 {
287 ts.init( startTime, 0 );
288 ts.expandTo( startTime, 0 );
289 }
290
262 dayView()->addSelection( ts ); 291 dayView()->addSelection( ts );
263 292
264 selectedWidget = 0; 293 selectedWidget = 0;
265 294
266 if (this->date() == QDate::currentDate())
267 timeMarker->show(); else timeMarker->hide();
268
269} 295}
270 296
271void DateBookDay::redraw() 297void DateBookDay::redraw()
272{ 298{
273 if ( isUpdatesEnabled() ) 299 if ( isUpdatesEnabled() )
274 relayoutPage(); 300 relayoutPage();
@@ -396,13 +422,16 @@ void DateBookDay::relayoutPage( bool fromResize )
396 while ( intersects( w, geom ) ) { 422 while ( intersects( w, geom ) ) {
397 geom.moveBy( wd + 2 + 1, 0 ); 423 geom.moveBy( wd + 2 + 1, 0 );
398 } 424 }
399 w->setGeometry( geom ); 425 w->setGeometry( geom );
400 } 426 }
401 427
402 view->setContentsPos( 0, startTime * view->rowHeight(0) ); 428 if (jumpToCurTime && this->date() == QDate::currentDate())
429 view->setContentsPos( 0, QTime::currentTime().hour() * view->rowHeight(0) ); //set listview to current hour
430 else
431 view->setContentsPos( 0, startTime * view->rowHeight(0) );
403 432
404 433
405 } else { 434 } else {
406 435
407 436
408 int hours[24]; 437 int hours[24];
@@ -441,17 +470,24 @@ void DateBookDay::relayoutPage( bool fromResize )
441 QRect geom = w->geometry(); 470 QRect geom = w->geometry();
442 geom.setX( xp*(wid+2) ); 471 geom.setX( xp*(wid+2) );
443 geom.setWidth( wid ); 472 geom.setWidth( wid );
444 w->setGeometry( geom ); 473 w->setGeometry( geom );
445 } 474 }
446 } 475 }
447 view->setContentsPos( 0, startTime * view->rowHeight(0) ); 476
477 if (jumpToCurTime && this->date() == QDate::currentDate())
478 view->setContentsPos( 0, QTime::currentTime().hour() * view->rowHeight(0) ); //set listview to current hour
479 else
480 view->setContentsPos( 0, startTime * view->rowHeight(0) );
448 } 481 }
449 482
450 timeMarker->setTime( QTime::currentTime() );//display timeMarker 483 timeMarker->setTime( QTime::currentTime() );//display timeMarker
451 timeMarker->raise(); //on top of all widgets 484 timeMarker->raise(); //on top of all widgets
485 if (this->date() == QDate::currentDate()) //only show timeMarker on current day
486 timeMarker->show(); else timeMarker->hide();
487
452 setUpdatesEnabled( TRUE ); 488 setUpdatesEnabled( TRUE );
453 return; 489 return;
454} 490}
455 491
456DateBookDayWidget *DateBookDay::intersects( const DateBookDayWidget *item, const QRect &geom ) 492DateBookDayWidget *DateBookDay::intersects( const DateBookDayWidget *item, const QRect &geom )
457{ 493{
@@ -476,14 +512,23 @@ QDate DateBookDay::date() const
476 512
477void DateBookDay::setStartViewTime( int startHere ) 513void DateBookDay::setStartViewTime( int startHere )
478{ 514{
479 startTime = startHere; 515 startTime = startHere;
480 dayView()->clearSelection(); 516 dayView()->clearSelection();
481 QTableSelection ts; 517 QTableSelection ts;
482 ts.init( startTime, 0 ); 518
483 ts.expandTo( startTime, 0 ); 519 if (jumpToCurTime && this->date() == QDate::currentDate())//this should probably be in datebook.cpp where it's called?
520 {
521 ts.init( QTime::currentTime().hour(), 0);
522 ts.expandTo( QTime::currentTime().hour(), 0);
523 } else
524 {
525 ts.init( startTime, 0 );
526 ts.expandTo( startTime, 0 );
527 }
528
484 dayView()->addSelection( ts ); 529 dayView()->addSelection( ts );
485} 530}
486 531
487int DateBookDay::startViewTime() const 532int DateBookDay::startViewTime() const
488{ 533{
489 return startTime; 534 return startTime;
diff --git a/core/pim/datebook/datebookday.h b/core/pim/datebook/datebookday.h
index db0f3b6..be7cc45 100644
--- a/core/pim/datebook/datebookday.h
+++ b/core/pim/datebook/datebookday.h
@@ -37,12 +37,14 @@ class QResizeEvent;
37class DateBookDayView : public QTable 37class DateBookDayView : public QTable
38{ 38{
39 Q_OBJECT 39 Q_OBJECT
40public: 40public:
41 DateBookDayView( bool hourClock, QWidget *parent, const char *name ); 41 DateBookDayView( bool hourClock, QWidget *parent, const char *name );
42 bool whichClock() const; 42 bool whichClock() const;
43
44 void setRowStyle( int style );
43 45
44public slots: 46public slots:
45 void moveUp(); 47 void moveUp();
46 void moveDown(); 48 void moveDown();
47 49
48signals: 50signals:
@@ -146,12 +148,14 @@ public:
146 QDate date() const; 148 QDate date() const;
147 DateBookDayView *dayView() const { return view; } 149 DateBookDayView *dayView() const { return view; }
148 void setStartViewTime( int startHere ); 150 void setStartViewTime( int startHere );
149 int startViewTime() const; 151 int startViewTime() const;
150 void setSelectedWidget( DateBookDayWidget * ); 152 void setSelectedWidget( DateBookDayWidget * );
151 DateBookDayWidget * getSelectedWidget( void ); 153 DateBookDayWidget * getSelectedWidget( void );
154 void setJumpToCurTime( bool bJump );
155 void setRowStyle( int style );
152 156
153public slots: 157public slots:
154 void setDate( int y, int m, int d ); 158 void setDate( int y, int m, int d );
155 void setDate( QDate ); 159 void setDate( QDate );
156 void redraw(); 160 void redraw();
157 void slotWeekChanged( bool bStartOnMonday ); 161 void slotWeekChanged( bool bStartOnMonday );
@@ -178,11 +182,13 @@ private:
178 QDate currDate; 182 QDate currDate;
179 DateBookDayView *view; 183 DateBookDayView *view;
180 DateBookDayHeader *header; 184 DateBookDayHeader *header;
181 DateBookDB *db; 185 DateBookDB *db;
182 WidgetListClass widgetList;//reimplemented QList for sorting widgets by height 186 WidgetListClass widgetList;//reimplemented QList for sorting widgets by height
183 int startTime; 187 int startTime;
188 bool jumpToCurTime;//should we jump to current time in dayview?
189 int rowStyle;
184 DateBookDayWidget *selectedWidget; //actual selected widget (obviously) 190 DateBookDayWidget *selectedWidget; //actual selected widget (obviously)
185 DateBookDayTimeMarker *timeMarker;//marker for current time 191 DateBookDayTimeMarker *timeMarker;//marker for current time
186}; 192};
187 193
188#endif 194#endif
diff --git a/core/pim/datebook/datebooksettings.cpp b/core/pim/datebook/datebooksettings.cpp
index c5d8ac1..49fcd17 100644
--- a/core/pim/datebook/datebooksettings.cpp
+++ b/core/pim/datebook/datebooksettings.cpp
@@ -130,6 +130,26 @@ void DateBookSettings::slotChangeClock( bool whichClock )
130 saveMe += 12; 130 saveMe += 12;
131 } 131 }
132 ampm = whichClock; 132 ampm = whichClock;
133 init(); 133 init();
134 setStartTime( saveMe ); 134 setStartTime( saveMe );
135} 135}
136
137void DateBookSettings::setJumpToCurTime( bool bJump )
138{
139 chkJumpToCurTime->setChecked( bJump );
140}
141
142bool DateBookSettings::jumpToCurTime() const
143{
144 return chkJumpToCurTime->isChecked();
145}
146
147void DateBookSettings::setRowStyle( int style )
148{
149 comboRowStyle->setCurrentItem( style );
150}
151
152int DateBookSettings::rowStyle() const
153{
154 return comboRowStyle->currentItem();
155}
diff --git a/core/pim/datebook/datebooksettings.h b/core/pim/datebook/datebooksettings.h
index ee9f39c..90a07f9 100644
--- a/core/pim/datebook/datebooksettings.h
+++ b/core/pim/datebook/datebooksettings.h
@@ -32,13 +32,18 @@ public:
32 int startTime() const; 32 int startTime() const;
33 void setAlarmPreset( bool bAlarm, int presetTime ); 33 void setAlarmPreset( bool bAlarm, int presetTime );
34 bool alarmPreset() const; 34 bool alarmPreset() const;
35 int presetTime() const; 35 int presetTime() const;
36 void setAlarmType( int alarmType ); 36 void setAlarmType( int alarmType );
37 int alarmType() const; 37 int alarmType() const;
38 38
39 void setJumpToCurTime( bool bJump );
40 bool jumpToCurTime() const;
41 void setRowStyle( int style );
42 int rowStyle() const;
43
39private slots: 44private slots:
40 void slot12Hour( int ); 45 void slot12Hour( int );
41 void slotChangeClock( bool ); 46 void slotChangeClock( bool );
42 47
43private: 48private:
44 void init(); 49 void init();
diff --git a/core/pim/datebook/datebooksettingsbase.ui b/core/pim/datebook/datebooksettingsbase.ui
index 0f40773..816a441 100644
--- a/core/pim/datebook/datebooksettingsbase.ui
+++ b/core/pim/datebook/datebooksettingsbase.ui
@@ -29,13 +29,13 @@
29 </property> 29 </property>
30 <property stdset="1"> 30 <property stdset="1">
31 <name>geometry</name> 31 <name>geometry</name>
32 <rect> 32 <rect>
33 <x>0</x> 33 <x>0</x>
34 <y>0</y> 34 <y>0</y>
35 <width>232</width> 35 <width>220</width>
36 <height>290</height> 36 <height>290</height>
37 </rect> 37 </rect>
38 </property> 38 </property>
39 <property stdset="1"> 39 <property stdset="1">
40 <name>caption</name> 40 <name>caption</name>
41 <string>Preferences</string> 41 <string>Preferences</string>
@@ -43,22 +43,22 @@
43 <property> 43 <property>
44 <name>layoutMargin</name> 44 <name>layoutMargin</name>
45 </property> 45 </property>
46 <property> 46 <property>
47 <name>layoutSpacing</name> 47 <name>layoutSpacing</name>
48 </property> 48 </property>
49 <vbox> 49 <grid>
50 <property stdset="1"> 50 <property stdset="1">
51 <name>margin</name> 51 <name>margin</name>
52 <number>5</number> 52 <number>11</number>
53 </property> 53 </property>
54 <property stdset="1"> 54 <property stdset="1">
55 <name>spacing</name> 55 <name>spacing</name>
56 <number>1</number> 56 <number>6</number>
57 </property> 57 </property>
58 <widget> 58 <widget row="0" column="0" >
59 <class>QGroupBox</class> 59 <class>QGroupBox</class>
60 <property stdset="1"> 60 <property stdset="1">
61 <name>name</name> 61 <name>name</name>
62 <cstring>fraStart</cstring> 62 <cstring>fraStart</cstring>
63 </property> 63 </property>
64 <property stdset="1"> 64 <property stdset="1">
@@ -70,151 +70,318 @@
70 <enum>Sunken</enum> 70 <enum>Sunken</enum>
71 </property> 71 </property>
72 <property stdset="1"> 72 <property stdset="1">
73 <name>title</name> 73 <name>title</name>
74 <string>Start viewing events</string> 74 <string>Start viewing events</string>
75 </property> 75 </property>
76 <vbox> 76 <widget>
77 <class>QLayoutWidget</class>
77 <property stdset="1"> 78 <property stdset="1">
78 <name>margin</name> 79 <name>name</name>
79 <number>11</number> 80 <cstring>Layout6</cstring>
80 </property> 81 </property>
81 <property stdset="1"> 82 <property stdset="1">
82 <name>spacing</name> 83 <name>geometry</name>
83 <number>6</number> 84 <rect>
85 <x>3</x>
86 <y>21</y>
87 <width>210</width>
88 <height>53</height>
89 </rect>
84 </property> 90 </property>
85 <widget> 91 <grid>
86 <class>QLayoutWidget</class>
87 <property stdset="1"> 92 <property stdset="1">
88 <name>name</name> 93 <name>margin</name>
89 <cstring>Layout1</cstring> 94 <number>0</number>
90 </property> 95 </property>
91 <hbox> 96 <property stdset="1">
97 <name>spacing</name>
98 <number>6</number>
99 </property>
100 <spacer row="1" column="0" >
101 <property>
102 <name>name</name>
103 <cstring>Spacer1</cstring>
104 </property>
92 <property stdset="1"> 105 <property stdset="1">
93 <name>margin</name> 106 <name>orientation</name>
94 <number>0</number> 107 <enum>Vertical</enum>
95 </property> 108 </property>
96 <property stdset="1"> 109 <property stdset="1">
97 <name>spacing</name> 110 <name>sizeType</name>
98 <number>6</number> 111 <enum>Expanding</enum>
99 </property> 112 </property>
100 <widget> 113 <property>
101 <class>QLabel</class> 114 <name>sizeHint</name>
102 <property stdset="1"> 115 <size>
103 <name>name</name> 116 <width>20</width>
104 <cstring>lblStartTime</cstring> 117 <height>20</height>
105 </property> 118 </size>
106 <property stdset="1"> 119 </property>
107 <name>text</name> 120 </spacer>
108 <string>Start Time:</string> 121 <widget row="0" column="0" >
109 </property> 122 <class>QLayoutWidget</class>
110 </widget> 123 <property stdset="1">
111 <widget> 124 <name>name</name>
112 <class>QSpinBox</class> 125 <cstring>Layout1</cstring>
113 <property stdset="1"> 126 </property>
114 <name>name</name> 127 <hbox>
115 <cstring>spinStart</cstring>
116 </property>
117 <property stdset="1">
118 <name>suffix</name>
119 <string>:00</string>
120 </property>
121 <property stdset="1"> 128 <property stdset="1">
122 <name>wrapping</name> 129 <name>margin</name>
123 <bool>true</bool> 130 <number>0</number>
124 </property> 131 </property>
125 <property stdset="1"> 132 <property stdset="1">
126 <name>maxValue</name> 133 <name>spacing</name>
127 <number>23</number> 134 <number>6</number>
128 </property> 135 </property>
129 </widget> 136 <widget>
130 </hbox> 137 <class>QLabel</class>
131 </widget> 138 <property stdset="1">
132 </vbox> 139 <name>name</name>
140 <cstring>lblStartTime</cstring>
141 </property>
142 <property stdset="1">
143 <name>text</name>
144 <string>Start Time:</string>
145 </property>
146 </widget>
147 <widget>
148 <class>QSpinBox</class>
149 <property stdset="1">
150 <name>name</name>
151 <cstring>spinStart</cstring>
152 </property>
153 <property stdset="1">
154 <name>suffix</name>
155 <string>:00</string>
156 </property>
157 <property stdset="1">
158 <name>wrapping</name>
159 <bool>true</bool>
160 </property>
161 <property stdset="1">
162 <name>maxValue</name>
163 <number>23</number>
164 </property>
165 </widget>
166 </hbox>
167 </widget>
168 </grid>
169 </widget>
133 </widget> 170 </widget>
134 <widget> 171 <widget row="1" column="0" >
135 <class>QGroupBox</class> 172 <class>QGroupBox</class>
136 <property stdset="1"> 173 <property stdset="1">
137 <name>name</name> 174 <name>name</name>
138 <cstring>fraAlarm</cstring> 175 <cstring>fraAlarm</cstring>
139 </property> 176 </property>
140 <property stdset="1"> 177 <property stdset="1">
141 <name>title</name> 178 <name>title</name>
142 <string>Alarm Settings</string> 179 <string>Alarm Settings</string>
143 </property> 180 </property>
144 <vbox> 181 <widget>
182 <class>QLayoutWidget</class>
145 <property stdset="1"> 183 <property stdset="1">
146 <name>margin</name> 184 <name>name</name>
147 <number>11</number> 185 <cstring>Layout4</cstring>
148 </property> 186 </property>
149 <property stdset="1"> 187 <property stdset="1">
150 <name>spacing</name> 188 <name>geometry</name>
151 <number>6</number> 189 <rect>
190 <x>10</x>
191 <y>20</y>
192 <width>200</width>
193 <height>53</height>
194 </rect>
152 </property> 195 </property>
153 <widget> 196 <grid>
154 <class>QLayoutWidget</class> 197 <property stdset="1">
198 <name>margin</name>
199 <number>0</number>
200 </property>
155 <property stdset="1"> 201 <property stdset="1">
156 <name>name</name> 202 <name>spacing</name>
157 <cstring>Layout6</cstring> 203 <number>6</number>
158 </property> 204 </property>
159 <hbox> 205 <spacer row="1" column="0" >
206 <property>
207 <name>name</name>
208 <cstring>Spacer2</cstring>
209 </property>
160 <property stdset="1"> 210 <property stdset="1">
161 <name>margin</name> 211 <name>orientation</name>
162 <number>0</number> 212 <enum>Vertical</enum>
163 </property> 213 </property>
164 <property stdset="1"> 214 <property stdset="1">
165 <name>spacing</name> 215 <name>sizeType</name>
166 <number>6</number> 216 <enum>Expanding</enum>
167 </property> 217 </property>
168 <widget> 218 <property>
169 <class>QCheckBox</class> 219 <name>sizeHint</name>
170 <property stdset="1"> 220 <size>
171 <name>name</name> 221 <width>20</width>
172 <cstring>chkAlarmPreset</cstring> 222 <height>20</height>
173 </property> 223 </size>
174 <property stdset="1"> 224 </property>
175 <name>text</name> 225 </spacer>
176 <string>Alarm Preset</string> 226 <widget row="0" column="0" >
177 </property> 227 <class>QLayoutWidget</class>
178 </widget> 228 <property stdset="1">
179 <widget> 229 <name>name</name>
180 <class>QSpinBox</class> 230 <cstring>Layout6</cstring>
181 <property stdset="1"> 231 </property>
182 <name>name</name> 232 <hbox>
183 <cstring>spinPreset</cstring>
184 </property>
185 <property stdset="1">
186 <name>enabled</name>
187 <bool>false</bool>
188 </property>
189 <property stdset="1"> 233 <property stdset="1">
190 <name>suffix</name> 234 <name>margin</name>
191 <string> minutes</string> 235 <number>0</number>
192 </property> 236 </property>
193 <property stdset="1"> 237 <property stdset="1">
194 <name>maxValue</name> 238 <name>spacing</name>
195 <number>180</number> 239 <number>6</number>
196 </property> 240 </property>
197 <property stdset="1"> 241 <widget>
198 <name>minValue</name> 242 <class>QCheckBox</class>
199 <number>0</number> 243 <property stdset="1">
244 <name>name</name>
245 <cstring>chkAlarmPreset</cstring>
246 </property>
247 <property stdset="1">
248 <name>text</name>
249 <string>Alarm Preset</string>
250 </property>
251 </widget>
252 <widget>
253 <class>QSpinBox</class>
254 <property stdset="1">
255 <name>name</name>
256 <cstring>spinPreset</cstring>
257 </property>
258 <property stdset="1">
259 <name>enabled</name>
260 <bool>false</bool>
261 </property>
262 <property stdset="1">
263 <name>suffix</name>
264 <string> minutes</string>
265 </property>
266 <property stdset="1">
267 <name>maxValue</name>
268 <number>180</number>
269 </property>
270 <property stdset="1">
271 <name>minValue</name>
272 <number>0</number>
273 </property>
274 <property stdset="1">
275 <name>lineStep</name>
276 <number>5</number>
277 </property>
278 <property stdset="1">
279 <name>value</name>
280 <number>5</number>
281 </property>
282 </widget>
283 </hbox>
284 </widget>
285 </grid>
286 </widget>
287 </widget>
288 <widget row="2" column="0" >
289 <class>QGroupBox</class>
290 <property stdset="1">
291 <name>name</name>
292 <cstring>fraMisc</cstring>
293 </property>
294 <property stdset="1">
295 <name>title</name>
296 <string>Misc</string>
297 </property>
298 <widget>
299 <class>QLayoutWidget</class>
300 <property stdset="1">
301 <name>name</name>
302 <cstring>Layout5</cstring>
303 </property>
304 <property stdset="1">
305 <name>geometry</name>
306 <rect>
307 <x>10</x>
308 <y>40</y>
309 <width>170</width>
310 <height>24</height>
311 </rect>
312 </property>
313 <hbox>
314 <property stdset="1">
315 <name>margin</name>
316 <number>0</number>
317 </property>
318 <property stdset="1">
319 <name>spacing</name>
320 <number>6</number>
321 </property>
322 <widget>
323 <class>QLabel</class>
324 <property stdset="1">
325 <name>name</name>
326 <cstring>TextLabel1</cstring>
327 </property>
328 <property stdset="1">
329 <name>text</name>
330 <string>Row style:</string>
331 </property>
332 </widget>
333 <widget>
334 <class>QComboBox</class>
335 <item>
336 <property>
337 <name>text</name>
338 <string>Default</string>
200 </property> 339 </property>
201 <property stdset="1"> 340 </item>
202 <name>lineStep</name> 341 <item>
203 <number>5</number> 342 <property>
343 <name>text</name>
344 <string>Medium</string>
204 </property> 345 </property>
205 <property stdset="1"> 346 </item>
206 <name>value</name> 347 <item>
207 <number>5</number> 348 <property>
349 <name>text</name>
350 <string>Large</string>
208 </property> 351 </property>
209 </widget> 352 </item>
210 </hbox> 353 <property stdset="1">
211 </widget> 354 <name>name</name>
212 </vbox> 355 <cstring>comboRowStyle</cstring>
356 </property>
357 </widget>
358 </hbox>
359 </widget>
360 <widget>
361 <class>QCheckBox</class>
362 <property stdset="1">
363 <name>name</name>
364 <cstring>chkJumpToCurTime</cstring>
365 </property>
366 <property stdset="1">
367 <name>geometry</name>
368 <rect>
369 <x>10</x>
370 <y>20</y>
371 <width>200</width>
372 <height>20</height>
373 </rect>
374 </property>
375 <property stdset="1">
376 <name>text</name>
377 <string>Jump to current time (dayview)</string>
378 </property>
379 </widget>
213 </widget> 380 </widget>
214 </vbox> 381 </grid>
215</widget> 382</widget>
216<connections> 383<connections>
217 <connection> 384 <connection>
218 <sender>chkAlarmPreset</sender> 385 <sender>chkAlarmPreset</sender>
219 <signal>toggled(bool)</signal> 386 <signal>toggled(bool)</signal>
220 <receiver>spinPreset</receiver> 387 <receiver>spinPreset</receiver>
diff --git a/core/pim/datebook/datebookweeklst.cpp b/core/pim/datebook/datebookweeklst.cpp
index 8e88377..58a9c53 100644
--- a/core/pim/datebook/datebookweeklst.cpp
+++ b/core/pim/datebook/datebookweeklst.cpp
@@ -17,20 +17,20 @@
17#include <qpainter.h> 17#include <qpainter.h>
18#include <qpopupmenu.h> 18#include <qpopupmenu.h>
19#include <qtimer.h> 19#include <qtimer.h>
20#include <qstyle.h> 20#include <qstyle.h>
21#include <qtoolbutton.h> 21#include <qtoolbutton.h>
22#include <qvbox.h> 22#include <qvbox.h>
23#include <qsizepolicy.h> 23#include <qsizepolicy.h>
24#include <qabstractlayout.h> 24#include <qabstractlayout.h>
25#include <qtl.h> 25#include <qtl.h>
26 26
27bool calcWeek(const QDate &d, int &week, int &year, 27bool calcWeek(const QDate &d, int &week, int &year,
28 bool startOnMonday = false); 28 bool startOnMonday = false);
29 29
30DateBookWeekLstHeader::DateBookWeekLstHeader(bool onM, QWidget* parent, 30DateBookWeekLstHeader::DateBookWeekLstHeader(bool /*onM*/, QWidget* parent,
31 const char* name, WFlags fl) 31 const char* name, WFlags fl)
32 : DateBookWeekLstHeaderBase(parent, name, fl) 32 : DateBookWeekLstHeaderBase(parent, name, fl)
33{ 33{
34 setBackgroundMode( PaletteButton ); 34 setBackgroundMode( PaletteButton );
35 labelDate->setBackgroundMode( PaletteButton ); 35 labelDate->setBackgroundMode( PaletteButton );
36 labelWeek->setBackgroundMode( PaletteButton ); 36 labelWeek->setBackgroundMode( PaletteButton );
@@ -51,18 +51,18 @@ DateBookWeekLstHeader::~DateBookWeekLstHeader(){}
51void DateBookWeekLstHeader::setDate(const QDate &d) { 51void DateBookWeekLstHeader::setDate(const QDate &d) {
52 date=d; 52 date=d;
53 53
54 int year,week; 54 int year,week;
55 calcWeek(d,week,year,onMonday); 55 calcWeek(d,week,year,onMonday);
56 labelWeek->setText("W: " + QString::number(week)); 56 labelWeek->setText("W: " + QString::number(week));
57 57
58 QDate start=date; 58 QDate start=date;
59 QDate stop=start.addDays(6); 59 QDate stop=start.addDays(6);
60 labelDate->setText( QString::number(start.day()) + " " + 60 labelDate->setText( QString::number(start.day()) + " " +
61 start.monthName(start.month()) + " - " + 61 start.monthName(start.month()) + " - " +
62 QString::number(stop.day()) + " " + 62 QString::number(stop.day()) + " " +
63 start.monthName(stop.month()) ); 63 start.monthName(stop.month()) );
64 emit dateChanged(year,week); 64 emit dateChanged(year,week);
65} 65}
66void DateBookWeekLstHeader::pickDate() { 66void DateBookWeekLstHeader::pickDate() {
67 static QPopupMenu *m1 = 0; 67 static QPopupMenu *m1 = 0;
68 static DateBookMonth *picker = 0; 68 static DateBookMonth *picker = 0;
@@ -89,31 +89,31 @@ void DateBookWeekLstHeader::nextWeek() {
89} 89}
90void DateBookWeekLstHeader::prevWeek() { 90void DateBookWeekLstHeader::prevWeek() {
91 setDate(date.addDays(-7)); 91 setDate(date.addDays(-7));
92} 92}
93 93
94DateBookWeekLstDayHdr::DateBookWeekLstDayHdr(const QDate &d, bool onM, 94DateBookWeekLstDayHdr::DateBookWeekLstDayHdr(const QDate &d, bool onM,
95 QWidget* parent, 95 QWidget* parent,
96 const char* name, 96 const char* name,
97 WFlags fl ) 97 WFlags fl )
98 : DateBookWeekLstDayHdrBase(parent, name, fl) { 98 : DateBookWeekLstDayHdrBase(parent, name, fl) {
99 99
100 date=d; 100 date=d;
101 101
102 static const char *wdays="MTWTFSS"; 102 static const char *wdays="MTWTFSS";
103 char day=wdays[d.dayOfWeek()-1]; 103 char day=wdays[d.dayOfWeek()-1];
104 104
105 label->setText( QString(QChar(day)) + " " + 105 label->setText( QString(QChar(day)) + " " +
106 QString::number(d.day()) ); 106 QString::number(d.day()) );
107 add->setText("+"); 107 add->setText("+");
108 108
109 if (d == QDate::currentDate()) { 109 if (d == QDate::currentDate()) {
110 QPalette pal=label->palette(); 110 QPalette pal=label->palette();
111 pal.setColor(QColorGroup::Foreground, QColor(0,0,255)); 111 pal.setColor(QColorGroup::Foreground, QColor(0,0,255));
112 label->setPalette(pal); 112 label->setPalette(pal);
113 113
114 /* 114 /*
115 QFont f=label->font(); 115 QFont f=label->font();
116 f.setItalic(true); 116 f.setItalic(true);
117 label->setFont(f); 117 label->setFont(f);
118 label->setPalette(QPalette(QColor(0,0,255),label->backgroundColor())); 118 label->setPalette(QPalette(QColor(0,0,255),label->backgroundColor()));
119 */ 119 */
@@ -136,15 +136,15 @@ void DateBookWeekLstDayHdr::newEvent() {
136 start=stop=date; 136 start=stop=date;
137 start.setTime(QTime(10,0)); 137 start.setTime(QTime(10,0));
138 stop.setTime(QTime(12,0)); 138 stop.setTime(QTime(12,0));
139 139
140 emit addEvent(start,stop,""); 140 emit addEvent(start,stop,"");
141} 141}
142DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev, 142DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev,
143 QWidget* parent, 143 QWidget* parent,
144 const char* name, 144 const char* name,
145 WFlags fl) : 145 WFlags fl) :
146 OClickableLabel(parent,name,fl), 146 OClickableLabel(parent,name,fl),
147 event(ev) 147 event(ev)
148{ 148{
149 char s[10]; 149 char s[10];
150 if ( ev.startDate() != ev.date() ) { // multiday event (not first day) 150 if ( ev.startDate() != ev.date() ) { // multiday event (not first day)
@@ -162,69 +162,69 @@ DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev,
162} 162}
163void DateBookWeekLstEvent::editMe() { 163void DateBookWeekLstEvent::editMe() {
164 emit editEvent(event.event()); 164 emit editEvent(event.event());
165} 165}
166 166
167 167
168DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev, 168DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
169 const QDate &d, bool onM, 169 const QDate &d, bool onM,
170 QWidget* parent, 170 QWidget* parent,
171 const char* name, WFlags fl) 171 const char* name, WFlags fl)
172 : QWidget( parent, name, fl ) 172 : QWidget( parent, name, fl )
173{ 173{
174 onMonday=onM; 174 onMonday=onM;
175 setPalette(white); 175 setPalette(white);
176 setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding)); 176 setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding));
177 177
178 QVBoxLayout *layout = new QVBoxLayout( this ); 178 QVBoxLayout *layout = new QVBoxLayout( this );
179 179
180 qBubbleSort(ev); 180 qBubbleSort(ev);
181 QValueListIterator<EffectiveEvent> it; 181 QValueListIterator<EffectiveEvent> it;
182 it=ev.begin(); 182 it=ev.begin();
183 183
184 int dayOrder[7]; 184 int dayOrder[7];
185 if (onMonday) 185 if (onMonday)
186 for (int d=0; d<7; d++) dayOrder[d]=d+1; 186 for (int d=0; d<7; d++) dayOrder[d]=d+1;
187 else { 187 else {
188 for (int d=0; d<7; d++) dayOrder[d]=d; 188 for (int d=0; d<7; d++) dayOrder[d]=d;
189 dayOrder[0]=7; 189 dayOrder[0]=7;
190 } 190 }
191 191
192 for (int i=0; i<7; i++) { 192 for (int i=0; i<7; i++) {
193 // Header 193 // Header
194 DateBookWeekLstDayHdr *hdr=new DateBookWeekLstDayHdr(d.addDays(i), 194 DateBookWeekLstDayHdr *hdr=new DateBookWeekLstDayHdr(d.addDays(i),
195 onMonday,this); 195 onMonday,this);
196 connect(hdr, SIGNAL(showDate(int,int,int)), 196 connect(hdr, SIGNAL(showDate(int,int,int)),
197 this, SIGNAL(showDate(int,int,int))); 197 this, SIGNAL(showDate(int,int,int)));
198 connect(hdr, SIGNAL(addEvent(const QDateTime &, 198 connect(hdr, SIGNAL(addEvent(const QDateTime &,
199 const QDateTime &, 199 const QDateTime &,
200 const QString &)), 200 const QString &)),
201 this, SIGNAL(addEvent(const QDateTime &, 201 this, SIGNAL(addEvent(const QDateTime &,
202 const QDateTime &, 202 const QDateTime &,
203 const QString &))); 203 const QString &)));
204 layout->addWidget(hdr); 204 layout->addWidget(hdr);
205 205
206 // Events 206 // Events
207 while ( (*it).date().dayOfWeek() == dayOrder[i] && it!=ev.end() ) { 207 while ( (*it).date().dayOfWeek() == dayOrder[i] && it!=ev.end() ) {
208 DateBookWeekLstEvent *l=new DateBookWeekLstEvent(*it,this); 208 DateBookWeekLstEvent *l=new DateBookWeekLstEvent(*it,this);
209 layout->addWidget(l); 209 layout->addWidget(l);
210 connect (l, SIGNAL(editEvent(const Event &)), 210 connect (l, SIGNAL(editEvent(const Event &)),
211 this, SIGNAL(editEvent(const Event &))); 211 this, SIGNAL(editEvent(const Event &)));
212 it++; 212 it++;
213 } 213 }
214 214
215 layout->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding)); 215 layout->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding));
216 } 216 }
217} 217}
218DateBookWeekLstView::~DateBookWeekLstView(){} 218DateBookWeekLstView::~DateBookWeekLstView(){}
219void DateBookWeekLstView::keyPressEvent(QKeyEvent *e) {e->ignore();} 219void DateBookWeekLstView::keyPressEvent(QKeyEvent *e) {e->ignore();}
220 220
221DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1, 221DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1,
222 QValueList<EffectiveEvent> &ev2, 222 QValueList<EffectiveEvent> &ev2,
223 QDate &d, bool onM, 223 QDate &d, bool onM,
224 QWidget* parent, 224 QWidget* parent,
225 const char* name, WFlags fl) 225 const char* name, WFlags fl)
226 : QWidget( parent, name, fl ) 226 : QWidget( parent, name, fl )
227{ 227{
228 QHBoxLayout *layout = new QHBoxLayout( this ); 228 QHBoxLayout *layout = new QHBoxLayout( this );
229 229
230 DateBookWeekLstView *w=new DateBookWeekLstView(ev1,d,onM,this); 230 DateBookWeekLstView *w=new DateBookWeekLstView(ev1,d,onM,this);
@@ -248,14 +248,14 @@ DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1,
248 connect (w, SIGNAL(addEvent(const QDateTime &, const QDateTime &, 248 connect (w, SIGNAL(addEvent(const QDateTime &, const QDateTime &,
249 const QString &)), 249 const QString &)),
250 this, SIGNAL(addEvent(const QDateTime &, const QDateTime &, 250 this, SIGNAL(addEvent(const QDateTime &, const QDateTime &,
251 const QString &))); 251 const QString &)));
252} 252}
253 253
254DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDB *newDB, 254DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDB *newDB,
255 QWidget *parent, 255 QWidget *parent,
256 const char *name ) 256 const char *name )
257 : QWidget( parent, name ), 257 : QWidget( parent, name ),
258 db( newDB ), 258 db( newDB ),
259 startTime( 0 ), 259 startTime( 0 ),
260 ampm( ap ), 260 ampm( ap ),
261 onMonday(onM) 261 onMonday(onM)
@@ -263,16 +263,16 @@ DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDB *newDB,
263 setFocusPolicy(StrongFocus); 263 setFocusPolicy(StrongFocus);
264 layout = new QVBoxLayout( this ); 264 layout = new QVBoxLayout( this );
265 layout->setMargin(0); 265 layout->setMargin(0);
266 266
267 header=new DateBookWeekLstHeader(onM, this); 267 header=new DateBookWeekLstHeader(onM, this);
268 layout->addWidget( header ); 268 layout->addWidget( header );
269 connect(header, SIGNAL(dateChanged(int,int)), 269 connect(header, SIGNAL(dateChanged(int,int)),
270 this, SLOT(dateChanged(int,int))); 270 this, SLOT(dateChanged(int,int)));
271 connect(header, SIGNAL(setDbl(bool)), 271 connect(header, SIGNAL(setDbl(bool)),
272 this, SLOT(setDbl(bool))); 272 this, SLOT(setDbl(bool)));
273 273
274 scroll=new QScrollView(this); 274 scroll=new QScrollView(this);
275 //scroll->setVScrollBarMode(QScrollView::AlwaysOn); 275 //scroll->setVScrollBarMode(QScrollView::AlwaysOn);
276 //scroll->setHScrollBarMode(QScrollView::AlwaysOff); 276 //scroll->setHScrollBarMode(QScrollView::AlwaysOff);
277 scroll->setResizePolicy(QScrollView::AutoOneFit); 277 scroll->setResizePolicy(QScrollView::AutoOneFit);
278 layout->addWidget(scroll); 278 layout->addWidget(scroll);
@@ -307,13 +307,13 @@ QDate DateBookWeekLst::date() const {
307 d.setYMD(year,1,1); 307 d.setYMD(year,1,1);
308 308
309 int dow= d.dayOfWeek(); 309 int dow= d.dayOfWeek();
310 if (!onMonday) 310 if (!onMonday)
311 if (dow==7) dow=1; 311 if (dow==7) dow=1;
312 else dow++; 312 else dow++;
313 313
314 d=d.addDays( (_week-1)*7 - dow + 1 ); 314 d=d.addDays( (_week-1)*7 - dow + 1 );
315 return d; 315 return d;
316} 316}
317 317
318void DateBookWeekLst::getEvents() { 318void DateBookWeekLst::getEvents() {
319 QDate start = date(); 319 QDate start = date();